\hypertarget{rtwn__pci__tx_8c_source}{}\doxysection{rtwn\+\_\+pci\+\_\+tx.\+c}
\label{rtwn__pci__tx_8c_source}\index{dev/rtwn/pci/rtwn\_pci\_tx.c@{dev/rtwn/pci/rtwn\_pci\_tx.c}}
\mbox{\hyperlink{rtwn__pci__tx_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00001}00001 \textcolor{comment}{/*      \$OpenBSD: if\_rtwn.c,v 1.6 2015/08/28 00:03:53 deraadt Exp \$     */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00002}00002 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00003}00003 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2015 Stefan Sperling <stsp@openbsd.org>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 2016 Andriy Voskoboinyk <avos@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00008}00008 \textcolor{comment}{ * Permission to use, copy, modify, and distribute this software for any}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00009}00009 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00010}00010 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00011}00011 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00012}00012 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00013}00013 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00014}00014 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00015}00015 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00016}00016 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00017}00017 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00018}00018 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00019}00019 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00020}00020 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00021}00021 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00022}\mbox{\hyperlink{rtwn__pci__tx_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00022}} \mbox{\hyperlink{rtwn__pci__tx_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00023}00023 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00024}00024 \textcolor{preprocessor}{\#include "{}opt\_wlan.h"{}}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00025}00025 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00026}00026 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00027}00027 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00028}00028 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/taskqueue.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <machine/resource.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <net/if\_var.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <net80211/ieee80211\_var.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <net80211/ieee80211\_radiotap.h>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{if__rtwnreg_8h}{dev/rtwn/if\_rtwnreg.h}}>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{if__rtwnvar_8h}{dev/rtwn/if\_rtwnvar.h}}>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{if__rtwn__debug_8h}{dev/rtwn/if\_rtwn\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{rtwn__pci__var_8h}{dev/rtwn/pci/rtwn\_pci\_var.h}}>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{rtwn__pci__tx_8h}{dev/rtwn/pci/rtwn\_pci\_tx.h}}>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{r92ce__reg_8h}{dev/rtwn/rtl8192c/pci/r92ce\_reg.h}}>}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00060}00060 \textcolor{keyword}{static} \textcolor{keyword}{struct }mbuf *}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00061}\mbox{\hyperlink{rtwn__pci__tx_8c_a61c2d28d3b2177fc5d316798e8ac54d6}{00061}} \mbox{\hyperlink{rtwn__pci__tx_8c_a61c2d28d3b2177fc5d316798e8ac54d6}{rtwn\_mbuf\_defrag}}(\textcolor{keyword}{struct} mbuf *m0, \textcolor{keywordtype}{int} how)}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00062}00062 \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00063}00063         \textcolor{keyword}{struct }mbuf *m = NULL;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00065}00065         KASSERT(m0-\/>m\_flags \& M\_PKTHDR,}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00066}00066             (\textcolor{stringliteral}{"{}M\_PKTHDR flag is absent (m \%p)!"{}}, m0));}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00068}00068         \textcolor{comment}{/* NB: we need \_exactly\_ one mbuf (no less, no more). */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00069}00069         \textcolor{keywordflow}{if} (m0-\/>m\_pkthdr.len > MJUMPAGESIZE) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00070}00070                 \textcolor{comment}{/* XXX MJUM9BYTES? */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00071}00071                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00072}00072         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (m0-\/>m\_pkthdr.len > MCLBYTES) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00073}00073                 m = m\_getjcl(how, MT\_DATA, M\_PKTHDR, MJUMPAGESIZE);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00074}00074                 \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00075}00075                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00077}00077                 \textcolor{keywordflow}{if} (m\_dup\_pkthdr(m, m0, how) == 0) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00078}00078                         m\_freem(m);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00079}00079                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00080}00080                 \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00082}00082                 m\_copydata(m0, 0, m0-\/>m\_pkthdr.len, mtod(m, caddr\_t));}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00083}00083                 m-\/>m\_len = m-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00084}00084                 m\_freem(m0);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00086}00086                 \textcolor{keywordflow}{return} (m);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00087}00087         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00088}00088                 \textcolor{keywordflow}{return} (m\_defrag(m0, how));}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00089}00089 \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00091}00091 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00092}\mbox{\hyperlink{rtwn__pci__tx_8c_a025abacf724e32efac2f864610fa562b}{00092}} \mbox{\hyperlink{rtwn__pci__tx_8c_a025abacf724e32efac2f864610fa562b}{rtwn\_pci\_tx\_start\_frame}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structrtwn__softc}{rtwn\_softc}} *sc, \textcolor{keyword}{struct} ieee80211\_node *ni,}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00093}00093     \textcolor{keyword}{struct} mbuf *m, uint8\_t *tx\_desc, uint8\_t type)}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00094}00094 \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00095}00095         \textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__pci__softc}{rtwn\_pci\_softc}} *pc = \mbox{\hyperlink{rtwn__pci__var_8h_ac9477df7805b09f52bda5da8badc1977}{RTWN\_PCI\_SOFTC}}(sc);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00096}00096         \textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__tx__ring}{rtwn\_tx\_ring}} *ring;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00097}00097         \textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__tx__data}{rtwn\_tx\_data}} *data;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00098}00098         \textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__tx__desc__common}{rtwn\_tx\_desc\_common}} *\mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00099}00099         bus\_dma\_segment\_t segs[1];}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00100}00100         uint8\_t qid;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00101}00101         \textcolor{keywordtype}{int} nsegs, error;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00103}00103         \mbox{\hyperlink{if__rtwnvar_8h_a11ab9aa31fac571d738d1df1dcabf4a0}{RTWN\_ASSERT\_LOCKED}}(sc);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00105}00105         \textcolor{keywordflow}{switch} (type) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00106}00106         \textcolor{keywordflow}{case} IEEE80211\_FC0\_TYPE\_CTL:}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00107}00107         \textcolor{keywordflow}{case} IEEE80211\_FC0\_TYPE\_MGT:}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00108}00108                 qid = \mbox{\hyperlink{rtwn__pci__var_8h_a61dadd085c1777f559549e05962b2c9eae1f16f010d0ef429d9a16d25dbcc2d5d}{RTWN\_PCI\_MGNT\_QUEUE}};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00109}00109                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00110}00110         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00111}00111                 qid = M\_WME\_GETAC(m);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00112}00112                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00113}00113         \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00115}00115         ring = \&pc-\/>\mbox{\hyperlink{structrtwn__pci__softc_a10b3170d45abd0286a306d59acc36880}{tx\_ring}}[qid];}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00116}00116         data = \&ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a1c2a0fb95cf66828cd366b6cd55361cc}{tx\_data}}[ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_ac279b36d98e24d34fdf1207355dc20d5}{cur}}];}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00117}00117         \textcolor{keywordflow}{if} (data-\/>\mbox{\hyperlink{structrtwn__tx__data_abfe1d5f49bc8177df5263e0d1748b5f9}{m}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00118}00118                 \mbox{\hyperlink{if__rtwn__debug_8h_a6ca1eeaaeb8a9a7f515dd33e65e9c591}{RTWN\_DPRINTF}}(sc, RTWN\_DEBUG\_XMIT,}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00119}00119                     \textcolor{stringliteral}{"{}\%s: ring \#\%u is full (m \%p)\(\backslash\)n"{}}, \_\_func\_\_, qid, data-\/>\mbox{\hyperlink{structrtwn__tx__data_abfe1d5f49bc8177df5263e0d1748b5f9}{m}});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00120}00120                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00121}00121         \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00123}00123         \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__tx__desc__common}{rtwn\_tx\_desc\_common}} *)}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00124}00124             ((uint8\_t *)ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a4641bf50f35d9ce71006a21a9d2a0644}{desc}} + sc-\/>\mbox{\hyperlink{structrtwn__softc_ad2c2633e226eaf646f68033fefddfdd2}{txdesc\_len}} * ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_ac279b36d98e24d34fdf1207355dc20d5}{cur}});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00125}00125         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>flags0 \& \mbox{\hyperlink{if__rtwnreg_8h_a1145cf295b358219b542ca3b38cca57e}{RTWN\_FLAGS0\_OWN}}) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00126}00126                 device\_printf(sc-\/>\mbox{\hyperlink{structrtwn__softc_a299d18a16d08213b975a1585651583f9}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00127}00127                     \textcolor{stringliteral}{"{}\%s: OWN bit is set (tx desc \%d, ring \%u)!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00128}00128                     \_\_func\_\_, ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_ac279b36d98e24d34fdf1207355dc20d5}{cur}}, qid);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00129}00129                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00130}00130         \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00132}00132         \textcolor{comment}{/* Copy Tx descriptor. */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00133}00133         \mbox{\hyperlink{rtwn__pci__var_8h_ab1550ac18ec0c1a972182ab78173b6fe}{rtwn\_pci\_copy\_tx\_desc}}(pc, \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}, tx\_desc);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00134}00134         \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>pktlen = htole16(m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00135}00135         \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>offset = sc-\/>\mbox{\hyperlink{structrtwn__softc_ad2c2633e226eaf646f68033fefddfdd2}{txdesc\_len}};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00137}00137         error = bus\_dmamap\_load\_mbuf\_sg(ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a12ee73e2cee180f318a4368f4fc5abd0}{data\_dmat}}, data-\/>\mbox{\hyperlink{structrtwn__tx__data_aa08b0e5df1b337b0e2abbf7662aa9576}{map}}, m, segs,}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00138}00138             \&nsegs, BUS\_DMA\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00139}00139         \textcolor{keywordflow}{if} (error != 0 \&\& error != EFBIG) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00140}00140                 device\_printf(sc-\/>\mbox{\hyperlink{structrtwn__softc_a299d18a16d08213b975a1585651583f9}{sc\_dev}}, \textcolor{stringliteral}{"{}can't map mbuf (error \%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00141}00141                     error);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00142}00142                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00143}00143         \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00144}00144         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00145}00145                 \textcolor{keyword}{struct }mbuf *mnew;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00147}00147                 mnew = \mbox{\hyperlink{rtwn__pci__tx_8c_a61c2d28d3b2177fc5d316798e8ac54d6}{rtwn\_mbuf\_defrag}}(m, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00148}00148                 \textcolor{keywordflow}{if} (mnew == NULL) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00149}00149                         device\_printf(sc-\/>\mbox{\hyperlink{structrtwn__softc_a299d18a16d08213b975a1585651583f9}{sc\_dev}}, \textcolor{stringliteral}{"{}can't defragment mbuf\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00150}00150                         \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00151}00151                 \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00152}00152                 m = mnew;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00154}00154                 error = bus\_dmamap\_load\_mbuf\_sg(ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a12ee73e2cee180f318a4368f4fc5abd0}{data\_dmat}}, data-\/>\mbox{\hyperlink{structrtwn__tx__data_aa08b0e5df1b337b0e2abbf7662aa9576}{map}}, m,}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00155}00155                     segs, \&nsegs, BUS\_DMA\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00156}00156                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00157}00157                         device\_printf(sc-\/>\mbox{\hyperlink{structrtwn__softc_a299d18a16d08213b975a1585651583f9}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00158}00158                             \textcolor{stringliteral}{"{}can't map mbuf (error \%d)\(\backslash\)n"{}}, error);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00159}00159                         \textcolor{keywordflow}{if} (ni != NULL) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00160}00160                                 if\_inc\_counter(ni-\/>ni\_vap-\/>iv\_ifp,}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00161}00161                                     IFCOUNTER\_OERRORS, 1);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00162}00162                                 ieee80211\_free\_node(ni);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00163}00163                         \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00164}00164                         m\_freem(m);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00165}00165                         \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00166}00166                 \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00167}00167         \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00169}00169         \mbox{\hyperlink{rtwn__pci__var_8h_ae05e09ff4aa9b0e87bc3811cde41f3b8}{rtwn\_pci\_tx\_postsetup}}(pc, \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}, segs);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00170}00170         \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>flags0 |= \mbox{\hyperlink{if__rtwnreg_8h_a1145cf295b358219b542ca3b38cca57e}{RTWN\_FLAGS0\_OWN}};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00172}00172         \textcolor{comment}{/* Dump Tx descriptor. */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00173}00173         \mbox{\hyperlink{if__rtwnvar_8h_ae68dfbe91686175718695fbc5db14ca5}{rtwn\_dump\_tx\_desc}}(sc, \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00175}00175         bus\_dmamap\_sync(ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a79ec3d6d6013bd5b8be6e28c06fbb5fb}{desc\_dmat}}, ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a565b0603c9d16c1edd8434629043ccf8}{desc\_map}},}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00176}00176             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00177}00177         bus\_dmamap\_sync(ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a12ee73e2cee180f318a4368f4fc5abd0}{data\_dmat}}, data-\/>\mbox{\hyperlink{structrtwn__tx__data_aa08b0e5df1b337b0e2abbf7662aa9576}{map}}, BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00179}00179         data-\/>\mbox{\hyperlink{structrtwn__tx__data_abfe1d5f49bc8177df5263e0d1748b5f9}{m}} = m;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00180}00180         data-\/>\mbox{\hyperlink{structrtwn__tx__data_a0924bf4cf65aa29ab7d9c3dc95aacad1}{ni}} = ni;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00182}00182         ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_ac279b36d98e24d34fdf1207355dc20d5}{cur}} = (ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_ac279b36d98e24d34fdf1207355dc20d5}{cur}} + 1) \% \mbox{\hyperlink{rtwn__pci__var_8h_a1602e0e114a998996c438a8173263a74}{RTWN\_PCI\_TX\_LIST\_COUNT}};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00184}00184         ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a4b9b6fd8b9eda514d1ca825b5844c381}{queued}}++;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00185}00185         \textcolor{keywordflow}{if} (ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a4b9b6fd8b9eda514d1ca825b5844c381}{queued}} >= (\mbox{\hyperlink{rtwn__pci__var_8h_a1602e0e114a998996c438a8173263a74}{RTWN\_PCI\_TX\_LIST\_COUNT}} -\/ 1))}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00186}00186                 sc-\/>\mbox{\hyperlink{structrtwn__softc_aa6b29970405d4733db848d33316fbcb6}{qfullmsk}} |= (1 << qid);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00188}00188 \textcolor{preprocessor}{\#ifndef D4054}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00189}00189         sc-\/>\mbox{\hyperlink{structrtwn__softc_a6d4ae3249397718b6f1d9d496951f05a}{sc\_tx\_timer}} = 5;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00190}00190 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00192}00192         \textcolor{comment}{/* Kick TX. */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00193}00193         \mbox{\hyperlink{if__rtwnvar_8h_a61d56a364bbdf0b209f7e07ebb59b823}{rtwn\_write\_2}}(sc, \mbox{\hyperlink{r92ce__reg_8h_aa2a2f8f12a26105949530fd3fd470355}{R92C\_PCIE\_CTRL\_REG}}, (1 << qid));}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00195}00195         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00196}00196 \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00198}00198 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00199}\mbox{\hyperlink{rtwn__pci__tx_8c_a86597e4bd001ba31d30c93b411db4977}{00199}} \mbox{\hyperlink{rtwn__pci__tx_8c_a86597e4bd001ba31d30c93b411db4977}{rtwn\_pci\_tx\_start\_beacon}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structrtwn__softc}{rtwn\_softc}} *sc, \textcolor{keyword}{struct} mbuf *m,}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00200}00200     uint8\_t *tx\_desc, \textcolor{keywordtype}{int} \textcolor{keywordtype}{id})}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00201}00201 \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00202}00202         \textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__pci__softc}{rtwn\_pci\_softc}} *pc = \mbox{\hyperlink{rtwn__pci__var_8h_ac9477df7805b09f52bda5da8badc1977}{RTWN\_PCI\_SOFTC}}(sc);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00203}00203         \textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__tx__ring}{rtwn\_tx\_ring}} *ring;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00204}00204         \textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__tx__data}{rtwn\_tx\_data}} *data;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00205}00205         \textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__tx__desc__common}{rtwn\_tx\_desc\_common}} *\mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00206}00206         bus\_dma\_segment\_t segs[1];}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00207}00207         \textcolor{keywordtype}{int} nsegs, error, own;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00209}00209         \mbox{\hyperlink{if__rtwnvar_8h_a11ab9aa31fac571d738d1df1dcabf4a0}{RTWN\_ASSERT\_LOCKED}}(sc);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00211}00211         KASSERT(\textcolor{keywordtype}{id} == 0 || \textcolor{keywordtype}{id} == 1, (\textcolor{stringliteral}{"{}bogus vap id \%d\(\backslash\)n"{}}, \textcolor{keywordtype}{id}));}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00212}00212 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00213}00213         ring = \&pc-\/>\mbox{\hyperlink{structrtwn__pci__softc_a10b3170d45abd0286a306d59acc36880}{tx\_ring}}[\mbox{\hyperlink{rtwn__pci__var_8h_a61dadd085c1777f559549e05962b2c9ea7d45fede14f64b44a8dd997496bc8dce}{RTWN\_PCI\_BEACON\_QUEUE}}];}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00214}00214         data = \&ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a1c2a0fb95cf66828cd366b6cd55361cc}{tx\_data}}[\mbox{\hyperlink{r88e__fw__cmd_8h_a1e6927fa1486224044e568f9c370519b}{id}}];}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00215}00215         \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structrtwn__tx__desc__common}{rtwn\_tx\_desc\_common}} *)}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00216}00216             ((uint8\_t *)ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a4641bf50f35d9ce71006a21a9d2a0644}{desc}} + \textcolor{keywordtype}{id} * sc-\/>\mbox{\hyperlink{structrtwn__softc_ad2c2633e226eaf646f68033fefddfdd2}{txdesc\_len}});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00218}00218         bus\_dmamap\_sync(ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a79ec3d6d6013bd5b8be6e28c06fbb5fb}{desc\_dmat}}, ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a565b0603c9d16c1edd8434629043ccf8}{desc\_map}},}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00219}00219             BUS\_DMASYNC\_POSTREAD);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00220}00220         own = !!(\mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>flags0 \& \mbox{\hyperlink{if__rtwnreg_8h_a1145cf295b358219b542ca3b38cca57e}{RTWN\_FLAGS0\_OWN}});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00221}00221         error = 0;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00222}00222         \textcolor{keywordflow}{if} (!own || \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>pktlen != htole16(m-\/>m\_pkthdr.len)) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00223}00223                 \textcolor{keywordflow}{if} (!own) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00224}00224                         \textcolor{comment}{/* Copy Tx descriptor. */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00225}00225                         \mbox{\hyperlink{rtwn__pci__var_8h_ab1550ac18ec0c1a972182ab78173b6fe}{rtwn\_pci\_copy\_tx\_desc}}(pc, \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}, tx\_desc);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00226}00226                         \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>offset = sc-\/>\mbox{\hyperlink{structrtwn__softc_ad2c2633e226eaf646f68033fefddfdd2}{txdesc\_len}};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00227}00227                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00228}00228                         \textcolor{comment}{/* Reload mbuf. */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00229}00229                         bus\_dmamap\_unload(ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a12ee73e2cee180f318a4368f4fc5abd0}{data\_dmat}}, data-\/>\mbox{\hyperlink{structrtwn__tx__data_aa08b0e5df1b337b0e2abbf7662aa9576}{map}});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00230}00230                 \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00231}00231 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00232}00232                 error = bus\_dmamap\_load\_mbuf\_sg(ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a12ee73e2cee180f318a4368f4fc5abd0}{data\_dmat}},}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00233}00233                     data-\/>\mbox{\hyperlink{structrtwn__tx__data_aa08b0e5df1b337b0e2abbf7662aa9576}{map}}, m, segs, \&nsegs, BUS\_DMA\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00234}00234                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00235}00235                         device\_printf(sc-\/>\mbox{\hyperlink{structrtwn__softc_a299d18a16d08213b975a1585651583f9}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00236}00236                             \textcolor{stringliteral}{"{}can't map beacon (error \%d)\(\backslash\)n"{}}, error);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00237}00237                         \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>flags0 \&= \string~RTWN\_FLAGS0\_OWN;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00238}00238                         \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00239}00239                 \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00241}00241                 \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>pktlen = htole16(m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00242}00242                 \mbox{\hyperlink{rtwn__pci__var_8h_ae05e09ff4aa9b0e87bc3811cde41f3b8}{rtwn\_pci\_tx\_postsetup}}(pc, \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}, segs);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00243}00243                 \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}}-\/>flags0 |= \mbox{\hyperlink{if__rtwnreg_8h_a1145cf295b358219b542ca3b38cca57e}{RTWN\_FLAGS0\_OWN}};}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00244}00244 end:}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00245}00245                 bus\_dmamap\_sync(ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a79ec3d6d6013bd5b8be6e28c06fbb5fb}{desc\_dmat}}, ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a565b0603c9d16c1edd8434629043ccf8}{desc\_map}},}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00246}00246                     BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00247}00247         \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00249}00249         \textcolor{comment}{/* Dump Tx descriptor. */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00250}00250         \mbox{\hyperlink{if__rtwnvar_8h_ae68dfbe91686175718695fbc5db14ca5}{rtwn\_dump\_tx\_desc}}(sc, \mbox{\hyperlink{if__rtwnvar_8h_a32bf980f9ea86441b67b2e1ce4eea343}{txd}});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00252}00252         bus\_dmamap\_sync(ring-\/>\mbox{\hyperlink{structrtwn__tx__ring_a12ee73e2cee180f318a4368f4fc5abd0}{data\_dmat}}, data-\/>\mbox{\hyperlink{structrtwn__tx__data_aa08b0e5df1b337b0e2abbf7662aa9576}{map}}, BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00253}00253 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00254}00254         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00255}00255 \}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00256}00256 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00257}00257 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00258}\mbox{\hyperlink{rtwn__pci__tx_8c_a991c7e42b3babc407b82e25ede9b1b8b}{00258}} \mbox{\hyperlink{rtwn__pci__tx_8c_a991c7e42b3babc407b82e25ede9b1b8b}{rtwn\_pci\_tx\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structrtwn__softc}{rtwn\_softc}} *sc, \textcolor{keyword}{struct} ieee80211\_node *ni,}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00259}00259     \textcolor{keyword}{struct} mbuf *m, uint8\_t *tx\_desc, uint8\_t type, \textcolor{keywordtype}{int} \textcolor{keywordtype}{id})}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00260}00260 \{}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00261}00261         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00263}00263         \mbox{\hyperlink{if__rtwnvar_8h_a11ab9aa31fac571d738d1df1dcabf4a0}{RTWN\_ASSERT\_LOCKED}}(sc);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00264}00264 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00265}00265         \textcolor{keywordflow}{if} (ni == NULL)         \textcolor{comment}{/* beacon frame */}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00266}00266                 error = \mbox{\hyperlink{rtwn__pci__tx_8c_a86597e4bd001ba31d30c93b411db4977}{rtwn\_pci\_tx\_start\_beacon}}(sc, m, tx\_desc, \textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00267}00267         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00268}00268                 error = \mbox{\hyperlink{rtwn__pci__tx_8c_a025abacf724e32efac2f864610fa562b}{rtwn\_pci\_tx\_start\_frame}}(sc, ni, m, tx\_desc, type);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00270}00270         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{rtwn__pci__tx_8c_source_l00271}00271 \}}

\end{DoxyCode}
