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