Skip to main content

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