\hypertarget{if__urndis_8c_source}{}\doxysection{if\+\_\+urndis.\+c}
\label{if__urndis_8c_source}\index{dev/usb/net/if\_urndis.c@{dev/usb/net/if\_urndis.c}}
\mbox{\hyperlink{if__urndis_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00001}00001 \textcolor{comment}{/*      \$OpenBSD: if\_urndis.c,v 1.46 2013/12/09 15:45:29 pirofti Exp \$ */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00002}00002 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00003}00003 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2010 Jonathan Armani <armani@openbsd.org>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2010 Fabien Romano <fabien@openbsd.org>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 2010 Michael Knudsen <mk@openbsd.org>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00007}00007 \textcolor{comment}{ * Copyright (c) 2014 Hans Petter Selasky <hselasky@freebsd.org>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00008}00008 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00010}00010 \textcolor{comment}{ * Permission to use, copy, modify, and distribute this software for any}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00011}00011 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00012}00012 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00014}00014 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00015}00015 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00016}00016 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00017}00017 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00018}00018 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00019}00019 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00020}00020 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00021}00021 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00022}00022 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00023}00023 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00024}\mbox{\hyperlink{if__urndis_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00024}} \mbox{\hyperlink{if__urndis_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00025}00025 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00026}00026 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00027}00027 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00028}00028 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <net/if\_var.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <net/rndis.h>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi__util_8h}{dev/usb/usbdi\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00053}00053 \textcolor{preprocessor}{\#include "{}usbdevs.h"{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00055}\mbox{\hyperlink{if__urndis_8c_a927dd6f59caf10a2991dfb564bcbb1e1}{00055}} \textcolor{preprocessor}{\#define USB\_DEBUG\_VAR urndis\_debug}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__debug_8h}{dev/usb/usb\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00058}00058 \textcolor{preprocessor}{\#include "{}usb\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__ethernet_8h}{dev/usb/net/usb\_ethernet.h}}>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{if__urndisreg_8h}{dev/usb/net/if\_urndisreg.h}}>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__cdc_8h}{dev/usb/usb\_cdc.h}}>}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00065}\mbox{\hyperlink{if__urndis_8c_a95fd2c7032e5d5b7876ec8548aaaaab8}{00065}} \textcolor{keyword}{static} device\_probe\_t \mbox{\hyperlink{if__urndis_8c_a95fd2c7032e5d5b7876ec8548aaaaab8}{urndis\_probe}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00066}\mbox{\hyperlink{if__urndis_8c_aa693bfebaac8e3bc69855ca8378f52b8}{00066}} \textcolor{keyword}{static} device\_attach\_t \mbox{\hyperlink{if__urndis_8c_aa693bfebaac8e3bc69855ca8378f52b8}{urndis\_attach}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00067}\mbox{\hyperlink{if__urndis_8c_af562173c0a24579420a650365aeed807}{00067}} \textcolor{keyword}{static} device\_detach\_t \mbox{\hyperlink{if__urndis_8c_af562173c0a24579420a650365aeed807}{urndis\_detach}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00068}\mbox{\hyperlink{if__urndis_8c_ad3a1286349ea936020d3065ef8e60b2b}{00068}} \textcolor{keyword}{static} device\_suspend\_t \mbox{\hyperlink{if__urndis_8c_ad3a1286349ea936020d3065ef8e60b2b}{urndis\_suspend}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00069}\mbox{\hyperlink{if__urndis_8c_ad8ef816b30ec3f38513be33cb724828c}{00069}} \textcolor{keyword}{static} device\_resume\_t \mbox{\hyperlink{if__urndis_8c_ad8ef816b30ec3f38513be33cb724828c}{urndis\_resume}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00071}\mbox{\hyperlink{if__urndis_8c_a9749e9b3a88a489241d0fbfe11779b51}{00071}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{if__urndis_8c_a9749e9b3a88a489241d0fbfe11779b51}{urndis\_bulk\_write\_callback}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00072}\mbox{\hyperlink{if__urndis_8c_a7b4f3176af32c848c6dfe9d5eb191eca}{00072}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{if__urndis_8c_a7b4f3176af32c848c6dfe9d5eb191eca}{urndis\_bulk\_read\_callback}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00073}\mbox{\hyperlink{if__urndis_8c_a1e03057a59ceaba91ae5080ed2eb5ad4}{00073}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{if__urndis_8c_a1e03057a59ceaba91ae5080ed2eb5ad4}{urndis\_intr\_read\_callback}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00075}\mbox{\hyperlink{if__urndis_8c_a433c97b9143df7e249f2d8235708823b}{00075}} \textcolor{keyword}{static} \mbox{\hyperlink{usb__ethernet_8h_ac29bf5775f723e7b7a1f7a29c906b93d}{uether\_fn\_t}} \mbox{\hyperlink{if__urndis_8c_a433c97b9143df7e249f2d8235708823b}{urndis\_attach\_post}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00076}\mbox{\hyperlink{if__urndis_8c_a774d65c29fea908d1a0bf3e34aada2c5}{00076}} \textcolor{keyword}{static} \mbox{\hyperlink{usb__ethernet_8h_ac29bf5775f723e7b7a1f7a29c906b93d}{uether\_fn\_t}} \mbox{\hyperlink{if__urndis_8c_a774d65c29fea908d1a0bf3e34aada2c5}{urndis\_init}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00077}\mbox{\hyperlink{if__urndis_8c_aa5db02b3f269a9135349b10516ccc143}{00077}} \textcolor{keyword}{static} \mbox{\hyperlink{usb__ethernet_8h_ac29bf5775f723e7b7a1f7a29c906b93d}{uether\_fn\_t}} \mbox{\hyperlink{if__urndis_8c_aa5db02b3f269a9135349b10516ccc143}{urndis\_stop}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00078}\mbox{\hyperlink{if__urndis_8c_a62f6d0d4f00bb6a05ef47c5ccab5da3f}{00078}} \textcolor{keyword}{static} \mbox{\hyperlink{usb__ethernet_8h_ac29bf5775f723e7b7a1f7a29c906b93d}{uether\_fn\_t}} \mbox{\hyperlink{if__urndis_8c_a62f6d0d4f00bb6a05ef47c5ccab5da3f}{urndis\_start}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00079}\mbox{\hyperlink{if__urndis_8c_afc353a5245ddc2c2dafa58cd896e2006}{00079}} \textcolor{keyword}{static} \mbox{\hyperlink{usb__ethernet_8h_ac29bf5775f723e7b7a1f7a29c906b93d}{uether\_fn\_t}} \mbox{\hyperlink{if__urndis_8c_afc353a5245ddc2c2dafa58cd896e2006}{urndis\_setmulti}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00080}\mbox{\hyperlink{if__urndis_8c_af4b870f82e20aa7fa001902bc8385f8f}{00080}} \textcolor{keyword}{static} \mbox{\hyperlink{usb__ethernet_8h_ac29bf5775f723e7b7a1f7a29c906b93d}{uether\_fn\_t}} \mbox{\hyperlink{if__urndis_8c_af4b870f82e20aa7fa001902bc8385f8f}{urndis\_setpromisc}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00082}00082 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{if__urndis_8c_a19c961c2719c75556b0b8b0ccd213eec}{urndis\_ctrl\_query}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc, uint32\_t oid,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00083}00083                     \textcolor{keyword}{struct} rndis\_query\_req *msg, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00084}00084                     \textcolor{keyword}{const} \textcolor{keywordtype}{void} **rbuf, uint16\_t *rbufsz);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00085}00085 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{if__urndis_8c_a5487dceb4fd00ba1288086ee41a90a47}{urndis\_ctrl\_set}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc, uint32\_t oid,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00086}00086                     \textcolor{keyword}{struct} rndis\_set\_req *msg, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00087}00087 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{if__urndis_8c_a693615126ad1c21bc56e2a910ed40ea1}{urndis\_ctrl\_handle\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00088}00088                     \textcolor{keyword}{const} \textcolor{keyword}{struct} rndis\_comp\_hdr *hdr);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00089}00089 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{if__urndis_8c_a82a03aae19bf6d817386c3639df0bf58}{urndis\_ctrl\_handle\_query}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00090}00090                     \textcolor{keyword}{const} \textcolor{keyword}{struct} rndis\_comp\_hdr *hdr, \textcolor{keyword}{const} \textcolor{keywordtype}{void} **buf,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00091}00091                     uint16\_t *bufsz);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00092}00092 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{if__urndis_8c_a9289e25ceb4c756cb6610d1754083743}{urndis\_ctrl\_handle\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00093}00093                     \textcolor{keyword}{const} \textcolor{keyword}{struct} rndis\_comp\_hdr *hdr);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00094}00094 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{if__urndis_8c_a409f272496597f5a7017896c74a8651f}{urndis\_ctrl\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00095}00095 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{if__urndis_8c_a5f77f5f7c76a730d33ad0e582f18b9d9}{urndis\_ctrl\_halt}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00097}00097 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00098}00098 \textcolor{keyword}{static} \textcolor{keywordtype}{int} urndis\_debug = 0;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00099}00099 \textcolor{keyword}{static}  \mbox{\hyperlink{dwc__otg_8c_a58e125bcf985ce2333baef42f97b33b3}{SYSCTL\_NODE}}(\_hw\_usb, OID\_AUTO, urndis, CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00100}00100     \textcolor{stringliteral}{"{}USB RNDIS-\/Ethernet"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00101}00101 \mbox{\hyperlink{dwc__otg_8c_a83d020f0b15dc2783f3f1a6966c75e36}{SYSCTL\_INT}}(\_hw\_usb\_urndis, OID\_AUTO, \mbox{\hyperlink{cfumass_8c_ac3e1795766a80ec63b157951b4b9a7d4}{debug}}, CTLFLAG\_RWTUN, \&urndis\_debug, 0,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00102}00102     \textcolor{stringliteral}{"{}Debug level"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00103}00103 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00105}\mbox{\hyperlink{if__urndis_8c_ab621b6072c33a5f9d270ed153742ccae}{00105}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{if__urndis_8c_ab621b6072c33a5f9d270ed153742ccae}{urndis\_config}}[\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798abd01fc7b0ecbbb8fc54905d9a1851524}{URNDIS\_N\_TRANSFER}}] = \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00106}00106         [\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798a6e9e14712b37f666312e45c34b13d3b2}{URNDIS\_BULK\_RX}}] = \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00107}00107                 .\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00108}00108                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00109}00109                 .direction = \mbox{\hyperlink{usb_8h_a6e0258e8570573ddabdd296569db720e}{UE\_DIR\_RX}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00110}00110                 .if\_index = 0,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00111}00111                 .frames = 1,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00112}00112                 .bufsize = \mbox{\hyperlink{if__urndisreg_8h_a477c72e82ae22615d5379ab947782a9f}{RNDIS\_RX\_MAXLEN}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00113}00113                 .flags = \{.short\_xfer\_ok = 1,\},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00114}00114                 .callback = \mbox{\hyperlink{if__urndis_8c_a7b4f3176af32c848c6dfe9d5eb191eca}{urndis\_bulk\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00115}00115                 .timeout = 0,           \textcolor{comment}{/* no timeout */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00116}00116                 .usb\_mode = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00117}00117         \},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00118}00118 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00119}00119         [\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798ace958cd7cf38373a814842abaa5975c2}{URNDIS\_BULK\_TX}}] = \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00120}00120                 .type = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00121}00121                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00122}00122                 .direction = \mbox{\hyperlink{usb_8h_aba70c1d0c8b6a6cd3452b304d9a981ba}{UE\_DIR\_TX}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00123}00123                 .if\_index = 0,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00124}00124                 .frames = \mbox{\hyperlink{if__urndisreg_8h_a332c122a09645fb98663969dca75ae2a}{RNDIS\_TX\_FRAMES\_MAX}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00125}00125                 .bufsize = (\mbox{\hyperlink{if__urndisreg_8h_a332c122a09645fb98663969dca75ae2a}{RNDIS\_TX\_FRAMES\_MAX}} * \mbox{\hyperlink{if__urndisreg_8h_aeffe59019822466e458e9deef6bd4e28}{RNDIS\_TX\_MAXLEN}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00126}00126                 .\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}} = \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00127}00127                         .\mbox{\hyperlink{structusb__xfer__flags_a76816b701c58c22a9a78904b109c2e95}{force\_short\_xfer}} = 1,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00128}00128                 \},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00129}00129                 .callback = \mbox{\hyperlink{if__urndis_8c_a9749e9b3a88a489241d0fbfe11779b51}{urndis\_bulk\_write\_callback}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00130}00130                 .timeout = 10000,       \textcolor{comment}{/* 10 seconds */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00131}00131                 .usb\_mode = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00132}00132         \},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00134}00134         [\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798a823ef05351167219366d0c881fb1deb6}{URNDIS\_INTR\_RX}}] = \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00135}00135                 .type = \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00136}00136                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00137}00137                 .direction = \mbox{\hyperlink{usb_8h_a6e0258e8570573ddabdd296569db720e}{UE\_DIR\_RX}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00138}00138                 .if\_index = 1,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00139}00139                 .bufsize = 0,   \textcolor{comment}{/* use wMaxPacketSize */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00140}00140                 .flags = \{.short\_xfer\_ok = 1,.no\_pipe\_ok = 1,\},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00141}00141                 .callback = \mbox{\hyperlink{if__urndis_8c_a1e03057a59ceaba91ae5080ed2eb5ad4}{urndis\_intr\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00142}00142                 .timeout = 0,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00143}00143                 .usb\_mode = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00144}00144         \},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00145}00145 \};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00147}\mbox{\hyperlink{if__urndis_8c_ab607b4a695062d3d0c1386f74d1b12f2}{00147}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{if__urndis_8c_ab607b4a695062d3d0c1386f74d1b12f2}{urndis\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00148}00148         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00149}00149         DEVMETHOD(device\_probe, \mbox{\hyperlink{if__urndis_8c_a95fd2c7032e5d5b7876ec8548aaaaab8}{urndis\_probe}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00150}00150         DEVMETHOD(device\_attach, \mbox{\hyperlink{if__urndis_8c_aa693bfebaac8e3bc69855ca8378f52b8}{urndis\_attach}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00151}00151         DEVMETHOD(device\_detach, \mbox{\hyperlink{if__urndis_8c_af562173c0a24579420a650365aeed807}{urndis\_detach}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00152}00152         DEVMETHOD(device\_suspend, \mbox{\hyperlink{if__urndis_8c_ad3a1286349ea936020d3065ef8e60b2b}{urndis\_suspend}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00153}00153         DEVMETHOD(device\_resume, \mbox{\hyperlink{if__urndis_8c_ad8ef816b30ec3f38513be33cb724828c}{urndis\_resume}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00155}00155         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00156}00156 \};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00158}\mbox{\hyperlink{if__urndis_8c_afb3079fc1423fdbd16bfafd636ed7129}{00158}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{if__urndis_8c_afb3079fc1423fdbd16bfafd636ed7129}{urndis\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00159}00159         .name = \textcolor{stringliteral}{"{}urndis"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00160}00160         .methods = \mbox{\hyperlink{if__urndis_8c_ab607b4a695062d3d0c1386f74d1b12f2}{urndis\_methods}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00161}00161         .size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structurndis__softc}{urndis\_softc}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00162}00162 \};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00163}00163 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00164}\mbox{\hyperlink{if__urndis_8c_accc58082b55bce8405d8c2eac2e6bedb}{00164}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{if__urndis_8c_accc58082b55bce8405d8c2eac2e6bedb}{urndis\_devclass}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00166}\mbox{\hyperlink{if__urndis_8c_aad74a1add5acd7ab8a3c9e12ff0ea0a2}{00166}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{usbdi_8h_acf836fd8d6349b66a31f45420728da8d}{STRUCT\_USB\_HOST\_ID}} \mbox{\hyperlink{if__urndis_8c_aad74a1add5acd7ab8a3c9e12ff0ea0a2}{urndis\_host\_devs}}[] = \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00167}00167         \textcolor{comment}{/* Generic RNDIS class match */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00168}00168         \{\mbox{\hyperlink{usbdi_8h_a74c0bae2d55b3014e0583ec8ea4d5dc0}{USB\_IFACE\_CLASS}}(\mbox{\hyperlink{usb_8h_a7ee8a2a46bb5ed7942883b57b7d866a1}{UICLASS\_CDC}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00169}00169                 \mbox{\hyperlink{usbdi_8h_a15ff0bc986f953c98128bd03e394b571}{USB\_IFACE\_SUBCLASS}}(\mbox{\hyperlink{usb_8h_ace94ac5934fa50385aae1f446dd2ea69}{UISUBCLASS\_ABSTRACT\_CONTROL\_MODEL}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00170}00170                 \mbox{\hyperlink{usbdi_8h_a99fe00139ae050549bc725ebd3c0d5cc}{USB\_IFACE\_PROTOCOL}}(0xff)\},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00171}00171         \{\mbox{\hyperlink{usbdi_8h_a74c0bae2d55b3014e0583ec8ea4d5dc0}{USB\_IFACE\_CLASS}}(\mbox{\hyperlink{usb_8h_a8e6d9c686d813c5a56ed3dea44d73f2a}{UICLASS\_WIRELESS}}), \mbox{\hyperlink{usbdi_8h_a15ff0bc986f953c98128bd03e394b571}{USB\_IFACE\_SUBCLASS}}(\mbox{\hyperlink{usb_8h_af00f485b307253643724da7a46840917}{UISUBCLASS\_RF}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00172}00172                 \mbox{\hyperlink{usbdi_8h_a99fe00139ae050549bc725ebd3c0d5cc}{USB\_IFACE\_PROTOCOL}}(\mbox{\hyperlink{usb_8h_a56cddd289543fe8a999921f16664df33}{UIPROTO\_RNDIS}})\},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00173}00173         \{\mbox{\hyperlink{usbdi_8h_a74c0bae2d55b3014e0583ec8ea4d5dc0}{USB\_IFACE\_CLASS}}(\mbox{\hyperlink{usb_8h_ab711970a9807038361c01cf5374597d6}{UICLASS\_IAD}}), \mbox{\hyperlink{usbdi_8h_a15ff0bc986f953c98128bd03e394b571}{USB\_IFACE\_SUBCLASS}}(\mbox{\hyperlink{usb_8h_ab2c837841eca26a850f8e789241f53c1}{UISUBCLASS\_SYNC}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00174}00174                 \mbox{\hyperlink{usbdi_8h_a99fe00139ae050549bc725ebd3c0d5cc}{USB\_IFACE\_PROTOCOL}}(\mbox{\hyperlink{usb_8h_a3bf53c5af43f446631950ec36762f882}{UIPROTO\_ACTIVESYNC}})\},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00175}00175         \textcolor{comment}{/* HP-\/WebOS */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00176}00176         \{\mbox{\hyperlink{usbdi_8h_ab5d541c01afa5eb1a62de5dc85273298}{USB\_VENDOR}}(USB\_VENDOR\_PALM), \mbox{\hyperlink{usbdi_8h_a74c0bae2d55b3014e0583ec8ea4d5dc0}{USB\_IFACE\_CLASS}}(\mbox{\hyperlink{usb_8h_a7ee8a2a46bb5ed7942883b57b7d866a1}{UICLASS\_CDC}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00177}00177                 \mbox{\hyperlink{usbdi_8h_a15ff0bc986f953c98128bd03e394b571}{USB\_IFACE\_SUBCLASS}}(\mbox{\hyperlink{usb_8h_ace94ac5934fa50385aae1f446dd2ea69}{UISUBCLASS\_ABSTRACT\_CONTROL\_MODEL}}),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00178}00178                 \mbox{\hyperlink{usbdi_8h_a99fe00139ae050549bc725ebd3c0d5cc}{USB\_IFACE\_PROTOCOL}}(0xff)\},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00179}00179         \textcolor{comment}{/* Nokia 7 plus */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00180}00180         \{\mbox{\hyperlink{usbdi_8h_a74c0bae2d55b3014e0583ec8ea4d5dc0}{USB\_IFACE\_CLASS}}(\mbox{\hyperlink{usb_8h_ab711970a9807038361c01cf5374597d6}{UICLASS\_IAD}}), \mbox{\hyperlink{usbdi_8h_a15ff0bc986f953c98128bd03e394b571}{USB\_IFACE\_SUBCLASS}}(0x4),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00181}00181                 \mbox{\hyperlink{usbdi_8h_a99fe00139ae050549bc725ebd3c0d5cc}{USB\_IFACE\_PROTOCOL}}(\mbox{\hyperlink{usb_8h_a3bf53c5af43f446631950ec36762f882}{UIPROTO\_ACTIVESYNC}})\},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00182}00182         \textcolor{comment}{/* Novatel Wireless 8800/8000/etc */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00183}00183         \{\mbox{\hyperlink{usbdi_8h_a74c0bae2d55b3014e0583ec8ea4d5dc0}{USB\_IFACE\_CLASS}}(\mbox{\hyperlink{usb_8h_ab711970a9807038361c01cf5374597d6}{UICLASS\_IAD}}), \mbox{\hyperlink{usbdi_8h_a15ff0bc986f953c98128bd03e394b571}{USB\_IFACE\_SUBCLASS}}(0xef),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00184}00184                 \mbox{\hyperlink{usbdi_8h_a99fe00139ae050549bc725ebd3c0d5cc}{USB\_IFACE\_PROTOCOL}}(\mbox{\hyperlink{usb_8h_a56cddd289543fe8a999921f16664df33}{UIPROTO\_RNDIS}})\},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00185}00185 \};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00187}\mbox{\hyperlink{if__urndis_8c_a98a15c86b51311798a4e240f24289860}{00187}} \mbox{\hyperlink{if__urndis_8c_a98a15c86b51311798a4e240f24289860}{DRIVER\_MODULE}}(urndis, uhub, \mbox{\hyperlink{if__urndis_8c_afb3079fc1423fdbd16bfafd636ed7129}{urndis\_driver}}, \mbox{\hyperlink{if__urndis_8c_accc58082b55bce8405d8c2eac2e6bedb}{urndis\_devclass}}, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00188}\mbox{\hyperlink{if__urndis_8c_a4a7169ab65cbccb2daa1e51812276679}{00188}} \mbox{\hyperlink{if__urndis_8c_a4a7169ab65cbccb2daa1e51812276679}{MODULE\_VERSION}}(urndis, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00189}\mbox{\hyperlink{if__urndis_8c_a6513a36b28c49a574e1e7cd576789f7c}{00189}} \mbox{\hyperlink{if__urndis_8c_a6513a36b28c49a574e1e7cd576789f7c}{MODULE\_DEPEND}}(urndis, uether, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00190}\mbox{\hyperlink{if__urndis_8c_a8b27d59efe216793bb46d0ba86d379a4}{00190}} \mbox{\hyperlink{if__urndis_8c_a6513a36b28c49a574e1e7cd576789f7c}{MODULE\_DEPEND}}(urndis, \mbox{\hyperlink{usb__if_8m_adfa3f6da9c4881e494b180c4ebb06470}{usb}}, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00191}\mbox{\hyperlink{if__urndis_8c_a4d9d54ef9a6577dafe8a1bdcc119a574}{00191}} \mbox{\hyperlink{if__urndis_8c_a6513a36b28c49a574e1e7cd576789f7c}{MODULE\_DEPEND}}(urndis, ether, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00192}\mbox{\hyperlink{if__urndis_8c_a09581ee06e461fc6db99b0cedb23ba6b}{00192}} \mbox{\hyperlink{if__urndis_8c_a09581ee06e461fc6db99b0cedb23ba6b}{USB\_PNP\_HOST\_INFO}}(\mbox{\hyperlink{if__urndis_8c_aad74a1add5acd7ab8a3c9e12ff0ea0a2}{urndis\_host\_devs}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00194}\mbox{\hyperlink{if__urndis_8c_aec39c3a000e9a6a2394a3917061cd440}{00194}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__ether__methods}{usb\_ether\_methods}} \mbox{\hyperlink{if__urndis_8c_aec39c3a000e9a6a2394a3917061cd440}{urndis\_ue\_methods}} = \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00195}00195         .\mbox{\hyperlink{structusb__ether__methods_a9568a90d86c68824b84eb6e5ccc7ebfc}{ue\_attach\_post}} = \mbox{\hyperlink{if__urndis_8c_a433c97b9143df7e249f2d8235708823b}{urndis\_attach\_post}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00196}00196         .ue\_start = \mbox{\hyperlink{if__urndis_8c_a62f6d0d4f00bb6a05ef47c5ccab5da3f}{urndis\_start}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00197}00197         .ue\_init = \mbox{\hyperlink{if__urndis_8c_a774d65c29fea908d1a0bf3e34aada2c5}{urndis\_init}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00198}00198         .ue\_stop = \mbox{\hyperlink{if__urndis_8c_aa5db02b3f269a9135349b10516ccc143}{urndis\_stop}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00199}00199         .ue\_setmulti = \mbox{\hyperlink{if__urndis_8c_afc353a5245ddc2c2dafa58cd896e2006}{urndis\_setmulti}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00200}00200         .ue\_setpromisc = \mbox{\hyperlink{if__urndis_8c_af4b870f82e20aa7fa001902bc8385f8f}{urndis\_setpromisc}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00201}00201 \};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00202}00202 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00203}00203 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00204}\mbox{\hyperlink{if__urndis_8c_aabf9872becdaf631b95e3c89712f9fd4}{00204}} \mbox{\hyperlink{if__urndis_8c_a95fd2c7032e5d5b7876ec8548aaaaab8}{urndis\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00205}00205 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00206}00206         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00207}00207 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00208}00208         \textcolor{keywordflow}{return} (\mbox{\hyperlink{usb__lookup_8c_aa691ad42d532498716f358cb1c994fb2}{usbd\_lookup\_id\_by\_uaa}}(\mbox{\hyperlink{if__urndis_8c_aad74a1add5acd7ab8a3c9e12ff0ea0a2}{urndis\_host\_devs}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{if__urndis_8c_aad74a1add5acd7ab8a3c9e12ff0ea0a2}{urndis\_host\_devs}}), uaa));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00209}00209 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00211}00211 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00212}\mbox{\hyperlink{if__urndis_8c_a668bfb997472a41436b689f6cbc92ef9}{00212}} \mbox{\hyperlink{if__urndis_8c_a433c97b9143df7e249f2d8235708823b}{urndis\_attach\_post}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00213}00213 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00215}00215         \textcolor{comment}{/* no-\/op */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00216}00216 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00218}00218 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00219}\mbox{\hyperlink{if__urndis_8c_ae55d7f71997fc09c02b16c6f3dd3d116}{00219}} \mbox{\hyperlink{if__urndis_8c_aa693bfebaac8e3bc69855ca8378f52b8}{urndis\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00220}00220 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00221}00221         \textcolor{keyword}{static} \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00222}00222                 \textcolor{keyword}{union }\{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00223}00223                         \textcolor{keyword}{struct }rndis\_query\_req query;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00224}00224                         \textcolor{keyword}{struct }rndis\_set\_req set;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00225}00225                 \} hdr;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00226}00226                 \textcolor{keyword}{union }\{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00227}00227                         uint8\_t eaddr[ETHER\_ADDR\_LEN];}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00228}00228                         uint32\_t filter;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00229}00229                 \} ibuf;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00230}00230         \} msg;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00231}00231         \textcolor{keyword}{struct }\mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00232}00232         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue = \&sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00233}00233         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00234}00234         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__cdc__cm__descriptor}{usb\_cdc\_cm\_descriptor}} *cmd;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00235}00235         \textcolor{keyword}{const} \textcolor{keywordtype}{void} *buf;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00236}00236         uint16\_t bufsz;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00237}00237         uint8\_t iface\_index[2] = \{ uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}} + 1, uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}} \};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00238}00238         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00239}00239         uint8\_t i;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00241}00241         sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}}.\mbox{\hyperlink{structusb__ether_a9038cbb427aa5dfd094db8d183f909cc}{ue\_udev}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00242}00242         sc-\/>\mbox{\hyperlink{structurndis__softc_ae12a0d1e9869eb678bba40313b5aaf9e}{sc\_ifaceno\_ctl}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a268433f99f7bfcc278a619418e3c44fa}{bIfaceNum}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00243}00243 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00244}00244         cmd = \mbox{\hyperlink{usb__device_8c_a6cad4345e7f3c057be6067849349d082}{usbd\_find\_descriptor}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}}, NULL, uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00245}00245             \mbox{\hyperlink{usb_8h_af31cdb4e483ebff028f8286207123844}{UDESC\_CS\_INTERFACE}}, 0xFF, \mbox{\hyperlink{usb__cdc_8h_a08942de54ca15bb3673356cb7917b836}{UDESCSUB\_CDC\_CM}}, 0xFF);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00246}00246         \textcolor{keywordflow}{if} (cmd != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00247}00247                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Call Mode Descriptor found, dataif=\%d\(\backslash\)n"{}}, cmd-\/>\mbox{\hyperlink{structusb__cdc__cm__descriptor_aa72da1f1033eb8e947adc130288ad1ab}{bDataInterface}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00248}00248                 iface\_index[0] = cmd-\/>\mbox{\hyperlink{structusb__cdc__cm__descriptor_aa72da1f1033eb8e947adc130288ad1ab}{bDataInterface}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00249}00249         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00251}00251         \mbox{\hyperlink{usb__util_8c_a2f65a197990caa1a69a16691ce4dc66a}{device\_set\_usb\_desc}}(dev);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00253}00253         mtx\_init(\&sc-\/>\mbox{\hyperlink{structurndis__softc_ad7a2ac7d8353aaa309a567955c73f95d}{sc\_mtx}}, device\_get\_nameunit(dev), NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00255}00255         \textcolor{comment}{/* scan the alternate settings looking for a valid one */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00256}00256         \textcolor{keywordflow}{for} (i = 0; i != 32; i++) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00257}00257                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__device_8c_a04693d160af658ae93ddddeac41e6ef2}{usbd\_set\_alt\_interface\_index}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00258}00258                     iface\_index[0], i);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00260}00260                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00261}00261                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00263}00263                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__transfer_8c_a7494c04fae5c5e7ef1af436308670a21}{usbd\_transfer\_setup}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00264}00264                     iface\_index, sc-\/>\mbox{\hyperlink{structurndis__softc_a5d243b7e171f57353fcbb61485946ed8}{sc\_xfer}}, \mbox{\hyperlink{if__urndis_8c_ab621b6072c33a5f9d270ed153742ccae}{urndis\_config}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00265}00265                     \mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798abd01fc7b0ecbbb8fc54905d9a1851524}{URNDIS\_N\_TRANSFER}}, sc, \&sc-\/>\mbox{\hyperlink{structurndis__softc_ad7a2ac7d8353aaa309a567955c73f95d}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00267}00267                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == 0)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00268}00268                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00269}00269         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00270}00270         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0) || (i == 32)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00271}00271                 device\_printf(dev, \textcolor{stringliteral}{"{}No valid alternate setting found\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00272}00272                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00273}00273         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00275}00275         \textcolor{comment}{/* Initialize device -\/ must be done before even querying it */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00276}00276         \mbox{\hyperlink{if__urndisreg_8h_ab25cda2ccf9d3900f1c5f37da0d33fb5}{URNDIS\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00277}00277         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{if__urndis_8c_a409f272496597f5a7017896c74a8651f}{urndis\_ctrl\_init}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00278}00278         \mbox{\hyperlink{if__urndisreg_8h_a1f312c181578d13c7c8465668966c022}{URNDIS\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00279}00279         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != (\textcolor{keywordtype}{int})RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00280}00280                 device\_printf(dev, \textcolor{stringliteral}{"{}Unable to initialize hardware\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00281}00281                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00282}00282         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00284}00284         \textcolor{comment}{/* Determine MAC address */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00285}00285         memset(msg.ibuf.eaddr, 0, \textcolor{keyword}{sizeof}(msg.ibuf.eaddr));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00286}00286         \mbox{\hyperlink{if__urndisreg_8h_ab25cda2ccf9d3900f1c5f37da0d33fb5}{URNDIS\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00287}00287         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{if__urndis_8c_a19c961c2719c75556b0b8b0ccd213eec}{urndis\_ctrl\_query}}(sc, OID\_802\_3\_PERMANENT\_ADDRESS,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00288}00288             \&msg.hdr.query, \textcolor{keyword}{sizeof}(msg.hdr.query) + \textcolor{keyword}{sizeof}(msg.ibuf.eaddr),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00289}00289             \&buf, \&bufsz);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00290}00290         \mbox{\hyperlink{if__urndisreg_8h_a1f312c181578d13c7c8465668966c022}{URNDIS\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00291}00291         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != (\textcolor{keywordtype}{int})RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00292}00292                 device\_printf(dev, \textcolor{stringliteral}{"{}Unable to get hardware address\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00293}00293                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00294}00294         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00295}00295         \textcolor{keywordflow}{if} (bufsz != ETHER\_ADDR\_LEN) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00296}00296                 device\_printf(dev, \textcolor{stringliteral}{"{}Invalid address length: \%d bytes\(\backslash\)n"{}}, bufsz);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00297}00297                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00298}00298         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00299}00299         memcpy(\&sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}}.\mbox{\hyperlink{structusb__ether_ad1e7ad3609b27b7adab9d6086a20059a}{ue\_eaddr}}, buf, ETHER\_ADDR\_LEN);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00301}00301         \textcolor{comment}{/* Initialize packet filter */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00302}00302         sc-\/>\mbox{\hyperlink{structurndis__softc_af1de6e4b7edf34106082d05e268fc1da}{sc\_filter}} = NDIS\_PACKET\_TYPE\_BROADCAST |}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00303}00303             NDIS\_PACKET\_TYPE\_ALL\_MULTICAST;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00304}00304         msg.ibuf.filter = htole32(sc-\/>\mbox{\hyperlink{structurndis__softc_af1de6e4b7edf34106082d05e268fc1da}{sc\_filter}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00305}00305         \mbox{\hyperlink{if__urndisreg_8h_ab25cda2ccf9d3900f1c5f37da0d33fb5}{URNDIS\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00306}00306         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{if__urndis_8c_a5487dceb4fd00ba1288086ee41a90a47}{urndis\_ctrl\_set}}(sc, OID\_GEN\_CURRENT\_PACKET\_FILTER,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00307}00307             \&msg.hdr.set, \textcolor{keyword}{sizeof}(msg.hdr.set) + \textcolor{keyword}{sizeof}(msg.ibuf.filter));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00308}00308         \mbox{\hyperlink{if__urndisreg_8h_a1f312c181578d13c7c8465668966c022}{URNDIS\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00309}00309         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != (\textcolor{keywordtype}{int})RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00310}00310                 device\_printf(dev, \textcolor{stringliteral}{"{}Unable to set data filters\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00311}00311                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00312}00312         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00314}00314         ue-\/>\mbox{\hyperlink{structusb__ether_af979047fbf844a27c7f2266c87fd03a4}{ue\_sc}} = sc;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00315}00315         ue-\/>\mbox{\hyperlink{structusb__ether_ade8818fa2f6daf9addc42c3e39027515}{ue\_dev}} = dev;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00316}00316         ue-\/>\mbox{\hyperlink{structusb__ether_a9038cbb427aa5dfd094db8d183f909cc}{ue\_udev}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00317}00317         ue-\/>\mbox{\hyperlink{structusb__ether_af390d8b75a7bd2d9f347f808f0c15a4f}{ue\_mtx}} = \&sc-\/>\mbox{\hyperlink{structurndis__softc_ad7a2ac7d8353aaa309a567955c73f95d}{sc\_mtx}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00318}00318         ue-\/>\mbox{\hyperlink{structusb__ether_a2b787f8aab7c5db729211c3a1c3bc141}{ue\_methods}} = \&\mbox{\hyperlink{if__urndis_8c_aec39c3a000e9a6a2394a3917061cd440}{urndis\_ue\_methods}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00319}00319 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00320}00320         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__ethernet_8c_ad75ada74935d33849a41ff3448d1f291}{uether\_ifattach}}(ue);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00321}00321         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00322}00322                 device\_printf(dev, \textcolor{stringliteral}{"{}Could not attach interface\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00323}00323                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00324}00324         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00325}00325 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00326}00326         \mbox{\hyperlink{if__urndisreg_8h_ab25cda2ccf9d3900f1c5f37da0d33fb5}{URNDIS\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00327}00327         \textcolor{comment}{/* start interrupt endpoint, if any */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00328}00328         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structurndis__softc_a5d243b7e171f57353fcbb61485946ed8}{sc\_xfer}}[\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798a823ef05351167219366d0c881fb1deb6}{URNDIS\_INTR\_RX}}]);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00329}00329         \mbox{\hyperlink{if__urndisreg_8h_a1f312c181578d13c7c8465668966c022}{URNDIS\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00331}00331         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00333}00333 detach:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00334}00334         (void)\mbox{\hyperlink{if__urndis_8c_af562173c0a24579420a650365aeed807}{urndis\_detach}}(dev);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00335}00335         \textcolor{keywordflow}{return} (ENXIO);                 \textcolor{comment}{/* failure */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00336}00336 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00337}00337 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00338}00338 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00339}\mbox{\hyperlink{if__urndis_8c_a23d95bcb1eaedfe6dd0aae99517bb1bd}{00339}} \mbox{\hyperlink{if__urndis_8c_af562173c0a24579420a650365aeed807}{urndis\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00340}00340 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00341}00341         \textcolor{keyword}{struct }\mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00342}00342         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue = \&sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00344}00344         \textcolor{comment}{/* stop all USB transfers first */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00345}00345         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(sc-\/>\mbox{\hyperlink{structurndis__softc_a5d243b7e171f57353fcbb61485946ed8}{sc\_xfer}}, \mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798abd01fc7b0ecbbb8fc54905d9a1851524}{URNDIS\_N\_TRANSFER}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00346}00346 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00347}00347         \mbox{\hyperlink{usb__ethernet_8c_a15f91b3474535af40e16b2c05d023e99}{uether\_ifdetach}}(ue);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00348}00348 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00349}00349         \mbox{\hyperlink{if__urndisreg_8h_ab25cda2ccf9d3900f1c5f37da0d33fb5}{URNDIS\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00350}00350         (void)\mbox{\hyperlink{if__urndis_8c_a5f77f5f7c76a730d33ad0e582f18b9d9}{urndis\_ctrl\_halt}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00351}00351         \mbox{\hyperlink{if__urndisreg_8h_a1f312c181578d13c7c8465668966c022}{URNDIS\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00353}00353         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structurndis__softc_ad7a2ac7d8353aaa309a567955c73f95d}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00354}00354 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00355}00355         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00356}00356 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00357}00357 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00358}00358 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00359}\mbox{\hyperlink{if__urndis_8c_a1abac8805bd9a1a9b73e510acea70f34}{00359}} \mbox{\hyperlink{if__urndis_8c_a62f6d0d4f00bb6a05ef47c5ccab5da3f}{urndis\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00360}00360 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00361}00361         \textcolor{keyword}{struct }\mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00363}00363         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00364}00364 \textcolor{comment}{         * Start the USB transfers, if not already started:}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00365}00365 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00366}00366         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structurndis__softc_a5d243b7e171f57353fcbb61485946ed8}{sc\_xfer}}[\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798ace958cd7cf38373a814842abaa5975c2}{URNDIS\_BULK\_TX}}]);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00367}00367         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structurndis__softc_a5d243b7e171f57353fcbb61485946ed8}{sc\_xfer}}[\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798a6e9e14712b37f666312e45c34b13d3b2}{URNDIS\_BULK\_RX}}]);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00368}00368 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00370}00370 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00371}\mbox{\hyperlink{if__urndis_8c_a154369f2e93f8257c81630b1628f5a98}{00371}} \mbox{\hyperlink{if__urndis_8c_a774d65c29fea908d1a0bf3e34aada2c5}{urndis\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00372}00372 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00373}00373         \textcolor{keyword}{struct }\mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00374}00374         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(ue);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00375}00375 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00376}00376         \mbox{\hyperlink{if__urndisreg_8h_a46968c8852c4093a176502585054bad2}{URNDIS\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00377}00377 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00378}00378         ifp-\/>if\_drv\_flags |= IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00380}00380         \textcolor{comment}{/* stall data write direction, which depends on USB mode */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00381}00381         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(sc-\/>\mbox{\hyperlink{structurndis__softc_a5d243b7e171f57353fcbb61485946ed8}{sc\_xfer}}[\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798ace958cd7cf38373a814842abaa5975c2}{URNDIS\_BULK\_TX}}]);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00382}00382 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00383}00383         \textcolor{comment}{/* start data transfers */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00384}00384         \mbox{\hyperlink{if__urndis_8c_a62f6d0d4f00bb6a05ef47c5ccab5da3f}{urndis\_start}}(ue);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00385}00385 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00386}00386 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00387}00387 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00388}\mbox{\hyperlink{if__urndis_8c_a652545759d7650b985bae2eb8f6c5f66}{00388}} \mbox{\hyperlink{if__urndis_8c_aa5db02b3f269a9135349b10516ccc143}{urndis\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00389}00389 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00390}00390         \textcolor{keyword}{struct }\mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00391}00391         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(ue);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00393}00393         \mbox{\hyperlink{if__urndisreg_8h_a46968c8852c4093a176502585054bad2}{URNDIS\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00394}00394 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00395}00395         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00397}00397         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00398}00398 \textcolor{comment}{         * stop all the transfers, if not already stopped:}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00399}00399 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00400}00400         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structurndis__softc_a5d243b7e171f57353fcbb61485946ed8}{sc\_xfer}}[\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798a6e9e14712b37f666312e45c34b13d3b2}{URNDIS\_BULK\_RX}}]);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00401}00401         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structurndis__softc_a5d243b7e171f57353fcbb61485946ed8}{sc\_xfer}}[\mbox{\hyperlink{if__urndisreg_8h_a77867ab4129f63159b37bca3b652a798ace958cd7cf38373a814842abaa5975c2}{URNDIS\_BULK\_TX}}]);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00402}00402 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00403}00403 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00404}00404 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00405}\mbox{\hyperlink{if__urndis_8c_aaa04e9d5577d0211f2694bdb23e39206}{00405}} \mbox{\hyperlink{if__urndis_8c_afc353a5245ddc2c2dafa58cd896e2006}{urndis\_setmulti}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00406}00406 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00407}00407 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00408}00408         \textcolor{comment}{/* no-\/op */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00409}00409 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00410}00410 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00411}00411 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00412}\mbox{\hyperlink{if__urndis_8c_ab1ff360e038c9793b2406a2a8a38ee59}{00412}} \mbox{\hyperlink{if__urndis_8c_af4b870f82e20aa7fa001902bc8385f8f}{urndis\_setpromisc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00413}00413 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00414}00414 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00415}00415         \textcolor{comment}{/* no-\/op */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00416}00416 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00417}00417 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00418}00418 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00419}\mbox{\hyperlink{if__urndis_8c_ac13144f8ec1a5b226a14c1dba100fb72}{00419}} \mbox{\hyperlink{if__urndis_8c_ad3a1286349ea936020d3065ef8e60b2b}{urndis\_suspend}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00420}00420 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00422}00422         device\_printf(dev, \textcolor{stringliteral}{"{}Suspending\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00423}00423         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00424}00424 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00425}00425 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00426}00426 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00427}\mbox{\hyperlink{if__urndis_8c_a9d2ca7fd18149ead31d904105aff6d71}{00427}} \mbox{\hyperlink{if__urndis_8c_ad8ef816b30ec3f38513be33cb724828c}{urndis\_resume}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00428}00428 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00429}00429 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00430}00430         device\_printf(dev, \textcolor{stringliteral}{"{}Resuming\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00431}00431         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00432}00432 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00434}00434 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00435}\mbox{\hyperlink{if__urndis_8c_a245468bd93e9a6211eab080fbe361d96}{00435}} \mbox{\hyperlink{if__urndis_8c_a245468bd93e9a6211eab080fbe361d96}{urndis\_ctrl\_msg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc, uint8\_t rt, uint8\_t \mbox{\hyperlink{if__run_8c_a4c5c6ceb8ed33456261fa907136e0c3a}{r}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00436}00436     uint16\_t index, uint16\_t value, \textcolor{keywordtype}{void} *buf, uint16\_t buflen)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00437}00437 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00438}00438         \mbox{\hyperlink{structusb__device__request}{usb\_device\_request\_t}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00439}00439 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00440}00440         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = rt;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00441}00441         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{if__run_8c_a4c5c6ceb8ed33456261fa907136e0c3a}{r}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00442}00442         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, value);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00443}00443         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, index);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00444}00444         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, buflen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00445}00445 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00446}00446         \textcolor{keywordflow}{return} (\mbox{\hyperlink{usb__request_8c_ae914a46bd63666caf7f4d8c182fa5e71}{usbd\_do\_request\_flags}}(sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}}.\mbox{\hyperlink{structusb__ether_a9038cbb427aa5dfd094db8d183f909cc}{ue\_udev}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00447}00447             \&sc-\/>\mbox{\hyperlink{structurndis__softc_ad7a2ac7d8353aaa309a567955c73f95d}{sc\_mtx}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, buf, (rt \& \mbox{\hyperlink{usb_8h_af5074f22163b18c7987cd3ef324cd4e0}{UT\_READ}}) ?}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00448}00448             \mbox{\hyperlink{usbdi_8h_a7d5cf39b730f3e4d901208079a7340ab}{USB\_SHORT\_XFER\_OK}} : 0, NULL, 2000 \textcolor{comment}{/* ms */} ));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00449}00449 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00450}00450 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00451}00451 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00452}\mbox{\hyperlink{if__urndis_8c_a4b51012138c0d6ef607d90499cb48d96}{00452}} \mbox{\hyperlink{if__urndis_8c_a4b51012138c0d6ef607d90499cb48d96}{urndis\_ctrl\_send}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc, \textcolor{keywordtype}{void} *buf, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}})}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00453}00453 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00454}00454         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00455}00455 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00456}00456         err = \mbox{\hyperlink{if__urndis_8c_a245468bd93e9a6211eab080fbe361d96}{urndis\_ctrl\_msg}}(sc, \mbox{\hyperlink{usb_8h_ac338c3af82b085859b50582e10fa7cb7}{UT\_WRITE\_CLASS\_INTERFACE}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00457}00457             \mbox{\hyperlink{usb__cdc_8h_a0df59475a5395b16cb2fc3d6e55e2bdc}{UCDC\_SEND\_ENCAPSULATED\_COMMAND}}, sc-\/>\mbox{\hyperlink{structurndis__softc_ae12a0d1e9869eb678bba40313b5aaf9e}{sc\_ifaceno\_ctl}}, 0, buf, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00458}00458 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00459}00459         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(err));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00460}00460 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00461}00461         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00462}00462 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00464}00464 \textcolor{keyword}{static} \textcolor{keyword}{struct }rndis\_comp\_hdr *}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00465}\mbox{\hyperlink{if__urndis_8c_a96a31510224a5b6c6012f1fbb3e93005}{00465}} \mbox{\hyperlink{if__urndis_8c_a96a31510224a5b6c6012f1fbb3e93005}{urndis\_ctrl\_recv}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00466}00466 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00467}00467         \textcolor{keyword}{struct }rndis\_comp\_hdr *hdr;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00468}00468         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00470}00470         err = \mbox{\hyperlink{if__urndis_8c_a245468bd93e9a6211eab080fbe361d96}{urndis\_ctrl\_msg}}(sc, \mbox{\hyperlink{usb_8h_a4f2e0216ffe1d8145cd1385e42c9a707}{UT\_READ\_CLASS\_INTERFACE}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00471}00471             \mbox{\hyperlink{usb__cdc_8h_ad5e926a29193420ea586a6aff76658d4}{UCDC\_GET\_ENCAPSULATED\_RESPONSE}}, sc-\/>\mbox{\hyperlink{structurndis__softc_ae12a0d1e9869eb678bba40313b5aaf9e}{sc\_ifaceno\_ctl}}, 0,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00472}00472             sc-\/>sc\_response\_buf, \mbox{\hyperlink{if__urndisreg_8h_aee080bfebb9af8704c63d373ced77d64}{RNDIS\_RESPONSE\_LEN}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00473}00473 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00474}00474         \textcolor{keywordflow}{if} (err != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a01e440e0629669433dd14bc477757c74}{USB\_ERR\_NORMAL\_COMPLETION}})}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00475}00475                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00476}00476 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00477}00477         hdr = (\textcolor{keyword}{struct }rndis\_comp\_hdr *)sc-\/>sc\_response\_buf;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00478}00478 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00479}00479         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}type 0x\%x len \%u\(\backslash\)n"{}}, le32toh(hdr-\/>rm\_type),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00480}00480             le32toh(hdr-\/>rm\_len));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00481}00481 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00482}00482         \textcolor{keywordflow}{if} (le32toh(hdr-\/>rm\_len) > \mbox{\hyperlink{if__urndisreg_8h_aee080bfebb9af8704c63d373ced77d64}{RNDIS\_RESPONSE\_LEN}}) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00483}00483                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}ctrl message error: wrong size \%u > \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00484}00484                     le32toh(hdr-\/>rm\_len), \mbox{\hyperlink{if__urndisreg_8h_aee080bfebb9af8704c63d373ced77d64}{RNDIS\_RESPONSE\_LEN}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00485}00485                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00486}00486         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00487}00487         \textcolor{keywordflow}{return} (hdr);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00488}00488 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00489}00489 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00490}00490 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00491}\mbox{\hyperlink{if__urndis_8c_a9c76609b1fd6147ff38fdbc4aa1bf72d}{00491}} \mbox{\hyperlink{if__urndis_8c_a9c76609b1fd6147ff38fdbc4aa1bf72d}{urndis\_ctrl\_handle}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc, \textcolor{keyword}{struct} rndis\_comp\_hdr *hdr,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00492}00492     \textcolor{keyword}{const} \textcolor{keywordtype}{void} **buf, uint16\_t *bufsz)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00493}00493 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00494}00494         uint32\_t rval;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00496}00496         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00498}00498         \textcolor{keywordflow}{if} (buf != NULL \&\& bufsz != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00499}00499                 *buf = NULL;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00500}00500                 *bufsz = 0;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00501}00501         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00502}00502         \textcolor{keywordflow}{switch} (le32toh(hdr-\/>rm\_type)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00503}00503         \textcolor{keywordflow}{case} REMOTE\_NDIS\_INITIALIZE\_CMPLT:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00504}00504                 rval = \mbox{\hyperlink{if__urndis_8c_a693615126ad1c21bc56e2a910ed40ea1}{urndis\_ctrl\_handle\_init}}(sc, hdr);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00505}00505                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00506}00506 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00507}00507         \textcolor{keywordflow}{case} REMOTE\_NDIS\_QUERY\_CMPLT:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00508}00508                 rval = \mbox{\hyperlink{if__urndis_8c_a82a03aae19bf6d817386c3639df0bf58}{urndis\_ctrl\_handle\_query}}(sc, hdr, buf, bufsz);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00509}00509                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00510}00510 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00511}00511         \textcolor{keywordflow}{case} REMOTE\_NDIS\_RESET\_CMPLT:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00512}00512                 rval = \mbox{\hyperlink{if__urndis_8c_a9289e25ceb4c756cb6610d1754083743}{urndis\_ctrl\_handle\_reset}}(sc, hdr);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00513}00513                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00514}00514 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00515}00515         \textcolor{keywordflow}{case} REMOTE\_NDIS\_KEEPALIVE\_CMPLT:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00516}00516         \textcolor{keywordflow}{case} REMOTE\_NDIS\_SET\_CMPLT:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00517}00517                 rval = le32toh(hdr-\/>rm\_status);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00518}00518                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00520}00520         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00521}00521                 device\_printf(sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}}.\mbox{\hyperlink{structusb__ether_ade8818fa2f6daf9addc42c3e39027515}{ue\_dev}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00522}00522                     \textcolor{stringliteral}{"{}ctrl message error: unknown event 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00523}00523                     le32toh(hdr-\/>rm\_type));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00524}00524                 rval = RNDIS\_STATUS\_FAILURE;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00525}00525                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00526}00526         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00527}00527         \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00528}00528 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00529}00529 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00530}00530 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00531}\mbox{\hyperlink{if__urndis_8c_a693615126ad1c21bc56e2a910ed40ea1}{00531}} \mbox{\hyperlink{if__urndis_8c_a693615126ad1c21bc56e2a910ed40ea1}{urndis\_ctrl\_handle\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00532}00532     \textcolor{keyword}{const} \textcolor{keyword}{struct} rndis\_comp\_hdr *hdr)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00533}00533 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00534}00534         \textcolor{keyword}{const} \textcolor{keyword}{struct }rndis\_init\_comp *msg;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00535}00535 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00536}00536         msg = (\textcolor{keyword}{const} \textcolor{keyword}{struct }rndis\_init\_comp *)hdr;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00537}00537 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00538}00538         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}len \%u rid \%u status 0x\%x "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00539}00539             \textcolor{stringliteral}{"{}ver\_major \%u ver\_minor \%u devflags 0x\%x medium 0x\%x pktmaxcnt \%u "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00540}00540             \textcolor{stringliteral}{"{}pktmaxsz \%u align \%u aflistoffset \%u aflistsz \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00541}00541             le32toh(msg-\/>rm\_len),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00542}00542             le32toh(msg-\/>rm\_rid),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00543}00543             le32toh(msg-\/>rm\_status),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00544}00544             le32toh(msg-\/>rm\_ver\_major),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00545}00545             le32toh(msg-\/>rm\_ver\_minor),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00546}00546             le32toh(msg-\/>rm\_devflags),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00547}00547             le32toh(msg-\/>rm\_medium),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00548}00548             le32toh(msg-\/>rm\_pktmaxcnt),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00549}00549             le32toh(msg-\/>rm\_pktmaxsz),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00550}00550             le32toh(msg-\/>rm\_align),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00551}00551             le32toh(msg-\/>rm\_aflistoffset),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00552}00552             le32toh(msg-\/>rm\_aflistsz));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00553}00553 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00554}00554         \textcolor{keywordflow}{if} (le32toh(msg-\/>rm\_status) != RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00555}00555                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}init failed 0x\%x\(\backslash\)n"{}}, le32toh(msg-\/>rm\_status));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00556}00556                 \textcolor{keywordflow}{return} (le32toh(msg-\/>rm\_status));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00557}00557         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00558}00558         \textcolor{keywordflow}{if} (le32toh(msg-\/>rm\_devflags) != RNDIS\_DF\_CONNECTIONLESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00559}00559                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}wrong device type (current type: 0x\%x)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00560}00560                     le32toh(msg-\/>rm\_devflags));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00561}00561                 \textcolor{keywordflow}{return} (RNDIS\_STATUS\_FAILURE);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00562}00562         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00563}00563         \textcolor{keywordflow}{if} (le32toh(msg-\/>rm\_medium) != RNDIS\_MEDIUM\_802\_3) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00564}00564                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}medium not 802.3 (current medium: 0x\%x)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00565}00565                     le32toh(msg-\/>rm\_medium));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00566}00566                 \textcolor{keywordflow}{return} (RNDIS\_STATUS\_FAILURE);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00567}00567         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00568}00568         sc-\/>\mbox{\hyperlink{structurndis__softc_a3b408dfebabb31557fa2adc73ab75a75}{sc\_lim\_pktsz}} = le32toh(msg-\/>rm\_pktmaxsz);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00569}00569 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00570}00570         \textcolor{keywordflow}{return} (le32toh(msg-\/>rm\_status));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00571}00571 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00572}00572 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00573}00573 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00574}\mbox{\hyperlink{if__urndis_8c_a82a03aae19bf6d817386c3639df0bf58}{00574}} \mbox{\hyperlink{if__urndis_8c_a82a03aae19bf6d817386c3639df0bf58}{urndis\_ctrl\_handle\_query}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00575}00575     \textcolor{keyword}{const} \textcolor{keyword}{struct} rndis\_comp\_hdr *hdr, \textcolor{keyword}{const} \textcolor{keywordtype}{void} **buf, uint16\_t *bufsz)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00576}00576 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00577}00577         \textcolor{keyword}{const} \textcolor{keyword}{struct }rndis\_query\_comp *msg;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00578}00578         uint64\_t limit;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00579}00579 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00580}00580         msg = (\textcolor{keyword}{const} \textcolor{keyword}{struct }rndis\_query\_comp *)hdr;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00581}00581 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00582}00582         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}len \%u rid \%u status 0x\%x "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00583}00583             \textcolor{stringliteral}{"{}buflen \%u bufoff \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00584}00584             le32toh(msg-\/>rm\_len),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00585}00585             le32toh(msg-\/>rm\_rid),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00586}00586             le32toh(msg-\/>rm\_status),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00587}00587             le32toh(msg-\/>rm\_infobuflen),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00588}00588             le32toh(msg-\/>rm\_infobufoffset));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00589}00589 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00590}00590         *buf = NULL;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00591}00591         *bufsz = 0;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00592}00592         \textcolor{keywordflow}{if} (le32toh(msg-\/>rm\_status) != RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00593}00593                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}query failed 0x\%x\(\backslash\)n"{}}, le32toh(msg-\/>rm\_status));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00594}00594                 \textcolor{keywordflow}{return} (le32toh(msg-\/>rm\_status));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00595}00595         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00596}00596         limit = le32toh(msg-\/>rm\_infobuflen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00597}00597         limit += le32toh(msg-\/>rm\_infobufoffset);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00598}00598         limit += RNDIS\_HEADER\_OFFSET;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00599}00599 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00600}00600         \textcolor{keywordflow}{if} (limit > (uint64\_t)le32toh(msg-\/>rm\_len)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00601}00601                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}ctrl message error: invalid query info "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00602}00602                     \textcolor{stringliteral}{"{}len/offset/end\_position(\%u/\%u/\%u) -\/> "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00603}00603                     \textcolor{stringliteral}{"{}go out of buffer limit \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00604}00604                     le32toh(msg-\/>rm\_infobuflen),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00605}00605                     le32toh(msg-\/>rm\_infobufoffset),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00606}00606                     le32toh(msg-\/>rm\_infobuflen) +}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00607}00607                     le32toh(msg-\/>rm\_infobufoffset) + RNDIS\_HEADER\_OFFSET,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00608}00608                     le32toh(msg-\/>rm\_len));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00609}00609                 \textcolor{keywordflow}{return} (RNDIS\_STATUS\_FAILURE);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00610}00610         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00611}00611         *buf = ((\textcolor{keyword}{const} uint8\_t *)msg) + RNDIS\_HEADER\_OFFSET +}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00612}00612             le32toh(msg-\/>rm\_infobufoffset);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00613}00613         *bufsz = le32toh(msg-\/>rm\_infobuflen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00614}00614 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00615}00615         \textcolor{keywordflow}{return} (le32toh(msg-\/>rm\_status));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00616}00616 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00617}00617 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00618}00618 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00619}\mbox{\hyperlink{if__urndis_8c_a9289e25ceb4c756cb6610d1754083743}{00619}} \mbox{\hyperlink{if__urndis_8c_a9289e25ceb4c756cb6610d1754083743}{urndis\_ctrl\_handle\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00620}00620     \textcolor{keyword}{const} \textcolor{keyword}{struct} rndis\_comp\_hdr *hdr)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00621}00621 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00622}00622         \textcolor{keyword}{const} \textcolor{keyword}{struct }rndis\_reset\_comp *msg;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00623}00623         uint32\_t rval;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00624}00624 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00625}00625         msg = (\textcolor{keyword}{const} \textcolor{keyword}{struct }rndis\_reset\_comp *)hdr;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00626}00626 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00627}00627         rval = le32toh(msg-\/>rm\_status);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00628}00628 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00629}00629         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}len \%u status 0x\%x "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00630}00630             \textcolor{stringliteral}{"{}adrreset \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00631}00631             le32toh(msg-\/>rm\_len),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00632}00632             rval,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00633}00633             le32toh(msg-\/>rm\_adrreset));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00634}00634 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00635}00635         \textcolor{keywordflow}{if} (rval != RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00636}00636                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}reset failed 0x\%x\(\backslash\)n"{}}, rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00637}00637                 \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00638}00638         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00639}00639         \textcolor{keywordflow}{if} (msg-\/>rm\_adrreset != 0) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00640}00640                 \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00641}00641                         \textcolor{keyword}{struct }rndis\_set\_req hdr;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00642}00642                         uint32\_t filter;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00643}00643                 \} msg\_filter;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00644}00644 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00645}00645                 msg\_filter.filter = htole32(sc-\/>\mbox{\hyperlink{structurndis__softc_af1de6e4b7edf34106082d05e268fc1da}{sc\_filter}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00646}00646 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00647}00647                 rval = \mbox{\hyperlink{if__urndis_8c_a5487dceb4fd00ba1288086ee41a90a47}{urndis\_ctrl\_set}}(sc, OID\_GEN\_CURRENT\_PACKET\_FILTER,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00648}00648                     \&msg\_filter.hdr, \textcolor{keyword}{sizeof}(msg\_filter));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00650}00650                 \textcolor{keywordflow}{if} (rval != RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00651}00651                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}unable to reset data filters\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00652}00652                         \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00653}00653                 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00654}00654         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00655}00655         \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00656}00656 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00657}00657 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00658}00658 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00659}\mbox{\hyperlink{if__urndis_8c_a409f272496597f5a7017896c74a8651f}{00659}} \mbox{\hyperlink{if__urndis_8c_a409f272496597f5a7017896c74a8651f}{urndis\_ctrl\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00660}00660 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00661}00661         \textcolor{keyword}{struct }rndis\_init\_req msg;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00662}00662         \textcolor{keyword}{struct }rndis\_comp\_hdr *hdr;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00663}00663         uint32\_t rval;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00664}00664 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00665}00665         msg.rm\_type = htole32(REMOTE\_NDIS\_INITIALIZE\_MSG);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00666}00666         msg.rm\_len = htole32(\textcolor{keyword}{sizeof}(msg));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00667}00667         msg.rm\_rid = 0;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00668}00668         msg.rm\_ver\_major = htole32(RNDIS\_VERSION\_MAJOR);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00669}00669         msg.rm\_ver\_minor = htole32(1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00670}00670         msg.rm\_max\_xfersz = htole32(\mbox{\hyperlink{if__urndisreg_8h_a477c72e82ae22615d5379ab947782a9f}{RNDIS\_RX\_MAXLEN}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00671}00671 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00672}00672         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}type \%u len \%u rid \%u ver\_major \%u "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00673}00673             \textcolor{stringliteral}{"{}ver\_minor \%u max\_xfersz \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00674}00674             le32toh(msg.rm\_type),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00675}00675             le32toh(msg.rm\_len),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00676}00676             le32toh(msg.rm\_rid),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00677}00677             le32toh(msg.rm\_ver\_major),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00678}00678             le32toh(msg.rm\_ver\_minor),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00679}00679             le32toh(msg.rm\_max\_xfersz));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00680}00680 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00681}00681         rval = \mbox{\hyperlink{if__urndis_8c_a4b51012138c0d6ef607d90499cb48d96}{urndis\_ctrl\_send}}(sc, \&msg, \textcolor{keyword}{sizeof}(msg));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00683}00683         \textcolor{keywordflow}{if} (rval != RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00684}00684                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}init failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00685}00685                 \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00686}00686         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00687}00687         \textcolor{keywordflow}{if} ((hdr = \mbox{\hyperlink{if__urndis_8c_a96a31510224a5b6c6012f1fbb3e93005}{urndis\_ctrl\_recv}}(sc)) == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00688}00688                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}unable to get init response\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00689}00689                 \textcolor{keywordflow}{return} (RNDIS\_STATUS\_FAILURE);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00690}00690         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00691}00691         rval = \mbox{\hyperlink{if__urndis_8c_a9c76609b1fd6147ff38fdbc4aa1bf72d}{urndis\_ctrl\_handle}}(sc, hdr, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00692}00692 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00693}00693         \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00694}00694 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00695}00695 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00696}00696 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00697}\mbox{\hyperlink{if__urndis_8c_a5f77f5f7c76a730d33ad0e582f18b9d9}{00697}} \mbox{\hyperlink{if__urndis_8c_a5f77f5f7c76a730d33ad0e582f18b9d9}{urndis\_ctrl\_halt}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00698}00698 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00699}00699         \textcolor{keyword}{struct }rndis\_halt\_req msg;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00700}00700         uint32\_t rval;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00701}00701 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00702}00702         msg.rm\_type = htole32(REMOTE\_NDIS\_HALT\_MSG);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00703}00703         msg.rm\_len = htole32(\textcolor{keyword}{sizeof}(msg));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00704}00704         msg.rm\_rid = 0;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00705}00705 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00706}00706         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}type \%u len \%u rid \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00707}00707             le32toh(msg.rm\_type),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00708}00708             le32toh(msg.rm\_len),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00709}00709             le32toh(msg.rm\_rid));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00710}00710 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00711}00711         rval = \mbox{\hyperlink{if__urndis_8c_a4b51012138c0d6ef607d90499cb48d96}{urndis\_ctrl\_send}}(sc, \&msg, \textcolor{keyword}{sizeof}(msg));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00712}00712 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00713}00713         \textcolor{keywordflow}{if} (rval != RNDIS\_STATUS\_SUCCESS)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00714}00714                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}halt failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00715}00715 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00716}00716         \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00717}00717 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00718}00718 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00719}00719 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00720}00720 \textcolor{comment}{ * NB: Querying a device has the requirement of using an input buffer the size}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00721}00721 \textcolor{comment}{ *     of the expected reply or larger, except for variably sized replies.}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00722}00722 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00723}00723 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00724}\mbox{\hyperlink{if__urndis_8c_a19c961c2719c75556b0b8b0ccd213eec}{00724}} \mbox{\hyperlink{if__urndis_8c_a19c961c2719c75556b0b8b0ccd213eec}{urndis\_ctrl\_query}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc, uint32\_t oid,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00725}00725     \textcolor{keyword}{struct} rndis\_query\_req *msg, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, \textcolor{keyword}{const} \textcolor{keywordtype}{void} **rbuf,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00726}00726     uint16\_t *rbufsz)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00727}00727 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00728}00728         \textcolor{keyword}{struct }rndis\_comp\_hdr *hdr;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00729}00729         uint32\_t datalen, rval;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00730}00730 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00731}00731         msg-\/>rm\_type = htole32(REMOTE\_NDIS\_QUERY\_MSG);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00732}00732         msg-\/>rm\_len = htole32(\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00733}00733         msg-\/>rm\_rid = 0;                \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00734}00734         msg-\/>rm\_oid = htole32(oid);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00735}00735         datalen = \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} -\/ \textcolor{keyword}{sizeof}(*msg);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00736}00736         msg-\/>rm\_infobuflen = htole32(datalen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00737}00737         \textcolor{keywordflow}{if} (datalen != 0) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00738}00738                 msg-\/>rm\_infobufoffset = htole32(\textcolor{keyword}{sizeof}(*msg) -\/}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00739}00739                     RNDIS\_HEADER\_OFFSET);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00740}00740         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00741}00741                 msg-\/>rm\_infobufoffset = 0;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00742}00742         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00743}00743         msg-\/>rm\_devicevchdl = 0;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00744}00744 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00745}00745         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}type \%u len \%u rid \%u oid 0x\%x "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00746}00746             \textcolor{stringliteral}{"{}infobuflen \%u infobufoffset \%u devicevchdl \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00747}00747             le32toh(msg-\/>rm\_type),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00748}00748             le32toh(msg-\/>rm\_len),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00749}00749             le32toh(msg-\/>rm\_rid),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00750}00750             le32toh(msg-\/>rm\_oid),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00751}00751             le32toh(msg-\/>rm\_infobuflen),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00752}00752             le32toh(msg-\/>rm\_infobufoffset),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00753}00753             le32toh(msg-\/>rm\_devicevchdl));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00754}00754 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00755}00755         rval = \mbox{\hyperlink{if__urndis_8c_a4b51012138c0d6ef607d90499cb48d96}{urndis\_ctrl\_send}}(sc, msg, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00756}00756 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00757}00757         \textcolor{keywordflow}{if} (rval != RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00758}00758                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}query failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00759}00759                 \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00760}00760         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00761}00761         \textcolor{keywordflow}{if} ((hdr = \mbox{\hyperlink{if__urndis_8c_a96a31510224a5b6c6012f1fbb3e93005}{urndis\_ctrl\_recv}}(sc)) == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00762}00762                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}unable to get query response\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00763}00763                 \textcolor{keywordflow}{return} (RNDIS\_STATUS\_FAILURE);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00764}00764         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00765}00765         rval = \mbox{\hyperlink{if__urndis_8c_a9c76609b1fd6147ff38fdbc4aa1bf72d}{urndis\_ctrl\_handle}}(sc, hdr, rbuf, rbufsz);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00766}00766 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00767}00767         \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00768}00768 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00769}00769 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00770}00770 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00771}\mbox{\hyperlink{if__urndis_8c_a5487dceb4fd00ba1288086ee41a90a47}{00771}} \mbox{\hyperlink{if__urndis_8c_a5487dceb4fd00ba1288086ee41a90a47}{urndis\_ctrl\_set}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc, uint32\_t oid,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00772}00772     \textcolor{keyword}{struct} rndis\_set\_req *msg, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}})}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00773}00773 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00774}00774         \textcolor{keyword}{struct }rndis\_comp\_hdr *hdr;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00775}00775         uint32\_t datalen, rval;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00776}00776 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00777}00777         msg-\/>rm\_type = htole32(REMOTE\_NDIS\_SET\_MSG);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00778}00778         msg-\/>rm\_len = htole32(\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00779}00779         msg-\/>rm\_rid = 0;                \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00780}00780         msg-\/>rm\_oid = htole32(oid);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00781}00781         datalen = \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} -\/ \textcolor{keyword}{sizeof}(*msg);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00782}00782         msg-\/>rm\_infobuflen = htole32(datalen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00783}00783         \textcolor{keywordflow}{if} (datalen != 0) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00784}00784                 msg-\/>rm\_infobufoffset = htole32(\textcolor{keyword}{sizeof}(*msg) -\/}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00785}00785                     RNDIS\_HEADER\_OFFSET);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00786}00786         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00787}00787                 msg-\/>rm\_infobufoffset = 0;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00788}00788         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00789}00789         msg-\/>rm\_devicevchdl = 0;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00790}00790 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00791}00791         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}type \%u len \%u rid \%u oid 0x\%x "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00792}00792             \textcolor{stringliteral}{"{}infobuflen \%u infobufoffset \%u devicevchdl \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00793}00793             le32toh(msg-\/>rm\_type),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00794}00794             le32toh(msg-\/>rm\_len),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00795}00795             le32toh(msg-\/>rm\_rid),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00796}00796             le32toh(msg-\/>rm\_oid),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00797}00797             le32toh(msg-\/>rm\_infobuflen),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00798}00798             le32toh(msg-\/>rm\_infobufoffset),}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00799}00799             le32toh(msg-\/>rm\_devicevchdl));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00800}00800 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00801}00801         rval = \mbox{\hyperlink{if__urndis_8c_a4b51012138c0d6ef607d90499cb48d96}{urndis\_ctrl\_send}}(sc, msg, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00802}00802 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00803}00803         \textcolor{keywordflow}{if} (rval != RNDIS\_STATUS\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00804}00804                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}set failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00805}00805                 \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00806}00806         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00807}00807         \textcolor{keywordflow}{if} ((hdr = \mbox{\hyperlink{if__urndis_8c_a96a31510224a5b6c6012f1fbb3e93005}{urndis\_ctrl\_recv}}(sc)) == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00808}00808                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}unable to get set response\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00809}00809                 \textcolor{keywordflow}{return} (RNDIS\_STATUS\_FAILURE);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00810}00810         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00811}00811         rval = \mbox{\hyperlink{if__urndis_8c_a9c76609b1fd6147ff38fdbc4aa1bf72d}{urndis\_ctrl\_handle}}(sc, hdr, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00812}00812         \textcolor{keywordflow}{if} (rval != RNDIS\_STATUS\_SUCCESS)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00813}00813                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}set failed 0x\%x\(\backslash\)n"{}}, rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00814}00814 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00815}00815         \textcolor{keywordflow}{return} (rval);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00816}00816 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00817}00817 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00818}00818 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00819}\mbox{\hyperlink{if__urndis_8c_ad599a97b0102ae6d1c8438e5a76ae632}{00819}} \mbox{\hyperlink{if__urndis_8c_a7b4f3176af32c848c6dfe9d5eb191eca}{urndis\_bulk\_read\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00820}00820 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00821}00821         \textcolor{keyword}{struct }\mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00822}00822         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00823}00823         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(\&sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00824}00824         \textcolor{keyword}{struct }rndis\_packet\_msg msg;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00825}00825         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00826}00826         \textcolor{keywordtype}{int} actlen;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00827}00827         \textcolor{keywordtype}{int} aframes;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00828}00828         \textcolor{keywordtype}{int} \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00829}00829 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00830}00830         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00831}00831         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00832}00832                 \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, NULL, \&aframes, NULL);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00833}00833 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00834}00834                 DPRINTFN(1, \textcolor{stringliteral}{"{}received \%u bytes in \%u frames\(\backslash\)n"{}}, actlen, aframes);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00835}00835 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00836}00836                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} = 0; actlen >= (uint32\_t)\textcolor{keyword}{sizeof}(msg);) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00837}00837                         \textcolor{comment}{/* copy out header */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00838}00838                         \mbox{\hyperlink{usb__busdma_8c_af52eece45b7868dbf58386f4c9e4eb9a}{usbd\_copy\_out}}(pc, \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}}, \&msg, \textcolor{keyword}{sizeof}(msg));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00839}00839 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00840}00840                         \textcolor{keywordflow}{if} (le32toh(0x1234567U) != 0x1234567U) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00841}00841                                 \textcolor{comment}{/* swap endianness */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00842}00842                                 msg.rm\_type = le32toh(msg.rm\_type);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00843}00843                                 msg.rm\_len = le32toh(msg.rm\_len);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00844}00844                                 msg.rm\_dataoffset = le32toh(msg.rm\_dataoffset);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00845}00845                                 msg.rm\_datalen = le32toh(msg.rm\_datalen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00846}00846                                 msg.rm\_oobdataoffset = le32toh(msg.rm\_oobdataoffset);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00847}00847                                 msg.rm\_oobdatalen = le32toh(msg.rm\_oobdatalen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00848}00848                                 msg.rm\_oobdataelements = le32toh(msg.rm\_oobdataelements);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00849}00849                                 msg.rm\_pktinfooffset = le32toh(msg.rm\_pktinfooffset);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00850}00850                                 msg.rm\_pktinfolen = le32toh(msg.rm\_pktinfolen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00851}00851                                 msg.rm\_vchandle = le32toh(msg.rm\_vchandle);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00852}00852                                 msg.rm\_reserved = le32toh(msg.rm\_reserved);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00853}00853                         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00854}00854 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00855}00855                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}len \%u data(off:\%u len:\%u) "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00856}00856                             \textcolor{stringliteral}{"{}oobdata(off:\%u len:\%u nb:\%u) perpacket(off:\%u len:\%u)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00857}00857                             msg.rm\_len, msg.rm\_dataoffset, msg.rm\_datalen,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00858}00858                             msg.rm\_oobdataoffset, msg.rm\_oobdatalen,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00859}00859                             msg.rm\_oobdataelements, msg.rm\_pktinfooffset,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00860}00860                             msg.rm\_pktinfooffset);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00861}00861 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00862}00862                         \textcolor{comment}{/* sanity check the RNDIS header */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00863}00863                         \textcolor{keywordflow}{if} (msg.rm\_type != REMOTE\_NDIS\_PACKET\_MSG) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00864}00864                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid type 0x\%x != 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00865}00865                                     msg.rm\_type, REMOTE\_NDIS\_PACKET\_MSG);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00866}00866                                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00867}00867                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (msg.rm\_len < (uint32\_t)\textcolor{keyword}{sizeof}(msg)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00868}00868                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid msg len \%u < \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00869}00869                                     msg.rm\_len, (\textcolor{keywordtype}{unsigned})\textcolor{keyword}{sizeof}(msg));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00870}00870                                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00871}00871                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (msg.rm\_len > (uint32\_t)actlen) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00872}00872                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid msg len \%u > buffer "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00873}00873                                     \textcolor{stringliteral}{"{}len \%u\(\backslash\)n"{}}, msg.rm\_len, actlen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00874}00874                                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00875}00875                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (msg.rm\_dataoffset >= (uint32\_t)actlen) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00876}00876                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid msg dataoffset \%u > buffer "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00877}00877                                     \textcolor{stringliteral}{"{}dataoffset \%u\(\backslash\)n"{}}, msg.rm\_dataoffset, actlen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00878}00878                                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00879}00879                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (msg.rm\_datalen > (uint32\_t)actlen) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00880}00880                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid msg datalen \%u > buffer "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00881}00881                                     \textcolor{stringliteral}{"{}datalen \%u\(\backslash\)n"{}}, msg.rm\_datalen, actlen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00882}00882                                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00883}00883                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((msg.rm\_dataoffset + msg.rm\_datalen +}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00884}00884                             (uint32\_t)\_\_offsetof(\textcolor{keyword}{struct} rndis\_packet\_msg,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00885}00885                             rm\_dataoffset)) > (uint32\_t)actlen) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00886}00886                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid dataoffset \%u larger than \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00887}00887                                     msg.rm\_dataoffset + msg.rm\_datalen +}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00888}00888                                     (uint32\_t)\_\_offsetof(\textcolor{keyword}{struct} rndis\_packet\_msg,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00889}00889                                     rm\_dataoffset), actlen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00890}00890                                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00891}00891                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (msg.rm\_datalen < (uint32\_t)\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ether\_header)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00892}00892                                 if\_inc\_counter(ifp, IFCOUNTER\_IERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00893}00893                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid ethernet size "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00894}00894                                     \textcolor{stringliteral}{"{}\%u < \%u\(\backslash\)n"{}}, msg.rm\_datalen, (\textcolor{keywordtype}{unsigned})\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ether\_header));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00895}00895                                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00896}00896                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (msg.rm\_datalen > (uint32\_t)(MCLBYTES -\/ ETHER\_ALIGN)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00897}00897                                 if\_inc\_counter(ifp, IFCOUNTER\_IERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00898}00898                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid ethernet size "{}}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00899}00899                                     \textcolor{stringliteral}{"{}\%u > \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00900}00900                                     msg.rm\_datalen, (\textcolor{keywordtype}{unsigned})MCLBYTES);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00901}00901                                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00902}00902                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (msg.rm\_datalen > (uint32\_t)(MHLEN -\/ ETHER\_ALIGN)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00903}00903                                 m = m\_getcl(M\_NOWAIT, MT\_DATA, M\_PKTHDR);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00904}00904                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00905}00905                                 m = m\_gethdr(M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00906}00906                         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00907}00907 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00908}00908                         \textcolor{comment}{/* check if we have a buffer */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00909}00909                         \textcolor{keywordflow}{if} (m != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00910}00910                                 m-\/>m\_len = m-\/>m\_pkthdr.len = msg.rm\_datalen + ETHER\_ALIGN;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00911}00911                                 m\_adj(m, ETHER\_ALIGN);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00912}00912 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00913}00913                                 \mbox{\hyperlink{usb__busdma_8c_af52eece45b7868dbf58386f4c9e4eb9a}{usbd\_copy\_out}}(pc, \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} + msg.rm\_dataoffset +}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00914}00914                                     \_\_offsetof(\textcolor{keyword}{struct} rndis\_packet\_msg,}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00915}00915                                     rm\_dataoffset), m-\/>m\_data, msg.rm\_datalen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00916}00916 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00917}00917                                 \textcolor{comment}{/* enqueue */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00918}00918                                 \mbox{\hyperlink{usb__ethernet_8c_a821ec2eb97a85d4969f2859e6f51a783}{uether\_rxmbuf}}(\&sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}}, m, msg.rm\_datalen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00919}00919                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00920}00920                                 if\_inc\_counter(ifp, IFCOUNTER\_IERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00921}00921                         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00922}00922                         \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} += msg.rm\_len;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00923}00923                         actlen -\/= msg.rm\_len;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00924}00924                 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00925}00925 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00926}00926         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00927}00927 tr\_setup:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00928}00928                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, \mbox{\hyperlink{if__urndisreg_8h_a477c72e82ae22615d5379ab947782a9f}{RNDIS\_RX\_MAXLEN}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00929}00929                 \mbox{\hyperlink{usb__transfer_8c_a10f82b008c3a5311e5210e44beaca014}{usbd\_xfer\_set\_frames}}(xfer, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00930}00930                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00931}00931                 \mbox{\hyperlink{usb__ethernet_8c_a007aff306fb41573661e03ac71e45966}{uether\_rxflush}}(\&sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}});  \textcolor{comment}{/* must be last */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00932}00932                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00933}00933 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00934}00934         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00935}00935                 DPRINTFN(1, \textcolor{stringliteral}{"{}error = \%s\(\backslash\)n"{}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00936}00936 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00937}00937                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00938}00938                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00939}00939                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00940}00940                         \mbox{\hyperlink{usb__transfer_8c_a10f82b008c3a5311e5210e44beaca014}{usbd\_xfer\_set\_frames}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00941}00941                         \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00942}00942                 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00943}00943                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00944}00944         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00945}00945 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00946}00946 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00947}00947 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00948}\mbox{\hyperlink{if__urndis_8c_af0643e53fc9ef8c9cd7213ef96d7c518}{00948}} \mbox{\hyperlink{if__urndis_8c_a9749e9b3a88a489241d0fbfe11779b51}{urndis\_bulk\_write\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00949}00949 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00950}00950         \textcolor{keyword}{struct }rndis\_packet\_msg msg;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00951}00951         \textcolor{keyword}{struct }\mbox{\hyperlink{structurndis__softc}{urndis\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00952}00952         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(\&sc-\/>\mbox{\hyperlink{structurndis__softc_ad75db19a6a33cebdb8774c827286292f}{sc\_ue}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00953}00953         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00954}00954         \textcolor{keywordtype}{unsigned} x;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00955}00955         \textcolor{keywordtype}{int} actlen;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00956}00956         \textcolor{keywordtype}{int} aframes;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00957}00957 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00958}00958         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, NULL, \&aframes, NULL);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00959}00959 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00960}00960         DPRINTFN(1, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00961}00961 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00962}00962         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00963}00963         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00964}00964                 DPRINTFN(11, \textcolor{stringliteral}{"{}\%u bytes in \%u frames\(\backslash\)n"{}}, actlen, aframes);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00965}00965 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00966}00966                 if\_inc\_counter(ifp, IFCOUNTER\_OPACKETS, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00967}00967 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00968}00968                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00969}00969         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00970}00970 tr\_setup:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00971}00971                 memset(\&msg, 0, \textcolor{keyword}{sizeof}(msg));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00972}00972 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00973}00973                 \textcolor{keywordflow}{for} (x = 0; x != \mbox{\hyperlink{if__urndisreg_8h_a332c122a09645fb98663969dca75ae2a}{RNDIS\_TX\_FRAMES\_MAX}}; x++) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00974}00974                         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, x);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00975}00975 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00976}00976                         \mbox{\hyperlink{usb__transfer_8c_aa9f706e03ede8468e81331de474aebb4}{usbd\_xfer\_set\_frame\_offset}}(xfer, x * \mbox{\hyperlink{if__urndisreg_8h_aeffe59019822466e458e9deef6bd4e28}{RNDIS\_TX\_MAXLEN}}, x);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00977}00977 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00978}00978 next\_pkt:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00979}00979                         IFQ\_DRV\_DEQUEUE(\&ifp-\/>if\_snd, m);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00980}00980 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00981}00981                         \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00982}00982                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00983}00983 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00984}00984                         \textcolor{keywordflow}{if} ((m-\/>m\_pkthdr.len + \textcolor{keyword}{sizeof}(msg)) > \mbox{\hyperlink{if__urndisreg_8h_aeffe59019822466e458e9deef6bd4e28}{RNDIS\_TX\_MAXLEN}}) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00985}00985                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Too big packet\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00986}00986                                 if\_inc\_counter(ifp, IFCOUNTER\_OERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00987}00987 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00988}00988                                 \textcolor{comment}{/* Free buffer */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00989}00989                                 m\_freem(m);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00990}00990                                 \textcolor{keywordflow}{goto} next\_pkt;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00991}00991                         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00992}00992                         msg.rm\_type = htole32(REMOTE\_NDIS\_PACKET\_MSG);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00993}00993                         msg.rm\_len = htole32(\textcolor{keyword}{sizeof}(msg) + m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00994}00994 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00995}00995                         msg.rm\_dataoffset = htole32(RNDIS\_DATA\_OFFSET);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00996}00996                         msg.rm\_datalen = htole32(m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00997}00997 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00998}00998                         \textcolor{comment}{/* copy in all data */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l00999}00999                         \mbox{\hyperlink{usb__busdma_8c_accb7cd85c3477e50c1ba1b1489226d09}{usbd\_copy\_in}}(pc, 0, \&msg, \textcolor{keyword}{sizeof}(msg));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01000}01000                         \mbox{\hyperlink{usbdi_8h_a9696aa8bcb25b1adcf45e8387a13897a}{usbd\_m\_copy\_in}}(pc, \textcolor{keyword}{sizeof}(msg), m, 0, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01001}01001                         \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, x, \textcolor{keyword}{sizeof}(msg) + m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01002}01002 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01003}01003                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01004}01004 \textcolor{comment}{                         * If there's a BPF listener, bounce a copy of}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01005}01005 \textcolor{comment}{                         * this frame to him:}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01006}01006 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01007}01007                         BPF\_MTAP(ifp, m);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01008}01008 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01009}01009                         \textcolor{comment}{/* Free buffer */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01010}01010                         m\_freem(m);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01011}01011                 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01012}01012                 \textcolor{keywordflow}{if} (x != 0) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01013}01013                         \mbox{\hyperlink{usb__transfer_8c_a10f82b008c3a5311e5210e44beaca014}{usbd\_xfer\_set\_frames}}(xfer, x);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01014}01014                         \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01015}01015                 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01016}01016                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01017}01017 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01018}01018         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01019}01019                 DPRINTFN(11, \textcolor{stringliteral}{"{}transfer error, \%s\(\backslash\)n"{}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01020}01020 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01021}01021                 \textcolor{comment}{/* count output errors */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01022}01022                 if\_inc\_counter(ifp, IFCOUNTER\_OERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01023}01023 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01024}01024                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01025}01025                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01026}01026                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01027}01027                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01028}01028                 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01029}01029                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01030}01030         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01031}01031 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01032}01032 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01033}01033 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01034}\mbox{\hyperlink{if__urndis_8c_a3ae238181b89d906942731a62b42f23e}{01034}} \mbox{\hyperlink{if__urndis_8c_a1e03057a59ceaba91ae5080ed2eb5ad4}{urndis\_intr\_read\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01035}01035 \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01036}01036         \textcolor{keywordtype}{int} actlen;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01037}01037 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01038}01038         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01039}01039 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01040}01040         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01041}01041         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01042}01042 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01043}01043                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Received \%d bytes\(\backslash\)n"{}}, actlen);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01044}01044 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01045}01045                 \textcolor{comment}{/* TODO: decode some indications */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01046}01046 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01047}01047                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01048}01048         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01049}01049 tr\_setup:}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01050}01050                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer));}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01051}01051                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01052}01052                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01053}01053 }
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01054}01054         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01055}01055                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01056}01056                         \textcolor{comment}{/* start clear stall */}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01057}01057                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01058}01058                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01059}01059                 \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01060}01060                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01061}01061         \}}
\DoxyCodeLine{\Hypertarget{if__urndis_8c_source_l01062}01062 \}}

\end{DoxyCode}
