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