fidl_fuchsia_wlan_softmac/
fidl_fuchsia_wlan_softmac.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::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_wlan_softmac__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct WlanSoftmacBridgeStartRequest {
16    pub ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
17    pub ethernet_tx: u64,
18    pub wlan_rx: u64,
19}
20
21impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
22    for WlanSoftmacBridgeStartRequest
23{
24}
25
26#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27pub struct WlanSoftmacBridgeStartResponse {
28    pub sme_channel: fidl::Channel,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32    for WlanSoftmacBridgeStartResponse
33{
34}
35
36#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
37pub struct EthernetRxMarker;
38
39impl fidl::endpoints::ProtocolMarker for EthernetRxMarker {
40    type Proxy = EthernetRxProxy;
41    type RequestStream = EthernetRxRequestStream;
42    #[cfg(target_os = "fuchsia")]
43    type SynchronousProxy = EthernetRxSynchronousProxy;
44
45    const DEBUG_NAME: &'static str = "(anonymous) EthernetRx";
46}
47pub type EthernetRxTransferResult = Result<(), i32>;
48
49pub trait EthernetRxProxyInterface: Send + Sync {
50    type TransferResponseFut: std::future::Future<Output = Result<EthernetRxTransferResult, fidl::Error>>
51        + Send;
52    fn r#transfer(&self, payload: &EthernetRxTransferRequest) -> Self::TransferResponseFut;
53}
54#[derive(Debug)]
55#[cfg(target_os = "fuchsia")]
56pub struct EthernetRxSynchronousProxy {
57    client: fidl::client::sync::Client,
58}
59
60#[cfg(target_os = "fuchsia")]
61impl fidl::endpoints::SynchronousProxy for EthernetRxSynchronousProxy {
62    type Proxy = EthernetRxProxy;
63    type Protocol = EthernetRxMarker;
64
65    fn from_channel(inner: fidl::Channel) -> Self {
66        Self::new(inner)
67    }
68
69    fn into_channel(self) -> fidl::Channel {
70        self.client.into_channel()
71    }
72
73    fn as_channel(&self) -> &fidl::Channel {
74        self.client.as_channel()
75    }
76}
77
78#[cfg(target_os = "fuchsia")]
79impl EthernetRxSynchronousProxy {
80    pub fn new(channel: fidl::Channel) -> Self {
81        let protocol_name = <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
82        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
83    }
84
85    pub fn into_channel(self) -> fidl::Channel {
86        self.client.into_channel()
87    }
88
89    /// Waits until an event arrives and returns it. It is safe for other
90    /// threads to make concurrent requests while waiting for an event.
91    pub fn wait_for_event(
92        &self,
93        deadline: zx::MonotonicInstant,
94    ) -> Result<EthernetRxEvent, fidl::Error> {
95        EthernetRxEvent::decode(self.client.wait_for_event(deadline)?)
96    }
97
98    pub fn r#transfer(
99        &self,
100        mut payload: &EthernetRxTransferRequest,
101        ___deadline: zx::MonotonicInstant,
102    ) -> Result<EthernetRxTransferResult, fidl::Error> {
103        let _response = self.client.send_query::<
104            EthernetRxTransferRequest,
105            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
106        >(
107            payload,
108            0x199ff3498ef8a22a,
109            fidl::encoding::DynamicFlags::empty(),
110            ___deadline,
111        )?;
112        Ok(_response.map(|x| x))
113    }
114}
115
116#[cfg(target_os = "fuchsia")]
117impl From<EthernetRxSynchronousProxy> for zx::NullableHandle {
118    fn from(value: EthernetRxSynchronousProxy) -> Self {
119        value.into_channel().into()
120    }
121}
122
123#[cfg(target_os = "fuchsia")]
124impl From<fidl::Channel> for EthernetRxSynchronousProxy {
125    fn from(value: fidl::Channel) -> Self {
126        Self::new(value)
127    }
128}
129
130#[cfg(target_os = "fuchsia")]
131impl fidl::endpoints::FromClient for EthernetRxSynchronousProxy {
132    type Protocol = EthernetRxMarker;
133
134    fn from_client(value: fidl::endpoints::ClientEnd<EthernetRxMarker>) -> Self {
135        Self::new(value.into_channel())
136    }
137}
138
139#[derive(Debug, Clone)]
140pub struct EthernetRxProxy {
141    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
142}
143
144impl fidl::endpoints::Proxy for EthernetRxProxy {
145    type Protocol = EthernetRxMarker;
146
147    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
148        Self::new(inner)
149    }
150
151    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
152        self.client.into_channel().map_err(|client| Self { client })
153    }
154
155    fn as_channel(&self) -> &::fidl::AsyncChannel {
156        self.client.as_channel()
157    }
158}
159
160impl EthernetRxProxy {
161    /// Create a new Proxy for fuchsia.wlan.softmac/EthernetRx.
162    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
163        let protocol_name = <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
164        Self { client: fidl::client::Client::new(channel, protocol_name) }
165    }
166
167    /// Get a Stream of events from the remote end of the protocol.
168    ///
169    /// # Panics
170    ///
171    /// Panics if the event stream was already taken.
172    pub fn take_event_stream(&self) -> EthernetRxEventStream {
173        EthernetRxEventStream { event_receiver: self.client.take_event_receiver() }
174    }
175
176    pub fn r#transfer(
177        &self,
178        mut payload: &EthernetRxTransferRequest,
179    ) -> fidl::client::QueryResponseFut<
180        EthernetRxTransferResult,
181        fidl::encoding::DefaultFuchsiaResourceDialect,
182    > {
183        EthernetRxProxyInterface::r#transfer(self, payload)
184    }
185}
186
187impl EthernetRxProxyInterface for EthernetRxProxy {
188    type TransferResponseFut = fidl::client::QueryResponseFut<
189        EthernetRxTransferResult,
190        fidl::encoding::DefaultFuchsiaResourceDialect,
191    >;
192    fn r#transfer(&self, mut payload: &EthernetRxTransferRequest) -> Self::TransferResponseFut {
193        fn _decode(
194            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
195        ) -> Result<EthernetRxTransferResult, fidl::Error> {
196            let _response = fidl::client::decode_transaction_body::<
197                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
198                fidl::encoding::DefaultFuchsiaResourceDialect,
199                0x199ff3498ef8a22a,
200            >(_buf?)?;
201            Ok(_response.map(|x| x))
202        }
203        self.client.send_query_and_decode::<EthernetRxTransferRequest, EthernetRxTransferResult>(
204            payload,
205            0x199ff3498ef8a22a,
206            fidl::encoding::DynamicFlags::empty(),
207            _decode,
208        )
209    }
210}
211
212pub struct EthernetRxEventStream {
213    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
214}
215
216impl std::marker::Unpin for EthernetRxEventStream {}
217
218impl futures::stream::FusedStream for EthernetRxEventStream {
219    fn is_terminated(&self) -> bool {
220        self.event_receiver.is_terminated()
221    }
222}
223
224impl futures::Stream for EthernetRxEventStream {
225    type Item = Result<EthernetRxEvent, fidl::Error>;
226
227    fn poll_next(
228        mut self: std::pin::Pin<&mut Self>,
229        cx: &mut std::task::Context<'_>,
230    ) -> std::task::Poll<Option<Self::Item>> {
231        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
232            &mut self.event_receiver,
233            cx
234        )?) {
235            Some(buf) => std::task::Poll::Ready(Some(EthernetRxEvent::decode(buf))),
236            None => std::task::Poll::Ready(None),
237        }
238    }
239}
240
241#[derive(Debug)]
242pub enum EthernetRxEvent {}
243
244impl EthernetRxEvent {
245    /// Decodes a message buffer as a [`EthernetRxEvent`].
246    fn decode(
247        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
248    ) -> Result<EthernetRxEvent, fidl::Error> {
249        let (bytes, _handles) = buf.split_mut();
250        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
251        debug_assert_eq!(tx_header.tx_id, 0);
252        match tx_header.ordinal {
253            _ => Err(fidl::Error::UnknownOrdinal {
254                ordinal: tx_header.ordinal,
255                protocol_name: <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
256            }),
257        }
258    }
259}
260
261/// A Stream of incoming requests for fuchsia.wlan.softmac/EthernetRx.
262pub struct EthernetRxRequestStream {
263    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
264    is_terminated: bool,
265}
266
267impl std::marker::Unpin for EthernetRxRequestStream {}
268
269impl futures::stream::FusedStream for EthernetRxRequestStream {
270    fn is_terminated(&self) -> bool {
271        self.is_terminated
272    }
273}
274
275impl fidl::endpoints::RequestStream for EthernetRxRequestStream {
276    type Protocol = EthernetRxMarker;
277    type ControlHandle = EthernetRxControlHandle;
278
279    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
280        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
281    }
282
283    fn control_handle(&self) -> Self::ControlHandle {
284        EthernetRxControlHandle { inner: self.inner.clone() }
285    }
286
287    fn into_inner(
288        self,
289    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
290    {
291        (self.inner, self.is_terminated)
292    }
293
294    fn from_inner(
295        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
296        is_terminated: bool,
297    ) -> Self {
298        Self { inner, is_terminated }
299    }
300}
301
302impl futures::Stream for EthernetRxRequestStream {
303    type Item = Result<EthernetRxRequest, fidl::Error>;
304
305    fn poll_next(
306        mut self: std::pin::Pin<&mut Self>,
307        cx: &mut std::task::Context<'_>,
308    ) -> std::task::Poll<Option<Self::Item>> {
309        let this = &mut *self;
310        if this.inner.check_shutdown(cx) {
311            this.is_terminated = true;
312            return std::task::Poll::Ready(None);
313        }
314        if this.is_terminated {
315            panic!("polled EthernetRxRequestStream after completion");
316        }
317        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
318            |bytes, handles| {
319                match this.inner.channel().read_etc(cx, bytes, handles) {
320                    std::task::Poll::Ready(Ok(())) => {}
321                    std::task::Poll::Pending => return std::task::Poll::Pending,
322                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
323                        this.is_terminated = true;
324                        return std::task::Poll::Ready(None);
325                    }
326                    std::task::Poll::Ready(Err(e)) => {
327                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
328                            e.into(),
329                        ))));
330                    }
331                }
332
333                // A message has been received from the channel
334                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
335
336                std::task::Poll::Ready(Some(match header.ordinal {
337                    0x199ff3498ef8a22a => {
338                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
339                        let mut req = fidl::new_empty!(
340                            EthernetRxTransferRequest,
341                            fidl::encoding::DefaultFuchsiaResourceDialect
342                        );
343                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EthernetRxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
344                        let control_handle = EthernetRxControlHandle { inner: this.inner.clone() };
345                        Ok(EthernetRxRequest::Transfer {
346                            payload: req,
347                            responder: EthernetRxTransferResponder {
348                                control_handle: std::mem::ManuallyDrop::new(control_handle),
349                                tx_id: header.tx_id,
350                            },
351                        })
352                    }
353                    _ => Err(fidl::Error::UnknownOrdinal {
354                        ordinal: header.ordinal,
355                        protocol_name:
356                            <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
357                    }),
358                }))
359            },
360        )
361    }
362}
363
364/// Protocol for sending an Ethernet frame from the bridged wlansoftmac
365/// driver to the wlansoftmac driver.
366///
367/// # Experimental
368///
369/// This protocol is implemented as a foreign function interface (FFI)
370/// between the wlansoftmac driver and the bridged driver solely to improve
371/// the performance of processing data frames through the wlan-mlme library.
372#[derive(Debug)]
373pub enum EthernetRxRequest {
374    Transfer { payload: EthernetRxTransferRequest, responder: EthernetRxTransferResponder },
375}
376
377impl EthernetRxRequest {
378    #[allow(irrefutable_let_patterns)]
379    pub fn into_transfer(self) -> Option<(EthernetRxTransferRequest, EthernetRxTransferResponder)> {
380        if let EthernetRxRequest::Transfer { payload, responder } = self {
381            Some((payload, responder))
382        } else {
383            None
384        }
385    }
386
387    /// Name of the method defined in FIDL
388    pub fn method_name(&self) -> &'static str {
389        match *self {
390            EthernetRxRequest::Transfer { .. } => "transfer",
391        }
392    }
393}
394
395#[derive(Debug, Clone)]
396pub struct EthernetRxControlHandle {
397    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
398}
399
400impl fidl::endpoints::ControlHandle for EthernetRxControlHandle {
401    fn shutdown(&self) {
402        self.inner.shutdown()
403    }
404
405    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
406        self.inner.shutdown_with_epitaph(status)
407    }
408
409    fn is_closed(&self) -> bool {
410        self.inner.channel().is_closed()
411    }
412    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
413        self.inner.channel().on_closed()
414    }
415
416    #[cfg(target_os = "fuchsia")]
417    fn signal_peer(
418        &self,
419        clear_mask: zx::Signals,
420        set_mask: zx::Signals,
421    ) -> Result<(), zx_status::Status> {
422        use fidl::Peered;
423        self.inner.channel().signal_peer(clear_mask, set_mask)
424    }
425}
426
427impl EthernetRxControlHandle {}
428
429#[must_use = "FIDL methods require a response to be sent"]
430#[derive(Debug)]
431pub struct EthernetRxTransferResponder {
432    control_handle: std::mem::ManuallyDrop<EthernetRxControlHandle>,
433    tx_id: u32,
434}
435
436/// Set the the channel to be shutdown (see [`EthernetRxControlHandle::shutdown`])
437/// if the responder is dropped without sending a response, so that the client
438/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
439impl std::ops::Drop for EthernetRxTransferResponder {
440    fn drop(&mut self) {
441        self.control_handle.shutdown();
442        // Safety: drops once, never accessed again
443        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
444    }
445}
446
447impl fidl::endpoints::Responder for EthernetRxTransferResponder {
448    type ControlHandle = EthernetRxControlHandle;
449
450    fn control_handle(&self) -> &EthernetRxControlHandle {
451        &self.control_handle
452    }
453
454    fn drop_without_shutdown(mut self) {
455        // Safety: drops once, never accessed again due to mem::forget
456        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
457        // Prevent Drop from running (which would shut down the channel)
458        std::mem::forget(self);
459    }
460}
461
462impl EthernetRxTransferResponder {
463    /// Sends a response to the FIDL transaction.
464    ///
465    /// Sets the channel to shutdown if an error occurs.
466    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
467        let _result = self.send_raw(result);
468        if _result.is_err() {
469            self.control_handle.shutdown();
470        }
471        self.drop_without_shutdown();
472        _result
473    }
474
475    /// Similar to "send" but does not shutdown the channel if an error occurs.
476    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
477        let _result = self.send_raw(result);
478        self.drop_without_shutdown();
479        _result
480    }
481
482    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
483        self.control_handle
484            .inner
485            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
486                result,
487                self.tx_id,
488                0x199ff3498ef8a22a,
489                fidl::encoding::DynamicFlags::empty(),
490            )
491    }
492}
493
494#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
495pub struct EthernetTxMarker;
496
497impl fidl::endpoints::ProtocolMarker for EthernetTxMarker {
498    type Proxy = EthernetTxProxy;
499    type RequestStream = EthernetTxRequestStream;
500    #[cfg(target_os = "fuchsia")]
501    type SynchronousProxy = EthernetTxSynchronousProxy;
502
503    const DEBUG_NAME: &'static str = "(anonymous) EthernetTx";
504}
505pub type EthernetTxTransferResult = Result<(), i32>;
506
507pub trait EthernetTxProxyInterface: Send + Sync {
508    type TransferResponseFut: std::future::Future<Output = Result<EthernetTxTransferResult, fidl::Error>>
509        + Send;
510    fn r#transfer(&self, payload: &EthernetTxTransferRequest) -> Self::TransferResponseFut;
511}
512#[derive(Debug)]
513#[cfg(target_os = "fuchsia")]
514pub struct EthernetTxSynchronousProxy {
515    client: fidl::client::sync::Client,
516}
517
518#[cfg(target_os = "fuchsia")]
519impl fidl::endpoints::SynchronousProxy for EthernetTxSynchronousProxy {
520    type Proxy = EthernetTxProxy;
521    type Protocol = EthernetTxMarker;
522
523    fn from_channel(inner: fidl::Channel) -> Self {
524        Self::new(inner)
525    }
526
527    fn into_channel(self) -> fidl::Channel {
528        self.client.into_channel()
529    }
530
531    fn as_channel(&self) -> &fidl::Channel {
532        self.client.as_channel()
533    }
534}
535
536#[cfg(target_os = "fuchsia")]
537impl EthernetTxSynchronousProxy {
538    pub fn new(channel: fidl::Channel) -> Self {
539        let protocol_name = <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
540        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
541    }
542
543    pub fn into_channel(self) -> fidl::Channel {
544        self.client.into_channel()
545    }
546
547    /// Waits until an event arrives and returns it. It is safe for other
548    /// threads to make concurrent requests while waiting for an event.
549    pub fn wait_for_event(
550        &self,
551        deadline: zx::MonotonicInstant,
552    ) -> Result<EthernetTxEvent, fidl::Error> {
553        EthernetTxEvent::decode(self.client.wait_for_event(deadline)?)
554    }
555
556    pub fn r#transfer(
557        &self,
558        mut payload: &EthernetTxTransferRequest,
559        ___deadline: zx::MonotonicInstant,
560    ) -> Result<EthernetTxTransferResult, fidl::Error> {
561        let _response = self.client.send_query::<
562            EthernetTxTransferRequest,
563            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
564        >(
565            payload,
566            0x616dafedf07d00e7,
567            fidl::encoding::DynamicFlags::empty(),
568            ___deadline,
569        )?;
570        Ok(_response.map(|x| x))
571    }
572}
573
574#[cfg(target_os = "fuchsia")]
575impl From<EthernetTxSynchronousProxy> for zx::NullableHandle {
576    fn from(value: EthernetTxSynchronousProxy) -> Self {
577        value.into_channel().into()
578    }
579}
580
581#[cfg(target_os = "fuchsia")]
582impl From<fidl::Channel> for EthernetTxSynchronousProxy {
583    fn from(value: fidl::Channel) -> Self {
584        Self::new(value)
585    }
586}
587
588#[cfg(target_os = "fuchsia")]
589impl fidl::endpoints::FromClient for EthernetTxSynchronousProxy {
590    type Protocol = EthernetTxMarker;
591
592    fn from_client(value: fidl::endpoints::ClientEnd<EthernetTxMarker>) -> Self {
593        Self::new(value.into_channel())
594    }
595}
596
597#[derive(Debug, Clone)]
598pub struct EthernetTxProxy {
599    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
600}
601
602impl fidl::endpoints::Proxy for EthernetTxProxy {
603    type Protocol = EthernetTxMarker;
604
605    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
606        Self::new(inner)
607    }
608
609    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
610        self.client.into_channel().map_err(|client| Self { client })
611    }
612
613    fn as_channel(&self) -> &::fidl::AsyncChannel {
614        self.client.as_channel()
615    }
616}
617
618impl EthernetTxProxy {
619    /// Create a new Proxy for fuchsia.wlan.softmac/EthernetTx.
620    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
621        let protocol_name = <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
622        Self { client: fidl::client::Client::new(channel, protocol_name) }
623    }
624
625    /// Get a Stream of events from the remote end of the protocol.
626    ///
627    /// # Panics
628    ///
629    /// Panics if the event stream was already taken.
630    pub fn take_event_stream(&self) -> EthernetTxEventStream {
631        EthernetTxEventStream { event_receiver: self.client.take_event_receiver() }
632    }
633
634    pub fn r#transfer(
635        &self,
636        mut payload: &EthernetTxTransferRequest,
637    ) -> fidl::client::QueryResponseFut<
638        EthernetTxTransferResult,
639        fidl::encoding::DefaultFuchsiaResourceDialect,
640    > {
641        EthernetTxProxyInterface::r#transfer(self, payload)
642    }
643}
644
645impl EthernetTxProxyInterface for EthernetTxProxy {
646    type TransferResponseFut = fidl::client::QueryResponseFut<
647        EthernetTxTransferResult,
648        fidl::encoding::DefaultFuchsiaResourceDialect,
649    >;
650    fn r#transfer(&self, mut payload: &EthernetTxTransferRequest) -> Self::TransferResponseFut {
651        fn _decode(
652            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
653        ) -> Result<EthernetTxTransferResult, fidl::Error> {
654            let _response = fidl::client::decode_transaction_body::<
655                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
656                fidl::encoding::DefaultFuchsiaResourceDialect,
657                0x616dafedf07d00e7,
658            >(_buf?)?;
659            Ok(_response.map(|x| x))
660        }
661        self.client.send_query_and_decode::<EthernetTxTransferRequest, EthernetTxTransferResult>(
662            payload,
663            0x616dafedf07d00e7,
664            fidl::encoding::DynamicFlags::empty(),
665            _decode,
666        )
667    }
668}
669
670pub struct EthernetTxEventStream {
671    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
672}
673
674impl std::marker::Unpin for EthernetTxEventStream {}
675
676impl futures::stream::FusedStream for EthernetTxEventStream {
677    fn is_terminated(&self) -> bool {
678        self.event_receiver.is_terminated()
679    }
680}
681
682impl futures::Stream for EthernetTxEventStream {
683    type Item = Result<EthernetTxEvent, fidl::Error>;
684
685    fn poll_next(
686        mut self: std::pin::Pin<&mut Self>,
687        cx: &mut std::task::Context<'_>,
688    ) -> std::task::Poll<Option<Self::Item>> {
689        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
690            &mut self.event_receiver,
691            cx
692        )?) {
693            Some(buf) => std::task::Poll::Ready(Some(EthernetTxEvent::decode(buf))),
694            None => std::task::Poll::Ready(None),
695        }
696    }
697}
698
699#[derive(Debug)]
700pub enum EthernetTxEvent {}
701
702impl EthernetTxEvent {
703    /// Decodes a message buffer as a [`EthernetTxEvent`].
704    fn decode(
705        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
706    ) -> Result<EthernetTxEvent, fidl::Error> {
707        let (bytes, _handles) = buf.split_mut();
708        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
709        debug_assert_eq!(tx_header.tx_id, 0);
710        match tx_header.ordinal {
711            _ => Err(fidl::Error::UnknownOrdinal {
712                ordinal: tx_header.ordinal,
713                protocol_name: <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
714            }),
715        }
716    }
717}
718
719/// A Stream of incoming requests for fuchsia.wlan.softmac/EthernetTx.
720pub struct EthernetTxRequestStream {
721    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
722    is_terminated: bool,
723}
724
725impl std::marker::Unpin for EthernetTxRequestStream {}
726
727impl futures::stream::FusedStream for EthernetTxRequestStream {
728    fn is_terminated(&self) -> bool {
729        self.is_terminated
730    }
731}
732
733impl fidl::endpoints::RequestStream for EthernetTxRequestStream {
734    type Protocol = EthernetTxMarker;
735    type ControlHandle = EthernetTxControlHandle;
736
737    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
738        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
739    }
740
741    fn control_handle(&self) -> Self::ControlHandle {
742        EthernetTxControlHandle { inner: self.inner.clone() }
743    }
744
745    fn into_inner(
746        self,
747    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
748    {
749        (self.inner, self.is_terminated)
750    }
751
752    fn from_inner(
753        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
754        is_terminated: bool,
755    ) -> Self {
756        Self { inner, is_terminated }
757    }
758}
759
760impl futures::Stream for EthernetTxRequestStream {
761    type Item = Result<EthernetTxRequest, fidl::Error>;
762
763    fn poll_next(
764        mut self: std::pin::Pin<&mut Self>,
765        cx: &mut std::task::Context<'_>,
766    ) -> std::task::Poll<Option<Self::Item>> {
767        let this = &mut *self;
768        if this.inner.check_shutdown(cx) {
769            this.is_terminated = true;
770            return std::task::Poll::Ready(None);
771        }
772        if this.is_terminated {
773            panic!("polled EthernetTxRequestStream after completion");
774        }
775        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
776            |bytes, handles| {
777                match this.inner.channel().read_etc(cx, bytes, handles) {
778                    std::task::Poll::Ready(Ok(())) => {}
779                    std::task::Poll::Pending => return std::task::Poll::Pending,
780                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
781                        this.is_terminated = true;
782                        return std::task::Poll::Ready(None);
783                    }
784                    std::task::Poll::Ready(Err(e)) => {
785                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
786                            e.into(),
787                        ))));
788                    }
789                }
790
791                // A message has been received from the channel
792                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
793
794                std::task::Poll::Ready(Some(match header.ordinal {
795                    0x616dafedf07d00e7 => {
796                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
797                        let mut req = fidl::new_empty!(
798                            EthernetTxTransferRequest,
799                            fidl::encoding::DefaultFuchsiaResourceDialect
800                        );
801                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EthernetTxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
802                        let control_handle = EthernetTxControlHandle { inner: this.inner.clone() };
803                        Ok(EthernetTxRequest::Transfer {
804                            payload: req,
805                            responder: EthernetTxTransferResponder {
806                                control_handle: std::mem::ManuallyDrop::new(control_handle),
807                                tx_id: header.tx_id,
808                            },
809                        })
810                    }
811                    _ => Err(fidl::Error::UnknownOrdinal {
812                        ordinal: header.ordinal,
813                        protocol_name:
814                            <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
815                    }),
816                }))
817            },
818        )
819    }
820}
821
822/// Protocol for sending an Ethernet frame from the wlansoftmac driver to the bridged
823/// wlansoftmac driver.
824///
825/// # Experimental
826///
827/// This protocol is implemented as a foreign function interface (FFI)
828/// between the wlansoftmac driver and the bridged driver solely to improve
829/// the performance of processing data frames through the wlan-mlme library.
830///
831/// # Safety
832///
833/// The `complete_borrowed_operation` field must be a function pointer of the type
834/// void (*)(eth::BorrowedOperation<>*, zx_status_t) where the first argument
835/// is the value of `borrowed_operation` field.
836///
837/// Calling `complete_borrowed_operation` will result in calling
838/// `eth::BorrowedOperation<>::Complete()` to release ownership of the packet. This
839/// must be called exactly once. Failing to call `complete_borrowed_operation`
840/// will leak memory, and calling more than once will result in use-after-free.
841#[derive(Debug)]
842pub enum EthernetTxRequest {
843    Transfer { payload: EthernetTxTransferRequest, responder: EthernetTxTransferResponder },
844}
845
846impl EthernetTxRequest {
847    #[allow(irrefutable_let_patterns)]
848    pub fn into_transfer(self) -> Option<(EthernetTxTransferRequest, EthernetTxTransferResponder)> {
849        if let EthernetTxRequest::Transfer { payload, responder } = self {
850            Some((payload, responder))
851        } else {
852            None
853        }
854    }
855
856    /// Name of the method defined in FIDL
857    pub fn method_name(&self) -> &'static str {
858        match *self {
859            EthernetTxRequest::Transfer { .. } => "transfer",
860        }
861    }
862}
863
864#[derive(Debug, Clone)]
865pub struct EthernetTxControlHandle {
866    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
867}
868
869impl fidl::endpoints::ControlHandle for EthernetTxControlHandle {
870    fn shutdown(&self) {
871        self.inner.shutdown()
872    }
873
874    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
875        self.inner.shutdown_with_epitaph(status)
876    }
877
878    fn is_closed(&self) -> bool {
879        self.inner.channel().is_closed()
880    }
881    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
882        self.inner.channel().on_closed()
883    }
884
885    #[cfg(target_os = "fuchsia")]
886    fn signal_peer(
887        &self,
888        clear_mask: zx::Signals,
889        set_mask: zx::Signals,
890    ) -> Result<(), zx_status::Status> {
891        use fidl::Peered;
892        self.inner.channel().signal_peer(clear_mask, set_mask)
893    }
894}
895
896impl EthernetTxControlHandle {}
897
898#[must_use = "FIDL methods require a response to be sent"]
899#[derive(Debug)]
900pub struct EthernetTxTransferResponder {
901    control_handle: std::mem::ManuallyDrop<EthernetTxControlHandle>,
902    tx_id: u32,
903}
904
905/// Set the the channel to be shutdown (see [`EthernetTxControlHandle::shutdown`])
906/// if the responder is dropped without sending a response, so that the client
907/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
908impl std::ops::Drop for EthernetTxTransferResponder {
909    fn drop(&mut self) {
910        self.control_handle.shutdown();
911        // Safety: drops once, never accessed again
912        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
913    }
914}
915
916impl fidl::endpoints::Responder for EthernetTxTransferResponder {
917    type ControlHandle = EthernetTxControlHandle;
918
919    fn control_handle(&self) -> &EthernetTxControlHandle {
920        &self.control_handle
921    }
922
923    fn drop_without_shutdown(mut self) {
924        // Safety: drops once, never accessed again due to mem::forget
925        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
926        // Prevent Drop from running (which would shut down the channel)
927        std::mem::forget(self);
928    }
929}
930
931impl EthernetTxTransferResponder {
932    /// Sends a response to the FIDL transaction.
933    ///
934    /// Sets the channel to shutdown if an error occurs.
935    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
936        let _result = self.send_raw(result);
937        if _result.is_err() {
938            self.control_handle.shutdown();
939        }
940        self.drop_without_shutdown();
941        _result
942    }
943
944    /// Similar to "send" but does not shutdown the channel if an error occurs.
945    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
946        let _result = self.send_raw(result);
947        self.drop_without_shutdown();
948        _result
949    }
950
951    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
952        self.control_handle
953            .inner
954            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
955                result,
956                self.tx_id,
957                0x616dafedf07d00e7,
958                fidl::encoding::DynamicFlags::empty(),
959            )
960    }
961}
962
963#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
964pub struct WlanRxMarker;
965
966impl fidl::endpoints::ProtocolMarker for WlanRxMarker {
967    type Proxy = WlanRxProxy;
968    type RequestStream = WlanRxRequestStream;
969    #[cfg(target_os = "fuchsia")]
970    type SynchronousProxy = WlanRxSynchronousProxy;
971
972    const DEBUG_NAME: &'static str = "(anonymous) WlanRx";
973}
974
975pub trait WlanRxProxyInterface: Send + Sync {
976    type TransferResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
977    fn r#transfer(&self, payload: &WlanRxTransferRequest) -> Self::TransferResponseFut;
978}
979#[derive(Debug)]
980#[cfg(target_os = "fuchsia")]
981pub struct WlanRxSynchronousProxy {
982    client: fidl::client::sync::Client,
983}
984
985#[cfg(target_os = "fuchsia")]
986impl fidl::endpoints::SynchronousProxy for WlanRxSynchronousProxy {
987    type Proxy = WlanRxProxy;
988    type Protocol = WlanRxMarker;
989
990    fn from_channel(inner: fidl::Channel) -> Self {
991        Self::new(inner)
992    }
993
994    fn into_channel(self) -> fidl::Channel {
995        self.client.into_channel()
996    }
997
998    fn as_channel(&self) -> &fidl::Channel {
999        self.client.as_channel()
1000    }
1001}
1002
1003#[cfg(target_os = "fuchsia")]
1004impl WlanRxSynchronousProxy {
1005    pub fn new(channel: fidl::Channel) -> Self {
1006        let protocol_name = <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1007        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1008    }
1009
1010    pub fn into_channel(self) -> fidl::Channel {
1011        self.client.into_channel()
1012    }
1013
1014    /// Waits until an event arrives and returns it. It is safe for other
1015    /// threads to make concurrent requests while waiting for an event.
1016    pub fn wait_for_event(
1017        &self,
1018        deadline: zx::MonotonicInstant,
1019    ) -> Result<WlanRxEvent, fidl::Error> {
1020        WlanRxEvent::decode(self.client.wait_for_event(deadline)?)
1021    }
1022
1023    pub fn r#transfer(
1024        &self,
1025        mut payload: &WlanRxTransferRequest,
1026        ___deadline: zx::MonotonicInstant,
1027    ) -> Result<(), fidl::Error> {
1028        let _response =
1029            self.client.send_query::<WlanRxTransferRequest, fidl::encoding::EmptyPayload>(
1030                payload,
1031                0x2c73b18cbfca6055,
1032                fidl::encoding::DynamicFlags::empty(),
1033                ___deadline,
1034            )?;
1035        Ok(_response)
1036    }
1037}
1038
1039#[cfg(target_os = "fuchsia")]
1040impl From<WlanRxSynchronousProxy> for zx::NullableHandle {
1041    fn from(value: WlanRxSynchronousProxy) -> Self {
1042        value.into_channel().into()
1043    }
1044}
1045
1046#[cfg(target_os = "fuchsia")]
1047impl From<fidl::Channel> for WlanRxSynchronousProxy {
1048    fn from(value: fidl::Channel) -> Self {
1049        Self::new(value)
1050    }
1051}
1052
1053#[cfg(target_os = "fuchsia")]
1054impl fidl::endpoints::FromClient for WlanRxSynchronousProxy {
1055    type Protocol = WlanRxMarker;
1056
1057    fn from_client(value: fidl::endpoints::ClientEnd<WlanRxMarker>) -> Self {
1058        Self::new(value.into_channel())
1059    }
1060}
1061
1062#[derive(Debug, Clone)]
1063pub struct WlanRxProxy {
1064    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1065}
1066
1067impl fidl::endpoints::Proxy for WlanRxProxy {
1068    type Protocol = WlanRxMarker;
1069
1070    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1071        Self::new(inner)
1072    }
1073
1074    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1075        self.client.into_channel().map_err(|client| Self { client })
1076    }
1077
1078    fn as_channel(&self) -> &::fidl::AsyncChannel {
1079        self.client.as_channel()
1080    }
1081}
1082
1083impl WlanRxProxy {
1084    /// Create a new Proxy for fuchsia.wlan.softmac/WlanRx.
1085    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1086        let protocol_name = <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1087        Self { client: fidl::client::Client::new(channel, protocol_name) }
1088    }
1089
1090    /// Get a Stream of events from the remote end of the protocol.
1091    ///
1092    /// # Panics
1093    ///
1094    /// Panics if the event stream was already taken.
1095    pub fn take_event_stream(&self) -> WlanRxEventStream {
1096        WlanRxEventStream { event_receiver: self.client.take_event_receiver() }
1097    }
1098
1099    pub fn r#transfer(
1100        &self,
1101        mut payload: &WlanRxTransferRequest,
1102    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1103        WlanRxProxyInterface::r#transfer(self, payload)
1104    }
1105}
1106
1107impl WlanRxProxyInterface for WlanRxProxy {
1108    type TransferResponseFut =
1109        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1110    fn r#transfer(&self, mut payload: &WlanRxTransferRequest) -> Self::TransferResponseFut {
1111        fn _decode(
1112            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1113        ) -> Result<(), fidl::Error> {
1114            let _response = fidl::client::decode_transaction_body::<
1115                fidl::encoding::EmptyPayload,
1116                fidl::encoding::DefaultFuchsiaResourceDialect,
1117                0x2c73b18cbfca6055,
1118            >(_buf?)?;
1119            Ok(_response)
1120        }
1121        self.client.send_query_and_decode::<WlanRxTransferRequest, ()>(
1122            payload,
1123            0x2c73b18cbfca6055,
1124            fidl::encoding::DynamicFlags::empty(),
1125            _decode,
1126        )
1127    }
1128}
1129
1130pub struct WlanRxEventStream {
1131    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1132}
1133
1134impl std::marker::Unpin for WlanRxEventStream {}
1135
1136impl futures::stream::FusedStream for WlanRxEventStream {
1137    fn is_terminated(&self) -> bool {
1138        self.event_receiver.is_terminated()
1139    }
1140}
1141
1142impl futures::Stream for WlanRxEventStream {
1143    type Item = Result<WlanRxEvent, fidl::Error>;
1144
1145    fn poll_next(
1146        mut self: std::pin::Pin<&mut Self>,
1147        cx: &mut std::task::Context<'_>,
1148    ) -> std::task::Poll<Option<Self::Item>> {
1149        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1150            &mut self.event_receiver,
1151            cx
1152        )?) {
1153            Some(buf) => std::task::Poll::Ready(Some(WlanRxEvent::decode(buf))),
1154            None => std::task::Poll::Ready(None),
1155        }
1156    }
1157}
1158
1159#[derive(Debug)]
1160pub enum WlanRxEvent {}
1161
1162impl WlanRxEvent {
1163    /// Decodes a message buffer as a [`WlanRxEvent`].
1164    fn decode(
1165        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1166    ) -> Result<WlanRxEvent, fidl::Error> {
1167        let (bytes, _handles) = buf.split_mut();
1168        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1169        debug_assert_eq!(tx_header.tx_id, 0);
1170        match tx_header.ordinal {
1171            _ => Err(fidl::Error::UnknownOrdinal {
1172                ordinal: tx_header.ordinal,
1173                protocol_name: <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1174            }),
1175        }
1176    }
1177}
1178
1179/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanRx.
1180pub struct WlanRxRequestStream {
1181    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1182    is_terminated: bool,
1183}
1184
1185impl std::marker::Unpin for WlanRxRequestStream {}
1186
1187impl futures::stream::FusedStream for WlanRxRequestStream {
1188    fn is_terminated(&self) -> bool {
1189        self.is_terminated
1190    }
1191}
1192
1193impl fidl::endpoints::RequestStream for WlanRxRequestStream {
1194    type Protocol = WlanRxMarker;
1195    type ControlHandle = WlanRxControlHandle;
1196
1197    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1198        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1199    }
1200
1201    fn control_handle(&self) -> Self::ControlHandle {
1202        WlanRxControlHandle { inner: self.inner.clone() }
1203    }
1204
1205    fn into_inner(
1206        self,
1207    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1208    {
1209        (self.inner, self.is_terminated)
1210    }
1211
1212    fn from_inner(
1213        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1214        is_terminated: bool,
1215    ) -> Self {
1216        Self { inner, is_terminated }
1217    }
1218}
1219
1220impl futures::Stream for WlanRxRequestStream {
1221    type Item = Result<WlanRxRequest, fidl::Error>;
1222
1223    fn poll_next(
1224        mut self: std::pin::Pin<&mut Self>,
1225        cx: &mut std::task::Context<'_>,
1226    ) -> std::task::Poll<Option<Self::Item>> {
1227        let this = &mut *self;
1228        if this.inner.check_shutdown(cx) {
1229            this.is_terminated = true;
1230            return std::task::Poll::Ready(None);
1231        }
1232        if this.is_terminated {
1233            panic!("polled WlanRxRequestStream after completion");
1234        }
1235        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1236            |bytes, handles| {
1237                match this.inner.channel().read_etc(cx, bytes, handles) {
1238                    std::task::Poll::Ready(Ok(())) => {}
1239                    std::task::Poll::Pending => return std::task::Poll::Pending,
1240                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1241                        this.is_terminated = true;
1242                        return std::task::Poll::Ready(None);
1243                    }
1244                    std::task::Poll::Ready(Err(e)) => {
1245                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1246                            e.into(),
1247                        ))));
1248                    }
1249                }
1250
1251                // A message has been received from the channel
1252                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1253
1254                std::task::Poll::Ready(Some(match header.ordinal {
1255                    0x2c73b18cbfca6055 => {
1256                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1257                        let mut req = fidl::new_empty!(
1258                            WlanRxTransferRequest,
1259                            fidl::encoding::DefaultFuchsiaResourceDialect
1260                        );
1261                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanRxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
1262                        let control_handle = WlanRxControlHandle { inner: this.inner.clone() };
1263                        Ok(WlanRxRequest::Transfer {
1264                            payload: req,
1265                            responder: WlanRxTransferResponder {
1266                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1267                                tx_id: header.tx_id,
1268                            },
1269                        })
1270                    }
1271                    _ => Err(fidl::Error::UnknownOrdinal {
1272                        ordinal: header.ordinal,
1273                        protocol_name:
1274                            <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1275                    }),
1276                }))
1277            },
1278        )
1279    }
1280}
1281
1282/// Protocol for sending a WLAN frame from the wlansoftmac driver to the bridged
1283/// wlansoftmac driver.
1284///
1285/// # Experimental
1286///
1287/// This protocol is implemented as a foreign function interface (FFI)
1288/// between the wlansoftmac driver and the bridged driver solely to improve
1289/// the performance of processing data frames through the wlan-mlme library.
1290#[derive(Debug)]
1291pub enum WlanRxRequest {
1292    Transfer { payload: WlanRxTransferRequest, responder: WlanRxTransferResponder },
1293}
1294
1295impl WlanRxRequest {
1296    #[allow(irrefutable_let_patterns)]
1297    pub fn into_transfer(self) -> Option<(WlanRxTransferRequest, WlanRxTransferResponder)> {
1298        if let WlanRxRequest::Transfer { payload, responder } = self {
1299            Some((payload, responder))
1300        } else {
1301            None
1302        }
1303    }
1304
1305    /// Name of the method defined in FIDL
1306    pub fn method_name(&self) -> &'static str {
1307        match *self {
1308            WlanRxRequest::Transfer { .. } => "transfer",
1309        }
1310    }
1311}
1312
1313#[derive(Debug, Clone)]
1314pub struct WlanRxControlHandle {
1315    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1316}
1317
1318impl fidl::endpoints::ControlHandle for WlanRxControlHandle {
1319    fn shutdown(&self) {
1320        self.inner.shutdown()
1321    }
1322
1323    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1324        self.inner.shutdown_with_epitaph(status)
1325    }
1326
1327    fn is_closed(&self) -> bool {
1328        self.inner.channel().is_closed()
1329    }
1330    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1331        self.inner.channel().on_closed()
1332    }
1333
1334    #[cfg(target_os = "fuchsia")]
1335    fn signal_peer(
1336        &self,
1337        clear_mask: zx::Signals,
1338        set_mask: zx::Signals,
1339    ) -> Result<(), zx_status::Status> {
1340        use fidl::Peered;
1341        self.inner.channel().signal_peer(clear_mask, set_mask)
1342    }
1343}
1344
1345impl WlanRxControlHandle {}
1346
1347#[must_use = "FIDL methods require a response to be sent"]
1348#[derive(Debug)]
1349pub struct WlanRxTransferResponder {
1350    control_handle: std::mem::ManuallyDrop<WlanRxControlHandle>,
1351    tx_id: u32,
1352}
1353
1354/// Set the the channel to be shutdown (see [`WlanRxControlHandle::shutdown`])
1355/// if the responder is dropped without sending a response, so that the client
1356/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1357impl std::ops::Drop for WlanRxTransferResponder {
1358    fn drop(&mut self) {
1359        self.control_handle.shutdown();
1360        // Safety: drops once, never accessed again
1361        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1362    }
1363}
1364
1365impl fidl::endpoints::Responder for WlanRxTransferResponder {
1366    type ControlHandle = WlanRxControlHandle;
1367
1368    fn control_handle(&self) -> &WlanRxControlHandle {
1369        &self.control_handle
1370    }
1371
1372    fn drop_without_shutdown(mut self) {
1373        // Safety: drops once, never accessed again due to mem::forget
1374        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1375        // Prevent Drop from running (which would shut down the channel)
1376        std::mem::forget(self);
1377    }
1378}
1379
1380impl WlanRxTransferResponder {
1381    /// Sends a response to the FIDL transaction.
1382    ///
1383    /// Sets the channel to shutdown if an error occurs.
1384    pub fn send(self) -> Result<(), fidl::Error> {
1385        let _result = self.send_raw();
1386        if _result.is_err() {
1387            self.control_handle.shutdown();
1388        }
1389        self.drop_without_shutdown();
1390        _result
1391    }
1392
1393    /// Similar to "send" but does not shutdown the channel if an error occurs.
1394    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1395        let _result = self.send_raw();
1396        self.drop_without_shutdown();
1397        _result
1398    }
1399
1400    fn send_raw(&self) -> Result<(), fidl::Error> {
1401        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1402            (),
1403            self.tx_id,
1404            0x2c73b18cbfca6055,
1405            fidl::encoding::DynamicFlags::empty(),
1406        )
1407    }
1408}
1409
1410#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1411pub struct WlanSoftmacBaseMarker;
1412
1413impl fidl::endpoints::ProtocolMarker for WlanSoftmacBaseMarker {
1414    type Proxy = WlanSoftmacBaseProxy;
1415    type RequestStream = WlanSoftmacBaseRequestStream;
1416    #[cfg(target_os = "fuchsia")]
1417    type SynchronousProxy = WlanSoftmacBaseSynchronousProxy;
1418
1419    const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacBase";
1420}
1421pub type WlanSoftmacBaseQueryResult = Result<WlanSoftmacQueryResponse, i32>;
1422pub type WlanSoftmacBaseQueryDiscoverySupportResult = Result<DiscoverySupport, i32>;
1423pub type WlanSoftmacBaseQueryMacSublayerSupportResult =
1424    Result<fidl_fuchsia_wlan_common::MacSublayerSupport, i32>;
1425pub type WlanSoftmacBaseQuerySecuritySupportResult =
1426    Result<fidl_fuchsia_wlan_common::SecuritySupport, i32>;
1427pub type WlanSoftmacBaseQuerySpectrumManagementSupportResult =
1428    Result<fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>;
1429pub type WlanSoftmacBaseSetChannelResult = Result<(), i32>;
1430pub type WlanSoftmacBaseJoinBssResult = Result<(), i32>;
1431pub type WlanSoftmacBaseEnableBeaconingResult = Result<(), i32>;
1432pub type WlanSoftmacBaseDisableBeaconingResult = Result<(), i32>;
1433pub type WlanSoftmacBaseInstallKeyResult = Result<(), i32>;
1434pub type WlanSoftmacBaseNotifyAssociationCompleteResult = Result<(), i32>;
1435pub type WlanSoftmacBaseClearAssociationResult = Result<(), i32>;
1436pub type WlanSoftmacBaseStartPassiveScanResult =
1437    Result<WlanSoftmacBaseStartPassiveScanResponse, i32>;
1438pub type WlanSoftmacBaseStartActiveScanResult = Result<WlanSoftmacBaseStartActiveScanResponse, i32>;
1439pub type WlanSoftmacBaseCancelScanResult = Result<(), i32>;
1440pub type WlanSoftmacBaseUpdateWmmParametersResult = Result<(), i32>;
1441
1442pub trait WlanSoftmacBaseProxyInterface: Send + Sync {
1443    type QueryResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQueryResult, fidl::Error>>
1444        + Send;
1445    fn r#query(&self) -> Self::QueryResponseFut;
1446    type QueryDiscoverySupportResponseFut: std::future::Future<
1447            Output = Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error>,
1448        > + Send;
1449    fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut;
1450    type QueryMacSublayerSupportResponseFut: std::future::Future<
1451            Output = Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error>,
1452        > + Send;
1453    fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut;
1454    type QuerySecuritySupportResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error>>
1455        + Send;
1456    fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut;
1457    type QuerySpectrumManagementSupportResponseFut: std::future::Future<
1458            Output = Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error>,
1459        > + Send;
1460    fn r#query_spectrum_management_support(
1461        &self,
1462    ) -> Self::QuerySpectrumManagementSupportResponseFut;
1463    type SetChannelResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseSetChannelResult, fidl::Error>>
1464        + Send;
1465    fn r#set_channel(
1466        &self,
1467        payload: &WlanSoftmacBaseSetChannelRequest,
1468    ) -> Self::SetChannelResponseFut;
1469    type JoinBssResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseJoinBssResult, fidl::Error>>
1470        + Send;
1471    fn r#join_bss(
1472        &self,
1473        join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
1474    ) -> Self::JoinBssResponseFut;
1475    type EnableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error>>
1476        + Send;
1477    fn r#enable_beaconing(
1478        &self,
1479        payload: &WlanSoftmacBaseEnableBeaconingRequest,
1480    ) -> Self::EnableBeaconingResponseFut;
1481    type DisableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error>>
1482        + Send;
1483    fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut;
1484    type InstallKeyResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseInstallKeyResult, fidl::Error>>
1485        + Send;
1486    fn r#install_key(&self, payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut;
1487    type NotifyAssociationCompleteResponseFut: std::future::Future<
1488            Output = Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error>,
1489        > + Send;
1490    fn r#notify_association_complete(
1491        &self,
1492        assoc_cfg: &WlanAssociationConfig,
1493    ) -> Self::NotifyAssociationCompleteResponseFut;
1494    type ClearAssociationResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseClearAssociationResult, fidl::Error>>
1495        + Send;
1496    fn r#clear_association(
1497        &self,
1498        payload: &WlanSoftmacBaseClearAssociationRequest,
1499    ) -> Self::ClearAssociationResponseFut;
1500    type StartPassiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error>>
1501        + Send;
1502    fn r#start_passive_scan(
1503        &self,
1504        payload: &WlanSoftmacBaseStartPassiveScanRequest,
1505    ) -> Self::StartPassiveScanResponseFut;
1506    type StartActiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error>>
1507        + Send;
1508    fn r#start_active_scan(
1509        &self,
1510        payload: &WlanSoftmacStartActiveScanRequest,
1511    ) -> Self::StartActiveScanResponseFut;
1512    type CancelScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseCancelScanResult, fidl::Error>>
1513        + Send;
1514    fn r#cancel_scan(
1515        &self,
1516        payload: &WlanSoftmacBaseCancelScanRequest,
1517    ) -> Self::CancelScanResponseFut;
1518    type UpdateWmmParametersResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error>>
1519        + Send;
1520    fn r#update_wmm_parameters(
1521        &self,
1522        payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
1523    ) -> Self::UpdateWmmParametersResponseFut;
1524}
1525#[derive(Debug)]
1526#[cfg(target_os = "fuchsia")]
1527pub struct WlanSoftmacBaseSynchronousProxy {
1528    client: fidl::client::sync::Client,
1529}
1530
1531#[cfg(target_os = "fuchsia")]
1532impl fidl::endpoints::SynchronousProxy for WlanSoftmacBaseSynchronousProxy {
1533    type Proxy = WlanSoftmacBaseProxy;
1534    type Protocol = WlanSoftmacBaseMarker;
1535
1536    fn from_channel(inner: fidl::Channel) -> Self {
1537        Self::new(inner)
1538    }
1539
1540    fn into_channel(self) -> fidl::Channel {
1541        self.client.into_channel()
1542    }
1543
1544    fn as_channel(&self) -> &fidl::Channel {
1545        self.client.as_channel()
1546    }
1547}
1548
1549#[cfg(target_os = "fuchsia")]
1550impl WlanSoftmacBaseSynchronousProxy {
1551    pub fn new(channel: fidl::Channel) -> Self {
1552        let protocol_name = <WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1553        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1554    }
1555
1556    pub fn into_channel(self) -> fidl::Channel {
1557        self.client.into_channel()
1558    }
1559
1560    /// Waits until an event arrives and returns it. It is safe for other
1561    /// threads to make concurrent requests while waiting for an event.
1562    pub fn wait_for_event(
1563        &self,
1564        deadline: zx::MonotonicInstant,
1565    ) -> Result<WlanSoftmacBaseEvent, fidl::Error> {
1566        WlanSoftmacBaseEvent::decode(self.client.wait_for_event(deadline)?)
1567    }
1568
1569    /// Gets general information about the device and its supported features.
1570    /// This method is safe to call even when the SoftMAC has not yet started.
1571    ///
1572    /// Note: The implementation of this method must not depend on a response
1573    /// from an ethernet driver, otherwise there is a risk of deadlock.
1574    /// The wlansoftmac driver calls this method synchronously while
1575    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
1576    pub fn r#query(
1577        &self,
1578        ___deadline: zx::MonotonicInstant,
1579    ) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
1580        let _response = self.client.send_query::<
1581            fidl::encoding::EmptyPayload,
1582            fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
1583        >(
1584            (),
1585            0x18231a638e508f9d,
1586            fidl::encoding::DynamicFlags::empty(),
1587            ___deadline,
1588        )?;
1589        Ok(_response.map(|x| x))
1590    }
1591
1592    /// Gets information about the station discovery (e.g., scanning and
1593    /// probing) features supported by the device. This method is safe to call
1594    /// even when the SoftMAC has not yet started.
1595    pub fn r#query_discovery_support(
1596        &self,
1597        ___deadline: zx::MonotonicInstant,
1598    ) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
1599        let _response =
1600            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1601                WlanSoftmacBaseQueryDiscoverySupportResponse,
1602                i32,
1603            >>(
1604                (),
1605                0x16797affc0cb58ae,
1606                fidl::encoding::DynamicFlags::empty(),
1607                ___deadline,
1608            )?;
1609        Ok(_response.map(|x| x.resp))
1610    }
1611
1612    /// Gets information about the MAC features supported by the device. This
1613    /// method is safe to call even when the SoftMAC has not yet started.
1614    ///
1615    /// Note: The implementation of this method must not depend on a response
1616    /// from an ethernet driver, otherwise there is a risk of deadlock.
1617    /// The wlansoftmac driver calls this method synchronously while
1618    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
1619    pub fn r#query_mac_sublayer_support(
1620        &self,
1621        ___deadline: zx::MonotonicInstant,
1622    ) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
1623        let _response =
1624            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1625                WlanSoftmacBaseQueryMacSublayerSupportResponse,
1626                i32,
1627            >>(
1628                (),
1629                0x7302c3f8c131f075,
1630                fidl::encoding::DynamicFlags::empty(),
1631                ___deadline,
1632            )?;
1633        Ok(_response.map(|x| x.resp))
1634    }
1635
1636    /// Gets information about the security features supported by the device.
1637    /// This method is safe to call even when the SoftMAC has not yet started.
1638    pub fn r#query_security_support(
1639        &self,
1640        ___deadline: zx::MonotonicInstant,
1641    ) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
1642        let _response =
1643            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1644                WlanSoftmacBaseQuerySecuritySupportResponse,
1645                i32,
1646            >>(
1647                (),
1648                0x3691bb75abf6354,
1649                fidl::encoding::DynamicFlags::empty(),
1650                ___deadline,
1651            )?;
1652        Ok(_response.map(|x| x.resp))
1653    }
1654
1655    /// Gets information about the spectrum usage (e.g., DFS) features supported
1656    /// by the device. This method is safe to call even when the SoftMAC has not
1657    /// yet started.
1658    pub fn r#query_spectrum_management_support(
1659        &self,
1660        ___deadline: zx::MonotonicInstant,
1661    ) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
1662        let _response = self
1663            .client
1664            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1665                WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
1666                i32,
1667            >>(
1668                (), 0x347d78dc1d4d27bf, fidl::encoding::DynamicFlags::empty(), ___deadline
1669            )?;
1670        Ok(_response.map(|x| x.resp))
1671    }
1672
1673    /// Set the primary radio channel, e.g. in response to a channel switch event.
1674    /// If successful, this will trigger the channel switch immediately. This may
1675    /// impact the transmission of any frames that are in-flight, and might also
1676    /// interfere with an ongoing scan request.
1677    ///
1678    /// Common errors include: \
1679    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
1680    pub fn r#set_channel(
1681        &self,
1682        mut payload: &WlanSoftmacBaseSetChannelRequest,
1683        ___deadline: zx::MonotonicInstant,
1684    ) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
1685        let _response = self.client.send_query::<
1686            WlanSoftmacBaseSetChannelRequest,
1687            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1688        >(
1689            payload,
1690            0x12836b533cd63ece,
1691            fidl::encoding::DynamicFlags::empty(),
1692            ___deadline,
1693        )?;
1694        Ok(_response.map(|x| x))
1695    }
1696
1697    /// Join a specific BSS in which we will participate.
1698    /// This applies regardless of if we are hosting the BSS or joining it
1699    /// (indicated by the `remote` flag in `JoinBssRequest`).
1700    /// If successful, the device will switch to the correct channel and perform
1701    /// any internal filtering/timing operations required to join the BSS.
1702    /// For client STAs, this is the first step before authenticating.
1703    ///
1704    /// Common errors include: \
1705    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
1706    pub fn r#join_bss(
1707        &self,
1708        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
1709        ___deadline: zx::MonotonicInstant,
1710    ) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
1711        let _response = self.client.send_query::<
1712            WlanSoftmacBaseJoinBssRequest,
1713            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1714        >(
1715            (join_request,),
1716            0x1336fb5455b77a6e,
1717            fidl::encoding::DynamicFlags::empty(),
1718            ___deadline,
1719        )?;
1720        Ok(_response.map(|x| x))
1721    }
1722
1723    /// Enables hardware Beaconing.
1724    ///
1725    /// This method cannot be called while beaconing is enabled and so
1726    /// `DisableBeaconing` must be called prior to this method if beaconing is
1727    /// enabled.
1728    ///
1729    /// All request fields are required.
1730    ///
1731    /// Common errors include:
1732    ///
1733    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
1734    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
1735    ///                          beacon.
1736    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
1737    pub fn r#enable_beaconing(
1738        &self,
1739        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
1740        ___deadline: zx::MonotonicInstant,
1741    ) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
1742        let _response = self.client.send_query::<
1743            WlanSoftmacBaseEnableBeaconingRequest,
1744            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1745        >(
1746            payload,
1747            0x6c35807632c64576,
1748            fidl::encoding::DynamicFlags::empty(),
1749            ___deadline,
1750        )?;
1751        Ok(_response.map(|x| x))
1752    }
1753
1754    /// Disables hardware beaconing.
1755    pub fn r#disable_beaconing(
1756        &self,
1757        ___deadline: zx::MonotonicInstant,
1758    ) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
1759        let _response = self.client.send_query::<
1760            fidl::encoding::EmptyPayload,
1761            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1762        >(
1763            (),
1764            0x3303b30f99dbb406,
1765            fidl::encoding::DynamicFlags::empty(),
1766            ___deadline,
1767        )?;
1768        Ok(_response.map(|x| x))
1769    }
1770
1771    /// Install a key for encryption when transmitting or receiving protected
1772    /// frames.
1773    ///
1774    /// Common errors include:
1775    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
1776    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
1777    pub fn r#install_key(
1778        &self,
1779        mut payload: &WlanKeyConfiguration,
1780        ___deadline: zx::MonotonicInstant,
1781    ) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
1782        let _response = self.client.send_query::<
1783            WlanKeyConfiguration,
1784            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1785        >(
1786            payload,
1787            0x7decf9b4200b9131,
1788            fidl::encoding::DynamicFlags::empty(),
1789            ___deadline,
1790        )?;
1791        Ok(_response.map(|x| x))
1792    }
1793
1794    /// Notifies the device of a successful association and configures
1795    /// additional parameters necessary to participate in that association.
1796    ///
1797    /// # Errors
1798    ///
1799    /// Common errors include:
1800    ///
1801    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
1802    ///                       via `WlanSoftmac.JoinBss`.
1803    pub fn r#notify_association_complete(
1804        &self,
1805        mut assoc_cfg: &WlanAssociationConfig,
1806        ___deadline: zx::MonotonicInstant,
1807    ) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
1808        let _response = self.client.send_query::<
1809            WlanSoftmacBaseNotifyAssociationCompleteRequest,
1810            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1811        >(
1812            (assoc_cfg,),
1813            0x436ffe3ba461d6cd,
1814            fidl::encoding::DynamicFlags::empty(),
1815            ___deadline,
1816        )?;
1817        Ok(_response.map(|x| x))
1818    }
1819
1820    /// Notifies MAC and PHY that the peer has been de-associated.
1821    pub fn r#clear_association(
1822        &self,
1823        mut payload: &WlanSoftmacBaseClearAssociationRequest,
1824        ___deadline: zx::MonotonicInstant,
1825    ) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
1826        let _response = self.client.send_query::<
1827            WlanSoftmacBaseClearAssociationRequest,
1828            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1829        >(
1830            payload,
1831            0x581d76c39190a7dd,
1832            fidl::encoding::DynamicFlags::empty(),
1833            ___deadline,
1834        )?;
1835        Ok(_response.map(|x| x))
1836    }
1837
1838    /// Starts a passive scan. The server will deliver scan results
1839    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
1840    /// the server will call WlanSoftmacIfc.ScanComplete() with the
1841    /// same `scan_id` returned by StartPassiveScan().
1842    ///
1843    /// The server indicates support for `StartPassiveScan()` using
1844    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
1845    ///
1846    /// Common errors include:
1847    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
1848    ///       requested scan, e.g. because an incompatible channel was requested.
1849    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
1850    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
1851    pub fn r#start_passive_scan(
1852        &self,
1853        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
1854        ___deadline: zx::MonotonicInstant,
1855    ) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
1856        let _response = self.client.send_query::<
1857            WlanSoftmacBaseStartPassiveScanRequest,
1858            fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
1859        >(
1860            payload,
1861            0x5662f989cb4083bb,
1862            fidl::encoding::DynamicFlags::empty(),
1863            ___deadline,
1864        )?;
1865        Ok(_response.map(|x| x))
1866    }
1867
1868    /// Starts an active scan. The server will deliver scan results
1869    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
1870    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
1871    /// with the same `scan_id` returned by StartActiveScan().
1872    ///
1873    /// A device driver indicates support for `StartActiveScan()` using
1874    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
1875    ///
1876    /// Common errors include:
1877    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
1878    ///       requested scan, e.g. because an incompatible channel was requested.
1879    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
1880    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
1881    pub fn r#start_active_scan(
1882        &self,
1883        mut payload: &WlanSoftmacStartActiveScanRequest,
1884        ___deadline: zx::MonotonicInstant,
1885    ) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
1886        let _response = self.client.send_query::<
1887            WlanSoftmacStartActiveScanRequest,
1888            fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
1889        >(
1890            payload,
1891            0x4896eafa9937751e,
1892            fidl::encoding::DynamicFlags::empty(),
1893            ___deadline,
1894        )?;
1895        Ok(_response.map(|x| x))
1896    }
1897
1898    /// Cancels the ongoing scan corresponding to `scan_id`,
1899    /// where `scan_id` is an identifier returned by
1900    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
1901    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
1902    /// `scan_id`.
1903    ///
1904    /// A device driver indicates support for `CancelScan()` using
1905    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
1906    ///
1907    /// Common errors include:
1908    ///
1909    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
1910    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
1911    pub fn r#cancel_scan(
1912        &self,
1913        mut payload: &WlanSoftmacBaseCancelScanRequest,
1914        ___deadline: zx::MonotonicInstant,
1915    ) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
1916        let _response = self.client.send_query::<
1917            WlanSoftmacBaseCancelScanRequest,
1918            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1919        >(
1920            payload,
1921            0xf7d859369764556,
1922            fidl::encoding::DynamicFlags::empty(),
1923            ___deadline,
1924        )?;
1925        Ok(_response.map(|x| x))
1926    }
1927
1928    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
1929    /// particular access category (AC).
1930    pub fn r#update_wmm_parameters(
1931        &self,
1932        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
1933        ___deadline: zx::MonotonicInstant,
1934    ) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
1935        let _response = self.client.send_query::<
1936            WlanSoftmacBaseUpdateWmmParametersRequest,
1937            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1938        >(
1939            payload,
1940            0x68522c7122d5f78c,
1941            fidl::encoding::DynamicFlags::empty(),
1942            ___deadline,
1943        )?;
1944        Ok(_response.map(|x| x))
1945    }
1946}
1947
1948#[cfg(target_os = "fuchsia")]
1949impl From<WlanSoftmacBaseSynchronousProxy> for zx::NullableHandle {
1950    fn from(value: WlanSoftmacBaseSynchronousProxy) -> Self {
1951        value.into_channel().into()
1952    }
1953}
1954
1955#[cfg(target_os = "fuchsia")]
1956impl From<fidl::Channel> for WlanSoftmacBaseSynchronousProxy {
1957    fn from(value: fidl::Channel) -> Self {
1958        Self::new(value)
1959    }
1960}
1961
1962#[cfg(target_os = "fuchsia")]
1963impl fidl::endpoints::FromClient for WlanSoftmacBaseSynchronousProxy {
1964    type Protocol = WlanSoftmacBaseMarker;
1965
1966    fn from_client(value: fidl::endpoints::ClientEnd<WlanSoftmacBaseMarker>) -> Self {
1967        Self::new(value.into_channel())
1968    }
1969}
1970
1971#[derive(Debug, Clone)]
1972pub struct WlanSoftmacBaseProxy {
1973    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1974}
1975
1976impl fidl::endpoints::Proxy for WlanSoftmacBaseProxy {
1977    type Protocol = WlanSoftmacBaseMarker;
1978
1979    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1980        Self::new(inner)
1981    }
1982
1983    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1984        self.client.into_channel().map_err(|client| Self { client })
1985    }
1986
1987    fn as_channel(&self) -> &::fidl::AsyncChannel {
1988        self.client.as_channel()
1989    }
1990}
1991
1992impl WlanSoftmacBaseProxy {
1993    /// Create a new Proxy for fuchsia.wlan.softmac/WlanSoftmacBase.
1994    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1995        let protocol_name = <WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1996        Self { client: fidl::client::Client::new(channel, protocol_name) }
1997    }
1998
1999    /// Get a Stream of events from the remote end of the protocol.
2000    ///
2001    /// # Panics
2002    ///
2003    /// Panics if the event stream was already taken.
2004    pub fn take_event_stream(&self) -> WlanSoftmacBaseEventStream {
2005        WlanSoftmacBaseEventStream { event_receiver: self.client.take_event_receiver() }
2006    }
2007
2008    /// Gets general information about the device and its supported features.
2009    /// This method is safe to call even when the SoftMAC has not yet started.
2010    ///
2011    /// Note: The implementation of this method must not depend on a response
2012    /// from an ethernet driver, otherwise there is a risk of deadlock.
2013    /// The wlansoftmac driver calls this method synchronously while
2014    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
2015    pub fn r#query(
2016        &self,
2017    ) -> fidl::client::QueryResponseFut<
2018        WlanSoftmacBaseQueryResult,
2019        fidl::encoding::DefaultFuchsiaResourceDialect,
2020    > {
2021        WlanSoftmacBaseProxyInterface::r#query(self)
2022    }
2023
2024    /// Gets information about the station discovery (e.g., scanning and
2025    /// probing) features supported by the device. This method is safe to call
2026    /// even when the SoftMAC has not yet started.
2027    pub fn r#query_discovery_support(
2028        &self,
2029    ) -> fidl::client::QueryResponseFut<
2030        WlanSoftmacBaseQueryDiscoverySupportResult,
2031        fidl::encoding::DefaultFuchsiaResourceDialect,
2032    > {
2033        WlanSoftmacBaseProxyInterface::r#query_discovery_support(self)
2034    }
2035
2036    /// Gets information about the MAC features supported by the device. This
2037    /// method is safe to call even when the SoftMAC has not yet started.
2038    ///
2039    /// Note: The implementation of this method must not depend on a response
2040    /// from an ethernet driver, otherwise there is a risk of deadlock.
2041    /// The wlansoftmac driver calls this method synchronously while
2042    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
2043    pub fn r#query_mac_sublayer_support(
2044        &self,
2045    ) -> fidl::client::QueryResponseFut<
2046        WlanSoftmacBaseQueryMacSublayerSupportResult,
2047        fidl::encoding::DefaultFuchsiaResourceDialect,
2048    > {
2049        WlanSoftmacBaseProxyInterface::r#query_mac_sublayer_support(self)
2050    }
2051
2052    /// Gets information about the security features supported by the device.
2053    /// This method is safe to call even when the SoftMAC has not yet started.
2054    pub fn r#query_security_support(
2055        &self,
2056    ) -> fidl::client::QueryResponseFut<
2057        WlanSoftmacBaseQuerySecuritySupportResult,
2058        fidl::encoding::DefaultFuchsiaResourceDialect,
2059    > {
2060        WlanSoftmacBaseProxyInterface::r#query_security_support(self)
2061    }
2062
2063    /// Gets information about the spectrum usage (e.g., DFS) features supported
2064    /// by the device. This method is safe to call even when the SoftMAC has not
2065    /// yet started.
2066    pub fn r#query_spectrum_management_support(
2067        &self,
2068    ) -> fidl::client::QueryResponseFut<
2069        WlanSoftmacBaseQuerySpectrumManagementSupportResult,
2070        fidl::encoding::DefaultFuchsiaResourceDialect,
2071    > {
2072        WlanSoftmacBaseProxyInterface::r#query_spectrum_management_support(self)
2073    }
2074
2075    /// Set the primary radio channel, e.g. in response to a channel switch event.
2076    /// If successful, this will trigger the channel switch immediately. This may
2077    /// impact the transmission of any frames that are in-flight, and might also
2078    /// interfere with an ongoing scan request.
2079    ///
2080    /// Common errors include: \
2081    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
2082    pub fn r#set_channel(
2083        &self,
2084        mut payload: &WlanSoftmacBaseSetChannelRequest,
2085    ) -> fidl::client::QueryResponseFut<
2086        WlanSoftmacBaseSetChannelResult,
2087        fidl::encoding::DefaultFuchsiaResourceDialect,
2088    > {
2089        WlanSoftmacBaseProxyInterface::r#set_channel(self, payload)
2090    }
2091
2092    /// Join a specific BSS in which we will participate.
2093    /// This applies regardless of if we are hosting the BSS or joining it
2094    /// (indicated by the `remote` flag in `JoinBssRequest`).
2095    /// If successful, the device will switch to the correct channel and perform
2096    /// any internal filtering/timing operations required to join the BSS.
2097    /// For client STAs, this is the first step before authenticating.
2098    ///
2099    /// Common errors include: \
2100    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
2101    pub fn r#join_bss(
2102        &self,
2103        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
2104    ) -> fidl::client::QueryResponseFut<
2105        WlanSoftmacBaseJoinBssResult,
2106        fidl::encoding::DefaultFuchsiaResourceDialect,
2107    > {
2108        WlanSoftmacBaseProxyInterface::r#join_bss(self, join_request)
2109    }
2110
2111    /// Enables hardware Beaconing.
2112    ///
2113    /// This method cannot be called while beaconing is enabled and so
2114    /// `DisableBeaconing` must be called prior to this method if beaconing is
2115    /// enabled.
2116    ///
2117    /// All request fields are required.
2118    ///
2119    /// Common errors include:
2120    ///
2121    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
2122    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
2123    ///                          beacon.
2124    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
2125    pub fn r#enable_beaconing(
2126        &self,
2127        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
2128    ) -> fidl::client::QueryResponseFut<
2129        WlanSoftmacBaseEnableBeaconingResult,
2130        fidl::encoding::DefaultFuchsiaResourceDialect,
2131    > {
2132        WlanSoftmacBaseProxyInterface::r#enable_beaconing(self, payload)
2133    }
2134
2135    /// Disables hardware beaconing.
2136    pub fn r#disable_beaconing(
2137        &self,
2138    ) -> fidl::client::QueryResponseFut<
2139        WlanSoftmacBaseDisableBeaconingResult,
2140        fidl::encoding::DefaultFuchsiaResourceDialect,
2141    > {
2142        WlanSoftmacBaseProxyInterface::r#disable_beaconing(self)
2143    }
2144
2145    /// Install a key for encryption when transmitting or receiving protected
2146    /// frames.
2147    ///
2148    /// Common errors include:
2149    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
2150    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
2151    pub fn r#install_key(
2152        &self,
2153        mut payload: &WlanKeyConfiguration,
2154    ) -> fidl::client::QueryResponseFut<
2155        WlanSoftmacBaseInstallKeyResult,
2156        fidl::encoding::DefaultFuchsiaResourceDialect,
2157    > {
2158        WlanSoftmacBaseProxyInterface::r#install_key(self, payload)
2159    }
2160
2161    /// Notifies the device of a successful association and configures
2162    /// additional parameters necessary to participate in that association.
2163    ///
2164    /// # Errors
2165    ///
2166    /// Common errors include:
2167    ///
2168    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
2169    ///                       via `WlanSoftmac.JoinBss`.
2170    pub fn r#notify_association_complete(
2171        &self,
2172        mut assoc_cfg: &WlanAssociationConfig,
2173    ) -> fidl::client::QueryResponseFut<
2174        WlanSoftmacBaseNotifyAssociationCompleteResult,
2175        fidl::encoding::DefaultFuchsiaResourceDialect,
2176    > {
2177        WlanSoftmacBaseProxyInterface::r#notify_association_complete(self, assoc_cfg)
2178    }
2179
2180    /// Notifies MAC and PHY that the peer has been de-associated.
2181    pub fn r#clear_association(
2182        &self,
2183        mut payload: &WlanSoftmacBaseClearAssociationRequest,
2184    ) -> fidl::client::QueryResponseFut<
2185        WlanSoftmacBaseClearAssociationResult,
2186        fidl::encoding::DefaultFuchsiaResourceDialect,
2187    > {
2188        WlanSoftmacBaseProxyInterface::r#clear_association(self, payload)
2189    }
2190
2191    /// Starts a passive scan. The server will deliver scan results
2192    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
2193    /// the server will call WlanSoftmacIfc.ScanComplete() with the
2194    /// same `scan_id` returned by StartPassiveScan().
2195    ///
2196    /// The server indicates support for `StartPassiveScan()` using
2197    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
2198    ///
2199    /// Common errors include:
2200    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
2201    ///       requested scan, e.g. because an incompatible channel was requested.
2202    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
2203    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
2204    pub fn r#start_passive_scan(
2205        &self,
2206        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
2207    ) -> fidl::client::QueryResponseFut<
2208        WlanSoftmacBaseStartPassiveScanResult,
2209        fidl::encoding::DefaultFuchsiaResourceDialect,
2210    > {
2211        WlanSoftmacBaseProxyInterface::r#start_passive_scan(self, payload)
2212    }
2213
2214    /// Starts an active scan. The server will deliver scan results
2215    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
2216    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
2217    /// with the same `scan_id` returned by StartActiveScan().
2218    ///
2219    /// A device driver indicates support for `StartActiveScan()` using
2220    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
2221    ///
2222    /// Common errors include:
2223    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
2224    ///       requested scan, e.g. because an incompatible channel was requested.
2225    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
2226    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
2227    pub fn r#start_active_scan(
2228        &self,
2229        mut payload: &WlanSoftmacStartActiveScanRequest,
2230    ) -> fidl::client::QueryResponseFut<
2231        WlanSoftmacBaseStartActiveScanResult,
2232        fidl::encoding::DefaultFuchsiaResourceDialect,
2233    > {
2234        WlanSoftmacBaseProxyInterface::r#start_active_scan(self, payload)
2235    }
2236
2237    /// Cancels the ongoing scan corresponding to `scan_id`,
2238    /// where `scan_id` is an identifier returned by
2239    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
2240    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
2241    /// `scan_id`.
2242    ///
2243    /// A device driver indicates support for `CancelScan()` using
2244    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
2245    ///
2246    /// Common errors include:
2247    ///
2248    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
2249    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
2250    pub fn r#cancel_scan(
2251        &self,
2252        mut payload: &WlanSoftmacBaseCancelScanRequest,
2253    ) -> fidl::client::QueryResponseFut<
2254        WlanSoftmacBaseCancelScanResult,
2255        fidl::encoding::DefaultFuchsiaResourceDialect,
2256    > {
2257        WlanSoftmacBaseProxyInterface::r#cancel_scan(self, payload)
2258    }
2259
2260    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
2261    /// particular access category (AC).
2262    pub fn r#update_wmm_parameters(
2263        &self,
2264        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
2265    ) -> fidl::client::QueryResponseFut<
2266        WlanSoftmacBaseUpdateWmmParametersResult,
2267        fidl::encoding::DefaultFuchsiaResourceDialect,
2268    > {
2269        WlanSoftmacBaseProxyInterface::r#update_wmm_parameters(self, payload)
2270    }
2271}
2272
2273impl WlanSoftmacBaseProxyInterface for WlanSoftmacBaseProxy {
2274    type QueryResponseFut = fidl::client::QueryResponseFut<
2275        WlanSoftmacBaseQueryResult,
2276        fidl::encoding::DefaultFuchsiaResourceDialect,
2277    >;
2278    fn r#query(&self) -> Self::QueryResponseFut {
2279        fn _decode(
2280            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2281        ) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
2282            let _response = fidl::client::decode_transaction_body::<
2283                fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
2284                fidl::encoding::DefaultFuchsiaResourceDialect,
2285                0x18231a638e508f9d,
2286            >(_buf?)?;
2287            Ok(_response.map(|x| x))
2288        }
2289        self.client
2290            .send_query_and_decode::<fidl::encoding::EmptyPayload, WlanSoftmacBaseQueryResult>(
2291                (),
2292                0x18231a638e508f9d,
2293                fidl::encoding::DynamicFlags::empty(),
2294                _decode,
2295            )
2296    }
2297
2298    type QueryDiscoverySupportResponseFut = fidl::client::QueryResponseFut<
2299        WlanSoftmacBaseQueryDiscoverySupportResult,
2300        fidl::encoding::DefaultFuchsiaResourceDialect,
2301    >;
2302    fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut {
2303        fn _decode(
2304            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2305        ) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
2306            let _response = fidl::client::decode_transaction_body::<
2307                fidl::encoding::ResultType<WlanSoftmacBaseQueryDiscoverySupportResponse, i32>,
2308                fidl::encoding::DefaultFuchsiaResourceDialect,
2309                0x16797affc0cb58ae,
2310            >(_buf?)?;
2311            Ok(_response.map(|x| x.resp))
2312        }
2313        self.client.send_query_and_decode::<
2314            fidl::encoding::EmptyPayload,
2315            WlanSoftmacBaseQueryDiscoverySupportResult,
2316        >(
2317            (),
2318            0x16797affc0cb58ae,
2319            fidl::encoding::DynamicFlags::empty(),
2320            _decode,
2321        )
2322    }
2323
2324    type QueryMacSublayerSupportResponseFut = fidl::client::QueryResponseFut<
2325        WlanSoftmacBaseQueryMacSublayerSupportResult,
2326        fidl::encoding::DefaultFuchsiaResourceDialect,
2327    >;
2328    fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut {
2329        fn _decode(
2330            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2331        ) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
2332            let _response = fidl::client::decode_transaction_body::<
2333                fidl::encoding::ResultType<WlanSoftmacBaseQueryMacSublayerSupportResponse, i32>,
2334                fidl::encoding::DefaultFuchsiaResourceDialect,
2335                0x7302c3f8c131f075,
2336            >(_buf?)?;
2337            Ok(_response.map(|x| x.resp))
2338        }
2339        self.client.send_query_and_decode::<
2340            fidl::encoding::EmptyPayload,
2341            WlanSoftmacBaseQueryMacSublayerSupportResult,
2342        >(
2343            (),
2344            0x7302c3f8c131f075,
2345            fidl::encoding::DynamicFlags::empty(),
2346            _decode,
2347        )
2348    }
2349
2350    type QuerySecuritySupportResponseFut = fidl::client::QueryResponseFut<
2351        WlanSoftmacBaseQuerySecuritySupportResult,
2352        fidl::encoding::DefaultFuchsiaResourceDialect,
2353    >;
2354    fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut {
2355        fn _decode(
2356            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2357        ) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
2358            let _response = fidl::client::decode_transaction_body::<
2359                fidl::encoding::ResultType<WlanSoftmacBaseQuerySecuritySupportResponse, i32>,
2360                fidl::encoding::DefaultFuchsiaResourceDialect,
2361                0x3691bb75abf6354,
2362            >(_buf?)?;
2363            Ok(_response.map(|x| x.resp))
2364        }
2365        self.client.send_query_and_decode::<
2366            fidl::encoding::EmptyPayload,
2367            WlanSoftmacBaseQuerySecuritySupportResult,
2368        >(
2369            (),
2370            0x3691bb75abf6354,
2371            fidl::encoding::DynamicFlags::empty(),
2372            _decode,
2373        )
2374    }
2375
2376    type QuerySpectrumManagementSupportResponseFut = fidl::client::QueryResponseFut<
2377        WlanSoftmacBaseQuerySpectrumManagementSupportResult,
2378        fidl::encoding::DefaultFuchsiaResourceDialect,
2379    >;
2380    fn r#query_spectrum_management_support(
2381        &self,
2382    ) -> Self::QuerySpectrumManagementSupportResponseFut {
2383        fn _decode(
2384            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2385        ) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
2386            let _response = fidl::client::decode_transaction_body::<
2387                fidl::encoding::ResultType<
2388                    WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
2389                    i32,
2390                >,
2391                fidl::encoding::DefaultFuchsiaResourceDialect,
2392                0x347d78dc1d4d27bf,
2393            >(_buf?)?;
2394            Ok(_response.map(|x| x.resp))
2395        }
2396        self.client.send_query_and_decode::<
2397            fidl::encoding::EmptyPayload,
2398            WlanSoftmacBaseQuerySpectrumManagementSupportResult,
2399        >(
2400            (),
2401            0x347d78dc1d4d27bf,
2402            fidl::encoding::DynamicFlags::empty(),
2403            _decode,
2404        )
2405    }
2406
2407    type SetChannelResponseFut = fidl::client::QueryResponseFut<
2408        WlanSoftmacBaseSetChannelResult,
2409        fidl::encoding::DefaultFuchsiaResourceDialect,
2410    >;
2411    fn r#set_channel(
2412        &self,
2413        mut payload: &WlanSoftmacBaseSetChannelRequest,
2414    ) -> Self::SetChannelResponseFut {
2415        fn _decode(
2416            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2417        ) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
2418            let _response = fidl::client::decode_transaction_body::<
2419                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2420                fidl::encoding::DefaultFuchsiaResourceDialect,
2421                0x12836b533cd63ece,
2422            >(_buf?)?;
2423            Ok(_response.map(|x| x))
2424        }
2425        self.client.send_query_and_decode::<
2426            WlanSoftmacBaseSetChannelRequest,
2427            WlanSoftmacBaseSetChannelResult,
2428        >(
2429            payload,
2430            0x12836b533cd63ece,
2431            fidl::encoding::DynamicFlags::empty(),
2432            _decode,
2433        )
2434    }
2435
2436    type JoinBssResponseFut = fidl::client::QueryResponseFut<
2437        WlanSoftmacBaseJoinBssResult,
2438        fidl::encoding::DefaultFuchsiaResourceDialect,
2439    >;
2440    fn r#join_bss(
2441        &self,
2442        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
2443    ) -> Self::JoinBssResponseFut {
2444        fn _decode(
2445            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2446        ) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
2447            let _response = fidl::client::decode_transaction_body::<
2448                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2449                fidl::encoding::DefaultFuchsiaResourceDialect,
2450                0x1336fb5455b77a6e,
2451            >(_buf?)?;
2452            Ok(_response.map(|x| x))
2453        }
2454        self.client
2455            .send_query_and_decode::<WlanSoftmacBaseJoinBssRequest, WlanSoftmacBaseJoinBssResult>(
2456                (join_request,),
2457                0x1336fb5455b77a6e,
2458                fidl::encoding::DynamicFlags::empty(),
2459                _decode,
2460            )
2461    }
2462
2463    type EnableBeaconingResponseFut = fidl::client::QueryResponseFut<
2464        WlanSoftmacBaseEnableBeaconingResult,
2465        fidl::encoding::DefaultFuchsiaResourceDialect,
2466    >;
2467    fn r#enable_beaconing(
2468        &self,
2469        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
2470    ) -> Self::EnableBeaconingResponseFut {
2471        fn _decode(
2472            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2473        ) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
2474            let _response = fidl::client::decode_transaction_body::<
2475                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2476                fidl::encoding::DefaultFuchsiaResourceDialect,
2477                0x6c35807632c64576,
2478            >(_buf?)?;
2479            Ok(_response.map(|x| x))
2480        }
2481        self.client.send_query_and_decode::<
2482            WlanSoftmacBaseEnableBeaconingRequest,
2483            WlanSoftmacBaseEnableBeaconingResult,
2484        >(
2485            payload,
2486            0x6c35807632c64576,
2487            fidl::encoding::DynamicFlags::empty(),
2488            _decode,
2489        )
2490    }
2491
2492    type DisableBeaconingResponseFut = fidl::client::QueryResponseFut<
2493        WlanSoftmacBaseDisableBeaconingResult,
2494        fidl::encoding::DefaultFuchsiaResourceDialect,
2495    >;
2496    fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut {
2497        fn _decode(
2498            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2499        ) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
2500            let _response = fidl::client::decode_transaction_body::<
2501                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2502                fidl::encoding::DefaultFuchsiaResourceDialect,
2503                0x3303b30f99dbb406,
2504            >(_buf?)?;
2505            Ok(_response.map(|x| x))
2506        }
2507        self.client.send_query_and_decode::<
2508            fidl::encoding::EmptyPayload,
2509            WlanSoftmacBaseDisableBeaconingResult,
2510        >(
2511            (),
2512            0x3303b30f99dbb406,
2513            fidl::encoding::DynamicFlags::empty(),
2514            _decode,
2515        )
2516    }
2517
2518    type InstallKeyResponseFut = fidl::client::QueryResponseFut<
2519        WlanSoftmacBaseInstallKeyResult,
2520        fidl::encoding::DefaultFuchsiaResourceDialect,
2521    >;
2522    fn r#install_key(&self, mut payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut {
2523        fn _decode(
2524            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2525        ) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
2526            let _response = fidl::client::decode_transaction_body::<
2527                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2528                fidl::encoding::DefaultFuchsiaResourceDialect,
2529                0x7decf9b4200b9131,
2530            >(_buf?)?;
2531            Ok(_response.map(|x| x))
2532        }
2533        self.client.send_query_and_decode::<WlanKeyConfiguration, WlanSoftmacBaseInstallKeyResult>(
2534            payload,
2535            0x7decf9b4200b9131,
2536            fidl::encoding::DynamicFlags::empty(),
2537            _decode,
2538        )
2539    }
2540
2541    type NotifyAssociationCompleteResponseFut = fidl::client::QueryResponseFut<
2542        WlanSoftmacBaseNotifyAssociationCompleteResult,
2543        fidl::encoding::DefaultFuchsiaResourceDialect,
2544    >;
2545    fn r#notify_association_complete(
2546        &self,
2547        mut assoc_cfg: &WlanAssociationConfig,
2548    ) -> Self::NotifyAssociationCompleteResponseFut {
2549        fn _decode(
2550            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2551        ) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
2552            let _response = fidl::client::decode_transaction_body::<
2553                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2554                fidl::encoding::DefaultFuchsiaResourceDialect,
2555                0x436ffe3ba461d6cd,
2556            >(_buf?)?;
2557            Ok(_response.map(|x| x))
2558        }
2559        self.client.send_query_and_decode::<
2560            WlanSoftmacBaseNotifyAssociationCompleteRequest,
2561            WlanSoftmacBaseNotifyAssociationCompleteResult,
2562        >(
2563            (assoc_cfg,),
2564            0x436ffe3ba461d6cd,
2565            fidl::encoding::DynamicFlags::empty(),
2566            _decode,
2567        )
2568    }
2569
2570    type ClearAssociationResponseFut = fidl::client::QueryResponseFut<
2571        WlanSoftmacBaseClearAssociationResult,
2572        fidl::encoding::DefaultFuchsiaResourceDialect,
2573    >;
2574    fn r#clear_association(
2575        &self,
2576        mut payload: &WlanSoftmacBaseClearAssociationRequest,
2577    ) -> Self::ClearAssociationResponseFut {
2578        fn _decode(
2579            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2580        ) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
2581            let _response = fidl::client::decode_transaction_body::<
2582                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2583                fidl::encoding::DefaultFuchsiaResourceDialect,
2584                0x581d76c39190a7dd,
2585            >(_buf?)?;
2586            Ok(_response.map(|x| x))
2587        }
2588        self.client.send_query_and_decode::<
2589            WlanSoftmacBaseClearAssociationRequest,
2590            WlanSoftmacBaseClearAssociationResult,
2591        >(
2592            payload,
2593            0x581d76c39190a7dd,
2594            fidl::encoding::DynamicFlags::empty(),
2595            _decode,
2596        )
2597    }
2598
2599    type StartPassiveScanResponseFut = fidl::client::QueryResponseFut<
2600        WlanSoftmacBaseStartPassiveScanResult,
2601        fidl::encoding::DefaultFuchsiaResourceDialect,
2602    >;
2603    fn r#start_passive_scan(
2604        &self,
2605        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
2606    ) -> Self::StartPassiveScanResponseFut {
2607        fn _decode(
2608            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2609        ) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
2610            let _response = fidl::client::decode_transaction_body::<
2611                fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
2612                fidl::encoding::DefaultFuchsiaResourceDialect,
2613                0x5662f989cb4083bb,
2614            >(_buf?)?;
2615            Ok(_response.map(|x| x))
2616        }
2617        self.client.send_query_and_decode::<
2618            WlanSoftmacBaseStartPassiveScanRequest,
2619            WlanSoftmacBaseStartPassiveScanResult,
2620        >(
2621            payload,
2622            0x5662f989cb4083bb,
2623            fidl::encoding::DynamicFlags::empty(),
2624            _decode,
2625        )
2626    }
2627
2628    type StartActiveScanResponseFut = fidl::client::QueryResponseFut<
2629        WlanSoftmacBaseStartActiveScanResult,
2630        fidl::encoding::DefaultFuchsiaResourceDialect,
2631    >;
2632    fn r#start_active_scan(
2633        &self,
2634        mut payload: &WlanSoftmacStartActiveScanRequest,
2635    ) -> Self::StartActiveScanResponseFut {
2636        fn _decode(
2637            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2638        ) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
2639            let _response = fidl::client::decode_transaction_body::<
2640                fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
2641                fidl::encoding::DefaultFuchsiaResourceDialect,
2642                0x4896eafa9937751e,
2643            >(_buf?)?;
2644            Ok(_response.map(|x| x))
2645        }
2646        self.client.send_query_and_decode::<
2647            WlanSoftmacStartActiveScanRequest,
2648            WlanSoftmacBaseStartActiveScanResult,
2649        >(
2650            payload,
2651            0x4896eafa9937751e,
2652            fidl::encoding::DynamicFlags::empty(),
2653            _decode,
2654        )
2655    }
2656
2657    type CancelScanResponseFut = fidl::client::QueryResponseFut<
2658        WlanSoftmacBaseCancelScanResult,
2659        fidl::encoding::DefaultFuchsiaResourceDialect,
2660    >;
2661    fn r#cancel_scan(
2662        &self,
2663        mut payload: &WlanSoftmacBaseCancelScanRequest,
2664    ) -> Self::CancelScanResponseFut {
2665        fn _decode(
2666            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2667        ) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
2668            let _response = fidl::client::decode_transaction_body::<
2669                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2670                fidl::encoding::DefaultFuchsiaResourceDialect,
2671                0xf7d859369764556,
2672            >(_buf?)?;
2673            Ok(_response.map(|x| x))
2674        }
2675        self.client.send_query_and_decode::<
2676            WlanSoftmacBaseCancelScanRequest,
2677            WlanSoftmacBaseCancelScanResult,
2678        >(
2679            payload,
2680            0xf7d859369764556,
2681            fidl::encoding::DynamicFlags::empty(),
2682            _decode,
2683        )
2684    }
2685
2686    type UpdateWmmParametersResponseFut = fidl::client::QueryResponseFut<
2687        WlanSoftmacBaseUpdateWmmParametersResult,
2688        fidl::encoding::DefaultFuchsiaResourceDialect,
2689    >;
2690    fn r#update_wmm_parameters(
2691        &self,
2692        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
2693    ) -> Self::UpdateWmmParametersResponseFut {
2694        fn _decode(
2695            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2696        ) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
2697            let _response = fidl::client::decode_transaction_body::<
2698                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2699                fidl::encoding::DefaultFuchsiaResourceDialect,
2700                0x68522c7122d5f78c,
2701            >(_buf?)?;
2702            Ok(_response.map(|x| x))
2703        }
2704        self.client.send_query_and_decode::<
2705            WlanSoftmacBaseUpdateWmmParametersRequest,
2706            WlanSoftmacBaseUpdateWmmParametersResult,
2707        >(
2708            payload,
2709            0x68522c7122d5f78c,
2710            fidl::encoding::DynamicFlags::empty(),
2711            _decode,
2712        )
2713    }
2714}
2715
2716pub struct WlanSoftmacBaseEventStream {
2717    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2718}
2719
2720impl std::marker::Unpin for WlanSoftmacBaseEventStream {}
2721
2722impl futures::stream::FusedStream for WlanSoftmacBaseEventStream {
2723    fn is_terminated(&self) -> bool {
2724        self.event_receiver.is_terminated()
2725    }
2726}
2727
2728impl futures::Stream for WlanSoftmacBaseEventStream {
2729    type Item = Result<WlanSoftmacBaseEvent, fidl::Error>;
2730
2731    fn poll_next(
2732        mut self: std::pin::Pin<&mut Self>,
2733        cx: &mut std::task::Context<'_>,
2734    ) -> std::task::Poll<Option<Self::Item>> {
2735        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2736            &mut self.event_receiver,
2737            cx
2738        )?) {
2739            Some(buf) => std::task::Poll::Ready(Some(WlanSoftmacBaseEvent::decode(buf))),
2740            None => std::task::Poll::Ready(None),
2741        }
2742    }
2743}
2744
2745#[derive(Debug)]
2746pub enum WlanSoftmacBaseEvent {
2747    #[non_exhaustive]
2748    _UnknownEvent {
2749        /// Ordinal of the event that was sent.
2750        ordinal: u64,
2751    },
2752}
2753
2754impl WlanSoftmacBaseEvent {
2755    /// Decodes a message buffer as a [`WlanSoftmacBaseEvent`].
2756    fn decode(
2757        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2758    ) -> Result<WlanSoftmacBaseEvent, fidl::Error> {
2759        let (bytes, _handles) = buf.split_mut();
2760        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2761        debug_assert_eq!(tx_header.tx_id, 0);
2762        match tx_header.ordinal {
2763            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2764                Ok(WlanSoftmacBaseEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2765            }
2766            _ => Err(fidl::Error::UnknownOrdinal {
2767                ordinal: tx_header.ordinal,
2768                protocol_name:
2769                    <WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2770            }),
2771        }
2772    }
2773}
2774
2775/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanSoftmacBase.
2776pub struct WlanSoftmacBaseRequestStream {
2777    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2778    is_terminated: bool,
2779}
2780
2781impl std::marker::Unpin for WlanSoftmacBaseRequestStream {}
2782
2783impl futures::stream::FusedStream for WlanSoftmacBaseRequestStream {
2784    fn is_terminated(&self) -> bool {
2785        self.is_terminated
2786    }
2787}
2788
2789impl fidl::endpoints::RequestStream for WlanSoftmacBaseRequestStream {
2790    type Protocol = WlanSoftmacBaseMarker;
2791    type ControlHandle = WlanSoftmacBaseControlHandle;
2792
2793    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2794        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2795    }
2796
2797    fn control_handle(&self) -> Self::ControlHandle {
2798        WlanSoftmacBaseControlHandle { inner: self.inner.clone() }
2799    }
2800
2801    fn into_inner(
2802        self,
2803    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2804    {
2805        (self.inner, self.is_terminated)
2806    }
2807
2808    fn from_inner(
2809        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2810        is_terminated: bool,
2811    ) -> Self {
2812        Self { inner, is_terminated }
2813    }
2814}
2815
2816impl futures::Stream for WlanSoftmacBaseRequestStream {
2817    type Item = Result<WlanSoftmacBaseRequest, fidl::Error>;
2818
2819    fn poll_next(
2820        mut self: std::pin::Pin<&mut Self>,
2821        cx: &mut std::task::Context<'_>,
2822    ) -> std::task::Poll<Option<Self::Item>> {
2823        let this = &mut *self;
2824        if this.inner.check_shutdown(cx) {
2825            this.is_terminated = true;
2826            return std::task::Poll::Ready(None);
2827        }
2828        if this.is_terminated {
2829            panic!("polled WlanSoftmacBaseRequestStream after completion");
2830        }
2831        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2832            |bytes, handles| {
2833                match this.inner.channel().read_etc(cx, bytes, handles) {
2834                    std::task::Poll::Ready(Ok(())) => {}
2835                    std::task::Poll::Pending => return std::task::Poll::Pending,
2836                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2837                        this.is_terminated = true;
2838                        return std::task::Poll::Ready(None);
2839                    }
2840                    std::task::Poll::Ready(Err(e)) => {
2841                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2842                            e.into(),
2843                        ))));
2844                    }
2845                }
2846
2847                // A message has been received from the channel
2848                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2849
2850                std::task::Poll::Ready(Some(match header.ordinal {
2851                    0x18231a638e508f9d => {
2852                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2853                        let mut req = fidl::new_empty!(
2854                            fidl::encoding::EmptyPayload,
2855                            fidl::encoding::DefaultFuchsiaResourceDialect
2856                        );
2857                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2858                        let control_handle =
2859                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
2860                        Ok(WlanSoftmacBaseRequest::Query {
2861                            responder: WlanSoftmacBaseQueryResponder {
2862                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2863                                tx_id: header.tx_id,
2864                            },
2865                        })
2866                    }
2867                    0x16797affc0cb58ae => {
2868                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2869                        let mut req = fidl::new_empty!(
2870                            fidl::encoding::EmptyPayload,
2871                            fidl::encoding::DefaultFuchsiaResourceDialect
2872                        );
2873                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2874                        let control_handle =
2875                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
2876                        Ok(WlanSoftmacBaseRequest::QueryDiscoverySupport {
2877                            responder: WlanSoftmacBaseQueryDiscoverySupportResponder {
2878                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2879                                tx_id: header.tx_id,
2880                            },
2881                        })
2882                    }
2883                    0x7302c3f8c131f075 => {
2884                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2885                        let mut req = fidl::new_empty!(
2886                            fidl::encoding::EmptyPayload,
2887                            fidl::encoding::DefaultFuchsiaResourceDialect
2888                        );
2889                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2890                        let control_handle =
2891                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
2892                        Ok(WlanSoftmacBaseRequest::QueryMacSublayerSupport {
2893                            responder: WlanSoftmacBaseQueryMacSublayerSupportResponder {
2894                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2895                                tx_id: header.tx_id,
2896                            },
2897                        })
2898                    }
2899                    0x3691bb75abf6354 => {
2900                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2901                        let mut req = fidl::new_empty!(
2902                            fidl::encoding::EmptyPayload,
2903                            fidl::encoding::DefaultFuchsiaResourceDialect
2904                        );
2905                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2906                        let control_handle =
2907                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
2908                        Ok(WlanSoftmacBaseRequest::QuerySecuritySupport {
2909                            responder: WlanSoftmacBaseQuerySecuritySupportResponder {
2910                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2911                                tx_id: header.tx_id,
2912                            },
2913                        })
2914                    }
2915                    0x347d78dc1d4d27bf => {
2916                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2917                        let mut req = fidl::new_empty!(
2918                            fidl::encoding::EmptyPayload,
2919                            fidl::encoding::DefaultFuchsiaResourceDialect
2920                        );
2921                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2922                        let control_handle =
2923                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
2924                        Ok(WlanSoftmacBaseRequest::QuerySpectrumManagementSupport {
2925                            responder: WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
2926                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2927                                tx_id: header.tx_id,
2928                            },
2929                        })
2930                    }
2931                    0x12836b533cd63ece => {
2932                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2933                        let mut req = fidl::new_empty!(
2934                            WlanSoftmacBaseSetChannelRequest,
2935                            fidl::encoding::DefaultFuchsiaResourceDialect
2936                        );
2937                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseSetChannelRequest>(&header, _body_bytes, handles, &mut req)?;
2938                        let control_handle =
2939                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
2940                        Ok(WlanSoftmacBaseRequest::SetChannel {
2941                            payload: req,
2942                            responder: WlanSoftmacBaseSetChannelResponder {
2943                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2944                                tx_id: header.tx_id,
2945                            },
2946                        })
2947                    }
2948                    0x1336fb5455b77a6e => {
2949                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2950                        let mut req = fidl::new_empty!(
2951                            WlanSoftmacBaseJoinBssRequest,
2952                            fidl::encoding::DefaultFuchsiaResourceDialect
2953                        );
2954                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseJoinBssRequest>(&header, _body_bytes, handles, &mut req)?;
2955                        let control_handle =
2956                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
2957                        Ok(WlanSoftmacBaseRequest::JoinBss {
2958                            join_request: req.join_request,
2959
2960                            responder: WlanSoftmacBaseJoinBssResponder {
2961                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2962                                tx_id: header.tx_id,
2963                            },
2964                        })
2965                    }
2966                    0x6c35807632c64576 => {
2967                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2968                        let mut req = fidl::new_empty!(
2969                            WlanSoftmacBaseEnableBeaconingRequest,
2970                            fidl::encoding::DefaultFuchsiaResourceDialect
2971                        );
2972                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseEnableBeaconingRequest>(&header, _body_bytes, handles, &mut req)?;
2973                        let control_handle =
2974                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
2975                        Ok(WlanSoftmacBaseRequest::EnableBeaconing {
2976                            payload: req,
2977                            responder: WlanSoftmacBaseEnableBeaconingResponder {
2978                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2979                                tx_id: header.tx_id,
2980                            },
2981                        })
2982                    }
2983                    0x3303b30f99dbb406 => {
2984                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2985                        let mut req = fidl::new_empty!(
2986                            fidl::encoding::EmptyPayload,
2987                            fidl::encoding::DefaultFuchsiaResourceDialect
2988                        );
2989                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2990                        let control_handle =
2991                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
2992                        Ok(WlanSoftmacBaseRequest::DisableBeaconing {
2993                            responder: WlanSoftmacBaseDisableBeaconingResponder {
2994                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2995                                tx_id: header.tx_id,
2996                            },
2997                        })
2998                    }
2999                    0x7decf9b4200b9131 => {
3000                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3001                        let mut req = fidl::new_empty!(
3002                            WlanKeyConfiguration,
3003                            fidl::encoding::DefaultFuchsiaResourceDialect
3004                        );
3005                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanKeyConfiguration>(&header, _body_bytes, handles, &mut req)?;
3006                        let control_handle =
3007                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3008                        Ok(WlanSoftmacBaseRequest::InstallKey {
3009                            payload: req,
3010                            responder: WlanSoftmacBaseInstallKeyResponder {
3011                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3012                                tx_id: header.tx_id,
3013                            },
3014                        })
3015                    }
3016                    0x436ffe3ba461d6cd => {
3017                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3018                        let mut req = fidl::new_empty!(
3019                            WlanSoftmacBaseNotifyAssociationCompleteRequest,
3020                            fidl::encoding::DefaultFuchsiaResourceDialect
3021                        );
3022                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
3023                        let control_handle =
3024                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3025                        Ok(WlanSoftmacBaseRequest::NotifyAssociationComplete {
3026                            assoc_cfg: req.assoc_cfg,
3027
3028                            responder: WlanSoftmacBaseNotifyAssociationCompleteResponder {
3029                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3030                                tx_id: header.tx_id,
3031                            },
3032                        })
3033                    }
3034                    0x581d76c39190a7dd => {
3035                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3036                        let mut req = fidl::new_empty!(
3037                            WlanSoftmacBaseClearAssociationRequest,
3038                            fidl::encoding::DefaultFuchsiaResourceDialect
3039                        );
3040                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseClearAssociationRequest>(&header, _body_bytes, handles, &mut req)?;
3041                        let control_handle =
3042                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3043                        Ok(WlanSoftmacBaseRequest::ClearAssociation {
3044                            payload: req,
3045                            responder: WlanSoftmacBaseClearAssociationResponder {
3046                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3047                                tx_id: header.tx_id,
3048                            },
3049                        })
3050                    }
3051                    0x5662f989cb4083bb => {
3052                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3053                        let mut req = fidl::new_empty!(
3054                            WlanSoftmacBaseStartPassiveScanRequest,
3055                            fidl::encoding::DefaultFuchsiaResourceDialect
3056                        );
3057                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseStartPassiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
3058                        let control_handle =
3059                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3060                        Ok(WlanSoftmacBaseRequest::StartPassiveScan {
3061                            payload: req,
3062                            responder: WlanSoftmacBaseStartPassiveScanResponder {
3063                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3064                                tx_id: header.tx_id,
3065                            },
3066                        })
3067                    }
3068                    0x4896eafa9937751e => {
3069                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3070                        let mut req = fidl::new_empty!(
3071                            WlanSoftmacStartActiveScanRequest,
3072                            fidl::encoding::DefaultFuchsiaResourceDialect
3073                        );
3074                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacStartActiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
3075                        let control_handle =
3076                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3077                        Ok(WlanSoftmacBaseRequest::StartActiveScan {
3078                            payload: req,
3079                            responder: WlanSoftmacBaseStartActiveScanResponder {
3080                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3081                                tx_id: header.tx_id,
3082                            },
3083                        })
3084                    }
3085                    0xf7d859369764556 => {
3086                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3087                        let mut req = fidl::new_empty!(
3088                            WlanSoftmacBaseCancelScanRequest,
3089                            fidl::encoding::DefaultFuchsiaResourceDialect
3090                        );
3091                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseCancelScanRequest>(&header, _body_bytes, handles, &mut req)?;
3092                        let control_handle =
3093                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3094                        Ok(WlanSoftmacBaseRequest::CancelScan {
3095                            payload: req,
3096                            responder: WlanSoftmacBaseCancelScanResponder {
3097                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3098                                tx_id: header.tx_id,
3099                            },
3100                        })
3101                    }
3102                    0x68522c7122d5f78c => {
3103                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3104                        let mut req = fidl::new_empty!(
3105                            WlanSoftmacBaseUpdateWmmParametersRequest,
3106                            fidl::encoding::DefaultFuchsiaResourceDialect
3107                        );
3108                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseUpdateWmmParametersRequest>(&header, _body_bytes, handles, &mut req)?;
3109                        let control_handle =
3110                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3111                        Ok(WlanSoftmacBaseRequest::UpdateWmmParameters {
3112                            payload: req,
3113                            responder: WlanSoftmacBaseUpdateWmmParametersResponder {
3114                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3115                                tx_id: header.tx_id,
3116                            },
3117                        })
3118                    }
3119                    _ if header.tx_id == 0
3120                        && header
3121                            .dynamic_flags()
3122                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3123                    {
3124                        Ok(WlanSoftmacBaseRequest::_UnknownMethod {
3125                            ordinal: header.ordinal,
3126                            control_handle: WlanSoftmacBaseControlHandle {
3127                                inner: this.inner.clone(),
3128                            },
3129                            method_type: fidl::MethodType::OneWay,
3130                        })
3131                    }
3132                    _ if header
3133                        .dynamic_flags()
3134                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3135                    {
3136                        this.inner.send_framework_err(
3137                            fidl::encoding::FrameworkErr::UnknownMethod,
3138                            header.tx_id,
3139                            header.ordinal,
3140                            header.dynamic_flags(),
3141                            (bytes, handles),
3142                        )?;
3143                        Ok(WlanSoftmacBaseRequest::_UnknownMethod {
3144                            ordinal: header.ordinal,
3145                            control_handle: WlanSoftmacBaseControlHandle {
3146                                inner: this.inner.clone(),
3147                            },
3148                            method_type: fidl::MethodType::TwoWay,
3149                        })
3150                    }
3151                    _ => Err(fidl::Error::UnknownOrdinal {
3152                        ordinal: header.ordinal,
3153                        protocol_name:
3154                            <WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3155                    }),
3156                }))
3157            },
3158        )
3159    }
3160}
3161
3162/// `WlanSoftmacBase` is a template protocol intended to be composed into
3163/// `WlanSoftmacBridge` and `WlanSoftmac`. `WlanSoftmacBase` contains all method
3164/// that both `WlanSoftmacBridge` and `WlanSoftmac` have in common.
3165/// `WlanSoftmacBase` should not be implemented directly.
3166///
3167/// NOTE: All methods use a `selector` attribute to maintain their ordinal
3168///       following migration from `WlanSoftmac` into this protocol. This is necessary
3169///       to preserve API compatibility.
3170#[derive(Debug)]
3171pub enum WlanSoftmacBaseRequest {
3172    /// Gets general information about the device and its supported features.
3173    /// This method is safe to call even when the SoftMAC has not yet started.
3174    ///
3175    /// Note: The implementation of this method must not depend on a response
3176    /// from an ethernet driver, otherwise there is a risk of deadlock.
3177    /// The wlansoftmac driver calls this method synchronously while
3178    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
3179    Query { responder: WlanSoftmacBaseQueryResponder },
3180    /// Gets information about the station discovery (e.g., scanning and
3181    /// probing) features supported by the device. This method is safe to call
3182    /// even when the SoftMAC has not yet started.
3183    QueryDiscoverySupport { responder: WlanSoftmacBaseQueryDiscoverySupportResponder },
3184    /// Gets information about the MAC features supported by the device. This
3185    /// method is safe to call even when the SoftMAC has not yet started.
3186    ///
3187    /// Note: The implementation of this method must not depend on a response
3188    /// from an ethernet driver, otherwise there is a risk of deadlock.
3189    /// The wlansoftmac driver calls this method synchronously while
3190    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
3191    QueryMacSublayerSupport { responder: WlanSoftmacBaseQueryMacSublayerSupportResponder },
3192    /// Gets information about the security features supported by the device.
3193    /// This method is safe to call even when the SoftMAC has not yet started.
3194    QuerySecuritySupport { responder: WlanSoftmacBaseQuerySecuritySupportResponder },
3195    /// Gets information about the spectrum usage (e.g., DFS) features supported
3196    /// by the device. This method is safe to call even when the SoftMAC has not
3197    /// yet started.
3198    QuerySpectrumManagementSupport {
3199        responder: WlanSoftmacBaseQuerySpectrumManagementSupportResponder,
3200    },
3201    /// Set the primary radio channel, e.g. in response to a channel switch event.
3202    /// If successful, this will trigger the channel switch immediately. This may
3203    /// impact the transmission of any frames that are in-flight, and might also
3204    /// interfere with an ongoing scan request.
3205    ///
3206    /// Common errors include: \
3207    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
3208    SetChannel {
3209        payload: WlanSoftmacBaseSetChannelRequest,
3210        responder: WlanSoftmacBaseSetChannelResponder,
3211    },
3212    /// Join a specific BSS in which we will participate.
3213    /// This applies regardless of if we are hosting the BSS or joining it
3214    /// (indicated by the `remote` flag in `JoinBssRequest`).
3215    /// If successful, the device will switch to the correct channel and perform
3216    /// any internal filtering/timing operations required to join the BSS.
3217    /// For client STAs, this is the first step before authenticating.
3218    ///
3219    /// Common errors include: \
3220    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
3221    JoinBss {
3222        join_request: fidl_fuchsia_wlan_common::JoinBssRequest,
3223        responder: WlanSoftmacBaseJoinBssResponder,
3224    },
3225    /// Enables hardware Beaconing.
3226    ///
3227    /// This method cannot be called while beaconing is enabled and so
3228    /// `DisableBeaconing` must be called prior to this method if beaconing is
3229    /// enabled.
3230    ///
3231    /// All request fields are required.
3232    ///
3233    /// Common errors include:
3234    ///
3235    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
3236    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
3237    ///                          beacon.
3238    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
3239    EnableBeaconing {
3240        payload: WlanSoftmacBaseEnableBeaconingRequest,
3241        responder: WlanSoftmacBaseEnableBeaconingResponder,
3242    },
3243    /// Disables hardware beaconing.
3244    DisableBeaconing { responder: WlanSoftmacBaseDisableBeaconingResponder },
3245    /// Install a key for encryption when transmitting or receiving protected
3246    /// frames.
3247    ///
3248    /// Common errors include:
3249    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
3250    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
3251    InstallKey { payload: WlanKeyConfiguration, responder: WlanSoftmacBaseInstallKeyResponder },
3252    /// Notifies the device of a successful association and configures
3253    /// additional parameters necessary to participate in that association.
3254    ///
3255    /// # Errors
3256    ///
3257    /// Common errors include:
3258    ///
3259    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
3260    ///                       via `WlanSoftmac.JoinBss`.
3261    NotifyAssociationComplete {
3262        assoc_cfg: WlanAssociationConfig,
3263        responder: WlanSoftmacBaseNotifyAssociationCompleteResponder,
3264    },
3265    /// Notifies MAC and PHY that the peer has been de-associated.
3266    ClearAssociation {
3267        payload: WlanSoftmacBaseClearAssociationRequest,
3268        responder: WlanSoftmacBaseClearAssociationResponder,
3269    },
3270    /// Starts a passive scan. The server will deliver scan results
3271    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
3272    /// the server will call WlanSoftmacIfc.ScanComplete() with the
3273    /// same `scan_id` returned by StartPassiveScan().
3274    ///
3275    /// The server indicates support for `StartPassiveScan()` using
3276    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
3277    ///
3278    /// Common errors include:
3279    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
3280    ///       requested scan, e.g. because an incompatible channel was requested.
3281    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
3282    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
3283    StartPassiveScan {
3284        payload: WlanSoftmacBaseStartPassiveScanRequest,
3285        responder: WlanSoftmacBaseStartPassiveScanResponder,
3286    },
3287    /// Starts an active scan. The server will deliver scan results
3288    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
3289    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
3290    /// with the same `scan_id` returned by StartActiveScan().
3291    ///
3292    /// A device driver indicates support for `StartActiveScan()` using
3293    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
3294    ///
3295    /// Common errors include:
3296    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
3297    ///       requested scan, e.g. because an incompatible channel was requested.
3298    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
3299    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
3300    StartActiveScan {
3301        payload: WlanSoftmacStartActiveScanRequest,
3302        responder: WlanSoftmacBaseStartActiveScanResponder,
3303    },
3304    /// Cancels the ongoing scan corresponding to `scan_id`,
3305    /// where `scan_id` is an identifier returned by
3306    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
3307    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
3308    /// `scan_id`.
3309    ///
3310    /// A device driver indicates support for `CancelScan()` using
3311    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
3312    ///
3313    /// Common errors include:
3314    ///
3315    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
3316    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
3317    CancelScan {
3318        payload: WlanSoftmacBaseCancelScanRequest,
3319        responder: WlanSoftmacBaseCancelScanResponder,
3320    },
3321    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
3322    /// particular access category (AC).
3323    UpdateWmmParameters {
3324        payload: WlanSoftmacBaseUpdateWmmParametersRequest,
3325        responder: WlanSoftmacBaseUpdateWmmParametersResponder,
3326    },
3327    /// An interaction was received which does not match any known method.
3328    #[non_exhaustive]
3329    _UnknownMethod {
3330        /// Ordinal of the method that was called.
3331        ordinal: u64,
3332        control_handle: WlanSoftmacBaseControlHandle,
3333        method_type: fidl::MethodType,
3334    },
3335}
3336
3337impl WlanSoftmacBaseRequest {
3338    #[allow(irrefutable_let_patterns)]
3339    pub fn into_query(self) -> Option<(WlanSoftmacBaseQueryResponder)> {
3340        if let WlanSoftmacBaseRequest::Query { responder } = self {
3341            Some((responder))
3342        } else {
3343            None
3344        }
3345    }
3346
3347    #[allow(irrefutable_let_patterns)]
3348    pub fn into_query_discovery_support(
3349        self,
3350    ) -> Option<(WlanSoftmacBaseQueryDiscoverySupportResponder)> {
3351        if let WlanSoftmacBaseRequest::QueryDiscoverySupport { responder } = self {
3352            Some((responder))
3353        } else {
3354            None
3355        }
3356    }
3357
3358    #[allow(irrefutable_let_patterns)]
3359    pub fn into_query_mac_sublayer_support(
3360        self,
3361    ) -> Option<(WlanSoftmacBaseQueryMacSublayerSupportResponder)> {
3362        if let WlanSoftmacBaseRequest::QueryMacSublayerSupport { responder } = self {
3363            Some((responder))
3364        } else {
3365            None
3366        }
3367    }
3368
3369    #[allow(irrefutable_let_patterns)]
3370    pub fn into_query_security_support(
3371        self,
3372    ) -> Option<(WlanSoftmacBaseQuerySecuritySupportResponder)> {
3373        if let WlanSoftmacBaseRequest::QuerySecuritySupport { responder } = self {
3374            Some((responder))
3375        } else {
3376            None
3377        }
3378    }
3379
3380    #[allow(irrefutable_let_patterns)]
3381    pub fn into_query_spectrum_management_support(
3382        self,
3383    ) -> Option<(WlanSoftmacBaseQuerySpectrumManagementSupportResponder)> {
3384        if let WlanSoftmacBaseRequest::QuerySpectrumManagementSupport { responder } = self {
3385            Some((responder))
3386        } else {
3387            None
3388        }
3389    }
3390
3391    #[allow(irrefutable_let_patterns)]
3392    pub fn into_set_channel(
3393        self,
3394    ) -> Option<(WlanSoftmacBaseSetChannelRequest, WlanSoftmacBaseSetChannelResponder)> {
3395        if let WlanSoftmacBaseRequest::SetChannel { payload, responder } = self {
3396            Some((payload, responder))
3397        } else {
3398            None
3399        }
3400    }
3401
3402    #[allow(irrefutable_let_patterns)]
3403    pub fn into_join_bss(
3404        self,
3405    ) -> Option<(fidl_fuchsia_wlan_common::JoinBssRequest, WlanSoftmacBaseJoinBssResponder)> {
3406        if let WlanSoftmacBaseRequest::JoinBss { join_request, responder } = self {
3407            Some((join_request, responder))
3408        } else {
3409            None
3410        }
3411    }
3412
3413    #[allow(irrefutable_let_patterns)]
3414    pub fn into_enable_beaconing(
3415        self,
3416    ) -> Option<(WlanSoftmacBaseEnableBeaconingRequest, WlanSoftmacBaseEnableBeaconingResponder)>
3417    {
3418        if let WlanSoftmacBaseRequest::EnableBeaconing { payload, responder } = self {
3419            Some((payload, responder))
3420        } else {
3421            None
3422        }
3423    }
3424
3425    #[allow(irrefutable_let_patterns)]
3426    pub fn into_disable_beaconing(self) -> Option<(WlanSoftmacBaseDisableBeaconingResponder)> {
3427        if let WlanSoftmacBaseRequest::DisableBeaconing { responder } = self {
3428            Some((responder))
3429        } else {
3430            None
3431        }
3432    }
3433
3434    #[allow(irrefutable_let_patterns)]
3435    pub fn into_install_key(
3436        self,
3437    ) -> Option<(WlanKeyConfiguration, WlanSoftmacBaseInstallKeyResponder)> {
3438        if let WlanSoftmacBaseRequest::InstallKey { payload, responder } = self {
3439            Some((payload, responder))
3440        } else {
3441            None
3442        }
3443    }
3444
3445    #[allow(irrefutable_let_patterns)]
3446    pub fn into_notify_association_complete(
3447        self,
3448    ) -> Option<(WlanAssociationConfig, WlanSoftmacBaseNotifyAssociationCompleteResponder)> {
3449        if let WlanSoftmacBaseRequest::NotifyAssociationComplete { assoc_cfg, responder } = self {
3450            Some((assoc_cfg, responder))
3451        } else {
3452            None
3453        }
3454    }
3455
3456    #[allow(irrefutable_let_patterns)]
3457    pub fn into_clear_association(
3458        self,
3459    ) -> Option<(WlanSoftmacBaseClearAssociationRequest, WlanSoftmacBaseClearAssociationResponder)>
3460    {
3461        if let WlanSoftmacBaseRequest::ClearAssociation { payload, responder } = self {
3462            Some((payload, responder))
3463        } else {
3464            None
3465        }
3466    }
3467
3468    #[allow(irrefutable_let_patterns)]
3469    pub fn into_start_passive_scan(
3470        self,
3471    ) -> Option<(WlanSoftmacBaseStartPassiveScanRequest, WlanSoftmacBaseStartPassiveScanResponder)>
3472    {
3473        if let WlanSoftmacBaseRequest::StartPassiveScan { payload, responder } = self {
3474            Some((payload, responder))
3475        } else {
3476            None
3477        }
3478    }
3479
3480    #[allow(irrefutable_let_patterns)]
3481    pub fn into_start_active_scan(
3482        self,
3483    ) -> Option<(WlanSoftmacStartActiveScanRequest, WlanSoftmacBaseStartActiveScanResponder)> {
3484        if let WlanSoftmacBaseRequest::StartActiveScan { payload, responder } = self {
3485            Some((payload, responder))
3486        } else {
3487            None
3488        }
3489    }
3490
3491    #[allow(irrefutable_let_patterns)]
3492    pub fn into_cancel_scan(
3493        self,
3494    ) -> Option<(WlanSoftmacBaseCancelScanRequest, WlanSoftmacBaseCancelScanResponder)> {
3495        if let WlanSoftmacBaseRequest::CancelScan { payload, responder } = self {
3496            Some((payload, responder))
3497        } else {
3498            None
3499        }
3500    }
3501
3502    #[allow(irrefutable_let_patterns)]
3503    pub fn into_update_wmm_parameters(
3504        self,
3505    ) -> Option<(
3506        WlanSoftmacBaseUpdateWmmParametersRequest,
3507        WlanSoftmacBaseUpdateWmmParametersResponder,
3508    )> {
3509        if let WlanSoftmacBaseRequest::UpdateWmmParameters { payload, responder } = self {
3510            Some((payload, responder))
3511        } else {
3512            None
3513        }
3514    }
3515
3516    /// Name of the method defined in FIDL
3517    pub fn method_name(&self) -> &'static str {
3518        match *self {
3519            WlanSoftmacBaseRequest::Query { .. } => "query",
3520            WlanSoftmacBaseRequest::QueryDiscoverySupport { .. } => "query_discovery_support",
3521            WlanSoftmacBaseRequest::QueryMacSublayerSupport { .. } => "query_mac_sublayer_support",
3522            WlanSoftmacBaseRequest::QuerySecuritySupport { .. } => "query_security_support",
3523            WlanSoftmacBaseRequest::QuerySpectrumManagementSupport { .. } => {
3524                "query_spectrum_management_support"
3525            }
3526            WlanSoftmacBaseRequest::SetChannel { .. } => "set_channel",
3527            WlanSoftmacBaseRequest::JoinBss { .. } => "join_bss",
3528            WlanSoftmacBaseRequest::EnableBeaconing { .. } => "enable_beaconing",
3529            WlanSoftmacBaseRequest::DisableBeaconing { .. } => "disable_beaconing",
3530            WlanSoftmacBaseRequest::InstallKey { .. } => "install_key",
3531            WlanSoftmacBaseRequest::NotifyAssociationComplete { .. } => {
3532                "notify_association_complete"
3533            }
3534            WlanSoftmacBaseRequest::ClearAssociation { .. } => "clear_association",
3535            WlanSoftmacBaseRequest::StartPassiveScan { .. } => "start_passive_scan",
3536            WlanSoftmacBaseRequest::StartActiveScan { .. } => "start_active_scan",
3537            WlanSoftmacBaseRequest::CancelScan { .. } => "cancel_scan",
3538            WlanSoftmacBaseRequest::UpdateWmmParameters { .. } => "update_wmm_parameters",
3539            WlanSoftmacBaseRequest::_UnknownMethod {
3540                method_type: fidl::MethodType::OneWay,
3541                ..
3542            } => "unknown one-way method",
3543            WlanSoftmacBaseRequest::_UnknownMethod {
3544                method_type: fidl::MethodType::TwoWay,
3545                ..
3546            } => "unknown two-way method",
3547        }
3548    }
3549}
3550
3551#[derive(Debug, Clone)]
3552pub struct WlanSoftmacBaseControlHandle {
3553    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3554}
3555
3556impl fidl::endpoints::ControlHandle for WlanSoftmacBaseControlHandle {
3557    fn shutdown(&self) {
3558        self.inner.shutdown()
3559    }
3560
3561    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3562        self.inner.shutdown_with_epitaph(status)
3563    }
3564
3565    fn is_closed(&self) -> bool {
3566        self.inner.channel().is_closed()
3567    }
3568    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3569        self.inner.channel().on_closed()
3570    }
3571
3572    #[cfg(target_os = "fuchsia")]
3573    fn signal_peer(
3574        &self,
3575        clear_mask: zx::Signals,
3576        set_mask: zx::Signals,
3577    ) -> Result<(), zx_status::Status> {
3578        use fidl::Peered;
3579        self.inner.channel().signal_peer(clear_mask, set_mask)
3580    }
3581}
3582
3583impl WlanSoftmacBaseControlHandle {}
3584
3585#[must_use = "FIDL methods require a response to be sent"]
3586#[derive(Debug)]
3587pub struct WlanSoftmacBaseQueryResponder {
3588    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
3589    tx_id: u32,
3590}
3591
3592/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
3593/// if the responder is dropped without sending a response, so that the client
3594/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3595impl std::ops::Drop for WlanSoftmacBaseQueryResponder {
3596    fn drop(&mut self) {
3597        self.control_handle.shutdown();
3598        // Safety: drops once, never accessed again
3599        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3600    }
3601}
3602
3603impl fidl::endpoints::Responder for WlanSoftmacBaseQueryResponder {
3604    type ControlHandle = WlanSoftmacBaseControlHandle;
3605
3606    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
3607        &self.control_handle
3608    }
3609
3610    fn drop_without_shutdown(mut self) {
3611        // Safety: drops once, never accessed again due to mem::forget
3612        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3613        // Prevent Drop from running (which would shut down the channel)
3614        std::mem::forget(self);
3615    }
3616}
3617
3618impl WlanSoftmacBaseQueryResponder {
3619    /// Sends a response to the FIDL transaction.
3620    ///
3621    /// Sets the channel to shutdown if an error occurs.
3622    pub fn send(
3623        self,
3624        mut result: Result<&WlanSoftmacQueryResponse, i32>,
3625    ) -> Result<(), fidl::Error> {
3626        let _result = self.send_raw(result);
3627        if _result.is_err() {
3628            self.control_handle.shutdown();
3629        }
3630        self.drop_without_shutdown();
3631        _result
3632    }
3633
3634    /// Similar to "send" but does not shutdown the channel if an error occurs.
3635    pub fn send_no_shutdown_on_err(
3636        self,
3637        mut result: Result<&WlanSoftmacQueryResponse, i32>,
3638    ) -> Result<(), fidl::Error> {
3639        let _result = self.send_raw(result);
3640        self.drop_without_shutdown();
3641        _result
3642    }
3643
3644    fn send_raw(
3645        &self,
3646        mut result: Result<&WlanSoftmacQueryResponse, i32>,
3647    ) -> Result<(), fidl::Error> {
3648        self.control_handle.inner.send::<fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>>(
3649            result,
3650            self.tx_id,
3651            0x18231a638e508f9d,
3652            fidl::encoding::DynamicFlags::empty(),
3653        )
3654    }
3655}
3656
3657#[must_use = "FIDL methods require a response to be sent"]
3658#[derive(Debug)]
3659pub struct WlanSoftmacBaseQueryDiscoverySupportResponder {
3660    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
3661    tx_id: u32,
3662}
3663
3664/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
3665/// if the responder is dropped without sending a response, so that the client
3666/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3667impl std::ops::Drop for WlanSoftmacBaseQueryDiscoverySupportResponder {
3668    fn drop(&mut self) {
3669        self.control_handle.shutdown();
3670        // Safety: drops once, never accessed again
3671        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3672    }
3673}
3674
3675impl fidl::endpoints::Responder for WlanSoftmacBaseQueryDiscoverySupportResponder {
3676    type ControlHandle = WlanSoftmacBaseControlHandle;
3677
3678    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
3679        &self.control_handle
3680    }
3681
3682    fn drop_without_shutdown(mut self) {
3683        // Safety: drops once, never accessed again due to mem::forget
3684        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3685        // Prevent Drop from running (which would shut down the channel)
3686        std::mem::forget(self);
3687    }
3688}
3689
3690impl WlanSoftmacBaseQueryDiscoverySupportResponder {
3691    /// Sends a response to the FIDL transaction.
3692    ///
3693    /// Sets the channel to shutdown if an error occurs.
3694    pub fn send(self, mut result: Result<&DiscoverySupport, i32>) -> Result<(), fidl::Error> {
3695        let _result = self.send_raw(result);
3696        if _result.is_err() {
3697            self.control_handle.shutdown();
3698        }
3699        self.drop_without_shutdown();
3700        _result
3701    }
3702
3703    /// Similar to "send" but does not shutdown the channel if an error occurs.
3704    pub fn send_no_shutdown_on_err(
3705        self,
3706        mut result: Result<&DiscoverySupport, i32>,
3707    ) -> Result<(), fidl::Error> {
3708        let _result = self.send_raw(result);
3709        self.drop_without_shutdown();
3710        _result
3711    }
3712
3713    fn send_raw(&self, mut result: Result<&DiscoverySupport, i32>) -> Result<(), fidl::Error> {
3714        self.control_handle.inner.send::<fidl::encoding::ResultType<
3715            WlanSoftmacBaseQueryDiscoverySupportResponse,
3716            i32,
3717        >>(
3718            result.map(|resp| (resp,)),
3719            self.tx_id,
3720            0x16797affc0cb58ae,
3721            fidl::encoding::DynamicFlags::empty(),
3722        )
3723    }
3724}
3725
3726#[must_use = "FIDL methods require a response to be sent"]
3727#[derive(Debug)]
3728pub struct WlanSoftmacBaseQueryMacSublayerSupportResponder {
3729    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
3730    tx_id: u32,
3731}
3732
3733/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
3734/// if the responder is dropped without sending a response, so that the client
3735/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3736impl std::ops::Drop for WlanSoftmacBaseQueryMacSublayerSupportResponder {
3737    fn drop(&mut self) {
3738        self.control_handle.shutdown();
3739        // Safety: drops once, never accessed again
3740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3741    }
3742}
3743
3744impl fidl::endpoints::Responder for WlanSoftmacBaseQueryMacSublayerSupportResponder {
3745    type ControlHandle = WlanSoftmacBaseControlHandle;
3746
3747    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
3748        &self.control_handle
3749    }
3750
3751    fn drop_without_shutdown(mut self) {
3752        // Safety: drops once, never accessed again due to mem::forget
3753        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3754        // Prevent Drop from running (which would shut down the channel)
3755        std::mem::forget(self);
3756    }
3757}
3758
3759impl WlanSoftmacBaseQueryMacSublayerSupportResponder {
3760    /// Sends a response to the FIDL transaction.
3761    ///
3762    /// Sets the channel to shutdown if an error occurs.
3763    pub fn send(
3764        self,
3765        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
3766    ) -> Result<(), fidl::Error> {
3767        let _result = self.send_raw(result);
3768        if _result.is_err() {
3769            self.control_handle.shutdown();
3770        }
3771        self.drop_without_shutdown();
3772        _result
3773    }
3774
3775    /// Similar to "send" but does not shutdown the channel if an error occurs.
3776    pub fn send_no_shutdown_on_err(
3777        self,
3778        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
3779    ) -> Result<(), fidl::Error> {
3780        let _result = self.send_raw(result);
3781        self.drop_without_shutdown();
3782        _result
3783    }
3784
3785    fn send_raw(
3786        &self,
3787        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
3788    ) -> Result<(), fidl::Error> {
3789        self.control_handle.inner.send::<fidl::encoding::ResultType<
3790            WlanSoftmacBaseQueryMacSublayerSupportResponse,
3791            i32,
3792        >>(
3793            result.map(|resp| (resp,)),
3794            self.tx_id,
3795            0x7302c3f8c131f075,
3796            fidl::encoding::DynamicFlags::empty(),
3797        )
3798    }
3799}
3800
3801#[must_use = "FIDL methods require a response to be sent"]
3802#[derive(Debug)]
3803pub struct WlanSoftmacBaseQuerySecuritySupportResponder {
3804    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
3805    tx_id: u32,
3806}
3807
3808/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
3809/// if the responder is dropped without sending a response, so that the client
3810/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3811impl std::ops::Drop for WlanSoftmacBaseQuerySecuritySupportResponder {
3812    fn drop(&mut self) {
3813        self.control_handle.shutdown();
3814        // Safety: drops once, never accessed again
3815        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3816    }
3817}
3818
3819impl fidl::endpoints::Responder for WlanSoftmacBaseQuerySecuritySupportResponder {
3820    type ControlHandle = WlanSoftmacBaseControlHandle;
3821
3822    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
3823        &self.control_handle
3824    }
3825
3826    fn drop_without_shutdown(mut self) {
3827        // Safety: drops once, never accessed again due to mem::forget
3828        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3829        // Prevent Drop from running (which would shut down the channel)
3830        std::mem::forget(self);
3831    }
3832}
3833
3834impl WlanSoftmacBaseQuerySecuritySupportResponder {
3835    /// Sends a response to the FIDL transaction.
3836    ///
3837    /// Sets the channel to shutdown if an error occurs.
3838    pub fn send(
3839        self,
3840        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
3841    ) -> Result<(), fidl::Error> {
3842        let _result = self.send_raw(result);
3843        if _result.is_err() {
3844            self.control_handle.shutdown();
3845        }
3846        self.drop_without_shutdown();
3847        _result
3848    }
3849
3850    /// Similar to "send" but does not shutdown the channel if an error occurs.
3851    pub fn send_no_shutdown_on_err(
3852        self,
3853        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
3854    ) -> Result<(), fidl::Error> {
3855        let _result = self.send_raw(result);
3856        self.drop_without_shutdown();
3857        _result
3858    }
3859
3860    fn send_raw(
3861        &self,
3862        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
3863    ) -> Result<(), fidl::Error> {
3864        self.control_handle.inner.send::<fidl::encoding::ResultType<
3865            WlanSoftmacBaseQuerySecuritySupportResponse,
3866            i32,
3867        >>(
3868            result.map(|resp| (resp,)),
3869            self.tx_id,
3870            0x3691bb75abf6354,
3871            fidl::encoding::DynamicFlags::empty(),
3872        )
3873    }
3874}
3875
3876#[must_use = "FIDL methods require a response to be sent"]
3877#[derive(Debug)]
3878pub struct WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
3879    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
3880    tx_id: u32,
3881}
3882
3883/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
3884/// if the responder is dropped without sending a response, so that the client
3885/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3886impl std::ops::Drop for WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
3887    fn drop(&mut self) {
3888        self.control_handle.shutdown();
3889        // Safety: drops once, never accessed again
3890        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3891    }
3892}
3893
3894impl fidl::endpoints::Responder for WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
3895    type ControlHandle = WlanSoftmacBaseControlHandle;
3896
3897    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
3898        &self.control_handle
3899    }
3900
3901    fn drop_without_shutdown(mut self) {
3902        // Safety: drops once, never accessed again due to mem::forget
3903        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3904        // Prevent Drop from running (which would shut down the channel)
3905        std::mem::forget(self);
3906    }
3907}
3908
3909impl WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
3910    /// Sends a response to the FIDL transaction.
3911    ///
3912    /// Sets the channel to shutdown if an error occurs.
3913    pub fn send(
3914        self,
3915        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
3916    ) -> Result<(), fidl::Error> {
3917        let _result = self.send_raw(result);
3918        if _result.is_err() {
3919            self.control_handle.shutdown();
3920        }
3921        self.drop_without_shutdown();
3922        _result
3923    }
3924
3925    /// Similar to "send" but does not shutdown the channel if an error occurs.
3926    pub fn send_no_shutdown_on_err(
3927        self,
3928        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
3929    ) -> Result<(), fidl::Error> {
3930        let _result = self.send_raw(result);
3931        self.drop_without_shutdown();
3932        _result
3933    }
3934
3935    fn send_raw(
3936        &self,
3937        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
3938    ) -> Result<(), fidl::Error> {
3939        self.control_handle.inner.send::<fidl::encoding::ResultType<
3940            WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
3941            i32,
3942        >>(
3943            result.map(|resp| (resp,)),
3944            self.tx_id,
3945            0x347d78dc1d4d27bf,
3946            fidl::encoding::DynamicFlags::empty(),
3947        )
3948    }
3949}
3950
3951#[must_use = "FIDL methods require a response to be sent"]
3952#[derive(Debug)]
3953pub struct WlanSoftmacBaseSetChannelResponder {
3954    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
3955    tx_id: u32,
3956}
3957
3958/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
3959/// if the responder is dropped without sending a response, so that the client
3960/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3961impl std::ops::Drop for WlanSoftmacBaseSetChannelResponder {
3962    fn drop(&mut self) {
3963        self.control_handle.shutdown();
3964        // Safety: drops once, never accessed again
3965        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3966    }
3967}
3968
3969impl fidl::endpoints::Responder for WlanSoftmacBaseSetChannelResponder {
3970    type ControlHandle = WlanSoftmacBaseControlHandle;
3971
3972    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
3973        &self.control_handle
3974    }
3975
3976    fn drop_without_shutdown(mut self) {
3977        // Safety: drops once, never accessed again due to mem::forget
3978        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3979        // Prevent Drop from running (which would shut down the channel)
3980        std::mem::forget(self);
3981    }
3982}
3983
3984impl WlanSoftmacBaseSetChannelResponder {
3985    /// Sends a response to the FIDL transaction.
3986    ///
3987    /// Sets the channel to shutdown if an error occurs.
3988    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3989        let _result = self.send_raw(result);
3990        if _result.is_err() {
3991            self.control_handle.shutdown();
3992        }
3993        self.drop_without_shutdown();
3994        _result
3995    }
3996
3997    /// Similar to "send" but does not shutdown the channel if an error occurs.
3998    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3999        let _result = self.send_raw(result);
4000        self.drop_without_shutdown();
4001        _result
4002    }
4003
4004    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4005        self.control_handle
4006            .inner
4007            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4008                result,
4009                self.tx_id,
4010                0x12836b533cd63ece,
4011                fidl::encoding::DynamicFlags::empty(),
4012            )
4013    }
4014}
4015
4016#[must_use = "FIDL methods require a response to be sent"]
4017#[derive(Debug)]
4018pub struct WlanSoftmacBaseJoinBssResponder {
4019    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4020    tx_id: u32,
4021}
4022
4023/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4024/// if the responder is dropped without sending a response, so that the client
4025/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4026impl std::ops::Drop for WlanSoftmacBaseJoinBssResponder {
4027    fn drop(&mut self) {
4028        self.control_handle.shutdown();
4029        // Safety: drops once, never accessed again
4030        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4031    }
4032}
4033
4034impl fidl::endpoints::Responder for WlanSoftmacBaseJoinBssResponder {
4035    type ControlHandle = WlanSoftmacBaseControlHandle;
4036
4037    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4038        &self.control_handle
4039    }
4040
4041    fn drop_without_shutdown(mut self) {
4042        // Safety: drops once, never accessed again due to mem::forget
4043        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4044        // Prevent Drop from running (which would shut down the channel)
4045        std::mem::forget(self);
4046    }
4047}
4048
4049impl WlanSoftmacBaseJoinBssResponder {
4050    /// Sends a response to the FIDL transaction.
4051    ///
4052    /// Sets the channel to shutdown if an error occurs.
4053    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4054        let _result = self.send_raw(result);
4055        if _result.is_err() {
4056            self.control_handle.shutdown();
4057        }
4058        self.drop_without_shutdown();
4059        _result
4060    }
4061
4062    /// Similar to "send" but does not shutdown the channel if an error occurs.
4063    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4064        let _result = self.send_raw(result);
4065        self.drop_without_shutdown();
4066        _result
4067    }
4068
4069    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4070        self.control_handle
4071            .inner
4072            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4073                result,
4074                self.tx_id,
4075                0x1336fb5455b77a6e,
4076                fidl::encoding::DynamicFlags::empty(),
4077            )
4078    }
4079}
4080
4081#[must_use = "FIDL methods require a response to be sent"]
4082#[derive(Debug)]
4083pub struct WlanSoftmacBaseEnableBeaconingResponder {
4084    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4085    tx_id: u32,
4086}
4087
4088/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4089/// if the responder is dropped without sending a response, so that the client
4090/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4091impl std::ops::Drop for WlanSoftmacBaseEnableBeaconingResponder {
4092    fn drop(&mut self) {
4093        self.control_handle.shutdown();
4094        // Safety: drops once, never accessed again
4095        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4096    }
4097}
4098
4099impl fidl::endpoints::Responder for WlanSoftmacBaseEnableBeaconingResponder {
4100    type ControlHandle = WlanSoftmacBaseControlHandle;
4101
4102    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4103        &self.control_handle
4104    }
4105
4106    fn drop_without_shutdown(mut self) {
4107        // Safety: drops once, never accessed again due to mem::forget
4108        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4109        // Prevent Drop from running (which would shut down the channel)
4110        std::mem::forget(self);
4111    }
4112}
4113
4114impl WlanSoftmacBaseEnableBeaconingResponder {
4115    /// Sends a response to the FIDL transaction.
4116    ///
4117    /// Sets the channel to shutdown if an error occurs.
4118    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4119        let _result = self.send_raw(result);
4120        if _result.is_err() {
4121            self.control_handle.shutdown();
4122        }
4123        self.drop_without_shutdown();
4124        _result
4125    }
4126
4127    /// Similar to "send" but does not shutdown the channel if an error occurs.
4128    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4129        let _result = self.send_raw(result);
4130        self.drop_without_shutdown();
4131        _result
4132    }
4133
4134    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4135        self.control_handle
4136            .inner
4137            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4138                result,
4139                self.tx_id,
4140                0x6c35807632c64576,
4141                fidl::encoding::DynamicFlags::empty(),
4142            )
4143    }
4144}
4145
4146#[must_use = "FIDL methods require a response to be sent"]
4147#[derive(Debug)]
4148pub struct WlanSoftmacBaseDisableBeaconingResponder {
4149    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4150    tx_id: u32,
4151}
4152
4153/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4154/// if the responder is dropped without sending a response, so that the client
4155/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4156impl std::ops::Drop for WlanSoftmacBaseDisableBeaconingResponder {
4157    fn drop(&mut self) {
4158        self.control_handle.shutdown();
4159        // Safety: drops once, never accessed again
4160        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4161    }
4162}
4163
4164impl fidl::endpoints::Responder for WlanSoftmacBaseDisableBeaconingResponder {
4165    type ControlHandle = WlanSoftmacBaseControlHandle;
4166
4167    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4168        &self.control_handle
4169    }
4170
4171    fn drop_without_shutdown(mut self) {
4172        // Safety: drops once, never accessed again due to mem::forget
4173        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4174        // Prevent Drop from running (which would shut down the channel)
4175        std::mem::forget(self);
4176    }
4177}
4178
4179impl WlanSoftmacBaseDisableBeaconingResponder {
4180    /// Sends a response to the FIDL transaction.
4181    ///
4182    /// Sets the channel to shutdown if an error occurs.
4183    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4184        let _result = self.send_raw(result);
4185        if _result.is_err() {
4186            self.control_handle.shutdown();
4187        }
4188        self.drop_without_shutdown();
4189        _result
4190    }
4191
4192    /// Similar to "send" but does not shutdown the channel if an error occurs.
4193    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4194        let _result = self.send_raw(result);
4195        self.drop_without_shutdown();
4196        _result
4197    }
4198
4199    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4200        self.control_handle
4201            .inner
4202            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4203                result,
4204                self.tx_id,
4205                0x3303b30f99dbb406,
4206                fidl::encoding::DynamicFlags::empty(),
4207            )
4208    }
4209}
4210
4211#[must_use = "FIDL methods require a response to be sent"]
4212#[derive(Debug)]
4213pub struct WlanSoftmacBaseInstallKeyResponder {
4214    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4215    tx_id: u32,
4216}
4217
4218/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4219/// if the responder is dropped without sending a response, so that the client
4220/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4221impl std::ops::Drop for WlanSoftmacBaseInstallKeyResponder {
4222    fn drop(&mut self) {
4223        self.control_handle.shutdown();
4224        // Safety: drops once, never accessed again
4225        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4226    }
4227}
4228
4229impl fidl::endpoints::Responder for WlanSoftmacBaseInstallKeyResponder {
4230    type ControlHandle = WlanSoftmacBaseControlHandle;
4231
4232    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4233        &self.control_handle
4234    }
4235
4236    fn drop_without_shutdown(mut self) {
4237        // Safety: drops once, never accessed again due to mem::forget
4238        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4239        // Prevent Drop from running (which would shut down the channel)
4240        std::mem::forget(self);
4241    }
4242}
4243
4244impl WlanSoftmacBaseInstallKeyResponder {
4245    /// Sends a response to the FIDL transaction.
4246    ///
4247    /// Sets the channel to shutdown if an error occurs.
4248    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4249        let _result = self.send_raw(result);
4250        if _result.is_err() {
4251            self.control_handle.shutdown();
4252        }
4253        self.drop_without_shutdown();
4254        _result
4255    }
4256
4257    /// Similar to "send" but does not shutdown the channel if an error occurs.
4258    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4259        let _result = self.send_raw(result);
4260        self.drop_without_shutdown();
4261        _result
4262    }
4263
4264    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4265        self.control_handle
4266            .inner
4267            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4268                result,
4269                self.tx_id,
4270                0x7decf9b4200b9131,
4271                fidl::encoding::DynamicFlags::empty(),
4272            )
4273    }
4274}
4275
4276#[must_use = "FIDL methods require a response to be sent"]
4277#[derive(Debug)]
4278pub struct WlanSoftmacBaseNotifyAssociationCompleteResponder {
4279    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4280    tx_id: u32,
4281}
4282
4283/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4284/// if the responder is dropped without sending a response, so that the client
4285/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4286impl std::ops::Drop for WlanSoftmacBaseNotifyAssociationCompleteResponder {
4287    fn drop(&mut self) {
4288        self.control_handle.shutdown();
4289        // Safety: drops once, never accessed again
4290        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4291    }
4292}
4293
4294impl fidl::endpoints::Responder for WlanSoftmacBaseNotifyAssociationCompleteResponder {
4295    type ControlHandle = WlanSoftmacBaseControlHandle;
4296
4297    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4298        &self.control_handle
4299    }
4300
4301    fn drop_without_shutdown(mut self) {
4302        // Safety: drops once, never accessed again due to mem::forget
4303        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4304        // Prevent Drop from running (which would shut down the channel)
4305        std::mem::forget(self);
4306    }
4307}
4308
4309impl WlanSoftmacBaseNotifyAssociationCompleteResponder {
4310    /// Sends a response to the FIDL transaction.
4311    ///
4312    /// Sets the channel to shutdown if an error occurs.
4313    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4314        let _result = self.send_raw(result);
4315        if _result.is_err() {
4316            self.control_handle.shutdown();
4317        }
4318        self.drop_without_shutdown();
4319        _result
4320    }
4321
4322    /// Similar to "send" but does not shutdown the channel if an error occurs.
4323    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4324        let _result = self.send_raw(result);
4325        self.drop_without_shutdown();
4326        _result
4327    }
4328
4329    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4330        self.control_handle
4331            .inner
4332            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4333                result,
4334                self.tx_id,
4335                0x436ffe3ba461d6cd,
4336                fidl::encoding::DynamicFlags::empty(),
4337            )
4338    }
4339}
4340
4341#[must_use = "FIDL methods require a response to be sent"]
4342#[derive(Debug)]
4343pub struct WlanSoftmacBaseClearAssociationResponder {
4344    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4345    tx_id: u32,
4346}
4347
4348/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4349/// if the responder is dropped without sending a response, so that the client
4350/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4351impl std::ops::Drop for WlanSoftmacBaseClearAssociationResponder {
4352    fn drop(&mut self) {
4353        self.control_handle.shutdown();
4354        // Safety: drops once, never accessed again
4355        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4356    }
4357}
4358
4359impl fidl::endpoints::Responder for WlanSoftmacBaseClearAssociationResponder {
4360    type ControlHandle = WlanSoftmacBaseControlHandle;
4361
4362    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4363        &self.control_handle
4364    }
4365
4366    fn drop_without_shutdown(mut self) {
4367        // Safety: drops once, never accessed again due to mem::forget
4368        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4369        // Prevent Drop from running (which would shut down the channel)
4370        std::mem::forget(self);
4371    }
4372}
4373
4374impl WlanSoftmacBaseClearAssociationResponder {
4375    /// Sends a response to the FIDL transaction.
4376    ///
4377    /// Sets the channel to shutdown if an error occurs.
4378    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4379        let _result = self.send_raw(result);
4380        if _result.is_err() {
4381            self.control_handle.shutdown();
4382        }
4383        self.drop_without_shutdown();
4384        _result
4385    }
4386
4387    /// Similar to "send" but does not shutdown the channel if an error occurs.
4388    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4389        let _result = self.send_raw(result);
4390        self.drop_without_shutdown();
4391        _result
4392    }
4393
4394    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4395        self.control_handle
4396            .inner
4397            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4398                result,
4399                self.tx_id,
4400                0x581d76c39190a7dd,
4401                fidl::encoding::DynamicFlags::empty(),
4402            )
4403    }
4404}
4405
4406#[must_use = "FIDL methods require a response to be sent"]
4407#[derive(Debug)]
4408pub struct WlanSoftmacBaseStartPassiveScanResponder {
4409    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4410    tx_id: u32,
4411}
4412
4413/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4414/// if the responder is dropped without sending a response, so that the client
4415/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4416impl std::ops::Drop for WlanSoftmacBaseStartPassiveScanResponder {
4417    fn drop(&mut self) {
4418        self.control_handle.shutdown();
4419        // Safety: drops once, never accessed again
4420        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4421    }
4422}
4423
4424impl fidl::endpoints::Responder for WlanSoftmacBaseStartPassiveScanResponder {
4425    type ControlHandle = WlanSoftmacBaseControlHandle;
4426
4427    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4428        &self.control_handle
4429    }
4430
4431    fn drop_without_shutdown(mut self) {
4432        // Safety: drops once, never accessed again due to mem::forget
4433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4434        // Prevent Drop from running (which would shut down the channel)
4435        std::mem::forget(self);
4436    }
4437}
4438
4439impl WlanSoftmacBaseStartPassiveScanResponder {
4440    /// Sends a response to the FIDL transaction.
4441    ///
4442    /// Sets the channel to shutdown if an error occurs.
4443    pub fn send(
4444        self,
4445        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
4446    ) -> Result<(), fidl::Error> {
4447        let _result = self.send_raw(result);
4448        if _result.is_err() {
4449            self.control_handle.shutdown();
4450        }
4451        self.drop_without_shutdown();
4452        _result
4453    }
4454
4455    /// Similar to "send" but does not shutdown the channel if an error occurs.
4456    pub fn send_no_shutdown_on_err(
4457        self,
4458        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
4459    ) -> Result<(), fidl::Error> {
4460        let _result = self.send_raw(result);
4461        self.drop_without_shutdown();
4462        _result
4463    }
4464
4465    fn send_raw(
4466        &self,
4467        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
4468    ) -> Result<(), fidl::Error> {
4469        self.control_handle.inner.send::<fidl::encoding::ResultType<
4470            WlanSoftmacBaseStartPassiveScanResponse,
4471            i32,
4472        >>(
4473            result,
4474            self.tx_id,
4475            0x5662f989cb4083bb,
4476            fidl::encoding::DynamicFlags::empty(),
4477        )
4478    }
4479}
4480
4481#[must_use = "FIDL methods require a response to be sent"]
4482#[derive(Debug)]
4483pub struct WlanSoftmacBaseStartActiveScanResponder {
4484    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4485    tx_id: u32,
4486}
4487
4488/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4489/// if the responder is dropped without sending a response, so that the client
4490/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4491impl std::ops::Drop for WlanSoftmacBaseStartActiveScanResponder {
4492    fn drop(&mut self) {
4493        self.control_handle.shutdown();
4494        // Safety: drops once, never accessed again
4495        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4496    }
4497}
4498
4499impl fidl::endpoints::Responder for WlanSoftmacBaseStartActiveScanResponder {
4500    type ControlHandle = WlanSoftmacBaseControlHandle;
4501
4502    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4503        &self.control_handle
4504    }
4505
4506    fn drop_without_shutdown(mut self) {
4507        // Safety: drops once, never accessed again due to mem::forget
4508        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4509        // Prevent Drop from running (which would shut down the channel)
4510        std::mem::forget(self);
4511    }
4512}
4513
4514impl WlanSoftmacBaseStartActiveScanResponder {
4515    /// Sends a response to the FIDL transaction.
4516    ///
4517    /// Sets the channel to shutdown if an error occurs.
4518    pub fn send(
4519        self,
4520        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
4521    ) -> Result<(), fidl::Error> {
4522        let _result = self.send_raw(result);
4523        if _result.is_err() {
4524            self.control_handle.shutdown();
4525        }
4526        self.drop_without_shutdown();
4527        _result
4528    }
4529
4530    /// Similar to "send" but does not shutdown the channel if an error occurs.
4531    pub fn send_no_shutdown_on_err(
4532        self,
4533        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
4534    ) -> Result<(), fidl::Error> {
4535        let _result = self.send_raw(result);
4536        self.drop_without_shutdown();
4537        _result
4538    }
4539
4540    fn send_raw(
4541        &self,
4542        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
4543    ) -> Result<(), fidl::Error> {
4544        self.control_handle.inner.send::<fidl::encoding::ResultType<
4545            WlanSoftmacBaseStartActiveScanResponse,
4546            i32,
4547        >>(
4548            result,
4549            self.tx_id,
4550            0x4896eafa9937751e,
4551            fidl::encoding::DynamicFlags::empty(),
4552        )
4553    }
4554}
4555
4556#[must_use = "FIDL methods require a response to be sent"]
4557#[derive(Debug)]
4558pub struct WlanSoftmacBaseCancelScanResponder {
4559    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4560    tx_id: u32,
4561}
4562
4563/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4564/// if the responder is dropped without sending a response, so that the client
4565/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4566impl std::ops::Drop for WlanSoftmacBaseCancelScanResponder {
4567    fn drop(&mut self) {
4568        self.control_handle.shutdown();
4569        // Safety: drops once, never accessed again
4570        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4571    }
4572}
4573
4574impl fidl::endpoints::Responder for WlanSoftmacBaseCancelScanResponder {
4575    type ControlHandle = WlanSoftmacBaseControlHandle;
4576
4577    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4578        &self.control_handle
4579    }
4580
4581    fn drop_without_shutdown(mut self) {
4582        // Safety: drops once, never accessed again due to mem::forget
4583        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4584        // Prevent Drop from running (which would shut down the channel)
4585        std::mem::forget(self);
4586    }
4587}
4588
4589impl WlanSoftmacBaseCancelScanResponder {
4590    /// Sends a response to the FIDL transaction.
4591    ///
4592    /// Sets the channel to shutdown if an error occurs.
4593    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4594        let _result = self.send_raw(result);
4595        if _result.is_err() {
4596            self.control_handle.shutdown();
4597        }
4598        self.drop_without_shutdown();
4599        _result
4600    }
4601
4602    /// Similar to "send" but does not shutdown the channel if an error occurs.
4603    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4604        let _result = self.send_raw(result);
4605        self.drop_without_shutdown();
4606        _result
4607    }
4608
4609    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4610        self.control_handle
4611            .inner
4612            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4613                result,
4614                self.tx_id,
4615                0xf7d859369764556,
4616                fidl::encoding::DynamicFlags::empty(),
4617            )
4618    }
4619}
4620
4621#[must_use = "FIDL methods require a response to be sent"]
4622#[derive(Debug)]
4623pub struct WlanSoftmacBaseUpdateWmmParametersResponder {
4624    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4625    tx_id: u32,
4626}
4627
4628/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4629/// if the responder is dropped without sending a response, so that the client
4630/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4631impl std::ops::Drop for WlanSoftmacBaseUpdateWmmParametersResponder {
4632    fn drop(&mut self) {
4633        self.control_handle.shutdown();
4634        // Safety: drops once, never accessed again
4635        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4636    }
4637}
4638
4639impl fidl::endpoints::Responder for WlanSoftmacBaseUpdateWmmParametersResponder {
4640    type ControlHandle = WlanSoftmacBaseControlHandle;
4641
4642    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4643        &self.control_handle
4644    }
4645
4646    fn drop_without_shutdown(mut self) {
4647        // Safety: drops once, never accessed again due to mem::forget
4648        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4649        // Prevent Drop from running (which would shut down the channel)
4650        std::mem::forget(self);
4651    }
4652}
4653
4654impl WlanSoftmacBaseUpdateWmmParametersResponder {
4655    /// Sends a response to the FIDL transaction.
4656    ///
4657    /// Sets the channel to shutdown if an error occurs.
4658    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4659        let _result = self.send_raw(result);
4660        if _result.is_err() {
4661            self.control_handle.shutdown();
4662        }
4663        self.drop_without_shutdown();
4664        _result
4665    }
4666
4667    /// Similar to "send" but does not shutdown the channel if an error occurs.
4668    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4669        let _result = self.send_raw(result);
4670        self.drop_without_shutdown();
4671        _result
4672    }
4673
4674    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4675        self.control_handle
4676            .inner
4677            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4678                result,
4679                self.tx_id,
4680                0x68522c7122d5f78c,
4681                fidl::encoding::DynamicFlags::empty(),
4682            )
4683    }
4684}
4685
4686#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4687pub struct WlanSoftmacBridgeMarker;
4688
4689impl fidl::endpoints::ProtocolMarker for WlanSoftmacBridgeMarker {
4690    type Proxy = WlanSoftmacBridgeProxy;
4691    type RequestStream = WlanSoftmacBridgeRequestStream;
4692    #[cfg(target_os = "fuchsia")]
4693    type SynchronousProxy = WlanSoftmacBridgeSynchronousProxy;
4694
4695    const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacBridge";
4696}
4697pub type WlanSoftmacBridgeStartResult = Result<fidl::Channel, i32>;
4698
4699pub trait WlanSoftmacBridgeProxyInterface: Send + Sync {
4700    type QueryResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQueryResult, fidl::Error>>
4701        + Send;
4702    fn r#query(&self) -> Self::QueryResponseFut;
4703    type QueryDiscoverySupportResponseFut: std::future::Future<
4704            Output = Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error>,
4705        > + Send;
4706    fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut;
4707    type QueryMacSublayerSupportResponseFut: std::future::Future<
4708            Output = Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error>,
4709        > + Send;
4710    fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut;
4711    type QuerySecuritySupportResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error>>
4712        + Send;
4713    fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut;
4714    type QuerySpectrumManagementSupportResponseFut: std::future::Future<
4715            Output = Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error>,
4716        > + Send;
4717    fn r#query_spectrum_management_support(
4718        &self,
4719    ) -> Self::QuerySpectrumManagementSupportResponseFut;
4720    type SetChannelResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseSetChannelResult, fidl::Error>>
4721        + Send;
4722    fn r#set_channel(
4723        &self,
4724        payload: &WlanSoftmacBaseSetChannelRequest,
4725    ) -> Self::SetChannelResponseFut;
4726    type JoinBssResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseJoinBssResult, fidl::Error>>
4727        + Send;
4728    fn r#join_bss(
4729        &self,
4730        join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
4731    ) -> Self::JoinBssResponseFut;
4732    type EnableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error>>
4733        + Send;
4734    fn r#enable_beaconing(
4735        &self,
4736        payload: &WlanSoftmacBaseEnableBeaconingRequest,
4737    ) -> Self::EnableBeaconingResponseFut;
4738    type DisableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error>>
4739        + Send;
4740    fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut;
4741    type InstallKeyResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseInstallKeyResult, fidl::Error>>
4742        + Send;
4743    fn r#install_key(&self, payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut;
4744    type NotifyAssociationCompleteResponseFut: std::future::Future<
4745            Output = Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error>,
4746        > + Send;
4747    fn r#notify_association_complete(
4748        &self,
4749        assoc_cfg: &WlanAssociationConfig,
4750    ) -> Self::NotifyAssociationCompleteResponseFut;
4751    type ClearAssociationResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseClearAssociationResult, fidl::Error>>
4752        + Send;
4753    fn r#clear_association(
4754        &self,
4755        payload: &WlanSoftmacBaseClearAssociationRequest,
4756    ) -> Self::ClearAssociationResponseFut;
4757    type StartPassiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error>>
4758        + Send;
4759    fn r#start_passive_scan(
4760        &self,
4761        payload: &WlanSoftmacBaseStartPassiveScanRequest,
4762    ) -> Self::StartPassiveScanResponseFut;
4763    type StartActiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error>>
4764        + Send;
4765    fn r#start_active_scan(
4766        &self,
4767        payload: &WlanSoftmacStartActiveScanRequest,
4768    ) -> Self::StartActiveScanResponseFut;
4769    type CancelScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseCancelScanResult, fidl::Error>>
4770        + Send;
4771    fn r#cancel_scan(
4772        &self,
4773        payload: &WlanSoftmacBaseCancelScanRequest,
4774    ) -> Self::CancelScanResponseFut;
4775    type UpdateWmmParametersResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error>>
4776        + Send;
4777    fn r#update_wmm_parameters(
4778        &self,
4779        payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
4780    ) -> Self::UpdateWmmParametersResponseFut;
4781    type StartResponseFut: std::future::Future<Output = Result<WlanSoftmacBridgeStartResult, fidl::Error>>
4782        + Send;
4783    fn r#start(
4784        &self,
4785        ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
4786        ethernet_tx: u64,
4787        wlan_rx: u64,
4788    ) -> Self::StartResponseFut;
4789    type SetEthernetStatusResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
4790    fn r#set_ethernet_status(&self, status: u32) -> Self::SetEthernetStatusResponseFut;
4791}
4792#[derive(Debug)]
4793#[cfg(target_os = "fuchsia")]
4794pub struct WlanSoftmacBridgeSynchronousProxy {
4795    client: fidl::client::sync::Client,
4796}
4797
4798#[cfg(target_os = "fuchsia")]
4799impl fidl::endpoints::SynchronousProxy for WlanSoftmacBridgeSynchronousProxy {
4800    type Proxy = WlanSoftmacBridgeProxy;
4801    type Protocol = WlanSoftmacBridgeMarker;
4802
4803    fn from_channel(inner: fidl::Channel) -> Self {
4804        Self::new(inner)
4805    }
4806
4807    fn into_channel(self) -> fidl::Channel {
4808        self.client.into_channel()
4809    }
4810
4811    fn as_channel(&self) -> &fidl::Channel {
4812        self.client.as_channel()
4813    }
4814}
4815
4816#[cfg(target_os = "fuchsia")]
4817impl WlanSoftmacBridgeSynchronousProxy {
4818    pub fn new(channel: fidl::Channel) -> Self {
4819        let protocol_name =
4820            <WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4821        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4822    }
4823
4824    pub fn into_channel(self) -> fidl::Channel {
4825        self.client.into_channel()
4826    }
4827
4828    /// Waits until an event arrives and returns it. It is safe for other
4829    /// threads to make concurrent requests while waiting for an event.
4830    pub fn wait_for_event(
4831        &self,
4832        deadline: zx::MonotonicInstant,
4833    ) -> Result<WlanSoftmacBridgeEvent, fidl::Error> {
4834        WlanSoftmacBridgeEvent::decode(self.client.wait_for_event(deadline)?)
4835    }
4836
4837    /// Gets general information about the device and its supported features.
4838    /// This method is safe to call even when the SoftMAC has not yet started.
4839    ///
4840    /// Note: The implementation of this method must not depend on a response
4841    /// from an ethernet driver, otherwise there is a risk of deadlock.
4842    /// The wlansoftmac driver calls this method synchronously while
4843    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
4844    pub fn r#query(
4845        &self,
4846        ___deadline: zx::MonotonicInstant,
4847    ) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
4848        let _response = self.client.send_query::<
4849            fidl::encoding::EmptyPayload,
4850            fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
4851        >(
4852            (),
4853            0x18231a638e508f9d,
4854            fidl::encoding::DynamicFlags::empty(),
4855            ___deadline,
4856        )?;
4857        Ok(_response.map(|x| x))
4858    }
4859
4860    /// Gets information about the station discovery (e.g., scanning and
4861    /// probing) features supported by the device. This method is safe to call
4862    /// even when the SoftMAC has not yet started.
4863    pub fn r#query_discovery_support(
4864        &self,
4865        ___deadline: zx::MonotonicInstant,
4866    ) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
4867        let _response =
4868            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4869                WlanSoftmacBaseQueryDiscoverySupportResponse,
4870                i32,
4871            >>(
4872                (),
4873                0x16797affc0cb58ae,
4874                fidl::encoding::DynamicFlags::empty(),
4875                ___deadline,
4876            )?;
4877        Ok(_response.map(|x| x.resp))
4878    }
4879
4880    /// Gets information about the MAC features supported by the device. This
4881    /// method is safe to call even when the SoftMAC has not yet started.
4882    ///
4883    /// Note: The implementation of this method must not depend on a response
4884    /// from an ethernet driver, otherwise there is a risk of deadlock.
4885    /// The wlansoftmac driver calls this method synchronously while
4886    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
4887    pub fn r#query_mac_sublayer_support(
4888        &self,
4889        ___deadline: zx::MonotonicInstant,
4890    ) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
4891        let _response =
4892            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4893                WlanSoftmacBaseQueryMacSublayerSupportResponse,
4894                i32,
4895            >>(
4896                (),
4897                0x7302c3f8c131f075,
4898                fidl::encoding::DynamicFlags::empty(),
4899                ___deadline,
4900            )?;
4901        Ok(_response.map(|x| x.resp))
4902    }
4903
4904    /// Gets information about the security features supported by the device.
4905    /// This method is safe to call even when the SoftMAC has not yet started.
4906    pub fn r#query_security_support(
4907        &self,
4908        ___deadline: zx::MonotonicInstant,
4909    ) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
4910        let _response =
4911            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4912                WlanSoftmacBaseQuerySecuritySupportResponse,
4913                i32,
4914            >>(
4915                (),
4916                0x3691bb75abf6354,
4917                fidl::encoding::DynamicFlags::empty(),
4918                ___deadline,
4919            )?;
4920        Ok(_response.map(|x| x.resp))
4921    }
4922
4923    /// Gets information about the spectrum usage (e.g., DFS) features supported
4924    /// by the device. This method is safe to call even when the SoftMAC has not
4925    /// yet started.
4926    pub fn r#query_spectrum_management_support(
4927        &self,
4928        ___deadline: zx::MonotonicInstant,
4929    ) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
4930        let _response = self
4931            .client
4932            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4933                WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
4934                i32,
4935            >>(
4936                (), 0x347d78dc1d4d27bf, fidl::encoding::DynamicFlags::empty(), ___deadline
4937            )?;
4938        Ok(_response.map(|x| x.resp))
4939    }
4940
4941    /// Set the primary radio channel, e.g. in response to a channel switch event.
4942    /// If successful, this will trigger the channel switch immediately. This may
4943    /// impact the transmission of any frames that are in-flight, and might also
4944    /// interfere with an ongoing scan request.
4945    ///
4946    /// Common errors include: \
4947    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
4948    pub fn r#set_channel(
4949        &self,
4950        mut payload: &WlanSoftmacBaseSetChannelRequest,
4951        ___deadline: zx::MonotonicInstant,
4952    ) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
4953        let _response = self.client.send_query::<
4954            WlanSoftmacBaseSetChannelRequest,
4955            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4956        >(
4957            payload,
4958            0x12836b533cd63ece,
4959            fidl::encoding::DynamicFlags::empty(),
4960            ___deadline,
4961        )?;
4962        Ok(_response.map(|x| x))
4963    }
4964
4965    /// Join a specific BSS in which we will participate.
4966    /// This applies regardless of if we are hosting the BSS or joining it
4967    /// (indicated by the `remote` flag in `JoinBssRequest`).
4968    /// If successful, the device will switch to the correct channel and perform
4969    /// any internal filtering/timing operations required to join the BSS.
4970    /// For client STAs, this is the first step before authenticating.
4971    ///
4972    /// Common errors include: \
4973    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
4974    pub fn r#join_bss(
4975        &self,
4976        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
4977        ___deadline: zx::MonotonicInstant,
4978    ) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
4979        let _response = self.client.send_query::<
4980            WlanSoftmacBaseJoinBssRequest,
4981            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4982        >(
4983            (join_request,),
4984            0x1336fb5455b77a6e,
4985            fidl::encoding::DynamicFlags::empty(),
4986            ___deadline,
4987        )?;
4988        Ok(_response.map(|x| x))
4989    }
4990
4991    /// Enables hardware Beaconing.
4992    ///
4993    /// This method cannot be called while beaconing is enabled and so
4994    /// `DisableBeaconing` must be called prior to this method if beaconing is
4995    /// enabled.
4996    ///
4997    /// All request fields are required.
4998    ///
4999    /// Common errors include:
5000    ///
5001    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
5002    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
5003    ///                          beacon.
5004    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
5005    pub fn r#enable_beaconing(
5006        &self,
5007        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
5008        ___deadline: zx::MonotonicInstant,
5009    ) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
5010        let _response = self.client.send_query::<
5011            WlanSoftmacBaseEnableBeaconingRequest,
5012            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5013        >(
5014            payload,
5015            0x6c35807632c64576,
5016            fidl::encoding::DynamicFlags::empty(),
5017            ___deadline,
5018        )?;
5019        Ok(_response.map(|x| x))
5020    }
5021
5022    /// Disables hardware beaconing.
5023    pub fn r#disable_beaconing(
5024        &self,
5025        ___deadline: zx::MonotonicInstant,
5026    ) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
5027        let _response = self.client.send_query::<
5028            fidl::encoding::EmptyPayload,
5029            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5030        >(
5031            (),
5032            0x3303b30f99dbb406,
5033            fidl::encoding::DynamicFlags::empty(),
5034            ___deadline,
5035        )?;
5036        Ok(_response.map(|x| x))
5037    }
5038
5039    /// Install a key for encryption when transmitting or receiving protected
5040    /// frames.
5041    ///
5042    /// Common errors include:
5043    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
5044    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
5045    pub fn r#install_key(
5046        &self,
5047        mut payload: &WlanKeyConfiguration,
5048        ___deadline: zx::MonotonicInstant,
5049    ) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
5050        let _response = self.client.send_query::<
5051            WlanKeyConfiguration,
5052            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5053        >(
5054            payload,
5055            0x7decf9b4200b9131,
5056            fidl::encoding::DynamicFlags::empty(),
5057            ___deadline,
5058        )?;
5059        Ok(_response.map(|x| x))
5060    }
5061
5062    /// Notifies the device of a successful association and configures
5063    /// additional parameters necessary to participate in that association.
5064    ///
5065    /// # Errors
5066    ///
5067    /// Common errors include:
5068    ///
5069    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
5070    ///                       via `WlanSoftmac.JoinBss`.
5071    pub fn r#notify_association_complete(
5072        &self,
5073        mut assoc_cfg: &WlanAssociationConfig,
5074        ___deadline: zx::MonotonicInstant,
5075    ) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
5076        let _response = self.client.send_query::<
5077            WlanSoftmacBaseNotifyAssociationCompleteRequest,
5078            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5079        >(
5080            (assoc_cfg,),
5081            0x436ffe3ba461d6cd,
5082            fidl::encoding::DynamicFlags::empty(),
5083            ___deadline,
5084        )?;
5085        Ok(_response.map(|x| x))
5086    }
5087
5088    /// Notifies MAC and PHY that the peer has been de-associated.
5089    pub fn r#clear_association(
5090        &self,
5091        mut payload: &WlanSoftmacBaseClearAssociationRequest,
5092        ___deadline: zx::MonotonicInstant,
5093    ) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
5094        let _response = self.client.send_query::<
5095            WlanSoftmacBaseClearAssociationRequest,
5096            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5097        >(
5098            payload,
5099            0x581d76c39190a7dd,
5100            fidl::encoding::DynamicFlags::empty(),
5101            ___deadline,
5102        )?;
5103        Ok(_response.map(|x| x))
5104    }
5105
5106    /// Starts a passive scan. The server will deliver scan results
5107    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
5108    /// the server will call WlanSoftmacIfc.ScanComplete() with the
5109    /// same `scan_id` returned by StartPassiveScan().
5110    ///
5111    /// The server indicates support for `StartPassiveScan()` using
5112    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
5113    ///
5114    /// Common errors include:
5115    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
5116    ///       requested scan, e.g. because an incompatible channel was requested.
5117    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
5118    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
5119    pub fn r#start_passive_scan(
5120        &self,
5121        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
5122        ___deadline: zx::MonotonicInstant,
5123    ) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
5124        let _response = self.client.send_query::<
5125            WlanSoftmacBaseStartPassiveScanRequest,
5126            fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
5127        >(
5128            payload,
5129            0x5662f989cb4083bb,
5130            fidl::encoding::DynamicFlags::empty(),
5131            ___deadline,
5132        )?;
5133        Ok(_response.map(|x| x))
5134    }
5135
5136    /// Starts an active scan. The server will deliver scan results
5137    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
5138    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
5139    /// with the same `scan_id` returned by StartActiveScan().
5140    ///
5141    /// A device driver indicates support for `StartActiveScan()` using
5142    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
5143    ///
5144    /// Common errors include:
5145    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
5146    ///       requested scan, e.g. because an incompatible channel was requested.
5147    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
5148    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
5149    pub fn r#start_active_scan(
5150        &self,
5151        mut payload: &WlanSoftmacStartActiveScanRequest,
5152        ___deadline: zx::MonotonicInstant,
5153    ) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
5154        let _response = self.client.send_query::<
5155            WlanSoftmacStartActiveScanRequest,
5156            fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
5157        >(
5158            payload,
5159            0x4896eafa9937751e,
5160            fidl::encoding::DynamicFlags::empty(),
5161            ___deadline,
5162        )?;
5163        Ok(_response.map(|x| x))
5164    }
5165
5166    /// Cancels the ongoing scan corresponding to `scan_id`,
5167    /// where `scan_id` is an identifier returned by
5168    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
5169    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
5170    /// `scan_id`.
5171    ///
5172    /// A device driver indicates support for `CancelScan()` using
5173    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
5174    ///
5175    /// Common errors include:
5176    ///
5177    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
5178    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
5179    pub fn r#cancel_scan(
5180        &self,
5181        mut payload: &WlanSoftmacBaseCancelScanRequest,
5182        ___deadline: zx::MonotonicInstant,
5183    ) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
5184        let _response = self.client.send_query::<
5185            WlanSoftmacBaseCancelScanRequest,
5186            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5187        >(
5188            payload,
5189            0xf7d859369764556,
5190            fidl::encoding::DynamicFlags::empty(),
5191            ___deadline,
5192        )?;
5193        Ok(_response.map(|x| x))
5194    }
5195
5196    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
5197    /// particular access category (AC).
5198    pub fn r#update_wmm_parameters(
5199        &self,
5200        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
5201        ___deadline: zx::MonotonicInstant,
5202    ) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
5203        let _response = self.client.send_query::<
5204            WlanSoftmacBaseUpdateWmmParametersRequest,
5205            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5206        >(
5207            payload,
5208            0x68522c7122d5f78c,
5209            fidl::encoding::DynamicFlags::empty(),
5210            ___deadline,
5211        )?;
5212        Ok(_response.map(|x| x))
5213    }
5214
5215    /// Signal to the server that the MLME for the iface is ready to send and receive
5216    /// frames.
5217    ///
5218    /// The client provides the following arguments:
5219    ///
5220    ///   - `ifc_bridge`: The client end of a `WlanSoftmacIfcBridge` server which the
5221    ///     `wlansoftmac` driver will use to forward `WlanSoftmacIfc` events to
5222    ///     the bridged driver.
5223    ///   - `ethernet_tx`: A `ethernet_tx_t*` casted to a `uint64`. The
5224    ///     `ethernet_tx_t` is defined in
5225    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
5226    ///   - `wlan_rx`: A `wlan_rx_t*` casted to a `uint64`. The
5227    ///     `wlan_rx_t` is defined in
5228    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
5229    ///
5230    /// The server must copy the contents of `ethernet_tx_t` and `wlan_rx_t` before
5231    /// returning from this method. The lifetimes of `ethernet_tx_t*` and `wlan_rx_t*` are only as
5232    /// long as this method call, but the contents of `ethernet_tx_t` and `wlan_rx_t` will
5233    /// live until the server stops the MLME.
5234    ///
5235    /// The server returns a server end of a `fuchsia.wlan.mlme/MLME` protocol. The SME
5236    /// for the iface owns the client end. Thus, this channel is used for SME <-> MLME
5237    /// communication.
5238    ///
5239    /// The `WlanSoftmacBridge.Start` method is different from `WlanSoftmac.Start`
5240    /// for two reasons. First, Rust bindings do not exist for Driver transported
5241    /// protocols, so `WlanSoftmacIfcBridge` protocol must be Zircon transported to be
5242    /// usable by the bridged driver. Second, the Zircon transport adds
5243    /// significant latency compared to the Driver transport. As a result, the
5244    /// `ethernet_tx` and `wlan_rx` arguments provide an FFI for the wlansoftmac driver
5245    /// to send Ethernet and receive WLAN packets to the bridged driver with
5246    /// latency comparable or better than a Driver transported protocol.
5247    ///
5248    /// Except where noted, `WlanSoftmacBridge` methods must only be called after
5249    /// a successful call to `WlanSoftmacBridge.Start`.
5250    ///
5251    /// Common errors include:
5252    ///
5253    ///   - `ZX_ERR_ALREADY_BOUND`: `Start` was already called on this softmac.
5254    pub fn r#start(
5255        &self,
5256        mut ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
5257        mut ethernet_tx: u64,
5258        mut wlan_rx: u64,
5259        ___deadline: zx::MonotonicInstant,
5260    ) -> Result<WlanSoftmacBridgeStartResult, fidl::Error> {
5261        let _response = self.client.send_query::<
5262            WlanSoftmacBridgeStartRequest,
5263            fidl::encoding::ResultType<WlanSoftmacBridgeStartResponse, i32>,
5264        >(
5265            (ifc_bridge, ethernet_tx, wlan_rx,),
5266            0x7b2c15a507020d4d,
5267            fidl::encoding::DynamicFlags::empty(),
5268            ___deadline,
5269        )?;
5270        Ok(_response.map(|x| x.sme_channel))
5271    }
5272
5273    /// Forwards a status containing `ETHERNET_STATUS_*` flags to the
5274    /// `fuchsia.hardware.ethernet/EthernetImplIfc` proxy owned by
5275    /// the C++ portion of wlansoftmac.
5276    ///
5277    /// As documented, the value of `status` is set by bits defined in
5278    /// `ETHERNET_STATUS_*` flags. However, there is only one flag named
5279    /// `ETHERNET_STATUS_ONLINE` and no specification of for the meaning
5280    /// of specifying no flags. In practice, `0x1` means the status is up,
5281    /// and `0x0` means the status is down.
5282    ///
5283    /// While this method should belong in something like an
5284    /// "`EthernetImplIfcBridge` protocol", it's included in the
5285    /// `WlanSoftmacBridge` protocol as a convenience. The wlansoftmac driver
5286    /// will eventually cease using a `fuchsia.hardware.ethernet/EthernetImplIfc`
5287    /// proxy and use a `fuchsia.hardware.network.driver/NetworkDeviceIfc`
5288    /// proxy instead. At that time, an equivalent of this method should be
5289    /// refactored into a separate bridge.
5290    pub fn r#set_ethernet_status(
5291        &self,
5292        mut status: u32,
5293        ___deadline: zx::MonotonicInstant,
5294    ) -> Result<(), fidl::Error> {
5295        let _response = self
5296            .client
5297            .send_query::<WlanSoftmacBridgeSetEthernetStatusRequest, fidl::encoding::EmptyPayload>(
5298                (status,),
5299                0x412503cb3aaa350b,
5300                fidl::encoding::DynamicFlags::empty(),
5301                ___deadline,
5302            )?;
5303        Ok(_response)
5304    }
5305}
5306
5307#[cfg(target_os = "fuchsia")]
5308impl From<WlanSoftmacBridgeSynchronousProxy> for zx::NullableHandle {
5309    fn from(value: WlanSoftmacBridgeSynchronousProxy) -> Self {
5310        value.into_channel().into()
5311    }
5312}
5313
5314#[cfg(target_os = "fuchsia")]
5315impl From<fidl::Channel> for WlanSoftmacBridgeSynchronousProxy {
5316    fn from(value: fidl::Channel) -> Self {
5317        Self::new(value)
5318    }
5319}
5320
5321#[cfg(target_os = "fuchsia")]
5322impl fidl::endpoints::FromClient for WlanSoftmacBridgeSynchronousProxy {
5323    type Protocol = WlanSoftmacBridgeMarker;
5324
5325    fn from_client(value: fidl::endpoints::ClientEnd<WlanSoftmacBridgeMarker>) -> Self {
5326        Self::new(value.into_channel())
5327    }
5328}
5329
5330#[derive(Debug, Clone)]
5331pub struct WlanSoftmacBridgeProxy {
5332    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5333}
5334
5335impl fidl::endpoints::Proxy for WlanSoftmacBridgeProxy {
5336    type Protocol = WlanSoftmacBridgeMarker;
5337
5338    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5339        Self::new(inner)
5340    }
5341
5342    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5343        self.client.into_channel().map_err(|client| Self { client })
5344    }
5345
5346    fn as_channel(&self) -> &::fidl::AsyncChannel {
5347        self.client.as_channel()
5348    }
5349}
5350
5351impl WlanSoftmacBridgeProxy {
5352    /// Create a new Proxy for fuchsia.wlan.softmac/WlanSoftmacBridge.
5353    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5354        let protocol_name =
5355            <WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5356        Self { client: fidl::client::Client::new(channel, protocol_name) }
5357    }
5358
5359    /// Get a Stream of events from the remote end of the protocol.
5360    ///
5361    /// # Panics
5362    ///
5363    /// Panics if the event stream was already taken.
5364    pub fn take_event_stream(&self) -> WlanSoftmacBridgeEventStream {
5365        WlanSoftmacBridgeEventStream { event_receiver: self.client.take_event_receiver() }
5366    }
5367
5368    /// Gets general information about the device and its supported features.
5369    /// This method is safe to call even when the SoftMAC has not yet started.
5370    ///
5371    /// Note: The implementation of this method must not depend on a response
5372    /// from an ethernet driver, otherwise there is a risk of deadlock.
5373    /// The wlansoftmac driver calls this method synchronously while
5374    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
5375    pub fn r#query(
5376        &self,
5377    ) -> fidl::client::QueryResponseFut<
5378        WlanSoftmacBaseQueryResult,
5379        fidl::encoding::DefaultFuchsiaResourceDialect,
5380    > {
5381        WlanSoftmacBridgeProxyInterface::r#query(self)
5382    }
5383
5384    /// Gets information about the station discovery (e.g., scanning and
5385    /// probing) features supported by the device. This method is safe to call
5386    /// even when the SoftMAC has not yet started.
5387    pub fn r#query_discovery_support(
5388        &self,
5389    ) -> fidl::client::QueryResponseFut<
5390        WlanSoftmacBaseQueryDiscoverySupportResult,
5391        fidl::encoding::DefaultFuchsiaResourceDialect,
5392    > {
5393        WlanSoftmacBridgeProxyInterface::r#query_discovery_support(self)
5394    }
5395
5396    /// Gets information about the MAC features supported by the device. This
5397    /// method is safe to call even when the SoftMAC has not yet started.
5398    ///
5399    /// Note: The implementation of this method must not depend on a response
5400    /// from an ethernet driver, otherwise there is a risk of deadlock.
5401    /// The wlansoftmac driver calls this method synchronously while
5402    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
5403    pub fn r#query_mac_sublayer_support(
5404        &self,
5405    ) -> fidl::client::QueryResponseFut<
5406        WlanSoftmacBaseQueryMacSublayerSupportResult,
5407        fidl::encoding::DefaultFuchsiaResourceDialect,
5408    > {
5409        WlanSoftmacBridgeProxyInterface::r#query_mac_sublayer_support(self)
5410    }
5411
5412    /// Gets information about the security features supported by the device.
5413    /// This method is safe to call even when the SoftMAC has not yet started.
5414    pub fn r#query_security_support(
5415        &self,
5416    ) -> fidl::client::QueryResponseFut<
5417        WlanSoftmacBaseQuerySecuritySupportResult,
5418        fidl::encoding::DefaultFuchsiaResourceDialect,
5419    > {
5420        WlanSoftmacBridgeProxyInterface::r#query_security_support(self)
5421    }
5422
5423    /// Gets information about the spectrum usage (e.g., DFS) features supported
5424    /// by the device. This method is safe to call even when the SoftMAC has not
5425    /// yet started.
5426    pub fn r#query_spectrum_management_support(
5427        &self,
5428    ) -> fidl::client::QueryResponseFut<
5429        WlanSoftmacBaseQuerySpectrumManagementSupportResult,
5430        fidl::encoding::DefaultFuchsiaResourceDialect,
5431    > {
5432        WlanSoftmacBridgeProxyInterface::r#query_spectrum_management_support(self)
5433    }
5434
5435    /// Set the primary radio channel, e.g. in response to a channel switch event.
5436    /// If successful, this will trigger the channel switch immediately. This may
5437    /// impact the transmission of any frames that are in-flight, and might also
5438    /// interfere with an ongoing scan request.
5439    ///
5440    /// Common errors include: \
5441    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
5442    pub fn r#set_channel(
5443        &self,
5444        mut payload: &WlanSoftmacBaseSetChannelRequest,
5445    ) -> fidl::client::QueryResponseFut<
5446        WlanSoftmacBaseSetChannelResult,
5447        fidl::encoding::DefaultFuchsiaResourceDialect,
5448    > {
5449        WlanSoftmacBridgeProxyInterface::r#set_channel(self, payload)
5450    }
5451
5452    /// Join a specific BSS in which we will participate.
5453    /// This applies regardless of if we are hosting the BSS or joining it
5454    /// (indicated by the `remote` flag in `JoinBssRequest`).
5455    /// If successful, the device will switch to the correct channel and perform
5456    /// any internal filtering/timing operations required to join the BSS.
5457    /// For client STAs, this is the first step before authenticating.
5458    ///
5459    /// Common errors include: \
5460    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
5461    pub fn r#join_bss(
5462        &self,
5463        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
5464    ) -> fidl::client::QueryResponseFut<
5465        WlanSoftmacBaseJoinBssResult,
5466        fidl::encoding::DefaultFuchsiaResourceDialect,
5467    > {
5468        WlanSoftmacBridgeProxyInterface::r#join_bss(self, join_request)
5469    }
5470
5471    /// Enables hardware Beaconing.
5472    ///
5473    /// This method cannot be called while beaconing is enabled and so
5474    /// `DisableBeaconing` must be called prior to this method if beaconing is
5475    /// enabled.
5476    ///
5477    /// All request fields are required.
5478    ///
5479    /// Common errors include:
5480    ///
5481    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
5482    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
5483    ///                          beacon.
5484    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
5485    pub fn r#enable_beaconing(
5486        &self,
5487        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
5488    ) -> fidl::client::QueryResponseFut<
5489        WlanSoftmacBaseEnableBeaconingResult,
5490        fidl::encoding::DefaultFuchsiaResourceDialect,
5491    > {
5492        WlanSoftmacBridgeProxyInterface::r#enable_beaconing(self, payload)
5493    }
5494
5495    /// Disables hardware beaconing.
5496    pub fn r#disable_beaconing(
5497        &self,
5498    ) -> fidl::client::QueryResponseFut<
5499        WlanSoftmacBaseDisableBeaconingResult,
5500        fidl::encoding::DefaultFuchsiaResourceDialect,
5501    > {
5502        WlanSoftmacBridgeProxyInterface::r#disable_beaconing(self)
5503    }
5504
5505    /// Install a key for encryption when transmitting or receiving protected
5506    /// frames.
5507    ///
5508    /// Common errors include:
5509    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
5510    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
5511    pub fn r#install_key(
5512        &self,
5513        mut payload: &WlanKeyConfiguration,
5514    ) -> fidl::client::QueryResponseFut<
5515        WlanSoftmacBaseInstallKeyResult,
5516        fidl::encoding::DefaultFuchsiaResourceDialect,
5517    > {
5518        WlanSoftmacBridgeProxyInterface::r#install_key(self, payload)
5519    }
5520
5521    /// Notifies the device of a successful association and configures
5522    /// additional parameters necessary to participate in that association.
5523    ///
5524    /// # Errors
5525    ///
5526    /// Common errors include:
5527    ///
5528    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
5529    ///                       via `WlanSoftmac.JoinBss`.
5530    pub fn r#notify_association_complete(
5531        &self,
5532        mut assoc_cfg: &WlanAssociationConfig,
5533    ) -> fidl::client::QueryResponseFut<
5534        WlanSoftmacBaseNotifyAssociationCompleteResult,
5535        fidl::encoding::DefaultFuchsiaResourceDialect,
5536    > {
5537        WlanSoftmacBridgeProxyInterface::r#notify_association_complete(self, assoc_cfg)
5538    }
5539
5540    /// Notifies MAC and PHY that the peer has been de-associated.
5541    pub fn r#clear_association(
5542        &self,
5543        mut payload: &WlanSoftmacBaseClearAssociationRequest,
5544    ) -> fidl::client::QueryResponseFut<
5545        WlanSoftmacBaseClearAssociationResult,
5546        fidl::encoding::DefaultFuchsiaResourceDialect,
5547    > {
5548        WlanSoftmacBridgeProxyInterface::r#clear_association(self, payload)
5549    }
5550
5551    /// Starts a passive scan. The server will deliver scan results
5552    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
5553    /// the server will call WlanSoftmacIfc.ScanComplete() with the
5554    /// same `scan_id` returned by StartPassiveScan().
5555    ///
5556    /// The server indicates support for `StartPassiveScan()` using
5557    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
5558    ///
5559    /// Common errors include:
5560    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
5561    ///       requested scan, e.g. because an incompatible channel was requested.
5562    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
5563    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
5564    pub fn r#start_passive_scan(
5565        &self,
5566        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
5567    ) -> fidl::client::QueryResponseFut<
5568        WlanSoftmacBaseStartPassiveScanResult,
5569        fidl::encoding::DefaultFuchsiaResourceDialect,
5570    > {
5571        WlanSoftmacBridgeProxyInterface::r#start_passive_scan(self, payload)
5572    }
5573
5574    /// Starts an active scan. The server will deliver scan results
5575    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
5576    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
5577    /// with the same `scan_id` returned by StartActiveScan().
5578    ///
5579    /// A device driver indicates support for `StartActiveScan()` using
5580    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
5581    ///
5582    /// Common errors include:
5583    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
5584    ///       requested scan, e.g. because an incompatible channel was requested.
5585    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
5586    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
5587    pub fn r#start_active_scan(
5588        &self,
5589        mut payload: &WlanSoftmacStartActiveScanRequest,
5590    ) -> fidl::client::QueryResponseFut<
5591        WlanSoftmacBaseStartActiveScanResult,
5592        fidl::encoding::DefaultFuchsiaResourceDialect,
5593    > {
5594        WlanSoftmacBridgeProxyInterface::r#start_active_scan(self, payload)
5595    }
5596
5597    /// Cancels the ongoing scan corresponding to `scan_id`,
5598    /// where `scan_id` is an identifier returned by
5599    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
5600    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
5601    /// `scan_id`.
5602    ///
5603    /// A device driver indicates support for `CancelScan()` using
5604    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
5605    ///
5606    /// Common errors include:
5607    ///
5608    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
5609    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
5610    pub fn r#cancel_scan(
5611        &self,
5612        mut payload: &WlanSoftmacBaseCancelScanRequest,
5613    ) -> fidl::client::QueryResponseFut<
5614        WlanSoftmacBaseCancelScanResult,
5615        fidl::encoding::DefaultFuchsiaResourceDialect,
5616    > {
5617        WlanSoftmacBridgeProxyInterface::r#cancel_scan(self, payload)
5618    }
5619
5620    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
5621    /// particular access category (AC).
5622    pub fn r#update_wmm_parameters(
5623        &self,
5624        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
5625    ) -> fidl::client::QueryResponseFut<
5626        WlanSoftmacBaseUpdateWmmParametersResult,
5627        fidl::encoding::DefaultFuchsiaResourceDialect,
5628    > {
5629        WlanSoftmacBridgeProxyInterface::r#update_wmm_parameters(self, payload)
5630    }
5631
5632    /// Signal to the server that the MLME for the iface is ready to send and receive
5633    /// frames.
5634    ///
5635    /// The client provides the following arguments:
5636    ///
5637    ///   - `ifc_bridge`: The client end of a `WlanSoftmacIfcBridge` server which the
5638    ///     `wlansoftmac` driver will use to forward `WlanSoftmacIfc` events to
5639    ///     the bridged driver.
5640    ///   - `ethernet_tx`: A `ethernet_tx_t*` casted to a `uint64`. The
5641    ///     `ethernet_tx_t` is defined in
5642    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
5643    ///   - `wlan_rx`: A `wlan_rx_t*` casted to a `uint64`. The
5644    ///     `wlan_rx_t` is defined in
5645    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
5646    ///
5647    /// The server must copy the contents of `ethernet_tx_t` and `wlan_rx_t` before
5648    /// returning from this method. The lifetimes of `ethernet_tx_t*` and `wlan_rx_t*` are only as
5649    /// long as this method call, but the contents of `ethernet_tx_t` and `wlan_rx_t` will
5650    /// live until the server stops the MLME.
5651    ///
5652    /// The server returns a server end of a `fuchsia.wlan.mlme/MLME` protocol. The SME
5653    /// for the iface owns the client end. Thus, this channel is used for SME <-> MLME
5654    /// communication.
5655    ///
5656    /// The `WlanSoftmacBridge.Start` method is different from `WlanSoftmac.Start`
5657    /// for two reasons. First, Rust bindings do not exist for Driver transported
5658    /// protocols, so `WlanSoftmacIfcBridge` protocol must be Zircon transported to be
5659    /// usable by the bridged driver. Second, the Zircon transport adds
5660    /// significant latency compared to the Driver transport. As a result, the
5661    /// `ethernet_tx` and `wlan_rx` arguments provide an FFI for the wlansoftmac driver
5662    /// to send Ethernet and receive WLAN packets to the bridged driver with
5663    /// latency comparable or better than a Driver transported protocol.
5664    ///
5665    /// Except where noted, `WlanSoftmacBridge` methods must only be called after
5666    /// a successful call to `WlanSoftmacBridge.Start`.
5667    ///
5668    /// Common errors include:
5669    ///
5670    ///   - `ZX_ERR_ALREADY_BOUND`: `Start` was already called on this softmac.
5671    pub fn r#start(
5672        &self,
5673        mut ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
5674        mut ethernet_tx: u64,
5675        mut wlan_rx: u64,
5676    ) -> fidl::client::QueryResponseFut<
5677        WlanSoftmacBridgeStartResult,
5678        fidl::encoding::DefaultFuchsiaResourceDialect,
5679    > {
5680        WlanSoftmacBridgeProxyInterface::r#start(self, ifc_bridge, ethernet_tx, wlan_rx)
5681    }
5682
5683    /// Forwards a status containing `ETHERNET_STATUS_*` flags to the
5684    /// `fuchsia.hardware.ethernet/EthernetImplIfc` proxy owned by
5685    /// the C++ portion of wlansoftmac.
5686    ///
5687    /// As documented, the value of `status` is set by bits defined in
5688    /// `ETHERNET_STATUS_*` flags. However, there is only one flag named
5689    /// `ETHERNET_STATUS_ONLINE` and no specification of for the meaning
5690    /// of specifying no flags. In practice, `0x1` means the status is up,
5691    /// and `0x0` means the status is down.
5692    ///
5693    /// While this method should belong in something like an
5694    /// "`EthernetImplIfcBridge` protocol", it's included in the
5695    /// `WlanSoftmacBridge` protocol as a convenience. The wlansoftmac driver
5696    /// will eventually cease using a `fuchsia.hardware.ethernet/EthernetImplIfc`
5697    /// proxy and use a `fuchsia.hardware.network.driver/NetworkDeviceIfc`
5698    /// proxy instead. At that time, an equivalent of this method should be
5699    /// refactored into a separate bridge.
5700    pub fn r#set_ethernet_status(
5701        &self,
5702        mut status: u32,
5703    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
5704        WlanSoftmacBridgeProxyInterface::r#set_ethernet_status(self, status)
5705    }
5706}
5707
5708impl WlanSoftmacBridgeProxyInterface for WlanSoftmacBridgeProxy {
5709    type QueryResponseFut = fidl::client::QueryResponseFut<
5710        WlanSoftmacBaseQueryResult,
5711        fidl::encoding::DefaultFuchsiaResourceDialect,
5712    >;
5713    fn r#query(&self) -> Self::QueryResponseFut {
5714        fn _decode(
5715            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5716        ) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
5717            let _response = fidl::client::decode_transaction_body::<
5718                fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
5719                fidl::encoding::DefaultFuchsiaResourceDialect,
5720                0x18231a638e508f9d,
5721            >(_buf?)?;
5722            Ok(_response.map(|x| x))
5723        }
5724        self.client
5725            .send_query_and_decode::<fidl::encoding::EmptyPayload, WlanSoftmacBaseQueryResult>(
5726                (),
5727                0x18231a638e508f9d,
5728                fidl::encoding::DynamicFlags::empty(),
5729                _decode,
5730            )
5731    }
5732
5733    type QueryDiscoverySupportResponseFut = fidl::client::QueryResponseFut<
5734        WlanSoftmacBaseQueryDiscoverySupportResult,
5735        fidl::encoding::DefaultFuchsiaResourceDialect,
5736    >;
5737    fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut {
5738        fn _decode(
5739            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5740        ) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
5741            let _response = fidl::client::decode_transaction_body::<
5742                fidl::encoding::ResultType<WlanSoftmacBaseQueryDiscoverySupportResponse, i32>,
5743                fidl::encoding::DefaultFuchsiaResourceDialect,
5744                0x16797affc0cb58ae,
5745            >(_buf?)?;
5746            Ok(_response.map(|x| x.resp))
5747        }
5748        self.client.send_query_and_decode::<
5749            fidl::encoding::EmptyPayload,
5750            WlanSoftmacBaseQueryDiscoverySupportResult,
5751        >(
5752            (),
5753            0x16797affc0cb58ae,
5754            fidl::encoding::DynamicFlags::empty(),
5755            _decode,
5756        )
5757    }
5758
5759    type QueryMacSublayerSupportResponseFut = fidl::client::QueryResponseFut<
5760        WlanSoftmacBaseQueryMacSublayerSupportResult,
5761        fidl::encoding::DefaultFuchsiaResourceDialect,
5762    >;
5763    fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut {
5764        fn _decode(
5765            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5766        ) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
5767            let _response = fidl::client::decode_transaction_body::<
5768                fidl::encoding::ResultType<WlanSoftmacBaseQueryMacSublayerSupportResponse, i32>,
5769                fidl::encoding::DefaultFuchsiaResourceDialect,
5770                0x7302c3f8c131f075,
5771            >(_buf?)?;
5772            Ok(_response.map(|x| x.resp))
5773        }
5774        self.client.send_query_and_decode::<
5775            fidl::encoding::EmptyPayload,
5776            WlanSoftmacBaseQueryMacSublayerSupportResult,
5777        >(
5778            (),
5779            0x7302c3f8c131f075,
5780            fidl::encoding::DynamicFlags::empty(),
5781            _decode,
5782        )
5783    }
5784
5785    type QuerySecuritySupportResponseFut = fidl::client::QueryResponseFut<
5786        WlanSoftmacBaseQuerySecuritySupportResult,
5787        fidl::encoding::DefaultFuchsiaResourceDialect,
5788    >;
5789    fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut {
5790        fn _decode(
5791            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5792        ) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
5793            let _response = fidl::client::decode_transaction_body::<
5794                fidl::encoding::ResultType<WlanSoftmacBaseQuerySecuritySupportResponse, i32>,
5795                fidl::encoding::DefaultFuchsiaResourceDialect,
5796                0x3691bb75abf6354,
5797            >(_buf?)?;
5798            Ok(_response.map(|x| x.resp))
5799        }
5800        self.client.send_query_and_decode::<
5801            fidl::encoding::EmptyPayload,
5802            WlanSoftmacBaseQuerySecuritySupportResult,
5803        >(
5804            (),
5805            0x3691bb75abf6354,
5806            fidl::encoding::DynamicFlags::empty(),
5807            _decode,
5808        )
5809    }
5810
5811    type QuerySpectrumManagementSupportResponseFut = fidl::client::QueryResponseFut<
5812        WlanSoftmacBaseQuerySpectrumManagementSupportResult,
5813        fidl::encoding::DefaultFuchsiaResourceDialect,
5814    >;
5815    fn r#query_spectrum_management_support(
5816        &self,
5817    ) -> Self::QuerySpectrumManagementSupportResponseFut {
5818        fn _decode(
5819            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5820        ) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
5821            let _response = fidl::client::decode_transaction_body::<
5822                fidl::encoding::ResultType<
5823                    WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
5824                    i32,
5825                >,
5826                fidl::encoding::DefaultFuchsiaResourceDialect,
5827                0x347d78dc1d4d27bf,
5828            >(_buf?)?;
5829            Ok(_response.map(|x| x.resp))
5830        }
5831        self.client.send_query_and_decode::<
5832            fidl::encoding::EmptyPayload,
5833            WlanSoftmacBaseQuerySpectrumManagementSupportResult,
5834        >(
5835            (),
5836            0x347d78dc1d4d27bf,
5837            fidl::encoding::DynamicFlags::empty(),
5838            _decode,
5839        )
5840    }
5841
5842    type SetChannelResponseFut = fidl::client::QueryResponseFut<
5843        WlanSoftmacBaseSetChannelResult,
5844        fidl::encoding::DefaultFuchsiaResourceDialect,
5845    >;
5846    fn r#set_channel(
5847        &self,
5848        mut payload: &WlanSoftmacBaseSetChannelRequest,
5849    ) -> Self::SetChannelResponseFut {
5850        fn _decode(
5851            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5852        ) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
5853            let _response = fidl::client::decode_transaction_body::<
5854                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5855                fidl::encoding::DefaultFuchsiaResourceDialect,
5856                0x12836b533cd63ece,
5857            >(_buf?)?;
5858            Ok(_response.map(|x| x))
5859        }
5860        self.client.send_query_and_decode::<
5861            WlanSoftmacBaseSetChannelRequest,
5862            WlanSoftmacBaseSetChannelResult,
5863        >(
5864            payload,
5865            0x12836b533cd63ece,
5866            fidl::encoding::DynamicFlags::empty(),
5867            _decode,
5868        )
5869    }
5870
5871    type JoinBssResponseFut = fidl::client::QueryResponseFut<
5872        WlanSoftmacBaseJoinBssResult,
5873        fidl::encoding::DefaultFuchsiaResourceDialect,
5874    >;
5875    fn r#join_bss(
5876        &self,
5877        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
5878    ) -> Self::JoinBssResponseFut {
5879        fn _decode(
5880            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5881        ) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
5882            let _response = fidl::client::decode_transaction_body::<
5883                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5884                fidl::encoding::DefaultFuchsiaResourceDialect,
5885                0x1336fb5455b77a6e,
5886            >(_buf?)?;
5887            Ok(_response.map(|x| x))
5888        }
5889        self.client
5890            .send_query_and_decode::<WlanSoftmacBaseJoinBssRequest, WlanSoftmacBaseJoinBssResult>(
5891                (join_request,),
5892                0x1336fb5455b77a6e,
5893                fidl::encoding::DynamicFlags::empty(),
5894                _decode,
5895            )
5896    }
5897
5898    type EnableBeaconingResponseFut = fidl::client::QueryResponseFut<
5899        WlanSoftmacBaseEnableBeaconingResult,
5900        fidl::encoding::DefaultFuchsiaResourceDialect,
5901    >;
5902    fn r#enable_beaconing(
5903        &self,
5904        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
5905    ) -> Self::EnableBeaconingResponseFut {
5906        fn _decode(
5907            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5908        ) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
5909            let _response = fidl::client::decode_transaction_body::<
5910                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5911                fidl::encoding::DefaultFuchsiaResourceDialect,
5912                0x6c35807632c64576,
5913            >(_buf?)?;
5914            Ok(_response.map(|x| x))
5915        }
5916        self.client.send_query_and_decode::<
5917            WlanSoftmacBaseEnableBeaconingRequest,
5918            WlanSoftmacBaseEnableBeaconingResult,
5919        >(
5920            payload,
5921            0x6c35807632c64576,
5922            fidl::encoding::DynamicFlags::empty(),
5923            _decode,
5924        )
5925    }
5926
5927    type DisableBeaconingResponseFut = fidl::client::QueryResponseFut<
5928        WlanSoftmacBaseDisableBeaconingResult,
5929        fidl::encoding::DefaultFuchsiaResourceDialect,
5930    >;
5931    fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut {
5932        fn _decode(
5933            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5934        ) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
5935            let _response = fidl::client::decode_transaction_body::<
5936                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5937                fidl::encoding::DefaultFuchsiaResourceDialect,
5938                0x3303b30f99dbb406,
5939            >(_buf?)?;
5940            Ok(_response.map(|x| x))
5941        }
5942        self.client.send_query_and_decode::<
5943            fidl::encoding::EmptyPayload,
5944            WlanSoftmacBaseDisableBeaconingResult,
5945        >(
5946            (),
5947            0x3303b30f99dbb406,
5948            fidl::encoding::DynamicFlags::empty(),
5949            _decode,
5950        )
5951    }
5952
5953    type InstallKeyResponseFut = fidl::client::QueryResponseFut<
5954        WlanSoftmacBaseInstallKeyResult,
5955        fidl::encoding::DefaultFuchsiaResourceDialect,
5956    >;
5957    fn r#install_key(&self, mut payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut {
5958        fn _decode(
5959            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5960        ) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
5961            let _response = fidl::client::decode_transaction_body::<
5962                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5963                fidl::encoding::DefaultFuchsiaResourceDialect,
5964                0x7decf9b4200b9131,
5965            >(_buf?)?;
5966            Ok(_response.map(|x| x))
5967        }
5968        self.client.send_query_and_decode::<WlanKeyConfiguration, WlanSoftmacBaseInstallKeyResult>(
5969            payload,
5970            0x7decf9b4200b9131,
5971            fidl::encoding::DynamicFlags::empty(),
5972            _decode,
5973        )
5974    }
5975
5976    type NotifyAssociationCompleteResponseFut = fidl::client::QueryResponseFut<
5977        WlanSoftmacBaseNotifyAssociationCompleteResult,
5978        fidl::encoding::DefaultFuchsiaResourceDialect,
5979    >;
5980    fn r#notify_association_complete(
5981        &self,
5982        mut assoc_cfg: &WlanAssociationConfig,
5983    ) -> Self::NotifyAssociationCompleteResponseFut {
5984        fn _decode(
5985            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5986        ) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
5987            let _response = fidl::client::decode_transaction_body::<
5988                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5989                fidl::encoding::DefaultFuchsiaResourceDialect,
5990                0x436ffe3ba461d6cd,
5991            >(_buf?)?;
5992            Ok(_response.map(|x| x))
5993        }
5994        self.client.send_query_and_decode::<
5995            WlanSoftmacBaseNotifyAssociationCompleteRequest,
5996            WlanSoftmacBaseNotifyAssociationCompleteResult,
5997        >(
5998            (assoc_cfg,),
5999            0x436ffe3ba461d6cd,
6000            fidl::encoding::DynamicFlags::empty(),
6001            _decode,
6002        )
6003    }
6004
6005    type ClearAssociationResponseFut = fidl::client::QueryResponseFut<
6006        WlanSoftmacBaseClearAssociationResult,
6007        fidl::encoding::DefaultFuchsiaResourceDialect,
6008    >;
6009    fn r#clear_association(
6010        &self,
6011        mut payload: &WlanSoftmacBaseClearAssociationRequest,
6012    ) -> Self::ClearAssociationResponseFut {
6013        fn _decode(
6014            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6015        ) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
6016            let _response = fidl::client::decode_transaction_body::<
6017                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6018                fidl::encoding::DefaultFuchsiaResourceDialect,
6019                0x581d76c39190a7dd,
6020            >(_buf?)?;
6021            Ok(_response.map(|x| x))
6022        }
6023        self.client.send_query_and_decode::<
6024            WlanSoftmacBaseClearAssociationRequest,
6025            WlanSoftmacBaseClearAssociationResult,
6026        >(
6027            payload,
6028            0x581d76c39190a7dd,
6029            fidl::encoding::DynamicFlags::empty(),
6030            _decode,
6031        )
6032    }
6033
6034    type StartPassiveScanResponseFut = fidl::client::QueryResponseFut<
6035        WlanSoftmacBaseStartPassiveScanResult,
6036        fidl::encoding::DefaultFuchsiaResourceDialect,
6037    >;
6038    fn r#start_passive_scan(
6039        &self,
6040        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
6041    ) -> Self::StartPassiveScanResponseFut {
6042        fn _decode(
6043            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6044        ) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
6045            let _response = fidl::client::decode_transaction_body::<
6046                fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
6047                fidl::encoding::DefaultFuchsiaResourceDialect,
6048                0x5662f989cb4083bb,
6049            >(_buf?)?;
6050            Ok(_response.map(|x| x))
6051        }
6052        self.client.send_query_and_decode::<
6053            WlanSoftmacBaseStartPassiveScanRequest,
6054            WlanSoftmacBaseStartPassiveScanResult,
6055        >(
6056            payload,
6057            0x5662f989cb4083bb,
6058            fidl::encoding::DynamicFlags::empty(),
6059            _decode,
6060        )
6061    }
6062
6063    type StartActiveScanResponseFut = fidl::client::QueryResponseFut<
6064        WlanSoftmacBaseStartActiveScanResult,
6065        fidl::encoding::DefaultFuchsiaResourceDialect,
6066    >;
6067    fn r#start_active_scan(
6068        &self,
6069        mut payload: &WlanSoftmacStartActiveScanRequest,
6070    ) -> Self::StartActiveScanResponseFut {
6071        fn _decode(
6072            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6073        ) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
6074            let _response = fidl::client::decode_transaction_body::<
6075                fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
6076                fidl::encoding::DefaultFuchsiaResourceDialect,
6077                0x4896eafa9937751e,
6078            >(_buf?)?;
6079            Ok(_response.map(|x| x))
6080        }
6081        self.client.send_query_and_decode::<
6082            WlanSoftmacStartActiveScanRequest,
6083            WlanSoftmacBaseStartActiveScanResult,
6084        >(
6085            payload,
6086            0x4896eafa9937751e,
6087            fidl::encoding::DynamicFlags::empty(),
6088            _decode,
6089        )
6090    }
6091
6092    type CancelScanResponseFut = fidl::client::QueryResponseFut<
6093        WlanSoftmacBaseCancelScanResult,
6094        fidl::encoding::DefaultFuchsiaResourceDialect,
6095    >;
6096    fn r#cancel_scan(
6097        &self,
6098        mut payload: &WlanSoftmacBaseCancelScanRequest,
6099    ) -> Self::CancelScanResponseFut {
6100        fn _decode(
6101            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6102        ) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
6103            let _response = fidl::client::decode_transaction_body::<
6104                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6105                fidl::encoding::DefaultFuchsiaResourceDialect,
6106                0xf7d859369764556,
6107            >(_buf?)?;
6108            Ok(_response.map(|x| x))
6109        }
6110        self.client.send_query_and_decode::<
6111            WlanSoftmacBaseCancelScanRequest,
6112            WlanSoftmacBaseCancelScanResult,
6113        >(
6114            payload,
6115            0xf7d859369764556,
6116            fidl::encoding::DynamicFlags::empty(),
6117            _decode,
6118        )
6119    }
6120
6121    type UpdateWmmParametersResponseFut = fidl::client::QueryResponseFut<
6122        WlanSoftmacBaseUpdateWmmParametersResult,
6123        fidl::encoding::DefaultFuchsiaResourceDialect,
6124    >;
6125    fn r#update_wmm_parameters(
6126        &self,
6127        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
6128    ) -> Self::UpdateWmmParametersResponseFut {
6129        fn _decode(
6130            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6131        ) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
6132            let _response = fidl::client::decode_transaction_body::<
6133                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6134                fidl::encoding::DefaultFuchsiaResourceDialect,
6135                0x68522c7122d5f78c,
6136            >(_buf?)?;
6137            Ok(_response.map(|x| x))
6138        }
6139        self.client.send_query_and_decode::<
6140            WlanSoftmacBaseUpdateWmmParametersRequest,
6141            WlanSoftmacBaseUpdateWmmParametersResult,
6142        >(
6143            payload,
6144            0x68522c7122d5f78c,
6145            fidl::encoding::DynamicFlags::empty(),
6146            _decode,
6147        )
6148    }
6149
6150    type StartResponseFut = fidl::client::QueryResponseFut<
6151        WlanSoftmacBridgeStartResult,
6152        fidl::encoding::DefaultFuchsiaResourceDialect,
6153    >;
6154    fn r#start(
6155        &self,
6156        mut ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
6157        mut ethernet_tx: u64,
6158        mut wlan_rx: u64,
6159    ) -> Self::StartResponseFut {
6160        fn _decode(
6161            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6162        ) -> Result<WlanSoftmacBridgeStartResult, fidl::Error> {
6163            let _response = fidl::client::decode_transaction_body::<
6164                fidl::encoding::ResultType<WlanSoftmacBridgeStartResponse, i32>,
6165                fidl::encoding::DefaultFuchsiaResourceDialect,
6166                0x7b2c15a507020d4d,
6167            >(_buf?)?;
6168            Ok(_response.map(|x| x.sme_channel))
6169        }
6170        self.client
6171            .send_query_and_decode::<WlanSoftmacBridgeStartRequest, WlanSoftmacBridgeStartResult>(
6172                (ifc_bridge, ethernet_tx, wlan_rx),
6173                0x7b2c15a507020d4d,
6174                fidl::encoding::DynamicFlags::empty(),
6175                _decode,
6176            )
6177    }
6178
6179    type SetEthernetStatusResponseFut =
6180        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6181    fn r#set_ethernet_status(&self, mut status: u32) -> Self::SetEthernetStatusResponseFut {
6182        fn _decode(
6183            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6184        ) -> Result<(), fidl::Error> {
6185            let _response = fidl::client::decode_transaction_body::<
6186                fidl::encoding::EmptyPayload,
6187                fidl::encoding::DefaultFuchsiaResourceDialect,
6188                0x412503cb3aaa350b,
6189            >(_buf?)?;
6190            Ok(_response)
6191        }
6192        self.client.send_query_and_decode::<WlanSoftmacBridgeSetEthernetStatusRequest, ()>(
6193            (status,),
6194            0x412503cb3aaa350b,
6195            fidl::encoding::DynamicFlags::empty(),
6196            _decode,
6197        )
6198    }
6199}
6200
6201pub struct WlanSoftmacBridgeEventStream {
6202    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6203}
6204
6205impl std::marker::Unpin for WlanSoftmacBridgeEventStream {}
6206
6207impl futures::stream::FusedStream for WlanSoftmacBridgeEventStream {
6208    fn is_terminated(&self) -> bool {
6209        self.event_receiver.is_terminated()
6210    }
6211}
6212
6213impl futures::Stream for WlanSoftmacBridgeEventStream {
6214    type Item = Result<WlanSoftmacBridgeEvent, fidl::Error>;
6215
6216    fn poll_next(
6217        mut self: std::pin::Pin<&mut Self>,
6218        cx: &mut std::task::Context<'_>,
6219    ) -> std::task::Poll<Option<Self::Item>> {
6220        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6221            &mut self.event_receiver,
6222            cx
6223        )?) {
6224            Some(buf) => std::task::Poll::Ready(Some(WlanSoftmacBridgeEvent::decode(buf))),
6225            None => std::task::Poll::Ready(None),
6226        }
6227    }
6228}
6229
6230#[derive(Debug)]
6231pub enum WlanSoftmacBridgeEvent {
6232    #[non_exhaustive]
6233    _UnknownEvent {
6234        /// Ordinal of the event that was sent.
6235        ordinal: u64,
6236    },
6237}
6238
6239impl WlanSoftmacBridgeEvent {
6240    /// Decodes a message buffer as a [`WlanSoftmacBridgeEvent`].
6241    fn decode(
6242        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6243    ) -> Result<WlanSoftmacBridgeEvent, fidl::Error> {
6244        let (bytes, _handles) = buf.split_mut();
6245        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6246        debug_assert_eq!(tx_header.tx_id, 0);
6247        match tx_header.ordinal {
6248            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6249                Ok(WlanSoftmacBridgeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6250            }
6251            _ => Err(fidl::Error::UnknownOrdinal {
6252                ordinal: tx_header.ordinal,
6253                protocol_name:
6254                    <WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6255            }),
6256        }
6257    }
6258}
6259
6260/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanSoftmacBridge.
6261pub struct WlanSoftmacBridgeRequestStream {
6262    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6263    is_terminated: bool,
6264}
6265
6266impl std::marker::Unpin for WlanSoftmacBridgeRequestStream {}
6267
6268impl futures::stream::FusedStream for WlanSoftmacBridgeRequestStream {
6269    fn is_terminated(&self) -> bool {
6270        self.is_terminated
6271    }
6272}
6273
6274impl fidl::endpoints::RequestStream for WlanSoftmacBridgeRequestStream {
6275    type Protocol = WlanSoftmacBridgeMarker;
6276    type ControlHandle = WlanSoftmacBridgeControlHandle;
6277
6278    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6279        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6280    }
6281
6282    fn control_handle(&self) -> Self::ControlHandle {
6283        WlanSoftmacBridgeControlHandle { inner: self.inner.clone() }
6284    }
6285
6286    fn into_inner(
6287        self,
6288    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6289    {
6290        (self.inner, self.is_terminated)
6291    }
6292
6293    fn from_inner(
6294        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6295        is_terminated: bool,
6296    ) -> Self {
6297        Self { inner, is_terminated }
6298    }
6299}
6300
6301impl futures::Stream for WlanSoftmacBridgeRequestStream {
6302    type Item = Result<WlanSoftmacBridgeRequest, fidl::Error>;
6303
6304    fn poll_next(
6305        mut self: std::pin::Pin<&mut Self>,
6306        cx: &mut std::task::Context<'_>,
6307    ) -> std::task::Poll<Option<Self::Item>> {
6308        let this = &mut *self;
6309        if this.inner.check_shutdown(cx) {
6310            this.is_terminated = true;
6311            return std::task::Poll::Ready(None);
6312        }
6313        if this.is_terminated {
6314            panic!("polled WlanSoftmacBridgeRequestStream after completion");
6315        }
6316        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6317            |bytes, handles| {
6318                match this.inner.channel().read_etc(cx, bytes, handles) {
6319                    std::task::Poll::Ready(Ok(())) => {}
6320                    std::task::Poll::Pending => return std::task::Poll::Pending,
6321                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6322                        this.is_terminated = true;
6323                        return std::task::Poll::Ready(None);
6324                    }
6325                    std::task::Poll::Ready(Err(e)) => {
6326                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6327                            e.into(),
6328                        ))));
6329                    }
6330                }
6331
6332                // A message has been received from the channel
6333                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6334
6335                std::task::Poll::Ready(Some(match header.ordinal {
6336                    0x18231a638e508f9d => {
6337                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6338                        let mut req = fidl::new_empty!(
6339                            fidl::encoding::EmptyPayload,
6340                            fidl::encoding::DefaultFuchsiaResourceDialect
6341                        );
6342                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6343                        let control_handle =
6344                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6345                        Ok(WlanSoftmacBridgeRequest::Query {
6346                            responder: WlanSoftmacBridgeQueryResponder {
6347                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6348                                tx_id: header.tx_id,
6349                            },
6350                        })
6351                    }
6352                    0x16797affc0cb58ae => {
6353                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6354                        let mut req = fidl::new_empty!(
6355                            fidl::encoding::EmptyPayload,
6356                            fidl::encoding::DefaultFuchsiaResourceDialect
6357                        );
6358                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6359                        let control_handle =
6360                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6361                        Ok(WlanSoftmacBridgeRequest::QueryDiscoverySupport {
6362                            responder: WlanSoftmacBridgeQueryDiscoverySupportResponder {
6363                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6364                                tx_id: header.tx_id,
6365                            },
6366                        })
6367                    }
6368                    0x7302c3f8c131f075 => {
6369                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6370                        let mut req = fidl::new_empty!(
6371                            fidl::encoding::EmptyPayload,
6372                            fidl::encoding::DefaultFuchsiaResourceDialect
6373                        );
6374                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6375                        let control_handle =
6376                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6377                        Ok(WlanSoftmacBridgeRequest::QueryMacSublayerSupport {
6378                            responder: WlanSoftmacBridgeQueryMacSublayerSupportResponder {
6379                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6380                                tx_id: header.tx_id,
6381                            },
6382                        })
6383                    }
6384                    0x3691bb75abf6354 => {
6385                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6386                        let mut req = fidl::new_empty!(
6387                            fidl::encoding::EmptyPayload,
6388                            fidl::encoding::DefaultFuchsiaResourceDialect
6389                        );
6390                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6391                        let control_handle =
6392                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6393                        Ok(WlanSoftmacBridgeRequest::QuerySecuritySupport {
6394                            responder: WlanSoftmacBridgeQuerySecuritySupportResponder {
6395                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6396                                tx_id: header.tx_id,
6397                            },
6398                        })
6399                    }
6400                    0x347d78dc1d4d27bf => {
6401                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6402                        let mut req = fidl::new_empty!(
6403                            fidl::encoding::EmptyPayload,
6404                            fidl::encoding::DefaultFuchsiaResourceDialect
6405                        );
6406                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6407                        let control_handle =
6408                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6409                        Ok(WlanSoftmacBridgeRequest::QuerySpectrumManagementSupport {
6410                            responder: WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
6411                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6412                                tx_id: header.tx_id,
6413                            },
6414                        })
6415                    }
6416                    0x12836b533cd63ece => {
6417                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6418                        let mut req = fidl::new_empty!(
6419                            WlanSoftmacBaseSetChannelRequest,
6420                            fidl::encoding::DefaultFuchsiaResourceDialect
6421                        );
6422                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseSetChannelRequest>(&header, _body_bytes, handles, &mut req)?;
6423                        let control_handle =
6424                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6425                        Ok(WlanSoftmacBridgeRequest::SetChannel {
6426                            payload: req,
6427                            responder: WlanSoftmacBridgeSetChannelResponder {
6428                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6429                                tx_id: header.tx_id,
6430                            },
6431                        })
6432                    }
6433                    0x1336fb5455b77a6e => {
6434                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6435                        let mut req = fidl::new_empty!(
6436                            WlanSoftmacBaseJoinBssRequest,
6437                            fidl::encoding::DefaultFuchsiaResourceDialect
6438                        );
6439                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseJoinBssRequest>(&header, _body_bytes, handles, &mut req)?;
6440                        let control_handle =
6441                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6442                        Ok(WlanSoftmacBridgeRequest::JoinBss {
6443                            join_request: req.join_request,
6444
6445                            responder: WlanSoftmacBridgeJoinBssResponder {
6446                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6447                                tx_id: header.tx_id,
6448                            },
6449                        })
6450                    }
6451                    0x6c35807632c64576 => {
6452                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6453                        let mut req = fidl::new_empty!(
6454                            WlanSoftmacBaseEnableBeaconingRequest,
6455                            fidl::encoding::DefaultFuchsiaResourceDialect
6456                        );
6457                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseEnableBeaconingRequest>(&header, _body_bytes, handles, &mut req)?;
6458                        let control_handle =
6459                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6460                        Ok(WlanSoftmacBridgeRequest::EnableBeaconing {
6461                            payload: req,
6462                            responder: WlanSoftmacBridgeEnableBeaconingResponder {
6463                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6464                                tx_id: header.tx_id,
6465                            },
6466                        })
6467                    }
6468                    0x3303b30f99dbb406 => {
6469                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6470                        let mut req = fidl::new_empty!(
6471                            fidl::encoding::EmptyPayload,
6472                            fidl::encoding::DefaultFuchsiaResourceDialect
6473                        );
6474                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6475                        let control_handle =
6476                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6477                        Ok(WlanSoftmacBridgeRequest::DisableBeaconing {
6478                            responder: WlanSoftmacBridgeDisableBeaconingResponder {
6479                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6480                                tx_id: header.tx_id,
6481                            },
6482                        })
6483                    }
6484                    0x7decf9b4200b9131 => {
6485                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6486                        let mut req = fidl::new_empty!(
6487                            WlanKeyConfiguration,
6488                            fidl::encoding::DefaultFuchsiaResourceDialect
6489                        );
6490                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanKeyConfiguration>(&header, _body_bytes, handles, &mut req)?;
6491                        let control_handle =
6492                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6493                        Ok(WlanSoftmacBridgeRequest::InstallKey {
6494                            payload: req,
6495                            responder: WlanSoftmacBridgeInstallKeyResponder {
6496                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6497                                tx_id: header.tx_id,
6498                            },
6499                        })
6500                    }
6501                    0x436ffe3ba461d6cd => {
6502                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6503                        let mut req = fidl::new_empty!(
6504                            WlanSoftmacBaseNotifyAssociationCompleteRequest,
6505                            fidl::encoding::DefaultFuchsiaResourceDialect
6506                        );
6507                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
6508                        let control_handle =
6509                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6510                        Ok(WlanSoftmacBridgeRequest::NotifyAssociationComplete {
6511                            assoc_cfg: req.assoc_cfg,
6512
6513                            responder: WlanSoftmacBridgeNotifyAssociationCompleteResponder {
6514                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6515                                tx_id: header.tx_id,
6516                            },
6517                        })
6518                    }
6519                    0x581d76c39190a7dd => {
6520                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6521                        let mut req = fidl::new_empty!(
6522                            WlanSoftmacBaseClearAssociationRequest,
6523                            fidl::encoding::DefaultFuchsiaResourceDialect
6524                        );
6525                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseClearAssociationRequest>(&header, _body_bytes, handles, &mut req)?;
6526                        let control_handle =
6527                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6528                        Ok(WlanSoftmacBridgeRequest::ClearAssociation {
6529                            payload: req,
6530                            responder: WlanSoftmacBridgeClearAssociationResponder {
6531                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6532                                tx_id: header.tx_id,
6533                            },
6534                        })
6535                    }
6536                    0x5662f989cb4083bb => {
6537                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6538                        let mut req = fidl::new_empty!(
6539                            WlanSoftmacBaseStartPassiveScanRequest,
6540                            fidl::encoding::DefaultFuchsiaResourceDialect
6541                        );
6542                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseStartPassiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
6543                        let control_handle =
6544                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6545                        Ok(WlanSoftmacBridgeRequest::StartPassiveScan {
6546                            payload: req,
6547                            responder: WlanSoftmacBridgeStartPassiveScanResponder {
6548                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6549                                tx_id: header.tx_id,
6550                            },
6551                        })
6552                    }
6553                    0x4896eafa9937751e => {
6554                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6555                        let mut req = fidl::new_empty!(
6556                            WlanSoftmacStartActiveScanRequest,
6557                            fidl::encoding::DefaultFuchsiaResourceDialect
6558                        );
6559                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacStartActiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
6560                        let control_handle =
6561                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6562                        Ok(WlanSoftmacBridgeRequest::StartActiveScan {
6563                            payload: req,
6564                            responder: WlanSoftmacBridgeStartActiveScanResponder {
6565                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6566                                tx_id: header.tx_id,
6567                            },
6568                        })
6569                    }
6570                    0xf7d859369764556 => {
6571                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6572                        let mut req = fidl::new_empty!(
6573                            WlanSoftmacBaseCancelScanRequest,
6574                            fidl::encoding::DefaultFuchsiaResourceDialect
6575                        );
6576                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseCancelScanRequest>(&header, _body_bytes, handles, &mut req)?;
6577                        let control_handle =
6578                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6579                        Ok(WlanSoftmacBridgeRequest::CancelScan {
6580                            payload: req,
6581                            responder: WlanSoftmacBridgeCancelScanResponder {
6582                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6583                                tx_id: header.tx_id,
6584                            },
6585                        })
6586                    }
6587                    0x68522c7122d5f78c => {
6588                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6589                        let mut req = fidl::new_empty!(
6590                            WlanSoftmacBaseUpdateWmmParametersRequest,
6591                            fidl::encoding::DefaultFuchsiaResourceDialect
6592                        );
6593                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseUpdateWmmParametersRequest>(&header, _body_bytes, handles, &mut req)?;
6594                        let control_handle =
6595                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6596                        Ok(WlanSoftmacBridgeRequest::UpdateWmmParameters {
6597                            payload: req,
6598                            responder: WlanSoftmacBridgeUpdateWmmParametersResponder {
6599                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6600                                tx_id: header.tx_id,
6601                            },
6602                        })
6603                    }
6604                    0x7b2c15a507020d4d => {
6605                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6606                        let mut req = fidl::new_empty!(
6607                            WlanSoftmacBridgeStartRequest,
6608                            fidl::encoding::DefaultFuchsiaResourceDialect
6609                        );
6610                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBridgeStartRequest>(&header, _body_bytes, handles, &mut req)?;
6611                        let control_handle =
6612                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6613                        Ok(WlanSoftmacBridgeRequest::Start {
6614                            ifc_bridge: req.ifc_bridge,
6615                            ethernet_tx: req.ethernet_tx,
6616                            wlan_rx: req.wlan_rx,
6617
6618                            responder: WlanSoftmacBridgeStartResponder {
6619                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6620                                tx_id: header.tx_id,
6621                            },
6622                        })
6623                    }
6624                    0x412503cb3aaa350b => {
6625                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6626                        let mut req = fidl::new_empty!(
6627                            WlanSoftmacBridgeSetEthernetStatusRequest,
6628                            fidl::encoding::DefaultFuchsiaResourceDialect
6629                        );
6630                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBridgeSetEthernetStatusRequest>(&header, _body_bytes, handles, &mut req)?;
6631                        let control_handle =
6632                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6633                        Ok(WlanSoftmacBridgeRequest::SetEthernetStatus {
6634                            status: req.status,
6635
6636                            responder: WlanSoftmacBridgeSetEthernetStatusResponder {
6637                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6638                                tx_id: header.tx_id,
6639                            },
6640                        })
6641                    }
6642                    _ if header.tx_id == 0
6643                        && header
6644                            .dynamic_flags()
6645                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6646                    {
6647                        Ok(WlanSoftmacBridgeRequest::_UnknownMethod {
6648                            ordinal: header.ordinal,
6649                            control_handle: WlanSoftmacBridgeControlHandle {
6650                                inner: this.inner.clone(),
6651                            },
6652                            method_type: fidl::MethodType::OneWay,
6653                        })
6654                    }
6655                    _ if header
6656                        .dynamic_flags()
6657                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6658                    {
6659                        this.inner.send_framework_err(
6660                            fidl::encoding::FrameworkErr::UnknownMethod,
6661                            header.tx_id,
6662                            header.ordinal,
6663                            header.dynamic_flags(),
6664                            (bytes, handles),
6665                        )?;
6666                        Ok(WlanSoftmacBridgeRequest::_UnknownMethod {
6667                            ordinal: header.ordinal,
6668                            control_handle: WlanSoftmacBridgeControlHandle {
6669                                inner: this.inner.clone(),
6670                            },
6671                            method_type: fidl::MethodType::TwoWay,
6672                        })
6673                    }
6674                    _ => Err(fidl::Error::UnknownOrdinal {
6675                        ordinal: header.ordinal,
6676                        protocol_name:
6677                            <WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6678                    }),
6679                }))
6680            },
6681        )
6682    }
6683}
6684
6685/// `WlanSoftmacBridge` is the protocol the `wlansoftmac` driver serves
6686/// to the bridged driver. This protocol **should not** be implemented
6687/// by a vendor driver.
6688#[derive(Debug)]
6689pub enum WlanSoftmacBridgeRequest {
6690    /// Gets general information about the device and its supported features.
6691    /// This method is safe to call even when the SoftMAC has not yet started.
6692    ///
6693    /// Note: The implementation of this method must not depend on a response
6694    /// from an ethernet driver, otherwise there is a risk of deadlock.
6695    /// The wlansoftmac driver calls this method synchronously while
6696    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
6697    Query { responder: WlanSoftmacBridgeQueryResponder },
6698    /// Gets information about the station discovery (e.g., scanning and
6699    /// probing) features supported by the device. This method is safe to call
6700    /// even when the SoftMAC has not yet started.
6701    QueryDiscoverySupport { responder: WlanSoftmacBridgeQueryDiscoverySupportResponder },
6702    /// Gets information about the MAC features supported by the device. This
6703    /// method is safe to call even when the SoftMAC has not yet started.
6704    ///
6705    /// Note: The implementation of this method must not depend on a response
6706    /// from an ethernet driver, otherwise there is a risk of deadlock.
6707    /// The wlansoftmac driver calls this method synchronously while
6708    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
6709    QueryMacSublayerSupport { responder: WlanSoftmacBridgeQueryMacSublayerSupportResponder },
6710    /// Gets information about the security features supported by the device.
6711    /// This method is safe to call even when the SoftMAC has not yet started.
6712    QuerySecuritySupport { responder: WlanSoftmacBridgeQuerySecuritySupportResponder },
6713    /// Gets information about the spectrum usage (e.g., DFS) features supported
6714    /// by the device. This method is safe to call even when the SoftMAC has not
6715    /// yet started.
6716    QuerySpectrumManagementSupport {
6717        responder: WlanSoftmacBridgeQuerySpectrumManagementSupportResponder,
6718    },
6719    /// Set the primary radio channel, e.g. in response to a channel switch event.
6720    /// If successful, this will trigger the channel switch immediately. This may
6721    /// impact the transmission of any frames that are in-flight, and might also
6722    /// interfere with an ongoing scan request.
6723    ///
6724    /// Common errors include: \
6725    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
6726    SetChannel {
6727        payload: WlanSoftmacBaseSetChannelRequest,
6728        responder: WlanSoftmacBridgeSetChannelResponder,
6729    },
6730    /// Join a specific BSS in which we will participate.
6731    /// This applies regardless of if we are hosting the BSS or joining it
6732    /// (indicated by the `remote` flag in `JoinBssRequest`).
6733    /// If successful, the device will switch to the correct channel and perform
6734    /// any internal filtering/timing operations required to join the BSS.
6735    /// For client STAs, this is the first step before authenticating.
6736    ///
6737    /// Common errors include: \
6738    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
6739    JoinBss {
6740        join_request: fidl_fuchsia_wlan_common::JoinBssRequest,
6741        responder: WlanSoftmacBridgeJoinBssResponder,
6742    },
6743    /// Enables hardware Beaconing.
6744    ///
6745    /// This method cannot be called while beaconing is enabled and so
6746    /// `DisableBeaconing` must be called prior to this method if beaconing is
6747    /// enabled.
6748    ///
6749    /// All request fields are required.
6750    ///
6751    /// Common errors include:
6752    ///
6753    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
6754    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
6755    ///                          beacon.
6756    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
6757    EnableBeaconing {
6758        payload: WlanSoftmacBaseEnableBeaconingRequest,
6759        responder: WlanSoftmacBridgeEnableBeaconingResponder,
6760    },
6761    /// Disables hardware beaconing.
6762    DisableBeaconing { responder: WlanSoftmacBridgeDisableBeaconingResponder },
6763    /// Install a key for encryption when transmitting or receiving protected
6764    /// frames.
6765    ///
6766    /// Common errors include:
6767    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
6768    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
6769    InstallKey { payload: WlanKeyConfiguration, responder: WlanSoftmacBridgeInstallKeyResponder },
6770    /// Notifies the device of a successful association and configures
6771    /// additional parameters necessary to participate in that association.
6772    ///
6773    /// # Errors
6774    ///
6775    /// Common errors include:
6776    ///
6777    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
6778    ///                       via `WlanSoftmac.JoinBss`.
6779    NotifyAssociationComplete {
6780        assoc_cfg: WlanAssociationConfig,
6781        responder: WlanSoftmacBridgeNotifyAssociationCompleteResponder,
6782    },
6783    /// Notifies MAC and PHY that the peer has been de-associated.
6784    ClearAssociation {
6785        payload: WlanSoftmacBaseClearAssociationRequest,
6786        responder: WlanSoftmacBridgeClearAssociationResponder,
6787    },
6788    /// Starts a passive scan. The server will deliver scan results
6789    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
6790    /// the server will call WlanSoftmacIfc.ScanComplete() with the
6791    /// same `scan_id` returned by StartPassiveScan().
6792    ///
6793    /// The server indicates support for `StartPassiveScan()` using
6794    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
6795    ///
6796    /// Common errors include:
6797    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
6798    ///       requested scan, e.g. because an incompatible channel was requested.
6799    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
6800    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
6801    StartPassiveScan {
6802        payload: WlanSoftmacBaseStartPassiveScanRequest,
6803        responder: WlanSoftmacBridgeStartPassiveScanResponder,
6804    },
6805    /// Starts an active scan. The server will deliver scan results
6806    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
6807    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
6808    /// with the same `scan_id` returned by StartActiveScan().
6809    ///
6810    /// A device driver indicates support for `StartActiveScan()` using
6811    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
6812    ///
6813    /// Common errors include:
6814    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
6815    ///       requested scan, e.g. because an incompatible channel was requested.
6816    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
6817    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
6818    StartActiveScan {
6819        payload: WlanSoftmacStartActiveScanRequest,
6820        responder: WlanSoftmacBridgeStartActiveScanResponder,
6821    },
6822    /// Cancels the ongoing scan corresponding to `scan_id`,
6823    /// where `scan_id` is an identifier returned by
6824    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
6825    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
6826    /// `scan_id`.
6827    ///
6828    /// A device driver indicates support for `CancelScan()` using
6829    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
6830    ///
6831    /// Common errors include:
6832    ///
6833    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
6834    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
6835    CancelScan {
6836        payload: WlanSoftmacBaseCancelScanRequest,
6837        responder: WlanSoftmacBridgeCancelScanResponder,
6838    },
6839    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
6840    /// particular access category (AC).
6841    UpdateWmmParameters {
6842        payload: WlanSoftmacBaseUpdateWmmParametersRequest,
6843        responder: WlanSoftmacBridgeUpdateWmmParametersResponder,
6844    },
6845    /// Signal to the server that the MLME for the iface is ready to send and receive
6846    /// frames.
6847    ///
6848    /// The client provides the following arguments:
6849    ///
6850    ///   - `ifc_bridge`: The client end of a `WlanSoftmacIfcBridge` server which the
6851    ///     `wlansoftmac` driver will use to forward `WlanSoftmacIfc` events to
6852    ///     the bridged driver.
6853    ///   - `ethernet_tx`: A `ethernet_tx_t*` casted to a `uint64`. The
6854    ///     `ethernet_tx_t` is defined in
6855    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
6856    ///   - `wlan_rx`: A `wlan_rx_t*` casted to a `uint64`. The
6857    ///     `wlan_rx_t` is defined in
6858    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
6859    ///
6860    /// The server must copy the contents of `ethernet_tx_t` and `wlan_rx_t` before
6861    /// returning from this method. The lifetimes of `ethernet_tx_t*` and `wlan_rx_t*` are only as
6862    /// long as this method call, but the contents of `ethernet_tx_t` and `wlan_rx_t` will
6863    /// live until the server stops the MLME.
6864    ///
6865    /// The server returns a server end of a `fuchsia.wlan.mlme/MLME` protocol. The SME
6866    /// for the iface owns the client end. Thus, this channel is used for SME <-> MLME
6867    /// communication.
6868    ///
6869    /// The `WlanSoftmacBridge.Start` method is different from `WlanSoftmac.Start`
6870    /// for two reasons. First, Rust bindings do not exist for Driver transported
6871    /// protocols, so `WlanSoftmacIfcBridge` protocol must be Zircon transported to be
6872    /// usable by the bridged driver. Second, the Zircon transport adds
6873    /// significant latency compared to the Driver transport. As a result, the
6874    /// `ethernet_tx` and `wlan_rx` arguments provide an FFI for the wlansoftmac driver
6875    /// to send Ethernet and receive WLAN packets to the bridged driver with
6876    /// latency comparable or better than a Driver transported protocol.
6877    ///
6878    /// Except where noted, `WlanSoftmacBridge` methods must only be called after
6879    /// a successful call to `WlanSoftmacBridge.Start`.
6880    ///
6881    /// Common errors include:
6882    ///
6883    ///   - `ZX_ERR_ALREADY_BOUND`: `Start` was already called on this softmac.
6884    Start {
6885        ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
6886        ethernet_tx: u64,
6887        wlan_rx: u64,
6888        responder: WlanSoftmacBridgeStartResponder,
6889    },
6890    /// Forwards a status containing `ETHERNET_STATUS_*` flags to the
6891    /// `fuchsia.hardware.ethernet/EthernetImplIfc` proxy owned by
6892    /// the C++ portion of wlansoftmac.
6893    ///
6894    /// As documented, the value of `status` is set by bits defined in
6895    /// `ETHERNET_STATUS_*` flags. However, there is only one flag named
6896    /// `ETHERNET_STATUS_ONLINE` and no specification of for the meaning
6897    /// of specifying no flags. In practice, `0x1` means the status is up,
6898    /// and `0x0` means the status is down.
6899    ///
6900    /// While this method should belong in something like an
6901    /// "`EthernetImplIfcBridge` protocol", it's included in the
6902    /// `WlanSoftmacBridge` protocol as a convenience. The wlansoftmac driver
6903    /// will eventually cease using a `fuchsia.hardware.ethernet/EthernetImplIfc`
6904    /// proxy and use a `fuchsia.hardware.network.driver/NetworkDeviceIfc`
6905    /// proxy instead. At that time, an equivalent of this method should be
6906    /// refactored into a separate bridge.
6907    SetEthernetStatus { status: u32, responder: WlanSoftmacBridgeSetEthernetStatusResponder },
6908    /// An interaction was received which does not match any known method.
6909    #[non_exhaustive]
6910    _UnknownMethod {
6911        /// Ordinal of the method that was called.
6912        ordinal: u64,
6913        control_handle: WlanSoftmacBridgeControlHandle,
6914        method_type: fidl::MethodType,
6915    },
6916}
6917
6918impl WlanSoftmacBridgeRequest {
6919    #[allow(irrefutable_let_patterns)]
6920    pub fn into_query(self) -> Option<(WlanSoftmacBridgeQueryResponder)> {
6921        if let WlanSoftmacBridgeRequest::Query { responder } = self {
6922            Some((responder))
6923        } else {
6924            None
6925        }
6926    }
6927
6928    #[allow(irrefutable_let_patterns)]
6929    pub fn into_query_discovery_support(
6930        self,
6931    ) -> Option<(WlanSoftmacBridgeQueryDiscoverySupportResponder)> {
6932        if let WlanSoftmacBridgeRequest::QueryDiscoverySupport { responder } = self {
6933            Some((responder))
6934        } else {
6935            None
6936        }
6937    }
6938
6939    #[allow(irrefutable_let_patterns)]
6940    pub fn into_query_mac_sublayer_support(
6941        self,
6942    ) -> Option<(WlanSoftmacBridgeQueryMacSublayerSupportResponder)> {
6943        if let WlanSoftmacBridgeRequest::QueryMacSublayerSupport { responder } = self {
6944            Some((responder))
6945        } else {
6946            None
6947        }
6948    }
6949
6950    #[allow(irrefutable_let_patterns)]
6951    pub fn into_query_security_support(
6952        self,
6953    ) -> Option<(WlanSoftmacBridgeQuerySecuritySupportResponder)> {
6954        if let WlanSoftmacBridgeRequest::QuerySecuritySupport { responder } = self {
6955            Some((responder))
6956        } else {
6957            None
6958        }
6959    }
6960
6961    #[allow(irrefutable_let_patterns)]
6962    pub fn into_query_spectrum_management_support(
6963        self,
6964    ) -> Option<(WlanSoftmacBridgeQuerySpectrumManagementSupportResponder)> {
6965        if let WlanSoftmacBridgeRequest::QuerySpectrumManagementSupport { responder } = self {
6966            Some((responder))
6967        } else {
6968            None
6969        }
6970    }
6971
6972    #[allow(irrefutable_let_patterns)]
6973    pub fn into_set_channel(
6974        self,
6975    ) -> Option<(WlanSoftmacBaseSetChannelRequest, WlanSoftmacBridgeSetChannelResponder)> {
6976        if let WlanSoftmacBridgeRequest::SetChannel { payload, responder } = self {
6977            Some((payload, responder))
6978        } else {
6979            None
6980        }
6981    }
6982
6983    #[allow(irrefutable_let_patterns)]
6984    pub fn into_join_bss(
6985        self,
6986    ) -> Option<(fidl_fuchsia_wlan_common::JoinBssRequest, WlanSoftmacBridgeJoinBssResponder)> {
6987        if let WlanSoftmacBridgeRequest::JoinBss { join_request, responder } = self {
6988            Some((join_request, responder))
6989        } else {
6990            None
6991        }
6992    }
6993
6994    #[allow(irrefutable_let_patterns)]
6995    pub fn into_enable_beaconing(
6996        self,
6997    ) -> Option<(WlanSoftmacBaseEnableBeaconingRequest, WlanSoftmacBridgeEnableBeaconingResponder)>
6998    {
6999        if let WlanSoftmacBridgeRequest::EnableBeaconing { payload, responder } = self {
7000            Some((payload, responder))
7001        } else {
7002            None
7003        }
7004    }
7005
7006    #[allow(irrefutable_let_patterns)]
7007    pub fn into_disable_beaconing(self) -> Option<(WlanSoftmacBridgeDisableBeaconingResponder)> {
7008        if let WlanSoftmacBridgeRequest::DisableBeaconing { responder } = self {
7009            Some((responder))
7010        } else {
7011            None
7012        }
7013    }
7014
7015    #[allow(irrefutable_let_patterns)]
7016    pub fn into_install_key(
7017        self,
7018    ) -> Option<(WlanKeyConfiguration, WlanSoftmacBridgeInstallKeyResponder)> {
7019        if let WlanSoftmacBridgeRequest::InstallKey { payload, responder } = self {
7020            Some((payload, responder))
7021        } else {
7022            None
7023        }
7024    }
7025
7026    #[allow(irrefutable_let_patterns)]
7027    pub fn into_notify_association_complete(
7028        self,
7029    ) -> Option<(WlanAssociationConfig, WlanSoftmacBridgeNotifyAssociationCompleteResponder)> {
7030        if let WlanSoftmacBridgeRequest::NotifyAssociationComplete { assoc_cfg, responder } = self {
7031            Some((assoc_cfg, responder))
7032        } else {
7033            None
7034        }
7035    }
7036
7037    #[allow(irrefutable_let_patterns)]
7038    pub fn into_clear_association(
7039        self,
7040    ) -> Option<(WlanSoftmacBaseClearAssociationRequest, WlanSoftmacBridgeClearAssociationResponder)>
7041    {
7042        if let WlanSoftmacBridgeRequest::ClearAssociation { payload, responder } = self {
7043            Some((payload, responder))
7044        } else {
7045            None
7046        }
7047    }
7048
7049    #[allow(irrefutable_let_patterns)]
7050    pub fn into_start_passive_scan(
7051        self,
7052    ) -> Option<(WlanSoftmacBaseStartPassiveScanRequest, WlanSoftmacBridgeStartPassiveScanResponder)>
7053    {
7054        if let WlanSoftmacBridgeRequest::StartPassiveScan { payload, responder } = self {
7055            Some((payload, responder))
7056        } else {
7057            None
7058        }
7059    }
7060
7061    #[allow(irrefutable_let_patterns)]
7062    pub fn into_start_active_scan(
7063        self,
7064    ) -> Option<(WlanSoftmacStartActiveScanRequest, WlanSoftmacBridgeStartActiveScanResponder)>
7065    {
7066        if let WlanSoftmacBridgeRequest::StartActiveScan { payload, responder } = self {
7067            Some((payload, responder))
7068        } else {
7069            None
7070        }
7071    }
7072
7073    #[allow(irrefutable_let_patterns)]
7074    pub fn into_cancel_scan(
7075        self,
7076    ) -> Option<(WlanSoftmacBaseCancelScanRequest, WlanSoftmacBridgeCancelScanResponder)> {
7077        if let WlanSoftmacBridgeRequest::CancelScan { payload, responder } = self {
7078            Some((payload, responder))
7079        } else {
7080            None
7081        }
7082    }
7083
7084    #[allow(irrefutable_let_patterns)]
7085    pub fn into_update_wmm_parameters(
7086        self,
7087    ) -> Option<(
7088        WlanSoftmacBaseUpdateWmmParametersRequest,
7089        WlanSoftmacBridgeUpdateWmmParametersResponder,
7090    )> {
7091        if let WlanSoftmacBridgeRequest::UpdateWmmParameters { payload, responder } = self {
7092            Some((payload, responder))
7093        } else {
7094            None
7095        }
7096    }
7097
7098    #[allow(irrefutable_let_patterns)]
7099    pub fn into_start(
7100        self,
7101    ) -> Option<(
7102        fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
7103        u64,
7104        u64,
7105        WlanSoftmacBridgeStartResponder,
7106    )> {
7107        if let WlanSoftmacBridgeRequest::Start { ifc_bridge, ethernet_tx, wlan_rx, responder } =
7108            self
7109        {
7110            Some((ifc_bridge, ethernet_tx, wlan_rx, responder))
7111        } else {
7112            None
7113        }
7114    }
7115
7116    #[allow(irrefutable_let_patterns)]
7117    pub fn into_set_ethernet_status(
7118        self,
7119    ) -> Option<(u32, WlanSoftmacBridgeSetEthernetStatusResponder)> {
7120        if let WlanSoftmacBridgeRequest::SetEthernetStatus { status, responder } = self {
7121            Some((status, responder))
7122        } else {
7123            None
7124        }
7125    }
7126
7127    /// Name of the method defined in FIDL
7128    pub fn method_name(&self) -> &'static str {
7129        match *self {
7130            WlanSoftmacBridgeRequest::Query { .. } => "query",
7131            WlanSoftmacBridgeRequest::QueryDiscoverySupport { .. } => "query_discovery_support",
7132            WlanSoftmacBridgeRequest::QueryMacSublayerSupport { .. } => {
7133                "query_mac_sublayer_support"
7134            }
7135            WlanSoftmacBridgeRequest::QuerySecuritySupport { .. } => "query_security_support",
7136            WlanSoftmacBridgeRequest::QuerySpectrumManagementSupport { .. } => {
7137                "query_spectrum_management_support"
7138            }
7139            WlanSoftmacBridgeRequest::SetChannel { .. } => "set_channel",
7140            WlanSoftmacBridgeRequest::JoinBss { .. } => "join_bss",
7141            WlanSoftmacBridgeRequest::EnableBeaconing { .. } => "enable_beaconing",
7142            WlanSoftmacBridgeRequest::DisableBeaconing { .. } => "disable_beaconing",
7143            WlanSoftmacBridgeRequest::InstallKey { .. } => "install_key",
7144            WlanSoftmacBridgeRequest::NotifyAssociationComplete { .. } => {
7145                "notify_association_complete"
7146            }
7147            WlanSoftmacBridgeRequest::ClearAssociation { .. } => "clear_association",
7148            WlanSoftmacBridgeRequest::StartPassiveScan { .. } => "start_passive_scan",
7149            WlanSoftmacBridgeRequest::StartActiveScan { .. } => "start_active_scan",
7150            WlanSoftmacBridgeRequest::CancelScan { .. } => "cancel_scan",
7151            WlanSoftmacBridgeRequest::UpdateWmmParameters { .. } => "update_wmm_parameters",
7152            WlanSoftmacBridgeRequest::Start { .. } => "start",
7153            WlanSoftmacBridgeRequest::SetEthernetStatus { .. } => "set_ethernet_status",
7154            WlanSoftmacBridgeRequest::_UnknownMethod {
7155                method_type: fidl::MethodType::OneWay,
7156                ..
7157            } => "unknown one-way method",
7158            WlanSoftmacBridgeRequest::_UnknownMethod {
7159                method_type: fidl::MethodType::TwoWay,
7160                ..
7161            } => "unknown two-way method",
7162        }
7163    }
7164}
7165
7166#[derive(Debug, Clone)]
7167pub struct WlanSoftmacBridgeControlHandle {
7168    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7169}
7170
7171impl fidl::endpoints::ControlHandle for WlanSoftmacBridgeControlHandle {
7172    fn shutdown(&self) {
7173        self.inner.shutdown()
7174    }
7175
7176    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7177        self.inner.shutdown_with_epitaph(status)
7178    }
7179
7180    fn is_closed(&self) -> bool {
7181        self.inner.channel().is_closed()
7182    }
7183    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7184        self.inner.channel().on_closed()
7185    }
7186
7187    #[cfg(target_os = "fuchsia")]
7188    fn signal_peer(
7189        &self,
7190        clear_mask: zx::Signals,
7191        set_mask: zx::Signals,
7192    ) -> Result<(), zx_status::Status> {
7193        use fidl::Peered;
7194        self.inner.channel().signal_peer(clear_mask, set_mask)
7195    }
7196}
7197
7198impl WlanSoftmacBridgeControlHandle {}
7199
7200#[must_use = "FIDL methods require a response to be sent"]
7201#[derive(Debug)]
7202pub struct WlanSoftmacBridgeQueryResponder {
7203    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7204    tx_id: u32,
7205}
7206
7207/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7208/// if the responder is dropped without sending a response, so that the client
7209/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7210impl std::ops::Drop for WlanSoftmacBridgeQueryResponder {
7211    fn drop(&mut self) {
7212        self.control_handle.shutdown();
7213        // Safety: drops once, never accessed again
7214        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7215    }
7216}
7217
7218impl fidl::endpoints::Responder for WlanSoftmacBridgeQueryResponder {
7219    type ControlHandle = WlanSoftmacBridgeControlHandle;
7220
7221    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7222        &self.control_handle
7223    }
7224
7225    fn drop_without_shutdown(mut self) {
7226        // Safety: drops once, never accessed again due to mem::forget
7227        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7228        // Prevent Drop from running (which would shut down the channel)
7229        std::mem::forget(self);
7230    }
7231}
7232
7233impl WlanSoftmacBridgeQueryResponder {
7234    /// Sends a response to the FIDL transaction.
7235    ///
7236    /// Sets the channel to shutdown if an error occurs.
7237    pub fn send(
7238        self,
7239        mut result: Result<&WlanSoftmacQueryResponse, i32>,
7240    ) -> Result<(), fidl::Error> {
7241        let _result = self.send_raw(result);
7242        if _result.is_err() {
7243            self.control_handle.shutdown();
7244        }
7245        self.drop_without_shutdown();
7246        _result
7247    }
7248
7249    /// Similar to "send" but does not shutdown the channel if an error occurs.
7250    pub fn send_no_shutdown_on_err(
7251        self,
7252        mut result: Result<&WlanSoftmacQueryResponse, i32>,
7253    ) -> Result<(), fidl::Error> {
7254        let _result = self.send_raw(result);
7255        self.drop_without_shutdown();
7256        _result
7257    }
7258
7259    fn send_raw(
7260        &self,
7261        mut result: Result<&WlanSoftmacQueryResponse, i32>,
7262    ) -> Result<(), fidl::Error> {
7263        self.control_handle.inner.send::<fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>>(
7264            result,
7265            self.tx_id,
7266            0x18231a638e508f9d,
7267            fidl::encoding::DynamicFlags::empty(),
7268        )
7269    }
7270}
7271
7272#[must_use = "FIDL methods require a response to be sent"]
7273#[derive(Debug)]
7274pub struct WlanSoftmacBridgeQueryDiscoverySupportResponder {
7275    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7276    tx_id: u32,
7277}
7278
7279/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7280/// if the responder is dropped without sending a response, so that the client
7281/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7282impl std::ops::Drop for WlanSoftmacBridgeQueryDiscoverySupportResponder {
7283    fn drop(&mut self) {
7284        self.control_handle.shutdown();
7285        // Safety: drops once, never accessed again
7286        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7287    }
7288}
7289
7290impl fidl::endpoints::Responder for WlanSoftmacBridgeQueryDiscoverySupportResponder {
7291    type ControlHandle = WlanSoftmacBridgeControlHandle;
7292
7293    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7294        &self.control_handle
7295    }
7296
7297    fn drop_without_shutdown(mut self) {
7298        // Safety: drops once, never accessed again due to mem::forget
7299        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7300        // Prevent Drop from running (which would shut down the channel)
7301        std::mem::forget(self);
7302    }
7303}
7304
7305impl WlanSoftmacBridgeQueryDiscoverySupportResponder {
7306    /// Sends a response to the FIDL transaction.
7307    ///
7308    /// Sets the channel to shutdown if an error occurs.
7309    pub fn send(self, mut result: Result<&DiscoverySupport, i32>) -> Result<(), fidl::Error> {
7310        let _result = self.send_raw(result);
7311        if _result.is_err() {
7312            self.control_handle.shutdown();
7313        }
7314        self.drop_without_shutdown();
7315        _result
7316    }
7317
7318    /// Similar to "send" but does not shutdown the channel if an error occurs.
7319    pub fn send_no_shutdown_on_err(
7320        self,
7321        mut result: Result<&DiscoverySupport, i32>,
7322    ) -> Result<(), fidl::Error> {
7323        let _result = self.send_raw(result);
7324        self.drop_without_shutdown();
7325        _result
7326    }
7327
7328    fn send_raw(&self, mut result: Result<&DiscoverySupport, i32>) -> Result<(), fidl::Error> {
7329        self.control_handle.inner.send::<fidl::encoding::ResultType<
7330            WlanSoftmacBaseQueryDiscoverySupportResponse,
7331            i32,
7332        >>(
7333            result.map(|resp| (resp,)),
7334            self.tx_id,
7335            0x16797affc0cb58ae,
7336            fidl::encoding::DynamicFlags::empty(),
7337        )
7338    }
7339}
7340
7341#[must_use = "FIDL methods require a response to be sent"]
7342#[derive(Debug)]
7343pub struct WlanSoftmacBridgeQueryMacSublayerSupportResponder {
7344    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7345    tx_id: u32,
7346}
7347
7348/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7349/// if the responder is dropped without sending a response, so that the client
7350/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7351impl std::ops::Drop for WlanSoftmacBridgeQueryMacSublayerSupportResponder {
7352    fn drop(&mut self) {
7353        self.control_handle.shutdown();
7354        // Safety: drops once, never accessed again
7355        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7356    }
7357}
7358
7359impl fidl::endpoints::Responder for WlanSoftmacBridgeQueryMacSublayerSupportResponder {
7360    type ControlHandle = WlanSoftmacBridgeControlHandle;
7361
7362    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7363        &self.control_handle
7364    }
7365
7366    fn drop_without_shutdown(mut self) {
7367        // Safety: drops once, never accessed again due to mem::forget
7368        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7369        // Prevent Drop from running (which would shut down the channel)
7370        std::mem::forget(self);
7371    }
7372}
7373
7374impl WlanSoftmacBridgeQueryMacSublayerSupportResponder {
7375    /// Sends a response to the FIDL transaction.
7376    ///
7377    /// Sets the channel to shutdown if an error occurs.
7378    pub fn send(
7379        self,
7380        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
7381    ) -> Result<(), fidl::Error> {
7382        let _result = self.send_raw(result);
7383        if _result.is_err() {
7384            self.control_handle.shutdown();
7385        }
7386        self.drop_without_shutdown();
7387        _result
7388    }
7389
7390    /// Similar to "send" but does not shutdown the channel if an error occurs.
7391    pub fn send_no_shutdown_on_err(
7392        self,
7393        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
7394    ) -> Result<(), fidl::Error> {
7395        let _result = self.send_raw(result);
7396        self.drop_without_shutdown();
7397        _result
7398    }
7399
7400    fn send_raw(
7401        &self,
7402        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
7403    ) -> Result<(), fidl::Error> {
7404        self.control_handle.inner.send::<fidl::encoding::ResultType<
7405            WlanSoftmacBaseQueryMacSublayerSupportResponse,
7406            i32,
7407        >>(
7408            result.map(|resp| (resp,)),
7409            self.tx_id,
7410            0x7302c3f8c131f075,
7411            fidl::encoding::DynamicFlags::empty(),
7412        )
7413    }
7414}
7415
7416#[must_use = "FIDL methods require a response to be sent"]
7417#[derive(Debug)]
7418pub struct WlanSoftmacBridgeQuerySecuritySupportResponder {
7419    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7420    tx_id: u32,
7421}
7422
7423/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7424/// if the responder is dropped without sending a response, so that the client
7425/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7426impl std::ops::Drop for WlanSoftmacBridgeQuerySecuritySupportResponder {
7427    fn drop(&mut self) {
7428        self.control_handle.shutdown();
7429        // Safety: drops once, never accessed again
7430        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7431    }
7432}
7433
7434impl fidl::endpoints::Responder for WlanSoftmacBridgeQuerySecuritySupportResponder {
7435    type ControlHandle = WlanSoftmacBridgeControlHandle;
7436
7437    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7438        &self.control_handle
7439    }
7440
7441    fn drop_without_shutdown(mut self) {
7442        // Safety: drops once, never accessed again due to mem::forget
7443        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7444        // Prevent Drop from running (which would shut down the channel)
7445        std::mem::forget(self);
7446    }
7447}
7448
7449impl WlanSoftmacBridgeQuerySecuritySupportResponder {
7450    /// Sends a response to the FIDL transaction.
7451    ///
7452    /// Sets the channel to shutdown if an error occurs.
7453    pub fn send(
7454        self,
7455        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
7456    ) -> Result<(), fidl::Error> {
7457        let _result = self.send_raw(result);
7458        if _result.is_err() {
7459            self.control_handle.shutdown();
7460        }
7461        self.drop_without_shutdown();
7462        _result
7463    }
7464
7465    /// Similar to "send" but does not shutdown the channel if an error occurs.
7466    pub fn send_no_shutdown_on_err(
7467        self,
7468        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
7469    ) -> Result<(), fidl::Error> {
7470        let _result = self.send_raw(result);
7471        self.drop_without_shutdown();
7472        _result
7473    }
7474
7475    fn send_raw(
7476        &self,
7477        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
7478    ) -> Result<(), fidl::Error> {
7479        self.control_handle.inner.send::<fidl::encoding::ResultType<
7480            WlanSoftmacBaseQuerySecuritySupportResponse,
7481            i32,
7482        >>(
7483            result.map(|resp| (resp,)),
7484            self.tx_id,
7485            0x3691bb75abf6354,
7486            fidl::encoding::DynamicFlags::empty(),
7487        )
7488    }
7489}
7490
7491#[must_use = "FIDL methods require a response to be sent"]
7492#[derive(Debug)]
7493pub struct WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
7494    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7495    tx_id: u32,
7496}
7497
7498/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7499/// if the responder is dropped without sending a response, so that the client
7500/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7501impl std::ops::Drop for WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
7502    fn drop(&mut self) {
7503        self.control_handle.shutdown();
7504        // Safety: drops once, never accessed again
7505        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7506    }
7507}
7508
7509impl fidl::endpoints::Responder for WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
7510    type ControlHandle = WlanSoftmacBridgeControlHandle;
7511
7512    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7513        &self.control_handle
7514    }
7515
7516    fn drop_without_shutdown(mut self) {
7517        // Safety: drops once, never accessed again due to mem::forget
7518        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7519        // Prevent Drop from running (which would shut down the channel)
7520        std::mem::forget(self);
7521    }
7522}
7523
7524impl WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
7525    /// Sends a response to the FIDL transaction.
7526    ///
7527    /// Sets the channel to shutdown if an error occurs.
7528    pub fn send(
7529        self,
7530        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
7531    ) -> Result<(), fidl::Error> {
7532        let _result = self.send_raw(result);
7533        if _result.is_err() {
7534            self.control_handle.shutdown();
7535        }
7536        self.drop_without_shutdown();
7537        _result
7538    }
7539
7540    /// Similar to "send" but does not shutdown the channel if an error occurs.
7541    pub fn send_no_shutdown_on_err(
7542        self,
7543        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
7544    ) -> Result<(), fidl::Error> {
7545        let _result = self.send_raw(result);
7546        self.drop_without_shutdown();
7547        _result
7548    }
7549
7550    fn send_raw(
7551        &self,
7552        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
7553    ) -> Result<(), fidl::Error> {
7554        self.control_handle.inner.send::<fidl::encoding::ResultType<
7555            WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
7556            i32,
7557        >>(
7558            result.map(|resp| (resp,)),
7559            self.tx_id,
7560            0x347d78dc1d4d27bf,
7561            fidl::encoding::DynamicFlags::empty(),
7562        )
7563    }
7564}
7565
7566#[must_use = "FIDL methods require a response to be sent"]
7567#[derive(Debug)]
7568pub struct WlanSoftmacBridgeSetChannelResponder {
7569    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7570    tx_id: u32,
7571}
7572
7573/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7574/// if the responder is dropped without sending a response, so that the client
7575/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7576impl std::ops::Drop for WlanSoftmacBridgeSetChannelResponder {
7577    fn drop(&mut self) {
7578        self.control_handle.shutdown();
7579        // Safety: drops once, never accessed again
7580        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7581    }
7582}
7583
7584impl fidl::endpoints::Responder for WlanSoftmacBridgeSetChannelResponder {
7585    type ControlHandle = WlanSoftmacBridgeControlHandle;
7586
7587    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7588        &self.control_handle
7589    }
7590
7591    fn drop_without_shutdown(mut self) {
7592        // Safety: drops once, never accessed again due to mem::forget
7593        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7594        // Prevent Drop from running (which would shut down the channel)
7595        std::mem::forget(self);
7596    }
7597}
7598
7599impl WlanSoftmacBridgeSetChannelResponder {
7600    /// Sends a response to the FIDL transaction.
7601    ///
7602    /// Sets the channel to shutdown if an error occurs.
7603    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7604        let _result = self.send_raw(result);
7605        if _result.is_err() {
7606            self.control_handle.shutdown();
7607        }
7608        self.drop_without_shutdown();
7609        _result
7610    }
7611
7612    /// Similar to "send" but does not shutdown the channel if an error occurs.
7613    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7614        let _result = self.send_raw(result);
7615        self.drop_without_shutdown();
7616        _result
7617    }
7618
7619    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7620        self.control_handle
7621            .inner
7622            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7623                result,
7624                self.tx_id,
7625                0x12836b533cd63ece,
7626                fidl::encoding::DynamicFlags::empty(),
7627            )
7628    }
7629}
7630
7631#[must_use = "FIDL methods require a response to be sent"]
7632#[derive(Debug)]
7633pub struct WlanSoftmacBridgeJoinBssResponder {
7634    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7635    tx_id: u32,
7636}
7637
7638/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7639/// if the responder is dropped without sending a response, so that the client
7640/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7641impl std::ops::Drop for WlanSoftmacBridgeJoinBssResponder {
7642    fn drop(&mut self) {
7643        self.control_handle.shutdown();
7644        // Safety: drops once, never accessed again
7645        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7646    }
7647}
7648
7649impl fidl::endpoints::Responder for WlanSoftmacBridgeJoinBssResponder {
7650    type ControlHandle = WlanSoftmacBridgeControlHandle;
7651
7652    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7653        &self.control_handle
7654    }
7655
7656    fn drop_without_shutdown(mut self) {
7657        // Safety: drops once, never accessed again due to mem::forget
7658        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7659        // Prevent Drop from running (which would shut down the channel)
7660        std::mem::forget(self);
7661    }
7662}
7663
7664impl WlanSoftmacBridgeJoinBssResponder {
7665    /// Sends a response to the FIDL transaction.
7666    ///
7667    /// Sets the channel to shutdown if an error occurs.
7668    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7669        let _result = self.send_raw(result);
7670        if _result.is_err() {
7671            self.control_handle.shutdown();
7672        }
7673        self.drop_without_shutdown();
7674        _result
7675    }
7676
7677    /// Similar to "send" but does not shutdown the channel if an error occurs.
7678    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7679        let _result = self.send_raw(result);
7680        self.drop_without_shutdown();
7681        _result
7682    }
7683
7684    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7685        self.control_handle
7686            .inner
7687            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7688                result,
7689                self.tx_id,
7690                0x1336fb5455b77a6e,
7691                fidl::encoding::DynamicFlags::empty(),
7692            )
7693    }
7694}
7695
7696#[must_use = "FIDL methods require a response to be sent"]
7697#[derive(Debug)]
7698pub struct WlanSoftmacBridgeEnableBeaconingResponder {
7699    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7700    tx_id: u32,
7701}
7702
7703/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7704/// if the responder is dropped without sending a response, so that the client
7705/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7706impl std::ops::Drop for WlanSoftmacBridgeEnableBeaconingResponder {
7707    fn drop(&mut self) {
7708        self.control_handle.shutdown();
7709        // Safety: drops once, never accessed again
7710        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7711    }
7712}
7713
7714impl fidl::endpoints::Responder for WlanSoftmacBridgeEnableBeaconingResponder {
7715    type ControlHandle = WlanSoftmacBridgeControlHandle;
7716
7717    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7718        &self.control_handle
7719    }
7720
7721    fn drop_without_shutdown(mut self) {
7722        // Safety: drops once, never accessed again due to mem::forget
7723        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7724        // Prevent Drop from running (which would shut down the channel)
7725        std::mem::forget(self);
7726    }
7727}
7728
7729impl WlanSoftmacBridgeEnableBeaconingResponder {
7730    /// Sends a response to the FIDL transaction.
7731    ///
7732    /// Sets the channel to shutdown if an error occurs.
7733    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7734        let _result = self.send_raw(result);
7735        if _result.is_err() {
7736            self.control_handle.shutdown();
7737        }
7738        self.drop_without_shutdown();
7739        _result
7740    }
7741
7742    /// Similar to "send" but does not shutdown the channel if an error occurs.
7743    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7744        let _result = self.send_raw(result);
7745        self.drop_without_shutdown();
7746        _result
7747    }
7748
7749    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7750        self.control_handle
7751            .inner
7752            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7753                result,
7754                self.tx_id,
7755                0x6c35807632c64576,
7756                fidl::encoding::DynamicFlags::empty(),
7757            )
7758    }
7759}
7760
7761#[must_use = "FIDL methods require a response to be sent"]
7762#[derive(Debug)]
7763pub struct WlanSoftmacBridgeDisableBeaconingResponder {
7764    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7765    tx_id: u32,
7766}
7767
7768/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7769/// if the responder is dropped without sending a response, so that the client
7770/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7771impl std::ops::Drop for WlanSoftmacBridgeDisableBeaconingResponder {
7772    fn drop(&mut self) {
7773        self.control_handle.shutdown();
7774        // Safety: drops once, never accessed again
7775        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7776    }
7777}
7778
7779impl fidl::endpoints::Responder for WlanSoftmacBridgeDisableBeaconingResponder {
7780    type ControlHandle = WlanSoftmacBridgeControlHandle;
7781
7782    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7783        &self.control_handle
7784    }
7785
7786    fn drop_without_shutdown(mut self) {
7787        // Safety: drops once, never accessed again due to mem::forget
7788        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7789        // Prevent Drop from running (which would shut down the channel)
7790        std::mem::forget(self);
7791    }
7792}
7793
7794impl WlanSoftmacBridgeDisableBeaconingResponder {
7795    /// Sends a response to the FIDL transaction.
7796    ///
7797    /// Sets the channel to shutdown if an error occurs.
7798    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7799        let _result = self.send_raw(result);
7800        if _result.is_err() {
7801            self.control_handle.shutdown();
7802        }
7803        self.drop_without_shutdown();
7804        _result
7805    }
7806
7807    /// Similar to "send" but does not shutdown the channel if an error occurs.
7808    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7809        let _result = self.send_raw(result);
7810        self.drop_without_shutdown();
7811        _result
7812    }
7813
7814    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7815        self.control_handle
7816            .inner
7817            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7818                result,
7819                self.tx_id,
7820                0x3303b30f99dbb406,
7821                fidl::encoding::DynamicFlags::empty(),
7822            )
7823    }
7824}
7825
7826#[must_use = "FIDL methods require a response to be sent"]
7827#[derive(Debug)]
7828pub struct WlanSoftmacBridgeInstallKeyResponder {
7829    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7830    tx_id: u32,
7831}
7832
7833/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7834/// if the responder is dropped without sending a response, so that the client
7835/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7836impl std::ops::Drop for WlanSoftmacBridgeInstallKeyResponder {
7837    fn drop(&mut self) {
7838        self.control_handle.shutdown();
7839        // Safety: drops once, never accessed again
7840        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7841    }
7842}
7843
7844impl fidl::endpoints::Responder for WlanSoftmacBridgeInstallKeyResponder {
7845    type ControlHandle = WlanSoftmacBridgeControlHandle;
7846
7847    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7848        &self.control_handle
7849    }
7850
7851    fn drop_without_shutdown(mut self) {
7852        // Safety: drops once, never accessed again due to mem::forget
7853        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7854        // Prevent Drop from running (which would shut down the channel)
7855        std::mem::forget(self);
7856    }
7857}
7858
7859impl WlanSoftmacBridgeInstallKeyResponder {
7860    /// Sends a response to the FIDL transaction.
7861    ///
7862    /// Sets the channel to shutdown if an error occurs.
7863    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7864        let _result = self.send_raw(result);
7865        if _result.is_err() {
7866            self.control_handle.shutdown();
7867        }
7868        self.drop_without_shutdown();
7869        _result
7870    }
7871
7872    /// Similar to "send" but does not shutdown the channel if an error occurs.
7873    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7874        let _result = self.send_raw(result);
7875        self.drop_without_shutdown();
7876        _result
7877    }
7878
7879    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7880        self.control_handle
7881            .inner
7882            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7883                result,
7884                self.tx_id,
7885                0x7decf9b4200b9131,
7886                fidl::encoding::DynamicFlags::empty(),
7887            )
7888    }
7889}
7890
7891#[must_use = "FIDL methods require a response to be sent"]
7892#[derive(Debug)]
7893pub struct WlanSoftmacBridgeNotifyAssociationCompleteResponder {
7894    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7895    tx_id: u32,
7896}
7897
7898/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7899/// if the responder is dropped without sending a response, so that the client
7900/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7901impl std::ops::Drop for WlanSoftmacBridgeNotifyAssociationCompleteResponder {
7902    fn drop(&mut self) {
7903        self.control_handle.shutdown();
7904        // Safety: drops once, never accessed again
7905        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7906    }
7907}
7908
7909impl fidl::endpoints::Responder for WlanSoftmacBridgeNotifyAssociationCompleteResponder {
7910    type ControlHandle = WlanSoftmacBridgeControlHandle;
7911
7912    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7913        &self.control_handle
7914    }
7915
7916    fn drop_without_shutdown(mut self) {
7917        // Safety: drops once, never accessed again due to mem::forget
7918        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7919        // Prevent Drop from running (which would shut down the channel)
7920        std::mem::forget(self);
7921    }
7922}
7923
7924impl WlanSoftmacBridgeNotifyAssociationCompleteResponder {
7925    /// Sends a response to the FIDL transaction.
7926    ///
7927    /// Sets the channel to shutdown if an error occurs.
7928    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7929        let _result = self.send_raw(result);
7930        if _result.is_err() {
7931            self.control_handle.shutdown();
7932        }
7933        self.drop_without_shutdown();
7934        _result
7935    }
7936
7937    /// Similar to "send" but does not shutdown the channel if an error occurs.
7938    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7939        let _result = self.send_raw(result);
7940        self.drop_without_shutdown();
7941        _result
7942    }
7943
7944    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7945        self.control_handle
7946            .inner
7947            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7948                result,
7949                self.tx_id,
7950                0x436ffe3ba461d6cd,
7951                fidl::encoding::DynamicFlags::empty(),
7952            )
7953    }
7954}
7955
7956#[must_use = "FIDL methods require a response to be sent"]
7957#[derive(Debug)]
7958pub struct WlanSoftmacBridgeClearAssociationResponder {
7959    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7960    tx_id: u32,
7961}
7962
7963/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7964/// if the responder is dropped without sending a response, so that the client
7965/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7966impl std::ops::Drop for WlanSoftmacBridgeClearAssociationResponder {
7967    fn drop(&mut self) {
7968        self.control_handle.shutdown();
7969        // Safety: drops once, never accessed again
7970        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7971    }
7972}
7973
7974impl fidl::endpoints::Responder for WlanSoftmacBridgeClearAssociationResponder {
7975    type ControlHandle = WlanSoftmacBridgeControlHandle;
7976
7977    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7978        &self.control_handle
7979    }
7980
7981    fn drop_without_shutdown(mut self) {
7982        // Safety: drops once, never accessed again due to mem::forget
7983        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7984        // Prevent Drop from running (which would shut down the channel)
7985        std::mem::forget(self);
7986    }
7987}
7988
7989impl WlanSoftmacBridgeClearAssociationResponder {
7990    /// Sends a response to the FIDL transaction.
7991    ///
7992    /// Sets the channel to shutdown if an error occurs.
7993    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7994        let _result = self.send_raw(result);
7995        if _result.is_err() {
7996            self.control_handle.shutdown();
7997        }
7998        self.drop_without_shutdown();
7999        _result
8000    }
8001
8002    /// Similar to "send" but does not shutdown the channel if an error occurs.
8003    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8004        let _result = self.send_raw(result);
8005        self.drop_without_shutdown();
8006        _result
8007    }
8008
8009    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8010        self.control_handle
8011            .inner
8012            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8013                result,
8014                self.tx_id,
8015                0x581d76c39190a7dd,
8016                fidl::encoding::DynamicFlags::empty(),
8017            )
8018    }
8019}
8020
8021#[must_use = "FIDL methods require a response to be sent"]
8022#[derive(Debug)]
8023pub struct WlanSoftmacBridgeStartPassiveScanResponder {
8024    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8025    tx_id: u32,
8026}
8027
8028/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8029/// if the responder is dropped without sending a response, so that the client
8030/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8031impl std::ops::Drop for WlanSoftmacBridgeStartPassiveScanResponder {
8032    fn drop(&mut self) {
8033        self.control_handle.shutdown();
8034        // Safety: drops once, never accessed again
8035        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8036    }
8037}
8038
8039impl fidl::endpoints::Responder for WlanSoftmacBridgeStartPassiveScanResponder {
8040    type ControlHandle = WlanSoftmacBridgeControlHandle;
8041
8042    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8043        &self.control_handle
8044    }
8045
8046    fn drop_without_shutdown(mut self) {
8047        // Safety: drops once, never accessed again due to mem::forget
8048        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8049        // Prevent Drop from running (which would shut down the channel)
8050        std::mem::forget(self);
8051    }
8052}
8053
8054impl WlanSoftmacBridgeStartPassiveScanResponder {
8055    /// Sends a response to the FIDL transaction.
8056    ///
8057    /// Sets the channel to shutdown if an error occurs.
8058    pub fn send(
8059        self,
8060        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
8061    ) -> Result<(), fidl::Error> {
8062        let _result = self.send_raw(result);
8063        if _result.is_err() {
8064            self.control_handle.shutdown();
8065        }
8066        self.drop_without_shutdown();
8067        _result
8068    }
8069
8070    /// Similar to "send" but does not shutdown the channel if an error occurs.
8071    pub fn send_no_shutdown_on_err(
8072        self,
8073        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
8074    ) -> Result<(), fidl::Error> {
8075        let _result = self.send_raw(result);
8076        self.drop_without_shutdown();
8077        _result
8078    }
8079
8080    fn send_raw(
8081        &self,
8082        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
8083    ) -> Result<(), fidl::Error> {
8084        self.control_handle.inner.send::<fidl::encoding::ResultType<
8085            WlanSoftmacBaseStartPassiveScanResponse,
8086            i32,
8087        >>(
8088            result,
8089            self.tx_id,
8090            0x5662f989cb4083bb,
8091            fidl::encoding::DynamicFlags::empty(),
8092        )
8093    }
8094}
8095
8096#[must_use = "FIDL methods require a response to be sent"]
8097#[derive(Debug)]
8098pub struct WlanSoftmacBridgeStartActiveScanResponder {
8099    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8100    tx_id: u32,
8101}
8102
8103/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8104/// if the responder is dropped without sending a response, so that the client
8105/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8106impl std::ops::Drop for WlanSoftmacBridgeStartActiveScanResponder {
8107    fn drop(&mut self) {
8108        self.control_handle.shutdown();
8109        // Safety: drops once, never accessed again
8110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8111    }
8112}
8113
8114impl fidl::endpoints::Responder for WlanSoftmacBridgeStartActiveScanResponder {
8115    type ControlHandle = WlanSoftmacBridgeControlHandle;
8116
8117    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8118        &self.control_handle
8119    }
8120
8121    fn drop_without_shutdown(mut self) {
8122        // Safety: drops once, never accessed again due to mem::forget
8123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8124        // Prevent Drop from running (which would shut down the channel)
8125        std::mem::forget(self);
8126    }
8127}
8128
8129impl WlanSoftmacBridgeStartActiveScanResponder {
8130    /// Sends a response to the FIDL transaction.
8131    ///
8132    /// Sets the channel to shutdown if an error occurs.
8133    pub fn send(
8134        self,
8135        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
8136    ) -> Result<(), fidl::Error> {
8137        let _result = self.send_raw(result);
8138        if _result.is_err() {
8139            self.control_handle.shutdown();
8140        }
8141        self.drop_without_shutdown();
8142        _result
8143    }
8144
8145    /// Similar to "send" but does not shutdown the channel if an error occurs.
8146    pub fn send_no_shutdown_on_err(
8147        self,
8148        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
8149    ) -> Result<(), fidl::Error> {
8150        let _result = self.send_raw(result);
8151        self.drop_without_shutdown();
8152        _result
8153    }
8154
8155    fn send_raw(
8156        &self,
8157        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
8158    ) -> Result<(), fidl::Error> {
8159        self.control_handle.inner.send::<fidl::encoding::ResultType<
8160            WlanSoftmacBaseStartActiveScanResponse,
8161            i32,
8162        >>(
8163            result,
8164            self.tx_id,
8165            0x4896eafa9937751e,
8166            fidl::encoding::DynamicFlags::empty(),
8167        )
8168    }
8169}
8170
8171#[must_use = "FIDL methods require a response to be sent"]
8172#[derive(Debug)]
8173pub struct WlanSoftmacBridgeCancelScanResponder {
8174    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8175    tx_id: u32,
8176}
8177
8178/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8179/// if the responder is dropped without sending a response, so that the client
8180/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8181impl std::ops::Drop for WlanSoftmacBridgeCancelScanResponder {
8182    fn drop(&mut self) {
8183        self.control_handle.shutdown();
8184        // Safety: drops once, never accessed again
8185        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8186    }
8187}
8188
8189impl fidl::endpoints::Responder for WlanSoftmacBridgeCancelScanResponder {
8190    type ControlHandle = WlanSoftmacBridgeControlHandle;
8191
8192    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8193        &self.control_handle
8194    }
8195
8196    fn drop_without_shutdown(mut self) {
8197        // Safety: drops once, never accessed again due to mem::forget
8198        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8199        // Prevent Drop from running (which would shut down the channel)
8200        std::mem::forget(self);
8201    }
8202}
8203
8204impl WlanSoftmacBridgeCancelScanResponder {
8205    /// Sends a response to the FIDL transaction.
8206    ///
8207    /// Sets the channel to shutdown if an error occurs.
8208    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8209        let _result = self.send_raw(result);
8210        if _result.is_err() {
8211            self.control_handle.shutdown();
8212        }
8213        self.drop_without_shutdown();
8214        _result
8215    }
8216
8217    /// Similar to "send" but does not shutdown the channel if an error occurs.
8218    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8219        let _result = self.send_raw(result);
8220        self.drop_without_shutdown();
8221        _result
8222    }
8223
8224    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8225        self.control_handle
8226            .inner
8227            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8228                result,
8229                self.tx_id,
8230                0xf7d859369764556,
8231                fidl::encoding::DynamicFlags::empty(),
8232            )
8233    }
8234}
8235
8236#[must_use = "FIDL methods require a response to be sent"]
8237#[derive(Debug)]
8238pub struct WlanSoftmacBridgeUpdateWmmParametersResponder {
8239    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8240    tx_id: u32,
8241}
8242
8243/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8244/// if the responder is dropped without sending a response, so that the client
8245/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8246impl std::ops::Drop for WlanSoftmacBridgeUpdateWmmParametersResponder {
8247    fn drop(&mut self) {
8248        self.control_handle.shutdown();
8249        // Safety: drops once, never accessed again
8250        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8251    }
8252}
8253
8254impl fidl::endpoints::Responder for WlanSoftmacBridgeUpdateWmmParametersResponder {
8255    type ControlHandle = WlanSoftmacBridgeControlHandle;
8256
8257    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8258        &self.control_handle
8259    }
8260
8261    fn drop_without_shutdown(mut self) {
8262        // Safety: drops once, never accessed again due to mem::forget
8263        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8264        // Prevent Drop from running (which would shut down the channel)
8265        std::mem::forget(self);
8266    }
8267}
8268
8269impl WlanSoftmacBridgeUpdateWmmParametersResponder {
8270    /// Sends a response to the FIDL transaction.
8271    ///
8272    /// Sets the channel to shutdown if an error occurs.
8273    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8274        let _result = self.send_raw(result);
8275        if _result.is_err() {
8276            self.control_handle.shutdown();
8277        }
8278        self.drop_without_shutdown();
8279        _result
8280    }
8281
8282    /// Similar to "send" but does not shutdown the channel if an error occurs.
8283    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8284        let _result = self.send_raw(result);
8285        self.drop_without_shutdown();
8286        _result
8287    }
8288
8289    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8290        self.control_handle
8291            .inner
8292            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8293                result,
8294                self.tx_id,
8295                0x68522c7122d5f78c,
8296                fidl::encoding::DynamicFlags::empty(),
8297            )
8298    }
8299}
8300
8301#[must_use = "FIDL methods require a response to be sent"]
8302#[derive(Debug)]
8303pub struct WlanSoftmacBridgeStartResponder {
8304    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8305    tx_id: u32,
8306}
8307
8308/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8309/// if the responder is dropped without sending a response, so that the client
8310/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8311impl std::ops::Drop for WlanSoftmacBridgeStartResponder {
8312    fn drop(&mut self) {
8313        self.control_handle.shutdown();
8314        // Safety: drops once, never accessed again
8315        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8316    }
8317}
8318
8319impl fidl::endpoints::Responder for WlanSoftmacBridgeStartResponder {
8320    type ControlHandle = WlanSoftmacBridgeControlHandle;
8321
8322    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8323        &self.control_handle
8324    }
8325
8326    fn drop_without_shutdown(mut self) {
8327        // Safety: drops once, never accessed again due to mem::forget
8328        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8329        // Prevent Drop from running (which would shut down the channel)
8330        std::mem::forget(self);
8331    }
8332}
8333
8334impl WlanSoftmacBridgeStartResponder {
8335    /// Sends a response to the FIDL transaction.
8336    ///
8337    /// Sets the channel to shutdown if an error occurs.
8338    pub fn send(self, mut result: Result<fidl::Channel, i32>) -> Result<(), fidl::Error> {
8339        let _result = self.send_raw(result);
8340        if _result.is_err() {
8341            self.control_handle.shutdown();
8342        }
8343        self.drop_without_shutdown();
8344        _result
8345    }
8346
8347    /// Similar to "send" but does not shutdown the channel if an error occurs.
8348    pub fn send_no_shutdown_on_err(
8349        self,
8350        mut result: Result<fidl::Channel, i32>,
8351    ) -> Result<(), fidl::Error> {
8352        let _result = self.send_raw(result);
8353        self.drop_without_shutdown();
8354        _result
8355    }
8356
8357    fn send_raw(&self, mut result: Result<fidl::Channel, i32>) -> Result<(), fidl::Error> {
8358        self.control_handle
8359            .inner
8360            .send::<fidl::encoding::ResultType<WlanSoftmacBridgeStartResponse, i32>>(
8361                result.map(|sme_channel| (sme_channel,)),
8362                self.tx_id,
8363                0x7b2c15a507020d4d,
8364                fidl::encoding::DynamicFlags::empty(),
8365            )
8366    }
8367}
8368
8369#[must_use = "FIDL methods require a response to be sent"]
8370#[derive(Debug)]
8371pub struct WlanSoftmacBridgeSetEthernetStatusResponder {
8372    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8373    tx_id: u32,
8374}
8375
8376/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8377/// if the responder is dropped without sending a response, so that the client
8378/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8379impl std::ops::Drop for WlanSoftmacBridgeSetEthernetStatusResponder {
8380    fn drop(&mut self) {
8381        self.control_handle.shutdown();
8382        // Safety: drops once, never accessed again
8383        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8384    }
8385}
8386
8387impl fidl::endpoints::Responder for WlanSoftmacBridgeSetEthernetStatusResponder {
8388    type ControlHandle = WlanSoftmacBridgeControlHandle;
8389
8390    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8391        &self.control_handle
8392    }
8393
8394    fn drop_without_shutdown(mut self) {
8395        // Safety: drops once, never accessed again due to mem::forget
8396        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8397        // Prevent Drop from running (which would shut down the channel)
8398        std::mem::forget(self);
8399    }
8400}
8401
8402impl WlanSoftmacBridgeSetEthernetStatusResponder {
8403    /// Sends a response to the FIDL transaction.
8404    ///
8405    /// Sets the channel to shutdown if an error occurs.
8406    pub fn send(self) -> Result<(), fidl::Error> {
8407        let _result = self.send_raw();
8408        if _result.is_err() {
8409            self.control_handle.shutdown();
8410        }
8411        self.drop_without_shutdown();
8412        _result
8413    }
8414
8415    /// Similar to "send" but does not shutdown the channel if an error occurs.
8416    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8417        let _result = self.send_raw();
8418        self.drop_without_shutdown();
8419        _result
8420    }
8421
8422    fn send_raw(&self) -> Result<(), fidl::Error> {
8423        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
8424            (),
8425            self.tx_id,
8426            0x412503cb3aaa350b,
8427            fidl::encoding::DynamicFlags::empty(),
8428        )
8429    }
8430}
8431
8432#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8433pub struct WlanSoftmacIfcBaseMarker;
8434
8435impl fidl::endpoints::ProtocolMarker for WlanSoftmacIfcBaseMarker {
8436    type Proxy = WlanSoftmacIfcBaseProxy;
8437    type RequestStream = WlanSoftmacIfcBaseRequestStream;
8438    #[cfg(target_os = "fuchsia")]
8439    type SynchronousProxy = WlanSoftmacIfcBaseSynchronousProxy;
8440
8441    const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacIfcBase";
8442}
8443
8444pub trait WlanSoftmacIfcBaseProxyInterface: Send + Sync {
8445    type ReportTxResultResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
8446    fn r#report_tx_result(
8447        &self,
8448        tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
8449    ) -> Self::ReportTxResultResponseFut;
8450    type NotifyScanCompleteResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
8451    fn r#notify_scan_complete(
8452        &self,
8453        payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8454    ) -> Self::NotifyScanCompleteResponseFut;
8455}
8456#[derive(Debug)]
8457#[cfg(target_os = "fuchsia")]
8458pub struct WlanSoftmacIfcBaseSynchronousProxy {
8459    client: fidl::client::sync::Client,
8460}
8461
8462#[cfg(target_os = "fuchsia")]
8463impl fidl::endpoints::SynchronousProxy for WlanSoftmacIfcBaseSynchronousProxy {
8464    type Proxy = WlanSoftmacIfcBaseProxy;
8465    type Protocol = WlanSoftmacIfcBaseMarker;
8466
8467    fn from_channel(inner: fidl::Channel) -> Self {
8468        Self::new(inner)
8469    }
8470
8471    fn into_channel(self) -> fidl::Channel {
8472        self.client.into_channel()
8473    }
8474
8475    fn as_channel(&self) -> &fidl::Channel {
8476        self.client.as_channel()
8477    }
8478}
8479
8480#[cfg(target_os = "fuchsia")]
8481impl WlanSoftmacIfcBaseSynchronousProxy {
8482    pub fn new(channel: fidl::Channel) -> Self {
8483        let protocol_name =
8484            <WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8485        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8486    }
8487
8488    pub fn into_channel(self) -> fidl::Channel {
8489        self.client.into_channel()
8490    }
8491
8492    /// Waits until an event arrives and returns it. It is safe for other
8493    /// threads to make concurrent requests while waiting for an event.
8494    pub fn wait_for_event(
8495        &self,
8496        deadline: zx::MonotonicInstant,
8497    ) -> Result<WlanSoftmacIfcBaseEvent, fidl::Error> {
8498        WlanSoftmacIfcBaseEvent::decode(self.client.wait_for_event(deadline)?)
8499    }
8500
8501    /// Reports the result of an attempted transmission.
8502    ///
8503    /// A device driver indicates support for `ReportTxResult()` using
8504    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
8505    pub fn r#report_tx_result(
8506        &self,
8507        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
8508        ___deadline: zx::MonotonicInstant,
8509    ) -> Result<(), fidl::Error> {
8510        let _response = self
8511            .client
8512            .send_query::<WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::EmptyPayload>(
8513                (tx_result,),
8514                0x5835c2f13d94e09a,
8515                fidl::encoding::DynamicFlags::empty(),
8516                ___deadline,
8517            )?;
8518        Ok(_response)
8519    }
8520
8521    /// Reports completion of a scan associated with the unique `scan_id`. `status`
8522    /// indicates whether the scan completed successfully, failed due to an error,
8523    /// or was cancelled.
8524    ///
8525    /// Return status indicates the reason for scan completion:
8526    ///   ZX_OK: All channels were scanned successfully.
8527    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
8528    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
8529    ///       incompatible request (e.g. connect).
8530    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
8531    ///       This may be due to the current country setting.
8532    pub fn r#notify_scan_complete(
8533        &self,
8534        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8535        ___deadline: zx::MonotonicInstant,
8536    ) -> Result<(), fidl::Error> {
8537        let _response = self.client.send_query::<
8538            WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8539            fidl::encoding::EmptyPayload,
8540        >(
8541            payload,
8542            0x7045e3cd460dc42c,
8543            fidl::encoding::DynamicFlags::empty(),
8544            ___deadline,
8545        )?;
8546        Ok(_response)
8547    }
8548}
8549
8550#[cfg(target_os = "fuchsia")]
8551impl From<WlanSoftmacIfcBaseSynchronousProxy> for zx::NullableHandle {
8552    fn from(value: WlanSoftmacIfcBaseSynchronousProxy) -> Self {
8553        value.into_channel().into()
8554    }
8555}
8556
8557#[cfg(target_os = "fuchsia")]
8558impl From<fidl::Channel> for WlanSoftmacIfcBaseSynchronousProxy {
8559    fn from(value: fidl::Channel) -> Self {
8560        Self::new(value)
8561    }
8562}
8563
8564#[cfg(target_os = "fuchsia")]
8565impl fidl::endpoints::FromClient for WlanSoftmacIfcBaseSynchronousProxy {
8566    type Protocol = WlanSoftmacIfcBaseMarker;
8567
8568    fn from_client(value: fidl::endpoints::ClientEnd<WlanSoftmacIfcBaseMarker>) -> Self {
8569        Self::new(value.into_channel())
8570    }
8571}
8572
8573#[derive(Debug, Clone)]
8574pub struct WlanSoftmacIfcBaseProxy {
8575    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8576}
8577
8578impl fidl::endpoints::Proxy for WlanSoftmacIfcBaseProxy {
8579    type Protocol = WlanSoftmacIfcBaseMarker;
8580
8581    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8582        Self::new(inner)
8583    }
8584
8585    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8586        self.client.into_channel().map_err(|client| Self { client })
8587    }
8588
8589    fn as_channel(&self) -> &::fidl::AsyncChannel {
8590        self.client.as_channel()
8591    }
8592}
8593
8594impl WlanSoftmacIfcBaseProxy {
8595    /// Create a new Proxy for fuchsia.wlan.softmac/WlanSoftmacIfcBase.
8596    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8597        let protocol_name =
8598            <WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8599        Self { client: fidl::client::Client::new(channel, protocol_name) }
8600    }
8601
8602    /// Get a Stream of events from the remote end of the protocol.
8603    ///
8604    /// # Panics
8605    ///
8606    /// Panics if the event stream was already taken.
8607    pub fn take_event_stream(&self) -> WlanSoftmacIfcBaseEventStream {
8608        WlanSoftmacIfcBaseEventStream { event_receiver: self.client.take_event_receiver() }
8609    }
8610
8611    /// Reports the result of an attempted transmission.
8612    ///
8613    /// A device driver indicates support for `ReportTxResult()` using
8614    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
8615    pub fn r#report_tx_result(
8616        &self,
8617        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
8618    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
8619        WlanSoftmacIfcBaseProxyInterface::r#report_tx_result(self, tx_result)
8620    }
8621
8622    /// Reports completion of a scan associated with the unique `scan_id`. `status`
8623    /// indicates whether the scan completed successfully, failed due to an error,
8624    /// or was cancelled.
8625    ///
8626    /// Return status indicates the reason for scan completion:
8627    ///   ZX_OK: All channels were scanned successfully.
8628    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
8629    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
8630    ///       incompatible request (e.g. connect).
8631    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
8632    ///       This may be due to the current country setting.
8633    pub fn r#notify_scan_complete(
8634        &self,
8635        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8636    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
8637        WlanSoftmacIfcBaseProxyInterface::r#notify_scan_complete(self, payload)
8638    }
8639}
8640
8641impl WlanSoftmacIfcBaseProxyInterface for WlanSoftmacIfcBaseProxy {
8642    type ReportTxResultResponseFut =
8643        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
8644    fn r#report_tx_result(
8645        &self,
8646        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
8647    ) -> Self::ReportTxResultResponseFut {
8648        fn _decode(
8649            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8650        ) -> Result<(), fidl::Error> {
8651            let _response = fidl::client::decode_transaction_body::<
8652                fidl::encoding::EmptyPayload,
8653                fidl::encoding::DefaultFuchsiaResourceDialect,
8654                0x5835c2f13d94e09a,
8655            >(_buf?)?;
8656            Ok(_response)
8657        }
8658        self.client.send_query_and_decode::<WlanSoftmacIfcBaseReportTxResultRequest, ()>(
8659            (tx_result,),
8660            0x5835c2f13d94e09a,
8661            fidl::encoding::DynamicFlags::empty(),
8662            _decode,
8663        )
8664    }
8665
8666    type NotifyScanCompleteResponseFut =
8667        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
8668    fn r#notify_scan_complete(
8669        &self,
8670        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8671    ) -> Self::NotifyScanCompleteResponseFut {
8672        fn _decode(
8673            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8674        ) -> Result<(), fidl::Error> {
8675            let _response = fidl::client::decode_transaction_body::<
8676                fidl::encoding::EmptyPayload,
8677                fidl::encoding::DefaultFuchsiaResourceDialect,
8678                0x7045e3cd460dc42c,
8679            >(_buf?)?;
8680            Ok(_response)
8681        }
8682        self.client.send_query_and_decode::<WlanSoftmacIfcBaseNotifyScanCompleteRequest, ()>(
8683            payload,
8684            0x7045e3cd460dc42c,
8685            fidl::encoding::DynamicFlags::empty(),
8686            _decode,
8687        )
8688    }
8689}
8690
8691pub struct WlanSoftmacIfcBaseEventStream {
8692    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8693}
8694
8695impl std::marker::Unpin for WlanSoftmacIfcBaseEventStream {}
8696
8697impl futures::stream::FusedStream for WlanSoftmacIfcBaseEventStream {
8698    fn is_terminated(&self) -> bool {
8699        self.event_receiver.is_terminated()
8700    }
8701}
8702
8703impl futures::Stream for WlanSoftmacIfcBaseEventStream {
8704    type Item = Result<WlanSoftmacIfcBaseEvent, fidl::Error>;
8705
8706    fn poll_next(
8707        mut self: std::pin::Pin<&mut Self>,
8708        cx: &mut std::task::Context<'_>,
8709    ) -> std::task::Poll<Option<Self::Item>> {
8710        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8711            &mut self.event_receiver,
8712            cx
8713        )?) {
8714            Some(buf) => std::task::Poll::Ready(Some(WlanSoftmacIfcBaseEvent::decode(buf))),
8715            None => std::task::Poll::Ready(None),
8716        }
8717    }
8718}
8719
8720#[derive(Debug)]
8721pub enum WlanSoftmacIfcBaseEvent {}
8722
8723impl WlanSoftmacIfcBaseEvent {
8724    /// Decodes a message buffer as a [`WlanSoftmacIfcBaseEvent`].
8725    fn decode(
8726        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8727    ) -> Result<WlanSoftmacIfcBaseEvent, fidl::Error> {
8728        let (bytes, _handles) = buf.split_mut();
8729        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8730        debug_assert_eq!(tx_header.tx_id, 0);
8731        match tx_header.ordinal {
8732            _ => Err(fidl::Error::UnknownOrdinal {
8733                ordinal: tx_header.ordinal,
8734                protocol_name:
8735                    <WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8736            }),
8737        }
8738    }
8739}
8740
8741/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanSoftmacIfcBase.
8742pub struct WlanSoftmacIfcBaseRequestStream {
8743    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8744    is_terminated: bool,
8745}
8746
8747impl std::marker::Unpin for WlanSoftmacIfcBaseRequestStream {}
8748
8749impl futures::stream::FusedStream for WlanSoftmacIfcBaseRequestStream {
8750    fn is_terminated(&self) -> bool {
8751        self.is_terminated
8752    }
8753}
8754
8755impl fidl::endpoints::RequestStream for WlanSoftmacIfcBaseRequestStream {
8756    type Protocol = WlanSoftmacIfcBaseMarker;
8757    type ControlHandle = WlanSoftmacIfcBaseControlHandle;
8758
8759    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8760        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8761    }
8762
8763    fn control_handle(&self) -> Self::ControlHandle {
8764        WlanSoftmacIfcBaseControlHandle { inner: self.inner.clone() }
8765    }
8766
8767    fn into_inner(
8768        self,
8769    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8770    {
8771        (self.inner, self.is_terminated)
8772    }
8773
8774    fn from_inner(
8775        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8776        is_terminated: bool,
8777    ) -> Self {
8778        Self { inner, is_terminated }
8779    }
8780}
8781
8782impl futures::Stream for WlanSoftmacIfcBaseRequestStream {
8783    type Item = Result<WlanSoftmacIfcBaseRequest, fidl::Error>;
8784
8785    fn poll_next(
8786        mut self: std::pin::Pin<&mut Self>,
8787        cx: &mut std::task::Context<'_>,
8788    ) -> std::task::Poll<Option<Self::Item>> {
8789        let this = &mut *self;
8790        if this.inner.check_shutdown(cx) {
8791            this.is_terminated = true;
8792            return std::task::Poll::Ready(None);
8793        }
8794        if this.is_terminated {
8795            panic!("polled WlanSoftmacIfcBaseRequestStream after completion");
8796        }
8797        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8798            |bytes, handles| {
8799                match this.inner.channel().read_etc(cx, bytes, handles) {
8800                    std::task::Poll::Ready(Ok(())) => {}
8801                    std::task::Poll::Pending => return std::task::Poll::Pending,
8802                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8803                        this.is_terminated = true;
8804                        return std::task::Poll::Ready(None);
8805                    }
8806                    std::task::Poll::Ready(Err(e)) => {
8807                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8808                            e.into(),
8809                        ))));
8810                    }
8811                }
8812
8813                // A message has been received from the channel
8814                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8815
8816                std::task::Poll::Ready(Some(match header.ordinal {
8817                0x5835c2f13d94e09a => {
8818                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8819                    let mut req = fidl::new_empty!(WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8820                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseReportTxResultRequest>(&header, _body_bytes, handles, &mut req)?;
8821                    let control_handle = WlanSoftmacIfcBaseControlHandle {
8822                        inner: this.inner.clone(),
8823                    };
8824                    Ok(WlanSoftmacIfcBaseRequest::ReportTxResult {tx_result: req.tx_result,
8825
8826                        responder: WlanSoftmacIfcBaseReportTxResultResponder {
8827                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8828                            tx_id: header.tx_id,
8829                        },
8830                    })
8831                }
8832                0x7045e3cd460dc42c => {
8833                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8834                    let mut req = fidl::new_empty!(WlanSoftmacIfcBaseNotifyScanCompleteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8835                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
8836                    let control_handle = WlanSoftmacIfcBaseControlHandle {
8837                        inner: this.inner.clone(),
8838                    };
8839                    Ok(WlanSoftmacIfcBaseRequest::NotifyScanComplete {payload: req,
8840                        responder: WlanSoftmacIfcBaseNotifyScanCompleteResponder {
8841                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8842                            tx_id: header.tx_id,
8843                        },
8844                    })
8845                }
8846                _ => Err(fidl::Error::UnknownOrdinal {
8847                    ordinal: header.ordinal,
8848                    protocol_name: <WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8849                }),
8850            }))
8851            },
8852        )
8853    }
8854}
8855
8856/// Protocol containing methods common to both `WlanSoftmacIfc` and `WlanSoftmacIfcBridge`.
8857///
8858/// The `WlanSoftmacIfc` and `WlanSoftmacIfcBridge` protocols have common methods, as the latter
8859/// generally forwards `WlanSoftmacIfc` requests received in the wlansoftmac driver
8860/// to `WlanSoftmacIfcBridge` requests in the bridged driver. Composing this
8861/// protocol into `WlanSoftmacIfc` and `WlanSoftmacIfcBridge` minimizes the duplication of method
8862/// definitions (and associated request conversions that would be caused by such duplication).
8863///
8864/// **This protocol is not implemented directly by any component.** It is composed into `WlanSoftmacIfc`
8865/// and `WlanSoftmacIfcBridge`.
8866#[derive(Debug)]
8867pub enum WlanSoftmacIfcBaseRequest {
8868    /// Reports the result of an attempted transmission.
8869    ///
8870    /// A device driver indicates support for `ReportTxResult()` using
8871    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
8872    ReportTxResult {
8873        tx_result: fidl_fuchsia_wlan_common::WlanTxResult,
8874        responder: WlanSoftmacIfcBaseReportTxResultResponder,
8875    },
8876    /// Reports completion of a scan associated with the unique `scan_id`. `status`
8877    /// indicates whether the scan completed successfully, failed due to an error,
8878    /// or was cancelled.
8879    ///
8880    /// Return status indicates the reason for scan completion:
8881    ///   ZX_OK: All channels were scanned successfully.
8882    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
8883    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
8884    ///       incompatible request (e.g. connect).
8885    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
8886    ///       This may be due to the current country setting.
8887    NotifyScanComplete {
8888        payload: WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8889        responder: WlanSoftmacIfcBaseNotifyScanCompleteResponder,
8890    },
8891}
8892
8893impl WlanSoftmacIfcBaseRequest {
8894    #[allow(irrefutable_let_patterns)]
8895    pub fn into_report_tx_result(
8896        self,
8897    ) -> Option<(fidl_fuchsia_wlan_common::WlanTxResult, WlanSoftmacIfcBaseReportTxResultResponder)>
8898    {
8899        if let WlanSoftmacIfcBaseRequest::ReportTxResult { tx_result, responder } = self {
8900            Some((tx_result, responder))
8901        } else {
8902            None
8903        }
8904    }
8905
8906    #[allow(irrefutable_let_patterns)]
8907    pub fn into_notify_scan_complete(
8908        self,
8909    ) -> Option<(
8910        WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8911        WlanSoftmacIfcBaseNotifyScanCompleteResponder,
8912    )> {
8913        if let WlanSoftmacIfcBaseRequest::NotifyScanComplete { payload, responder } = self {
8914            Some((payload, responder))
8915        } else {
8916            None
8917        }
8918    }
8919
8920    /// Name of the method defined in FIDL
8921    pub fn method_name(&self) -> &'static str {
8922        match *self {
8923            WlanSoftmacIfcBaseRequest::ReportTxResult { .. } => "report_tx_result",
8924            WlanSoftmacIfcBaseRequest::NotifyScanComplete { .. } => "notify_scan_complete",
8925        }
8926    }
8927}
8928
8929#[derive(Debug, Clone)]
8930pub struct WlanSoftmacIfcBaseControlHandle {
8931    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8932}
8933
8934impl fidl::endpoints::ControlHandle for WlanSoftmacIfcBaseControlHandle {
8935    fn shutdown(&self) {
8936        self.inner.shutdown()
8937    }
8938
8939    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8940        self.inner.shutdown_with_epitaph(status)
8941    }
8942
8943    fn is_closed(&self) -> bool {
8944        self.inner.channel().is_closed()
8945    }
8946    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8947        self.inner.channel().on_closed()
8948    }
8949
8950    #[cfg(target_os = "fuchsia")]
8951    fn signal_peer(
8952        &self,
8953        clear_mask: zx::Signals,
8954        set_mask: zx::Signals,
8955    ) -> Result<(), zx_status::Status> {
8956        use fidl::Peered;
8957        self.inner.channel().signal_peer(clear_mask, set_mask)
8958    }
8959}
8960
8961impl WlanSoftmacIfcBaseControlHandle {}
8962
8963#[must_use = "FIDL methods require a response to be sent"]
8964#[derive(Debug)]
8965pub struct WlanSoftmacIfcBaseReportTxResultResponder {
8966    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBaseControlHandle>,
8967    tx_id: u32,
8968}
8969
8970/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBaseControlHandle::shutdown`])
8971/// if the responder is dropped without sending a response, so that the client
8972/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8973impl std::ops::Drop for WlanSoftmacIfcBaseReportTxResultResponder {
8974    fn drop(&mut self) {
8975        self.control_handle.shutdown();
8976        // Safety: drops once, never accessed again
8977        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8978    }
8979}
8980
8981impl fidl::endpoints::Responder for WlanSoftmacIfcBaseReportTxResultResponder {
8982    type ControlHandle = WlanSoftmacIfcBaseControlHandle;
8983
8984    fn control_handle(&self) -> &WlanSoftmacIfcBaseControlHandle {
8985        &self.control_handle
8986    }
8987
8988    fn drop_without_shutdown(mut self) {
8989        // Safety: drops once, never accessed again due to mem::forget
8990        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8991        // Prevent Drop from running (which would shut down the channel)
8992        std::mem::forget(self);
8993    }
8994}
8995
8996impl WlanSoftmacIfcBaseReportTxResultResponder {
8997    /// Sends a response to the FIDL transaction.
8998    ///
8999    /// Sets the channel to shutdown if an error occurs.
9000    pub fn send(self) -> Result<(), fidl::Error> {
9001        let _result = self.send_raw();
9002        if _result.is_err() {
9003            self.control_handle.shutdown();
9004        }
9005        self.drop_without_shutdown();
9006        _result
9007    }
9008
9009    /// Similar to "send" but does not shutdown the channel if an error occurs.
9010    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9011        let _result = self.send_raw();
9012        self.drop_without_shutdown();
9013        _result
9014    }
9015
9016    fn send_raw(&self) -> Result<(), fidl::Error> {
9017        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9018            (),
9019            self.tx_id,
9020            0x5835c2f13d94e09a,
9021            fidl::encoding::DynamicFlags::empty(),
9022        )
9023    }
9024}
9025
9026#[must_use = "FIDL methods require a response to be sent"]
9027#[derive(Debug)]
9028pub struct WlanSoftmacIfcBaseNotifyScanCompleteResponder {
9029    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBaseControlHandle>,
9030    tx_id: u32,
9031}
9032
9033/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBaseControlHandle::shutdown`])
9034/// if the responder is dropped without sending a response, so that the client
9035/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9036impl std::ops::Drop for WlanSoftmacIfcBaseNotifyScanCompleteResponder {
9037    fn drop(&mut self) {
9038        self.control_handle.shutdown();
9039        // Safety: drops once, never accessed again
9040        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9041    }
9042}
9043
9044impl fidl::endpoints::Responder for WlanSoftmacIfcBaseNotifyScanCompleteResponder {
9045    type ControlHandle = WlanSoftmacIfcBaseControlHandle;
9046
9047    fn control_handle(&self) -> &WlanSoftmacIfcBaseControlHandle {
9048        &self.control_handle
9049    }
9050
9051    fn drop_without_shutdown(mut self) {
9052        // Safety: drops once, never accessed again due to mem::forget
9053        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9054        // Prevent Drop from running (which would shut down the channel)
9055        std::mem::forget(self);
9056    }
9057}
9058
9059impl WlanSoftmacIfcBaseNotifyScanCompleteResponder {
9060    /// Sends a response to the FIDL transaction.
9061    ///
9062    /// Sets the channel to shutdown if an error occurs.
9063    pub fn send(self) -> Result<(), fidl::Error> {
9064        let _result = self.send_raw();
9065        if _result.is_err() {
9066            self.control_handle.shutdown();
9067        }
9068        self.drop_without_shutdown();
9069        _result
9070    }
9071
9072    /// Similar to "send" but does not shutdown the channel if an error occurs.
9073    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9074        let _result = self.send_raw();
9075        self.drop_without_shutdown();
9076        _result
9077    }
9078
9079    fn send_raw(&self) -> Result<(), fidl::Error> {
9080        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9081            (),
9082            self.tx_id,
9083            0x7045e3cd460dc42c,
9084            fidl::encoding::DynamicFlags::empty(),
9085        )
9086    }
9087}
9088
9089#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9090pub struct WlanSoftmacIfcBridgeMarker;
9091
9092impl fidl::endpoints::ProtocolMarker for WlanSoftmacIfcBridgeMarker {
9093    type Proxy = WlanSoftmacIfcBridgeProxy;
9094    type RequestStream = WlanSoftmacIfcBridgeRequestStream;
9095    #[cfg(target_os = "fuchsia")]
9096    type SynchronousProxy = WlanSoftmacIfcBridgeSynchronousProxy;
9097
9098    const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacIfcBridge";
9099}
9100
9101pub trait WlanSoftmacIfcBridgeProxyInterface: Send + Sync {
9102    type ReportTxResultResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
9103    fn r#report_tx_result(
9104        &self,
9105        tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9106    ) -> Self::ReportTxResultResponseFut;
9107    type NotifyScanCompleteResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
9108    fn r#notify_scan_complete(
9109        &self,
9110        payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9111    ) -> Self::NotifyScanCompleteResponseFut;
9112    type StopBridgedDriverResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
9113    fn r#stop_bridged_driver(&self) -> Self::StopBridgedDriverResponseFut;
9114}
9115#[derive(Debug)]
9116#[cfg(target_os = "fuchsia")]
9117pub struct WlanSoftmacIfcBridgeSynchronousProxy {
9118    client: fidl::client::sync::Client,
9119}
9120
9121#[cfg(target_os = "fuchsia")]
9122impl fidl::endpoints::SynchronousProxy for WlanSoftmacIfcBridgeSynchronousProxy {
9123    type Proxy = WlanSoftmacIfcBridgeProxy;
9124    type Protocol = WlanSoftmacIfcBridgeMarker;
9125
9126    fn from_channel(inner: fidl::Channel) -> Self {
9127        Self::new(inner)
9128    }
9129
9130    fn into_channel(self) -> fidl::Channel {
9131        self.client.into_channel()
9132    }
9133
9134    fn as_channel(&self) -> &fidl::Channel {
9135        self.client.as_channel()
9136    }
9137}
9138
9139#[cfg(target_os = "fuchsia")]
9140impl WlanSoftmacIfcBridgeSynchronousProxy {
9141    pub fn new(channel: fidl::Channel) -> Self {
9142        let protocol_name =
9143            <WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9144        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9145    }
9146
9147    pub fn into_channel(self) -> fidl::Channel {
9148        self.client.into_channel()
9149    }
9150
9151    /// Waits until an event arrives and returns it. It is safe for other
9152    /// threads to make concurrent requests while waiting for an event.
9153    pub fn wait_for_event(
9154        &self,
9155        deadline: zx::MonotonicInstant,
9156    ) -> Result<WlanSoftmacIfcBridgeEvent, fidl::Error> {
9157        WlanSoftmacIfcBridgeEvent::decode(self.client.wait_for_event(deadline)?)
9158    }
9159
9160    /// Reports the result of an attempted transmission.
9161    ///
9162    /// A device driver indicates support for `ReportTxResult()` using
9163    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
9164    pub fn r#report_tx_result(
9165        &self,
9166        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9167        ___deadline: zx::MonotonicInstant,
9168    ) -> Result<(), fidl::Error> {
9169        let _response = self
9170            .client
9171            .send_query::<WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::EmptyPayload>(
9172                (tx_result,),
9173                0x5835c2f13d94e09a,
9174                fidl::encoding::DynamicFlags::empty(),
9175                ___deadline,
9176            )?;
9177        Ok(_response)
9178    }
9179
9180    /// Reports completion of a scan associated with the unique `scan_id`. `status`
9181    /// indicates whether the scan completed successfully, failed due to an error,
9182    /// or was cancelled.
9183    ///
9184    /// Return status indicates the reason for scan completion:
9185    ///   ZX_OK: All channels were scanned successfully.
9186    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
9187    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
9188    ///       incompatible request (e.g. connect).
9189    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
9190    ///       This may be due to the current country setting.
9191    pub fn r#notify_scan_complete(
9192        &self,
9193        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9194        ___deadline: zx::MonotonicInstant,
9195    ) -> Result<(), fidl::Error> {
9196        let _response = self.client.send_query::<
9197            WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9198            fidl::encoding::EmptyPayload,
9199        >(
9200            payload,
9201            0x7045e3cd460dc42c,
9202            fidl::encoding::DynamicFlags::empty(),
9203            ___deadline,
9204        )?;
9205        Ok(_response)
9206    }
9207
9208    /// Stop the bridged driver.
9209    ///
9210    /// Calling this method causes both the server end of this protocol (`WlanSoftmacIfcBridge`)
9211    /// to close and the client end of `WlanSoftmacBridge` to close. The server will not return a
9212    /// response from this method until after processing all queued events.
9213    ///
9214    /// In practice, the wlansoftmac driver calls this method during unbind.
9215    pub fn r#stop_bridged_driver(
9216        &self,
9217        ___deadline: zx::MonotonicInstant,
9218    ) -> Result<(), fidl::Error> {
9219        let _response =
9220            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
9221                (),
9222                0x112dbd0cc2251151,
9223                fidl::encoding::DynamicFlags::empty(),
9224                ___deadline,
9225            )?;
9226        Ok(_response)
9227    }
9228}
9229
9230#[cfg(target_os = "fuchsia")]
9231impl From<WlanSoftmacIfcBridgeSynchronousProxy> for zx::NullableHandle {
9232    fn from(value: WlanSoftmacIfcBridgeSynchronousProxy) -> Self {
9233        value.into_channel().into()
9234    }
9235}
9236
9237#[cfg(target_os = "fuchsia")]
9238impl From<fidl::Channel> for WlanSoftmacIfcBridgeSynchronousProxy {
9239    fn from(value: fidl::Channel) -> Self {
9240        Self::new(value)
9241    }
9242}
9243
9244#[cfg(target_os = "fuchsia")]
9245impl fidl::endpoints::FromClient for WlanSoftmacIfcBridgeSynchronousProxy {
9246    type Protocol = WlanSoftmacIfcBridgeMarker;
9247
9248    fn from_client(value: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>) -> Self {
9249        Self::new(value.into_channel())
9250    }
9251}
9252
9253#[derive(Debug, Clone)]
9254pub struct WlanSoftmacIfcBridgeProxy {
9255    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9256}
9257
9258impl fidl::endpoints::Proxy for WlanSoftmacIfcBridgeProxy {
9259    type Protocol = WlanSoftmacIfcBridgeMarker;
9260
9261    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9262        Self::new(inner)
9263    }
9264
9265    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9266        self.client.into_channel().map_err(|client| Self { client })
9267    }
9268
9269    fn as_channel(&self) -> &::fidl::AsyncChannel {
9270        self.client.as_channel()
9271    }
9272}
9273
9274impl WlanSoftmacIfcBridgeProxy {
9275    /// Create a new Proxy for fuchsia.wlan.softmac/WlanSoftmacIfcBridge.
9276    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9277        let protocol_name =
9278            <WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9279        Self { client: fidl::client::Client::new(channel, protocol_name) }
9280    }
9281
9282    /// Get a Stream of events from the remote end of the protocol.
9283    ///
9284    /// # Panics
9285    ///
9286    /// Panics if the event stream was already taken.
9287    pub fn take_event_stream(&self) -> WlanSoftmacIfcBridgeEventStream {
9288        WlanSoftmacIfcBridgeEventStream { event_receiver: self.client.take_event_receiver() }
9289    }
9290
9291    /// Reports the result of an attempted transmission.
9292    ///
9293    /// A device driver indicates support for `ReportTxResult()` using
9294    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
9295    pub fn r#report_tx_result(
9296        &self,
9297        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9298    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9299        WlanSoftmacIfcBridgeProxyInterface::r#report_tx_result(self, tx_result)
9300    }
9301
9302    /// Reports completion of a scan associated with the unique `scan_id`. `status`
9303    /// indicates whether the scan completed successfully, failed due to an error,
9304    /// or was cancelled.
9305    ///
9306    /// Return status indicates the reason for scan completion:
9307    ///   ZX_OK: All channels were scanned successfully.
9308    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
9309    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
9310    ///       incompatible request (e.g. connect).
9311    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
9312    ///       This may be due to the current country setting.
9313    pub fn r#notify_scan_complete(
9314        &self,
9315        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9316    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9317        WlanSoftmacIfcBridgeProxyInterface::r#notify_scan_complete(self, payload)
9318    }
9319
9320    /// Stop the bridged driver.
9321    ///
9322    /// Calling this method causes both the server end of this protocol (`WlanSoftmacIfcBridge`)
9323    /// to close and the client end of `WlanSoftmacBridge` to close. The server will not return a
9324    /// response from this method until after processing all queued events.
9325    ///
9326    /// In practice, the wlansoftmac driver calls this method during unbind.
9327    pub fn r#stop_bridged_driver(
9328        &self,
9329    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9330        WlanSoftmacIfcBridgeProxyInterface::r#stop_bridged_driver(self)
9331    }
9332}
9333
9334impl WlanSoftmacIfcBridgeProxyInterface for WlanSoftmacIfcBridgeProxy {
9335    type ReportTxResultResponseFut =
9336        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9337    fn r#report_tx_result(
9338        &self,
9339        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9340    ) -> Self::ReportTxResultResponseFut {
9341        fn _decode(
9342            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9343        ) -> Result<(), fidl::Error> {
9344            let _response = fidl::client::decode_transaction_body::<
9345                fidl::encoding::EmptyPayload,
9346                fidl::encoding::DefaultFuchsiaResourceDialect,
9347                0x5835c2f13d94e09a,
9348            >(_buf?)?;
9349            Ok(_response)
9350        }
9351        self.client.send_query_and_decode::<WlanSoftmacIfcBaseReportTxResultRequest, ()>(
9352            (tx_result,),
9353            0x5835c2f13d94e09a,
9354            fidl::encoding::DynamicFlags::empty(),
9355            _decode,
9356        )
9357    }
9358
9359    type NotifyScanCompleteResponseFut =
9360        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9361    fn r#notify_scan_complete(
9362        &self,
9363        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9364    ) -> Self::NotifyScanCompleteResponseFut {
9365        fn _decode(
9366            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9367        ) -> Result<(), fidl::Error> {
9368            let _response = fidl::client::decode_transaction_body::<
9369                fidl::encoding::EmptyPayload,
9370                fidl::encoding::DefaultFuchsiaResourceDialect,
9371                0x7045e3cd460dc42c,
9372            >(_buf?)?;
9373            Ok(_response)
9374        }
9375        self.client.send_query_and_decode::<WlanSoftmacIfcBaseNotifyScanCompleteRequest, ()>(
9376            payload,
9377            0x7045e3cd460dc42c,
9378            fidl::encoding::DynamicFlags::empty(),
9379            _decode,
9380        )
9381    }
9382
9383    type StopBridgedDriverResponseFut =
9384        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9385    fn r#stop_bridged_driver(&self) -> Self::StopBridgedDriverResponseFut {
9386        fn _decode(
9387            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9388        ) -> Result<(), fidl::Error> {
9389            let _response = fidl::client::decode_transaction_body::<
9390                fidl::encoding::EmptyPayload,
9391                fidl::encoding::DefaultFuchsiaResourceDialect,
9392                0x112dbd0cc2251151,
9393            >(_buf?)?;
9394            Ok(_response)
9395        }
9396        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
9397            (),
9398            0x112dbd0cc2251151,
9399            fidl::encoding::DynamicFlags::empty(),
9400            _decode,
9401        )
9402    }
9403}
9404
9405pub struct WlanSoftmacIfcBridgeEventStream {
9406    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9407}
9408
9409impl std::marker::Unpin for WlanSoftmacIfcBridgeEventStream {}
9410
9411impl futures::stream::FusedStream for WlanSoftmacIfcBridgeEventStream {
9412    fn is_terminated(&self) -> bool {
9413        self.event_receiver.is_terminated()
9414    }
9415}
9416
9417impl futures::Stream for WlanSoftmacIfcBridgeEventStream {
9418    type Item = Result<WlanSoftmacIfcBridgeEvent, fidl::Error>;
9419
9420    fn poll_next(
9421        mut self: std::pin::Pin<&mut Self>,
9422        cx: &mut std::task::Context<'_>,
9423    ) -> std::task::Poll<Option<Self::Item>> {
9424        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9425            &mut self.event_receiver,
9426            cx
9427        )?) {
9428            Some(buf) => std::task::Poll::Ready(Some(WlanSoftmacIfcBridgeEvent::decode(buf))),
9429            None => std::task::Poll::Ready(None),
9430        }
9431    }
9432}
9433
9434#[derive(Debug)]
9435pub enum WlanSoftmacIfcBridgeEvent {}
9436
9437impl WlanSoftmacIfcBridgeEvent {
9438    /// Decodes a message buffer as a [`WlanSoftmacIfcBridgeEvent`].
9439    fn decode(
9440        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9441    ) -> Result<WlanSoftmacIfcBridgeEvent, fidl::Error> {
9442        let (bytes, _handles) = buf.split_mut();
9443        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9444        debug_assert_eq!(tx_header.tx_id, 0);
9445        match tx_header.ordinal {
9446            _ => Err(fidl::Error::UnknownOrdinal {
9447                ordinal: tx_header.ordinal,
9448                protocol_name:
9449                    <WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9450            }),
9451        }
9452    }
9453}
9454
9455/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanSoftmacIfcBridge.
9456pub struct WlanSoftmacIfcBridgeRequestStream {
9457    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9458    is_terminated: bool,
9459}
9460
9461impl std::marker::Unpin for WlanSoftmacIfcBridgeRequestStream {}
9462
9463impl futures::stream::FusedStream for WlanSoftmacIfcBridgeRequestStream {
9464    fn is_terminated(&self) -> bool {
9465        self.is_terminated
9466    }
9467}
9468
9469impl fidl::endpoints::RequestStream for WlanSoftmacIfcBridgeRequestStream {
9470    type Protocol = WlanSoftmacIfcBridgeMarker;
9471    type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
9472
9473    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9474        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9475    }
9476
9477    fn control_handle(&self) -> Self::ControlHandle {
9478        WlanSoftmacIfcBridgeControlHandle { inner: self.inner.clone() }
9479    }
9480
9481    fn into_inner(
9482        self,
9483    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9484    {
9485        (self.inner, self.is_terminated)
9486    }
9487
9488    fn from_inner(
9489        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9490        is_terminated: bool,
9491    ) -> Self {
9492        Self { inner, is_terminated }
9493    }
9494}
9495
9496impl futures::Stream for WlanSoftmacIfcBridgeRequestStream {
9497    type Item = Result<WlanSoftmacIfcBridgeRequest, fidl::Error>;
9498
9499    fn poll_next(
9500        mut self: std::pin::Pin<&mut Self>,
9501        cx: &mut std::task::Context<'_>,
9502    ) -> std::task::Poll<Option<Self::Item>> {
9503        let this = &mut *self;
9504        if this.inner.check_shutdown(cx) {
9505            this.is_terminated = true;
9506            return std::task::Poll::Ready(None);
9507        }
9508        if this.is_terminated {
9509            panic!("polled WlanSoftmacIfcBridgeRequestStream after completion");
9510        }
9511        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9512            |bytes, handles| {
9513                match this.inner.channel().read_etc(cx, bytes, handles) {
9514                    std::task::Poll::Ready(Ok(())) => {}
9515                    std::task::Poll::Pending => return std::task::Poll::Pending,
9516                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9517                        this.is_terminated = true;
9518                        return std::task::Poll::Ready(None);
9519                    }
9520                    std::task::Poll::Ready(Err(e)) => {
9521                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9522                            e.into(),
9523                        ))));
9524                    }
9525                }
9526
9527                // A message has been received from the channel
9528                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9529
9530                std::task::Poll::Ready(Some(match header.ordinal {
9531                0x5835c2f13d94e09a => {
9532                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9533                    let mut req = fidl::new_empty!(WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9534                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseReportTxResultRequest>(&header, _body_bytes, handles, &mut req)?;
9535                    let control_handle = WlanSoftmacIfcBridgeControlHandle {
9536                        inner: this.inner.clone(),
9537                    };
9538                    Ok(WlanSoftmacIfcBridgeRequest::ReportTxResult {tx_result: req.tx_result,
9539
9540                        responder: WlanSoftmacIfcBridgeReportTxResultResponder {
9541                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9542                            tx_id: header.tx_id,
9543                        },
9544                    })
9545                }
9546                0x7045e3cd460dc42c => {
9547                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9548                    let mut req = fidl::new_empty!(WlanSoftmacIfcBaseNotifyScanCompleteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9549                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
9550                    let control_handle = WlanSoftmacIfcBridgeControlHandle {
9551                        inner: this.inner.clone(),
9552                    };
9553                    Ok(WlanSoftmacIfcBridgeRequest::NotifyScanComplete {payload: req,
9554                        responder: WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
9555                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9556                            tx_id: header.tx_id,
9557                        },
9558                    })
9559                }
9560                0x112dbd0cc2251151 => {
9561                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9562                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
9563                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9564                    let control_handle = WlanSoftmacIfcBridgeControlHandle {
9565                        inner: this.inner.clone(),
9566                    };
9567                    Ok(WlanSoftmacIfcBridgeRequest::StopBridgedDriver {
9568                        responder: WlanSoftmacIfcBridgeStopBridgedDriverResponder {
9569                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9570                            tx_id: header.tx_id,
9571                        },
9572                    })
9573                }
9574                _ => Err(fidl::Error::UnknownOrdinal {
9575                    ordinal: header.ordinal,
9576                    protocol_name: <WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9577                }),
9578            }))
9579            },
9580        )
9581    }
9582}
9583
9584/// Protocol that transports `WlanSoftmacIfc` requests from the wlansoftmac driver to
9585/// the bridged driver.
9586///
9587/// This protocol should always be available at HEAD since it's intended to be an in-tree only protocol.
9588/// This protocol only exists because wlansoftmac cannot be implemented in Rust and must interact with
9589/// the wlansoftmac-c, wlansoftmac-rust, and wlan-mlme Rust crates.
9590#[derive(Debug)]
9591pub enum WlanSoftmacIfcBridgeRequest {
9592    /// Reports the result of an attempted transmission.
9593    ///
9594    /// A device driver indicates support for `ReportTxResult()` using
9595    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
9596    ReportTxResult {
9597        tx_result: fidl_fuchsia_wlan_common::WlanTxResult,
9598        responder: WlanSoftmacIfcBridgeReportTxResultResponder,
9599    },
9600    /// Reports completion of a scan associated with the unique `scan_id`. `status`
9601    /// indicates whether the scan completed successfully, failed due to an error,
9602    /// or was cancelled.
9603    ///
9604    /// Return status indicates the reason for scan completion:
9605    ///   ZX_OK: All channels were scanned successfully.
9606    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
9607    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
9608    ///       incompatible request (e.g. connect).
9609    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
9610    ///       This may be due to the current country setting.
9611    NotifyScanComplete {
9612        payload: WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9613        responder: WlanSoftmacIfcBridgeNotifyScanCompleteResponder,
9614    },
9615    /// Stop the bridged driver.
9616    ///
9617    /// Calling this method causes both the server end of this protocol (`WlanSoftmacIfcBridge`)
9618    /// to close and the client end of `WlanSoftmacBridge` to close. The server will not return a
9619    /// response from this method until after processing all queued events.
9620    ///
9621    /// In practice, the wlansoftmac driver calls this method during unbind.
9622    StopBridgedDriver { responder: WlanSoftmacIfcBridgeStopBridgedDriverResponder },
9623}
9624
9625impl WlanSoftmacIfcBridgeRequest {
9626    #[allow(irrefutable_let_patterns)]
9627    pub fn into_report_tx_result(
9628        self,
9629    ) -> Option<(fidl_fuchsia_wlan_common::WlanTxResult, WlanSoftmacIfcBridgeReportTxResultResponder)>
9630    {
9631        if let WlanSoftmacIfcBridgeRequest::ReportTxResult { tx_result, responder } = self {
9632            Some((tx_result, responder))
9633        } else {
9634            None
9635        }
9636    }
9637
9638    #[allow(irrefutable_let_patterns)]
9639    pub fn into_notify_scan_complete(
9640        self,
9641    ) -> Option<(
9642        WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9643        WlanSoftmacIfcBridgeNotifyScanCompleteResponder,
9644    )> {
9645        if let WlanSoftmacIfcBridgeRequest::NotifyScanComplete { payload, responder } = self {
9646            Some((payload, responder))
9647        } else {
9648            None
9649        }
9650    }
9651
9652    #[allow(irrefutable_let_patterns)]
9653    pub fn into_stop_bridged_driver(
9654        self,
9655    ) -> Option<(WlanSoftmacIfcBridgeStopBridgedDriverResponder)> {
9656        if let WlanSoftmacIfcBridgeRequest::StopBridgedDriver { responder } = self {
9657            Some((responder))
9658        } else {
9659            None
9660        }
9661    }
9662
9663    /// Name of the method defined in FIDL
9664    pub fn method_name(&self) -> &'static str {
9665        match *self {
9666            WlanSoftmacIfcBridgeRequest::ReportTxResult { .. } => "report_tx_result",
9667            WlanSoftmacIfcBridgeRequest::NotifyScanComplete { .. } => "notify_scan_complete",
9668            WlanSoftmacIfcBridgeRequest::StopBridgedDriver { .. } => "stop_bridged_driver",
9669        }
9670    }
9671}
9672
9673#[derive(Debug, Clone)]
9674pub struct WlanSoftmacIfcBridgeControlHandle {
9675    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9676}
9677
9678impl fidl::endpoints::ControlHandle for WlanSoftmacIfcBridgeControlHandle {
9679    fn shutdown(&self) {
9680        self.inner.shutdown()
9681    }
9682
9683    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9684        self.inner.shutdown_with_epitaph(status)
9685    }
9686
9687    fn is_closed(&self) -> bool {
9688        self.inner.channel().is_closed()
9689    }
9690    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9691        self.inner.channel().on_closed()
9692    }
9693
9694    #[cfg(target_os = "fuchsia")]
9695    fn signal_peer(
9696        &self,
9697        clear_mask: zx::Signals,
9698        set_mask: zx::Signals,
9699    ) -> Result<(), zx_status::Status> {
9700        use fidl::Peered;
9701        self.inner.channel().signal_peer(clear_mask, set_mask)
9702    }
9703}
9704
9705impl WlanSoftmacIfcBridgeControlHandle {}
9706
9707#[must_use = "FIDL methods require a response to be sent"]
9708#[derive(Debug)]
9709pub struct WlanSoftmacIfcBridgeReportTxResultResponder {
9710    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBridgeControlHandle>,
9711    tx_id: u32,
9712}
9713
9714/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBridgeControlHandle::shutdown`])
9715/// if the responder is dropped without sending a response, so that the client
9716/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9717impl std::ops::Drop for WlanSoftmacIfcBridgeReportTxResultResponder {
9718    fn drop(&mut self) {
9719        self.control_handle.shutdown();
9720        // Safety: drops once, never accessed again
9721        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9722    }
9723}
9724
9725impl fidl::endpoints::Responder for WlanSoftmacIfcBridgeReportTxResultResponder {
9726    type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
9727
9728    fn control_handle(&self) -> &WlanSoftmacIfcBridgeControlHandle {
9729        &self.control_handle
9730    }
9731
9732    fn drop_without_shutdown(mut self) {
9733        // Safety: drops once, never accessed again due to mem::forget
9734        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9735        // Prevent Drop from running (which would shut down the channel)
9736        std::mem::forget(self);
9737    }
9738}
9739
9740impl WlanSoftmacIfcBridgeReportTxResultResponder {
9741    /// Sends a response to the FIDL transaction.
9742    ///
9743    /// Sets the channel to shutdown if an error occurs.
9744    pub fn send(self) -> Result<(), fidl::Error> {
9745        let _result = self.send_raw();
9746        if _result.is_err() {
9747            self.control_handle.shutdown();
9748        }
9749        self.drop_without_shutdown();
9750        _result
9751    }
9752
9753    /// Similar to "send" but does not shutdown the channel if an error occurs.
9754    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9755        let _result = self.send_raw();
9756        self.drop_without_shutdown();
9757        _result
9758    }
9759
9760    fn send_raw(&self) -> Result<(), fidl::Error> {
9761        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9762            (),
9763            self.tx_id,
9764            0x5835c2f13d94e09a,
9765            fidl::encoding::DynamicFlags::empty(),
9766        )
9767    }
9768}
9769
9770#[must_use = "FIDL methods require a response to be sent"]
9771#[derive(Debug)]
9772pub struct WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
9773    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBridgeControlHandle>,
9774    tx_id: u32,
9775}
9776
9777/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBridgeControlHandle::shutdown`])
9778/// if the responder is dropped without sending a response, so that the client
9779/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9780impl std::ops::Drop for WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
9781    fn drop(&mut self) {
9782        self.control_handle.shutdown();
9783        // Safety: drops once, never accessed again
9784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9785    }
9786}
9787
9788impl fidl::endpoints::Responder for WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
9789    type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
9790
9791    fn control_handle(&self) -> &WlanSoftmacIfcBridgeControlHandle {
9792        &self.control_handle
9793    }
9794
9795    fn drop_without_shutdown(mut self) {
9796        // Safety: drops once, never accessed again due to mem::forget
9797        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9798        // Prevent Drop from running (which would shut down the channel)
9799        std::mem::forget(self);
9800    }
9801}
9802
9803impl WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
9804    /// Sends a response to the FIDL transaction.
9805    ///
9806    /// Sets the channel to shutdown if an error occurs.
9807    pub fn send(self) -> Result<(), fidl::Error> {
9808        let _result = self.send_raw();
9809        if _result.is_err() {
9810            self.control_handle.shutdown();
9811        }
9812        self.drop_without_shutdown();
9813        _result
9814    }
9815
9816    /// Similar to "send" but does not shutdown the channel if an error occurs.
9817    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9818        let _result = self.send_raw();
9819        self.drop_without_shutdown();
9820        _result
9821    }
9822
9823    fn send_raw(&self) -> Result<(), fidl::Error> {
9824        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9825            (),
9826            self.tx_id,
9827            0x7045e3cd460dc42c,
9828            fidl::encoding::DynamicFlags::empty(),
9829        )
9830    }
9831}
9832
9833#[must_use = "FIDL methods require a response to be sent"]
9834#[derive(Debug)]
9835pub struct WlanSoftmacIfcBridgeStopBridgedDriverResponder {
9836    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBridgeControlHandle>,
9837    tx_id: u32,
9838}
9839
9840/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBridgeControlHandle::shutdown`])
9841/// if the responder is dropped without sending a response, so that the client
9842/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9843impl std::ops::Drop for WlanSoftmacIfcBridgeStopBridgedDriverResponder {
9844    fn drop(&mut self) {
9845        self.control_handle.shutdown();
9846        // Safety: drops once, never accessed again
9847        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9848    }
9849}
9850
9851impl fidl::endpoints::Responder for WlanSoftmacIfcBridgeStopBridgedDriverResponder {
9852    type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
9853
9854    fn control_handle(&self) -> &WlanSoftmacIfcBridgeControlHandle {
9855        &self.control_handle
9856    }
9857
9858    fn drop_without_shutdown(mut self) {
9859        // Safety: drops once, never accessed again due to mem::forget
9860        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9861        // Prevent Drop from running (which would shut down the channel)
9862        std::mem::forget(self);
9863    }
9864}
9865
9866impl WlanSoftmacIfcBridgeStopBridgedDriverResponder {
9867    /// Sends a response to the FIDL transaction.
9868    ///
9869    /// Sets the channel to shutdown if an error occurs.
9870    pub fn send(self) -> Result<(), fidl::Error> {
9871        let _result = self.send_raw();
9872        if _result.is_err() {
9873            self.control_handle.shutdown();
9874        }
9875        self.drop_without_shutdown();
9876        _result
9877    }
9878
9879    /// Similar to "send" but does not shutdown the channel if an error occurs.
9880    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9881        let _result = self.send_raw();
9882        self.drop_without_shutdown();
9883        _result
9884    }
9885
9886    fn send_raw(&self) -> Result<(), fidl::Error> {
9887        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9888            (),
9889            self.tx_id,
9890            0x112dbd0cc2251151,
9891            fidl::encoding::DynamicFlags::empty(),
9892        )
9893    }
9894}
9895
9896#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9897pub struct WlanTxMarker;
9898
9899impl fidl::endpoints::ProtocolMarker for WlanTxMarker {
9900    type Proxy = WlanTxProxy;
9901    type RequestStream = WlanTxRequestStream;
9902    #[cfg(target_os = "fuchsia")]
9903    type SynchronousProxy = WlanTxSynchronousProxy;
9904
9905    const DEBUG_NAME: &'static str = "(anonymous) WlanTx";
9906}
9907pub type WlanTxTransferResult = Result<(), i32>;
9908
9909pub trait WlanTxProxyInterface: Send + Sync {
9910    type TransferResponseFut: std::future::Future<Output = Result<WlanTxTransferResult, fidl::Error>>
9911        + Send;
9912    fn r#transfer(&self, payload: &WlanTxTransferRequest) -> Self::TransferResponseFut;
9913}
9914#[derive(Debug)]
9915#[cfg(target_os = "fuchsia")]
9916pub struct WlanTxSynchronousProxy {
9917    client: fidl::client::sync::Client,
9918}
9919
9920#[cfg(target_os = "fuchsia")]
9921impl fidl::endpoints::SynchronousProxy for WlanTxSynchronousProxy {
9922    type Proxy = WlanTxProxy;
9923    type Protocol = WlanTxMarker;
9924
9925    fn from_channel(inner: fidl::Channel) -> Self {
9926        Self::new(inner)
9927    }
9928
9929    fn into_channel(self) -> fidl::Channel {
9930        self.client.into_channel()
9931    }
9932
9933    fn as_channel(&self) -> &fidl::Channel {
9934        self.client.as_channel()
9935    }
9936}
9937
9938#[cfg(target_os = "fuchsia")]
9939impl WlanTxSynchronousProxy {
9940    pub fn new(channel: fidl::Channel) -> Self {
9941        let protocol_name = <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9942        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9943    }
9944
9945    pub fn into_channel(self) -> fidl::Channel {
9946        self.client.into_channel()
9947    }
9948
9949    /// Waits until an event arrives and returns it. It is safe for other
9950    /// threads to make concurrent requests while waiting for an event.
9951    pub fn wait_for_event(
9952        &self,
9953        deadline: zx::MonotonicInstant,
9954    ) -> Result<WlanTxEvent, fidl::Error> {
9955        WlanTxEvent::decode(self.client.wait_for_event(deadline)?)
9956    }
9957
9958    pub fn r#transfer(
9959        &self,
9960        mut payload: &WlanTxTransferRequest,
9961        ___deadline: zx::MonotonicInstant,
9962    ) -> Result<WlanTxTransferResult, fidl::Error> {
9963        let _response = self.client.send_query::<
9964            WlanTxTransferRequest,
9965            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
9966        >(
9967            payload,
9968            0x19f8ff7a8b910ab3,
9969            fidl::encoding::DynamicFlags::empty(),
9970            ___deadline,
9971        )?;
9972        Ok(_response.map(|x| x))
9973    }
9974}
9975
9976#[cfg(target_os = "fuchsia")]
9977impl From<WlanTxSynchronousProxy> for zx::NullableHandle {
9978    fn from(value: WlanTxSynchronousProxy) -> Self {
9979        value.into_channel().into()
9980    }
9981}
9982
9983#[cfg(target_os = "fuchsia")]
9984impl From<fidl::Channel> for WlanTxSynchronousProxy {
9985    fn from(value: fidl::Channel) -> Self {
9986        Self::new(value)
9987    }
9988}
9989
9990#[cfg(target_os = "fuchsia")]
9991impl fidl::endpoints::FromClient for WlanTxSynchronousProxy {
9992    type Protocol = WlanTxMarker;
9993
9994    fn from_client(value: fidl::endpoints::ClientEnd<WlanTxMarker>) -> Self {
9995        Self::new(value.into_channel())
9996    }
9997}
9998
9999#[derive(Debug, Clone)]
10000pub struct WlanTxProxy {
10001    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10002}
10003
10004impl fidl::endpoints::Proxy for WlanTxProxy {
10005    type Protocol = WlanTxMarker;
10006
10007    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10008        Self::new(inner)
10009    }
10010
10011    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10012        self.client.into_channel().map_err(|client| Self { client })
10013    }
10014
10015    fn as_channel(&self) -> &::fidl::AsyncChannel {
10016        self.client.as_channel()
10017    }
10018}
10019
10020impl WlanTxProxy {
10021    /// Create a new Proxy for fuchsia.wlan.softmac/WlanTx.
10022    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10023        let protocol_name = <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10024        Self { client: fidl::client::Client::new(channel, protocol_name) }
10025    }
10026
10027    /// Get a Stream of events from the remote end of the protocol.
10028    ///
10029    /// # Panics
10030    ///
10031    /// Panics if the event stream was already taken.
10032    pub fn take_event_stream(&self) -> WlanTxEventStream {
10033        WlanTxEventStream { event_receiver: self.client.take_event_receiver() }
10034    }
10035
10036    pub fn r#transfer(
10037        &self,
10038        mut payload: &WlanTxTransferRequest,
10039    ) -> fidl::client::QueryResponseFut<
10040        WlanTxTransferResult,
10041        fidl::encoding::DefaultFuchsiaResourceDialect,
10042    > {
10043        WlanTxProxyInterface::r#transfer(self, payload)
10044    }
10045}
10046
10047impl WlanTxProxyInterface for WlanTxProxy {
10048    type TransferResponseFut = fidl::client::QueryResponseFut<
10049        WlanTxTransferResult,
10050        fidl::encoding::DefaultFuchsiaResourceDialect,
10051    >;
10052    fn r#transfer(&self, mut payload: &WlanTxTransferRequest) -> Self::TransferResponseFut {
10053        fn _decode(
10054            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10055        ) -> Result<WlanTxTransferResult, fidl::Error> {
10056            let _response = fidl::client::decode_transaction_body::<
10057                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
10058                fidl::encoding::DefaultFuchsiaResourceDialect,
10059                0x19f8ff7a8b910ab3,
10060            >(_buf?)?;
10061            Ok(_response.map(|x| x))
10062        }
10063        self.client.send_query_and_decode::<WlanTxTransferRequest, WlanTxTransferResult>(
10064            payload,
10065            0x19f8ff7a8b910ab3,
10066            fidl::encoding::DynamicFlags::empty(),
10067            _decode,
10068        )
10069    }
10070}
10071
10072pub struct WlanTxEventStream {
10073    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10074}
10075
10076impl std::marker::Unpin for WlanTxEventStream {}
10077
10078impl futures::stream::FusedStream for WlanTxEventStream {
10079    fn is_terminated(&self) -> bool {
10080        self.event_receiver.is_terminated()
10081    }
10082}
10083
10084impl futures::Stream for WlanTxEventStream {
10085    type Item = Result<WlanTxEvent, fidl::Error>;
10086
10087    fn poll_next(
10088        mut self: std::pin::Pin<&mut Self>,
10089        cx: &mut std::task::Context<'_>,
10090    ) -> std::task::Poll<Option<Self::Item>> {
10091        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10092            &mut self.event_receiver,
10093            cx
10094        )?) {
10095            Some(buf) => std::task::Poll::Ready(Some(WlanTxEvent::decode(buf))),
10096            None => std::task::Poll::Ready(None),
10097        }
10098    }
10099}
10100
10101#[derive(Debug)]
10102pub enum WlanTxEvent {}
10103
10104impl WlanTxEvent {
10105    /// Decodes a message buffer as a [`WlanTxEvent`].
10106    fn decode(
10107        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10108    ) -> Result<WlanTxEvent, fidl::Error> {
10109        let (bytes, _handles) = buf.split_mut();
10110        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10111        debug_assert_eq!(tx_header.tx_id, 0);
10112        match tx_header.ordinal {
10113            _ => Err(fidl::Error::UnknownOrdinal {
10114                ordinal: tx_header.ordinal,
10115                protocol_name: <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10116            }),
10117        }
10118    }
10119}
10120
10121/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanTx.
10122pub struct WlanTxRequestStream {
10123    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10124    is_terminated: bool,
10125}
10126
10127impl std::marker::Unpin for WlanTxRequestStream {}
10128
10129impl futures::stream::FusedStream for WlanTxRequestStream {
10130    fn is_terminated(&self) -> bool {
10131        self.is_terminated
10132    }
10133}
10134
10135impl fidl::endpoints::RequestStream for WlanTxRequestStream {
10136    type Protocol = WlanTxMarker;
10137    type ControlHandle = WlanTxControlHandle;
10138
10139    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10140        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10141    }
10142
10143    fn control_handle(&self) -> Self::ControlHandle {
10144        WlanTxControlHandle { inner: self.inner.clone() }
10145    }
10146
10147    fn into_inner(
10148        self,
10149    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10150    {
10151        (self.inner, self.is_terminated)
10152    }
10153
10154    fn from_inner(
10155        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10156        is_terminated: bool,
10157    ) -> Self {
10158        Self { inner, is_terminated }
10159    }
10160}
10161
10162impl futures::Stream for WlanTxRequestStream {
10163    type Item = Result<WlanTxRequest, fidl::Error>;
10164
10165    fn poll_next(
10166        mut self: std::pin::Pin<&mut Self>,
10167        cx: &mut std::task::Context<'_>,
10168    ) -> std::task::Poll<Option<Self::Item>> {
10169        let this = &mut *self;
10170        if this.inner.check_shutdown(cx) {
10171            this.is_terminated = true;
10172            return std::task::Poll::Ready(None);
10173        }
10174        if this.is_terminated {
10175            panic!("polled WlanTxRequestStream after completion");
10176        }
10177        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10178            |bytes, handles| {
10179                match this.inner.channel().read_etc(cx, bytes, handles) {
10180                    std::task::Poll::Ready(Ok(())) => {}
10181                    std::task::Poll::Pending => return std::task::Poll::Pending,
10182                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10183                        this.is_terminated = true;
10184                        return std::task::Poll::Ready(None);
10185                    }
10186                    std::task::Poll::Ready(Err(e)) => {
10187                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10188                            e.into(),
10189                        ))));
10190                    }
10191                }
10192
10193                // A message has been received from the channel
10194                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10195
10196                std::task::Poll::Ready(Some(match header.ordinal {
10197                    0x19f8ff7a8b910ab3 => {
10198                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10199                        let mut req = fidl::new_empty!(
10200                            WlanTxTransferRequest,
10201                            fidl::encoding::DefaultFuchsiaResourceDialect
10202                        );
10203                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanTxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
10204                        let control_handle = WlanTxControlHandle { inner: this.inner.clone() };
10205                        Ok(WlanTxRequest::Transfer {
10206                            payload: req,
10207                            responder: WlanTxTransferResponder {
10208                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10209                                tx_id: header.tx_id,
10210                            },
10211                        })
10212                    }
10213                    _ => Err(fidl::Error::UnknownOrdinal {
10214                        ordinal: header.ordinal,
10215                        protocol_name:
10216                            <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10217                    }),
10218                }))
10219            },
10220        )
10221    }
10222}
10223
10224/// Protocol for sending a WLAN frame from the bridged wlansoftmac
10225/// driver to the wlansoftmac driver.
10226///
10227/// # Experimental
10228///
10229/// This protocol is implemented as a foreign function interface (FFI)
10230/// between the wlansoftmac driver and the bridged driver solely to improve
10231/// the performance of processing data frames through the wlan-mlme library.
10232#[derive(Debug)]
10233pub enum WlanTxRequest {
10234    Transfer { payload: WlanTxTransferRequest, responder: WlanTxTransferResponder },
10235}
10236
10237impl WlanTxRequest {
10238    #[allow(irrefutable_let_patterns)]
10239    pub fn into_transfer(self) -> Option<(WlanTxTransferRequest, WlanTxTransferResponder)> {
10240        if let WlanTxRequest::Transfer { payload, responder } = self {
10241            Some((payload, responder))
10242        } else {
10243            None
10244        }
10245    }
10246
10247    /// Name of the method defined in FIDL
10248    pub fn method_name(&self) -> &'static str {
10249        match *self {
10250            WlanTxRequest::Transfer { .. } => "transfer",
10251        }
10252    }
10253}
10254
10255#[derive(Debug, Clone)]
10256pub struct WlanTxControlHandle {
10257    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10258}
10259
10260impl fidl::endpoints::ControlHandle for WlanTxControlHandle {
10261    fn shutdown(&self) {
10262        self.inner.shutdown()
10263    }
10264
10265    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10266        self.inner.shutdown_with_epitaph(status)
10267    }
10268
10269    fn is_closed(&self) -> bool {
10270        self.inner.channel().is_closed()
10271    }
10272    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10273        self.inner.channel().on_closed()
10274    }
10275
10276    #[cfg(target_os = "fuchsia")]
10277    fn signal_peer(
10278        &self,
10279        clear_mask: zx::Signals,
10280        set_mask: zx::Signals,
10281    ) -> Result<(), zx_status::Status> {
10282        use fidl::Peered;
10283        self.inner.channel().signal_peer(clear_mask, set_mask)
10284    }
10285}
10286
10287impl WlanTxControlHandle {}
10288
10289#[must_use = "FIDL methods require a response to be sent"]
10290#[derive(Debug)]
10291pub struct WlanTxTransferResponder {
10292    control_handle: std::mem::ManuallyDrop<WlanTxControlHandle>,
10293    tx_id: u32,
10294}
10295
10296/// Set the the channel to be shutdown (see [`WlanTxControlHandle::shutdown`])
10297/// if the responder is dropped without sending a response, so that the client
10298/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10299impl std::ops::Drop for WlanTxTransferResponder {
10300    fn drop(&mut self) {
10301        self.control_handle.shutdown();
10302        // Safety: drops once, never accessed again
10303        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10304    }
10305}
10306
10307impl fidl::endpoints::Responder for WlanTxTransferResponder {
10308    type ControlHandle = WlanTxControlHandle;
10309
10310    fn control_handle(&self) -> &WlanTxControlHandle {
10311        &self.control_handle
10312    }
10313
10314    fn drop_without_shutdown(mut self) {
10315        // Safety: drops once, never accessed again due to mem::forget
10316        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10317        // Prevent Drop from running (which would shut down the channel)
10318        std::mem::forget(self);
10319    }
10320}
10321
10322impl WlanTxTransferResponder {
10323    /// Sends a response to the FIDL transaction.
10324    ///
10325    /// Sets the channel to shutdown if an error occurs.
10326    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10327        let _result = self.send_raw(result);
10328        if _result.is_err() {
10329            self.control_handle.shutdown();
10330        }
10331        self.drop_without_shutdown();
10332        _result
10333    }
10334
10335    /// Similar to "send" but does not shutdown the channel if an error occurs.
10336    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10337        let _result = self.send_raw(result);
10338        self.drop_without_shutdown();
10339        _result
10340    }
10341
10342    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10343        self.control_handle
10344            .inner
10345            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10346                result,
10347                self.tx_id,
10348                0x19f8ff7a8b910ab3,
10349                fidl::encoding::DynamicFlags::empty(),
10350            )
10351    }
10352}
10353
10354mod internal {
10355    use super::*;
10356
10357    impl fidl::encoding::ResourceTypeMarker for WlanSoftmacBridgeStartRequest {
10358        type Borrowed<'a> = &'a mut Self;
10359        fn take_or_borrow<'a>(
10360            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10361        ) -> Self::Borrowed<'a> {
10362            value
10363        }
10364    }
10365
10366    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeStartRequest {
10367        type Owned = Self;
10368
10369        #[inline(always)]
10370        fn inline_align(_context: fidl::encoding::Context) -> usize {
10371            8
10372        }
10373
10374        #[inline(always)]
10375        fn inline_size(_context: fidl::encoding::Context) -> usize {
10376            24
10377        }
10378    }
10379
10380    unsafe impl
10381        fidl::encoding::Encode<
10382            WlanSoftmacBridgeStartRequest,
10383            fidl::encoding::DefaultFuchsiaResourceDialect,
10384        > for &mut WlanSoftmacBridgeStartRequest
10385    {
10386        #[inline]
10387        unsafe fn encode(
10388            self,
10389            encoder: &mut fidl::encoding::Encoder<
10390                '_,
10391                fidl::encoding::DefaultFuchsiaResourceDialect,
10392            >,
10393            offset: usize,
10394            _depth: fidl::encoding::Depth,
10395        ) -> fidl::Result<()> {
10396            encoder.debug_check_bounds::<WlanSoftmacBridgeStartRequest>(offset);
10397            // Delegate to tuple encoding.
10398            fidl::encoding::Encode::<
10399                WlanSoftmacBridgeStartRequest,
10400                fidl::encoding::DefaultFuchsiaResourceDialect,
10401            >::encode(
10402                (
10403                    <fidl::encoding::Endpoint<
10404                        fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
10405                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10406                        &mut self.ifc_bridge
10407                    ),
10408                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.ethernet_tx),
10409                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_rx),
10410                ),
10411                encoder,
10412                offset,
10413                _depth,
10414            )
10415        }
10416    }
10417    unsafe impl<
10418        T0: fidl::encoding::Encode<
10419                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>>,
10420                fidl::encoding::DefaultFuchsiaResourceDialect,
10421            >,
10422        T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10423        T2: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10424    >
10425        fidl::encoding::Encode<
10426            WlanSoftmacBridgeStartRequest,
10427            fidl::encoding::DefaultFuchsiaResourceDialect,
10428        > for (T0, T1, T2)
10429    {
10430        #[inline]
10431        unsafe fn encode(
10432            self,
10433            encoder: &mut fidl::encoding::Encoder<
10434                '_,
10435                fidl::encoding::DefaultFuchsiaResourceDialect,
10436            >,
10437            offset: usize,
10438            depth: fidl::encoding::Depth,
10439        ) -> fidl::Result<()> {
10440            encoder.debug_check_bounds::<WlanSoftmacBridgeStartRequest>(offset);
10441            // Zero out padding regions. There's no need to apply masks
10442            // because the unmasked parts will be overwritten by fields.
10443            unsafe {
10444                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10445                (ptr as *mut u64).write_unaligned(0);
10446            }
10447            // Write the fields.
10448            self.0.encode(encoder, offset + 0, depth)?;
10449            self.1.encode(encoder, offset + 8, depth)?;
10450            self.2.encode(encoder, offset + 16, depth)?;
10451            Ok(())
10452        }
10453    }
10454
10455    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10456        for WlanSoftmacBridgeStartRequest
10457    {
10458        #[inline(always)]
10459        fn new_empty() -> Self {
10460            Self {
10461                ifc_bridge: fidl::new_empty!(
10462                    fidl::encoding::Endpoint<
10463                        fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
10464                    >,
10465                    fidl::encoding::DefaultFuchsiaResourceDialect
10466                ),
10467                ethernet_tx: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10468                wlan_rx: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10469            }
10470        }
10471
10472        #[inline]
10473        unsafe fn decode(
10474            &mut self,
10475            decoder: &mut fidl::encoding::Decoder<
10476                '_,
10477                fidl::encoding::DefaultFuchsiaResourceDialect,
10478            >,
10479            offset: usize,
10480            _depth: fidl::encoding::Depth,
10481        ) -> fidl::Result<()> {
10482            decoder.debug_check_bounds::<Self>(offset);
10483            // Verify that padding bytes are zero.
10484            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10485            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10486            let mask = 0xffffffff00000000u64;
10487            let maskedval = padval & mask;
10488            if maskedval != 0 {
10489                return Err(fidl::Error::NonZeroPadding {
10490                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10491                });
10492            }
10493            fidl::decode!(
10494                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>>,
10495                fidl::encoding::DefaultFuchsiaResourceDialect,
10496                &mut self.ifc_bridge,
10497                decoder,
10498                offset + 0,
10499                _depth
10500            )?;
10501            fidl::decode!(
10502                u64,
10503                fidl::encoding::DefaultFuchsiaResourceDialect,
10504                &mut self.ethernet_tx,
10505                decoder,
10506                offset + 8,
10507                _depth
10508            )?;
10509            fidl::decode!(
10510                u64,
10511                fidl::encoding::DefaultFuchsiaResourceDialect,
10512                &mut self.wlan_rx,
10513                decoder,
10514                offset + 16,
10515                _depth
10516            )?;
10517            Ok(())
10518        }
10519    }
10520
10521    impl fidl::encoding::ResourceTypeMarker for WlanSoftmacBridgeStartResponse {
10522        type Borrowed<'a> = &'a mut Self;
10523        fn take_or_borrow<'a>(
10524            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10525        ) -> Self::Borrowed<'a> {
10526            value
10527        }
10528    }
10529
10530    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeStartResponse {
10531        type Owned = Self;
10532
10533        #[inline(always)]
10534        fn inline_align(_context: fidl::encoding::Context) -> usize {
10535            4
10536        }
10537
10538        #[inline(always)]
10539        fn inline_size(_context: fidl::encoding::Context) -> usize {
10540            4
10541        }
10542    }
10543
10544    unsafe impl
10545        fidl::encoding::Encode<
10546            WlanSoftmacBridgeStartResponse,
10547            fidl::encoding::DefaultFuchsiaResourceDialect,
10548        > for &mut WlanSoftmacBridgeStartResponse
10549    {
10550        #[inline]
10551        unsafe fn encode(
10552            self,
10553            encoder: &mut fidl::encoding::Encoder<
10554                '_,
10555                fidl::encoding::DefaultFuchsiaResourceDialect,
10556            >,
10557            offset: usize,
10558            _depth: fidl::encoding::Depth,
10559        ) -> fidl::Result<()> {
10560            encoder.debug_check_bounds::<WlanSoftmacBridgeStartResponse>(offset);
10561            // Delegate to tuple encoding.
10562            fidl::encoding::Encode::<
10563                WlanSoftmacBridgeStartResponse,
10564                fidl::encoding::DefaultFuchsiaResourceDialect,
10565            >::encode(
10566                (<fidl::encoding::HandleType<
10567                    fidl::Channel,
10568                    { fidl::ObjectType::CHANNEL.into_raw() },
10569                    2147483648,
10570                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10571                    &mut self.sme_channel
10572                ),),
10573                encoder,
10574                offset,
10575                _depth,
10576            )
10577        }
10578    }
10579    unsafe impl<
10580        T0: fidl::encoding::Encode<
10581                fidl::encoding::HandleType<
10582                    fidl::Channel,
10583                    { fidl::ObjectType::CHANNEL.into_raw() },
10584                    2147483648,
10585                >,
10586                fidl::encoding::DefaultFuchsiaResourceDialect,
10587            >,
10588    >
10589        fidl::encoding::Encode<
10590            WlanSoftmacBridgeStartResponse,
10591            fidl::encoding::DefaultFuchsiaResourceDialect,
10592        > for (T0,)
10593    {
10594        #[inline]
10595        unsafe fn encode(
10596            self,
10597            encoder: &mut fidl::encoding::Encoder<
10598                '_,
10599                fidl::encoding::DefaultFuchsiaResourceDialect,
10600            >,
10601            offset: usize,
10602            depth: fidl::encoding::Depth,
10603        ) -> fidl::Result<()> {
10604            encoder.debug_check_bounds::<WlanSoftmacBridgeStartResponse>(offset);
10605            // Zero out padding regions. There's no need to apply masks
10606            // because the unmasked parts will be overwritten by fields.
10607            // Write the fields.
10608            self.0.encode(encoder, offset + 0, depth)?;
10609            Ok(())
10610        }
10611    }
10612
10613    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10614        for WlanSoftmacBridgeStartResponse
10615    {
10616        #[inline(always)]
10617        fn new_empty() -> Self {
10618            Self {
10619                sme_channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10620            }
10621        }
10622
10623        #[inline]
10624        unsafe fn decode(
10625            &mut self,
10626            decoder: &mut fidl::encoding::Decoder<
10627                '_,
10628                fidl::encoding::DefaultFuchsiaResourceDialect,
10629            >,
10630            offset: usize,
10631            _depth: fidl::encoding::Depth,
10632        ) -> fidl::Result<()> {
10633            decoder.debug_check_bounds::<Self>(offset);
10634            // Verify that padding bytes are zero.
10635            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.sme_channel, decoder, offset + 0, _depth)?;
10636            Ok(())
10637        }
10638    }
10639}