\hypertarget{lio__ioctl_8c_source}{}\doxysection{lio\+\_\+ioctl.\+c}
\label{lio__ioctl_8c_source}\index{dev/liquidio/lio\_ioctl.c@{dev/liquidio/lio\_ioctl.c}}
\mbox{\hyperlink{lio__ioctl_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00002}00002 \textcolor{comment}{ *   BSD LICENSE}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00004}00004 \textcolor{comment}{ *   Copyright(c) 2017 Cavium, Inc.. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00005}00005 \textcolor{comment}{ *   All rights reserved.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00007}00007 \textcolor{comment}{ *   Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00008}00008 \textcolor{comment}{ *   modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00009}00009 \textcolor{comment}{ *   are met:}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00011}00011 \textcolor{comment}{ *     * Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00012}00012 \textcolor{comment}{ *       notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00013}00013 \textcolor{comment}{ *     * Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00014}00014 \textcolor{comment}{ *       notice, this list of conditions and the following disclaimer in}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00015}00015 \textcolor{comment}{ *       the documentation and/or other materials provided with the}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00016}00016 \textcolor{comment}{ *       distribution.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00017}00017 \textcolor{comment}{ *     * Neither the name of Cavium, Inc. nor the names of its}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00018}00018 \textcolor{comment}{ *       contributors may be used to endorse or promote products derived}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00019}00019 \textcolor{comment}{ *       from this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00020}00020 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00021}00021 \textcolor{comment}{ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00022}00022 \textcolor{comment}{ *   "{}AS IS"{} AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00023}00023 \textcolor{comment}{ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00024}00024 \textcolor{comment}{ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00025}00025 \textcolor{comment}{ *   OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00026}00026 \textcolor{comment}{ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00027}00027 \textcolor{comment}{ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00028}00028 \textcolor{comment}{ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00029}00029 \textcolor{comment}{ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00030}00030 \textcolor{comment}{ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00031}00031 \textcolor{comment}{ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00032}00032 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00033}00033 \textcolor{comment}{/*\$FreeBSD\$*/}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00035}00035 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__bsd_8h}{lio\_bsd.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00036}00036 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__common_8h}{lio\_common.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__droq_8h}{lio\_droq.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00038}00038 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__iq_8h}{lio\_iq.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00039}00039 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__response__manager_8h}{lio\_response\_manager.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00040}00040 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__device_8h}{lio\_device.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00041}00041 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__network_8h}{lio\_network.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00042}00042 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__ctrl_8h}{lio\_ctrl.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00043}00043 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{cn23xx__pf__device_8h}{cn23xx\_pf\_device.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00044}00044 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__image_8h}{lio\_image.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00045}00045 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__ioctl_8h}{lio\_ioctl.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00046}00046 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__main_8h}{lio\_main.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00047}00047 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__rxtx_8h}{lio\_rxtx.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00049}00049 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{lio__ioctl_8c_a40c8b0e77fd12913d582d0852e79e493}{lio\_set\_rx\_csum}}(\textcolor{keyword}{struct} ifnet *ifp, uint32\_t data);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00050}00050 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{lio__ioctl_8c_a0c1b961fb59bbd512522ad0c3f46245b}{lio\_set\_tso4}}(\textcolor{keyword}{struct} ifnet *ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00051}00051 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{lio__ioctl_8c_a90479f0d85aeee5fabeebcac8e7bb19f}{lio\_set\_tso6}}(\textcolor{keyword}{struct} ifnet *ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00052}00052 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{lio__ioctl_8c_a9bc74ee3eed2bdf0477b57194a7d5f1f}{lio\_set\_lro}}(\textcolor{keyword}{struct} ifnet *ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00053}00053 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{lio__ioctl_8c_a7c3f2daf776f1078a30fab1d1de6904b}{lio\_change\_mtu}}(\textcolor{keyword}{struct} ifnet *ifp, \textcolor{keywordtype}{int} new\_mtu);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00054}00054 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{lio__ioctl_8c_a7a332ce8942d1b77ed68b3c7a6ccea75}{lio\_set\_mcast\_list}}(\textcolor{keyword}{struct} ifnet *ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00055}00055 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{enum}      \mbox{\hyperlink{lio__common_8h_aa4169cf3f2c021d524235d8b72daad75}{lio\_ifflags}} \mbox{\hyperlink{lio__ioctl_8c_a990be2bc9ef548536974058f982f7b59}{lio\_get\_new\_flags}}(\textcolor{keyword}{struct} ifnet *ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00057}00057 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00058}\mbox{\hyperlink{lio__ioctl_8c_accf7d62b9298ba05c08a475f0c43c0b5}{00058}} \mbox{\hyperlink{lio__ioctl_8c_accf7d62b9298ba05c08a475f0c43c0b5}{lio\_is\_valid\_ether\_addr}}(\textcolor{keyword}{const} uint8\_t *addr)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00059}00059 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00061}00061         \textcolor{keywordflow}{return} (!(0x01 \& addr[0]) \&\& !((addr[0] + addr[1] + addr[2] + addr[3] +}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00062}00062                                         addr[4] + addr[5]) == 0x00));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00063}00063 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00065}00065 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00066}\mbox{\hyperlink{lio__ioctl_8c_a973acb3200ab25599afd2189aa5f6f60}{00066}} \mbox{\hyperlink{lio__ioctl_8c_a973acb3200ab25599afd2189aa5f6f60}{lio\_change\_dev\_flags}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00067}00067 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00068}00068         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__ctrl__pkt}{lio\_ctrl\_pkt}} nctrl;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00069}00069         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}           *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00070}00070         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}       *oct = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00071}00071         \textcolor{keywordtype}{int} ret = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00073}00073         bzero(\&nctrl, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__ctrl__pkt}{lio\_ctrl\_pkt}}));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00075}00075         \textcolor{comment}{/* Create a ctrl pkt command to be sent to core app. */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00076}00076         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_abdc7441d60674e269cc22b4a1facb233}{cmd64}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00077}00077         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_ae8a289a502362b98e550d65d3986dc3f}{cmd}} = \mbox{\hyperlink{lio__common_8h_ae523a1aafdc011d40671c5f65be6e8e1}{LIO\_CMD\_CHANGE\_DEVFLAGS}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00078}00078         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_aa4b02c6bc773b809463ceb325e8fdc5f}{param1}} = \mbox{\hyperlink{lio__ioctl_8c_a990be2bc9ef548536974058f982f7b59}{lio\_get\_new\_flags}}(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00079}00079         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a8a585822f4eb70f431c7db4606c50a50}{iq\_no}} = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aea3442e0b2b012f49360d68d80e30323}{linfo}}.\mbox{\hyperlink{structocteon__link__info_ab81ea307e028882d131992fd679923d7}{txpciq}}[0].\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_a036a1f65fa239c8b4dbdcca730c8e47a}{q\_no}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00080}00080         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a8ed757510cd56d869fbc2a281008b91f}{lio}} = \mbox{\hyperlink{structlio}{lio}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00081}00081         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_adcc5ed7ab9f23d57202ceff098fa2146}{cb\_fn}} = \mbox{\hyperlink{lio__core_8c_a48c1e67dffbf88a354e7ef45e0261674}{lio\_ctrl\_cmd\_completion}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00083}00083         ret = \mbox{\hyperlink{lio__ctrl_8c_a93d515939a6aef78b9f008a414e73940}{lio\_send\_ctrl\_pkt}}(oct, \&nctrl);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00084}00084         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00085}00085                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Failed to change flags ret \%d\(\backslash\)n"{}}, ret);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00087}00087         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00088}00088 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00090}00090 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00091}00091 \textcolor{comment}{ * lio\_ioctl : User calls this routine for configuring}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00092}00092 \textcolor{comment}{ * the interface.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00093}00093 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00094}00094 \textcolor{comment}{ * return 0 on success, positive on failure}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00095}00095 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00096}00096 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00097}\mbox{\hyperlink{lio__ioctl_8c_ae00ae2395f23c76ccf55502fd7350693}{00097}} \mbox{\hyperlink{lio__ioctl_8c_ae00ae2395f23c76ccf55502fd7350693}{lio\_ioctl}}(\textcolor{keyword}{struct} ifnet *ifp, u\_long cmd, caddr\_t data)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00098}00098 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00099}00099         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}   *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00100}00100         \textcolor{keyword}{struct }ifreq    *ifrequest = (\textcolor{keyword}{struct }ifreq *)data;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00101}00101         \textcolor{keywordtype}{int}     error = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00103}00103         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00104}00104         \textcolor{keywordflow}{case} SIOCSIFADDR:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00105}00105                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: SIOCSIFADDR\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00106}00106                 if\_setflagbits(ifp, IFF\_UP, 0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00107}00107                 error = ether\_ioctl(ifp, cmd, data);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00108}00108                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00109}00109         \textcolor{keywordflow}{case} SIOCSIFMTU:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00110}00110                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: SIOCSIFMTU\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00111}00111                 error = \mbox{\hyperlink{lio__ioctl_8c_a7c3f2daf776f1078a30fab1d1de6904b}{lio\_change\_mtu}}(ifp, ifrequest-\/>ifr\_mtu);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00112}00112                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00113}00113         \textcolor{keywordflow}{case} SIOCSIFFLAGS:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00114}00114                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: SIOCSIFFLAGS\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00115}00115                 \textcolor{keywordflow}{if} (if\_getflags(ifp) \& IFF\_UP) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00116}00116                         \textcolor{keywordflow}{if} (if\_getdrvflags(ifp) \& IFF\_DRV\_RUNNING) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00117}00117                                 \textcolor{keywordflow}{if} ((if\_getflags(ifp) \string^ \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a997937871fec0dbbf98b11b3a94769e7}{if\_flags}}) \&}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00118}00118                                     (IFF\_PROMISC | IFF\_ALLMULTI))}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00119}00119                                         error = \mbox{\hyperlink{lio__ioctl_8c_a973acb3200ab25599afd2189aa5f6f60}{lio\_change\_dev\_flags}}(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00120}00120                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00121}00121                                 \textcolor{keywordflow}{if} (!(atomic\_load\_acq\_int(\&\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aa69df616e50527613761d53375065bb7}{ifstate}}) \&}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00122}00122                                       \mbox{\hyperlink{lio__rxtx_8h_acb5c5b25492a14adeeaaa82e9fcccf68}{LIO\_IFSTATE\_DETACH}}))}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00123}00123                                         \mbox{\hyperlink{lio__ioctl_8h_ab265f93e7d9b385e555cf74fff1f335c}{lio\_open}}(\mbox{\hyperlink{structlio}{lio}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00124}00124                         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00125}00125                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00126}00126                         \textcolor{keywordflow}{if} (if\_getdrvflags(ifp) \& IFF\_DRV\_RUNNING)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00127}00127                                 \mbox{\hyperlink{lio__ioctl_8h_a030ec76d4cb48166ad9307a2462a2380}{lio\_stop}}(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00128}00128                 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00129}00129                 \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a997937871fec0dbbf98b11b3a94769e7}{if\_flags}} = if\_getflags(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00130}00130                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00131}00131         \textcolor{keywordflow}{case} SIOCADDMULTI:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00132}00132                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: SIOCADDMULTI\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00133}00133                 \textcolor{keywordflow}{if} (if\_getdrvflags(ifp) \& IFF\_DRV\_RUNNING)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00134}00134                         error = \mbox{\hyperlink{lio__ioctl_8c_a7a332ce8942d1b77ed68b3c7a6ccea75}{lio\_set\_mcast\_list}}(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00135}00135                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00136}00136         \textcolor{keywordflow}{case} SIOCDELMULTI:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00137}00137                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: SIOCSIFMULTI\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00138}00138                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00139}00139         \textcolor{keywordflow}{case} SIOCSIFMEDIA:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00140}00140                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: SIOCSIFMEDIA\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00141}00141         \textcolor{keywordflow}{case} SIOCGIFMEDIA:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00142}00142                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: SIOCGIFMEDIA\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00143}00143         \textcolor{keywordflow}{case} SIOCGIFXMEDIA:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00144}00144                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: SIOCGIFXMEDIA\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00145}00145                 error = ifmedia\_ioctl(ifp, ifrequest, \&\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aa8e7e23eb5e79aba33841336c56f1901}{ifmedia}}, cmd);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00146}00146                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00147}00147         \textcolor{keywordflow}{case} SIOCSIFCAP:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00148}00148                 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00149}00149                         \textcolor{keywordtype}{int}     features = ifrequest-\/>ifr\_reqcap \string^}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00150}00150                                         if\_getcapenable(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00152}00152                         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: SIOCSIFCAP (Set Capabilities)\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00154}00154                         \textcolor{keywordflow}{if} (!features)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00155}00155                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00157}00157                         \textcolor{keywordflow}{if} (features \& IFCAP\_TXCSUM) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00158}00158                                 if\_togglecapenable(ifp, IFCAP\_TXCSUM);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00159}00159                                 \textcolor{keywordflow}{if} (if\_getcapenable(ifp) \& IFCAP\_TXCSUM)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00160}00160                                         if\_sethwassistbits(ifp, (CSUM\_TCP |}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00161}00161                                                                  CSUM\_UDP |}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00162}00162                                                                  CSUM\_IP), 0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00163}00163                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00164}00164                                         if\_sethwassistbits(ifp, 0,}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00165}00165                                                         (CSUM\_TCP | CSUM\_UDP |}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00166}00166                                                          CSUM\_IP));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00167}00167                         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00168}00168                         \textcolor{keywordflow}{if} (features \& IFCAP\_TXCSUM\_IPV6) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00169}00169                                 if\_togglecapenable(ifp, IFCAP\_TXCSUM\_IPV6);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00170}00170                                 \textcolor{keywordflow}{if} (if\_getcapenable(ifp) \& IFCAP\_TXCSUM\_IPV6)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00171}00171                                         if\_sethwassistbits(ifp, (CSUM\_UDP\_IPV6 |}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00172}00172                                                            CSUM\_TCP\_IPV6), 0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00173}00173                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00174}00174                                         if\_sethwassistbits(ifp, 0,}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00175}00175                                                            (CSUM\_UDP\_IPV6 |}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00176}00176                                                             CSUM\_TCP\_IPV6));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00177}00177                         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00178}00178                         \textcolor{keywordflow}{if} (features \& (IFCAP\_RXCSUM | IFCAP\_RXCSUM\_IPV6))}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00179}00179                                 error |= \mbox{\hyperlink{lio__ioctl_8c_a40c8b0e77fd12913d582d0852e79e493}{lio\_set\_rx\_csum}}(ifp, (features \&}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00180}00180                                                                (IFCAP\_RXCSUM |}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00181}00181                                                          IFCAP\_RXCSUM\_IPV6)));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00183}00183                         \textcolor{keywordflow}{if} (features \& IFCAP\_TSO4)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00184}00184                                 error |= \mbox{\hyperlink{lio__ioctl_8c_a0c1b961fb59bbd512522ad0c3f46245b}{lio\_set\_tso4}}(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00186}00186                         \textcolor{keywordflow}{if} (features \& IFCAP\_TSO6)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00187}00187                                 error |= \mbox{\hyperlink{lio__ioctl_8c_a90479f0d85aeee5fabeebcac8e7bb19f}{lio\_set\_tso6}}(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00188}00188 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00189}00189                         \textcolor{keywordflow}{if} (features \& IFCAP\_LRO)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00190}00190                                 error |= \mbox{\hyperlink{lio__ioctl_8c_a9bc74ee3eed2bdf0477b57194a7d5f1f}{lio\_set\_lro}}(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00192}00192                         \textcolor{keywordflow}{if} (features \& IFCAP\_VLAN\_HWTAGGING)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00193}00193                                 if\_togglecapenable(ifp, IFCAP\_VLAN\_HWTAGGING);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00195}00195                         \textcolor{keywordflow}{if} (features \& IFCAP\_VLAN\_HWFILTER)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00196}00196                                 if\_togglecapenable(ifp, IFCAP\_VLAN\_HWFILTER);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00198}00198                         \textcolor{keywordflow}{if} (features \& IFCAP\_VLAN\_HWTSO)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00199}00199                                 if\_togglecapenable(ifp, IFCAP\_VLAN\_HWTSO);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00201}00201                         VLAN\_CAPABILITIES(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00202}00202                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00203}00203                 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00204}00204         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00205}00205                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}ioctl: UNKNOWN (0x\%X)\(\backslash\)n"{}}, (\textcolor{keywordtype}{int})cmd);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00206}00206                 error = ether\_ioctl(ifp, cmd, data);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00207}00207                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00208}00208         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00209}00209 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00210}00210         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00211}00211 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00212}00212 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00213}00213 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00214}\mbox{\hyperlink{lio__ioctl_8c_a0c1b961fb59bbd512522ad0c3f46245b}{00214}} \mbox{\hyperlink{lio__ioctl_8c_a0c1b961fb59bbd512522ad0c3f46245b}{lio\_set\_tso4}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00215}00215 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00216}00216         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}   *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00218}00218         \textcolor{keywordflow}{if} (if\_getcapabilities(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_TSO4) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00219}00219                 if\_togglecapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, IFCAP\_TSO4);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00220}00220                 \textcolor{keywordflow}{if} (if\_getcapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_TSO4)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00221}00221                         if\_sethwassistbits(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, CSUM\_IP\_TSO, 0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00222}00222                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00223}00223                         if\_sethwassistbits(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, 0, CSUM\_IP\_TSO);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00224}00224         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00225}00225                 \mbox{\hyperlink{lio__bsd_8h_ae98de25aa714ca601589b31d9364062a}{lio\_dev\_info}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}TSO4 capability not supported\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00226}00226                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00227}00227         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00229}00229         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00230}00230 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00231}00231 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00232}00232 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00233}\mbox{\hyperlink{lio__ioctl_8c_a90479f0d85aeee5fabeebcac8e7bb19f}{00233}} \mbox{\hyperlink{lio__ioctl_8c_a90479f0d85aeee5fabeebcac8e7bb19f}{lio\_set\_tso6}}(\textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}})}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00234}00234 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00235}00235         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}   *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00236}00236 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00237}00237         \textcolor{keywordflow}{if} (if\_getcapabilities(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_TSO6) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00238}00238                 if\_togglecapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, IFCAP\_TSO6);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00239}00239                 \textcolor{keywordflow}{if} (if\_getcapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_TSO6)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00240}00240                         if\_sethwassistbits(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, CSUM\_IP6\_TSO, 0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00241}00241                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00242}00242                         if\_sethwassistbits(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, 0, CSUM\_IP6\_TSO);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00243}00243         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00244}00244                 \mbox{\hyperlink{lio__bsd_8h_ae98de25aa714ca601589b31d9364062a}{lio\_dev\_info}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}TSO6 capability not supported\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00245}00245                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00246}00246         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00248}00248         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00249}00249 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00251}00251 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00252}\mbox{\hyperlink{lio__ioctl_8c_a40c8b0e77fd12913d582d0852e79e493}{00252}} \mbox{\hyperlink{lio__ioctl_8c_a40c8b0e77fd12913d582d0852e79e493}{lio\_set\_rx\_csum}}(\textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, uint32\_t data)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00253}00253 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00254}00254         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}   *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00255}00255         \textcolor{keywordtype}{int}     ret = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00256}00256 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00257}00257         \textcolor{keywordflow}{if} (if\_getcapabilities(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& (IFCAP\_RXCSUM | IFCAP\_RXCSUM\_IPV6)) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00258}00258                 if\_togglecapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, (IFCAP\_RXCSUM | IFCAP\_RXCSUM\_IPV6));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00260}00260                 \textcolor{keywordflow}{if} (data) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00261}00261                         \textcolor{comment}{/* LRO requires RXCSUM */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00262}00262                         \textcolor{keywordflow}{if} ((if\_getcapabilities(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_LRO) \&\&}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00263}00263                             (if\_getcapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_LRO)) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00264}00264                                 ret = \mbox{\hyperlink{lio__core_8c_a777682709fe51635e2daaa073f81d1b1}{lio\_set\_feature}}(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, \mbox{\hyperlink{lio__common_8h_a1baae719bec46723c4ca955edf488ca8}{LIO\_CMD\_LRO\_DISABLE}},}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00265}00265                                                       \mbox{\hyperlink{lio__common_8h_a98fba0698bb62f0629ccb48518ebff65}{LIO\_LROIPV4}} |}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00266}00266                                                       \mbox{\hyperlink{lio__common_8h_ab376c2b2b339084d44cb4d1586b08dce}{LIO\_LROIPV6}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00267}00267                                 if\_togglecapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, IFCAP\_LRO);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00268}00268                         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00269}00269                 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00270}00270         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00271}00271                 \mbox{\hyperlink{lio__bsd_8h_ae98de25aa714ca601589b31d9364062a}{lio\_dev\_info}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}Rx checksum offload capability not supported\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00272}00272                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00273}00273         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00275}00275         \textcolor{keywordflow}{return} ((ret) ? EINVAL : 0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00276}00276 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00278}00278 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00279}\mbox{\hyperlink{lio__ioctl_8c_a9bc74ee3eed2bdf0477b57194a7d5f1f}{00279}} \mbox{\hyperlink{lio__ioctl_8c_a9bc74ee3eed2bdf0477b57194a7d5f1f}{lio\_set\_lro}}(\textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}})}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00280}00280 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00281}00281         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}   *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00282}00282         \textcolor{keywordtype}{int}     ret = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00284}00284         \textcolor{keywordflow}{if} (!(if\_getcapabilities(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_LRO)) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00285}00285                 \mbox{\hyperlink{lio__bsd_8h_ae98de25aa714ca601589b31d9364062a}{lio\_dev\_info}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}LRO capability not supported\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00286}00286                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00287}00287         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00288}00288 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00289}00289         \textcolor{keywordflow}{if} ((!(if\_getcapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_LRO)) \&\&}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00290}00290             (if\_getcapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_RXCSUM) \&\&}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00291}00291             (if\_getcapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_RXCSUM\_IPV6)) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00292}00292                 if\_togglecapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, IFCAP\_LRO);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00293}00293 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00294}00294                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__main_8c_a17f570aaf869da2cc2a06e75a1d8bd41}{lio\_hwlro}})}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00295}00295                         ret = \mbox{\hyperlink{lio__core_8c_a777682709fe51635e2daaa073f81d1b1}{lio\_set\_feature}}(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, \mbox{\hyperlink{lio__common_8h_a84603cb24195b195a64887a58eeae71b}{LIO\_CMD\_LRO\_ENABLE}}, \mbox{\hyperlink{lio__common_8h_a98fba0698bb62f0629ccb48518ebff65}{LIO\_LROIPV4}} |}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00296}00296                                               \mbox{\hyperlink{lio__common_8h_ab376c2b2b339084d44cb4d1586b08dce}{LIO\_LROIPV6}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00297}00297 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00298}00298         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (if\_getcapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}) \& IFCAP\_LRO) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00299}00299                 if\_togglecapenable(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, IFCAP\_LRO);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00301}00301                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__main_8c_a17f570aaf869da2cc2a06e75a1d8bd41}{lio\_hwlro}})}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00302}00302                         ret = \mbox{\hyperlink{lio__core_8c_a777682709fe51635e2daaa073f81d1b1}{lio\_set\_feature}}(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}}, \mbox{\hyperlink{lio__common_8h_a1baae719bec46723c4ca955edf488ca8}{LIO\_CMD\_LRO\_DISABLE}}, \mbox{\hyperlink{lio__common_8h_a98fba0698bb62f0629ccb48518ebff65}{LIO\_LROIPV4}} |}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00303}00303                                               \mbox{\hyperlink{lio__common_8h_ab376c2b2b339084d44cb4d1586b08dce}{LIO\_LROIPV6}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00304}00304         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00305}00305                 \mbox{\hyperlink{lio__bsd_8h_ae98de25aa714ca601589b31d9364062a}{lio\_dev\_info}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \textcolor{stringliteral}{"{}LRO requires RXCSUM"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00307}00307         \textcolor{keywordflow}{return} ((ret) ? EINVAL : 0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00308}00308 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00309}00309 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00310}00310 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00311}\mbox{\hyperlink{lio__ioctl_8c_a5518fe6f06802fe8da63127c612a906e}{00311}} \mbox{\hyperlink{lio__ioctl_8c_a5518fe6f06802fe8da63127c612a906e}{lio\_mtu\_ctl\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint32\_t status, \textcolor{keywordtype}{void} *buf)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00312}00312 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00313}00313         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *sc = buf;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00314}00314         \textcolor{keyword}{volatile} \textcolor{keywordtype}{int}            *mtu\_sc\_ctx;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00315}00315 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00316}00316         mtu\_sc\_ctx = sc-\/>\mbox{\hyperlink{structlio__soft__command_a288d7c6ce348f6c917681748ebf432fd}{ctxptr}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00318}00318         \textcolor{keywordflow}{if} (status) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00319}00319                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}MTU updation ctl instruction failed. Status: \%llx\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00320}00320                             \mbox{\hyperlink{lio__main_8h_ae67a87eb5deeb31e550aa38dfa869505}{LIO\_CAST64}}(status));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00321}00321                 *mtu\_sc\_ctx = -\/1;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00322}00322                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00323}00323 \textcolor{comment}{                 * This barrier is required to be sure that the}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00324}00324 \textcolor{comment}{                 * response has been written fully.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00325}00325 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00326}00326                 wmb();}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00327}00327                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00328}00328         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00330}00330         *mtu\_sc\_ctx = 1;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00331}00331 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00332}00332         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00333}00333 \textcolor{comment}{         * This barrier is required to be sure that the response has been}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00334}00334 \textcolor{comment}{         * written fully.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00335}00335 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00336}00336         wmb();}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00337}00337 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00338}00338 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00339}00339 \textcolor{comment}{/* @param ifp is network device */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00340}00340 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00341}\mbox{\hyperlink{lio__ioctl_8c_a7c3f2daf776f1078a30fab1d1de6904b}{00341}} \mbox{\hyperlink{lio__ioctl_8c_a7c3f2daf776f1078a30fab1d1de6904b}{lio\_change\_mtu}}(\textcolor{keyword}{struct} ifnet *ifp, \textcolor{keywordtype}{int} new\_mtu)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00342}00342 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00343}00343         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}           *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00344}00344         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}       *oct = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00345}00345         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *sc;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00346}00346         \textcolor{keyword}{union }\mbox{\hyperlink{unionocteon__cmd}{octeon\_cmd}}      *ncmd;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00347}00347         \textcolor{keyword}{volatile} \textcolor{keywordtype}{int}            *mtu\_sc\_ctx;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00348}00348         \textcolor{keywordtype}{int}     retval = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00349}00349 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00350}00350         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a2c9f94ccb0cc0cf6c75af8d35e604ef4}{mtu}} == new\_mtu)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00351}00351                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00353}00353         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00354}00354 \textcolor{comment}{         * Limit the MTU to make sure the ethernet packets are between}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00355}00355 \textcolor{comment}{         * LIO\_MIN\_MTU\_SIZE bytes and LIO\_MAX\_MTU\_SIZE bytes}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00356}00356 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00357}00357         \textcolor{keywordflow}{if} ((new\_mtu < \mbox{\hyperlink{lio__network_8h_a0543d954104d9b478c423125da049724}{LIO\_MIN\_MTU\_SIZE}}) || (new\_mtu > \mbox{\hyperlink{lio__network_8h_a7daadae141d26dfda745a969e7a24df0}{LIO\_MAX\_MTU\_SIZE}})) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00358}00358                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Invalid MTU: \%d\(\backslash\)n"{}}, new\_mtu);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00359}00359                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Valid range \%d and \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00360}00360                             \mbox{\hyperlink{lio__network_8h_a0543d954104d9b478c423125da049724}{LIO\_MIN\_MTU\_SIZE}}, \mbox{\hyperlink{lio__network_8h_a7daadae141d26dfda745a969e7a24df0}{LIO\_MAX\_MTU\_SIZE}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00361}00361                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00362}00362         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00363}00363 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00364}00364         sc = \mbox{\hyperlink{lio__iq_8h_add1cd4d610e5132e206f17aa347c6116}{lio\_alloc\_soft\_command}}(oct, \mbox{\hyperlink{lio__common_8h_ae5c5b88cddd153bccec303ce6be63718}{OCTEON\_CMD\_SIZE}}, 16,}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00365}00365                                     \textcolor{keyword}{sizeof}(*mtu\_sc\_ctx));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00366}00366         \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00367}00367                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00369}00369         ncmd = (\textcolor{keyword}{union }\mbox{\hyperlink{unionocteon__cmd}{octeon\_cmd}} *)sc-\/>\mbox{\hyperlink{structlio__soft__command_acaf5313ed39db3b404d471eb73a6494d}{virtdptr}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00370}00370         mtu\_sc\_ctx = sc-\/>\mbox{\hyperlink{structlio__soft__command_a288d7c6ce348f6c917681748ebf432fd}{ctxptr}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00371}00371 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00372}00372         *mtu\_sc\_ctx = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00373}00373 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00374}00374         ncmd-\/>\mbox{\hyperlink{unionocteon__cmd_abdc7441d60674e269cc22b4a1facb233}{cmd64}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00375}00375         ncmd-\/>\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_ae8a289a502362b98e550d65d3986dc3f}{cmd}} = \mbox{\hyperlink{lio__common_8h_acad7a0e6776b5d2f5a62f8a8f13ed3f3}{LIO\_CMD\_CHANGE\_MTU}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00376}00376         ncmd-\/>\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_aa4b02c6bc773b809463ceb325e8fdc5f}{param1}} = new\_mtu;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00377}00377 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00378}00378         \mbox{\hyperlink{lio__main_8h_ab294e8e0e748bf0d78f5c1c0283a79cf}{lio\_swap\_8B\_data}}((uint64\_t *)ncmd, (\mbox{\hyperlink{lio__common_8h_ae5c5b88cddd153bccec303ce6be63718}{OCTEON\_CMD\_SIZE}} >> 3));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00380}00380         sc-\/>\mbox{\hyperlink{structlio__soft__command_ad15512a7fe14de8f48679ea491ceef6d}{iq\_no}} = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aea3442e0b2b012f49360d68d80e30323}{linfo}}.\mbox{\hyperlink{structocteon__link__info_ab81ea307e028882d131992fd679923d7}{txpciq}}[0].\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_a036a1f65fa239c8b4dbdcca730c8e47a}{q\_no}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00382}00382         \mbox{\hyperlink{lio__iq_8h_a6bd987af0b5107ea95f63de23cb68cda}{lio\_prepare\_soft\_command}}(oct, sc, \mbox{\hyperlink{lio__common_8h_a33e94e4d8a48c4f8fcca7f71a4f622c3}{LIO\_OPCODE\_NIC}},}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00383}00383                                  \mbox{\hyperlink{lio__common_8h_a471543356599fbd11ef4ec2bd3c13d05}{LIO\_OPCODE\_NIC\_CMD}}, 0, 0, 0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00384}00384 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00385}00385         sc-\/>\mbox{\hyperlink{structlio__soft__command_a912a296891fe84dc401a7219a8847063}{callback}} = \mbox{\hyperlink{lio__ioctl_8c_a5518fe6f06802fe8da63127c612a906e}{lio\_mtu\_ctl\_callback}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00386}00386         sc-\/>\mbox{\hyperlink{structlio__soft__command_a998df93b613de98f6a4f5f47ac72f64a}{callback\_arg}} = sc;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00387}00387         sc-\/>\mbox{\hyperlink{structlio__soft__command_a8e77d97141a049d956998e5bc28bc90d}{wait\_time}} = 5000;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00388}00388 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00389}00389         retval = \mbox{\hyperlink{lio__iq_8h_a208aa2e8ecfdc37f4f3f961afd44c264}{lio\_send\_soft\_command}}(oct, sc);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00390}00390         \textcolor{keywordflow}{if} (retval == \mbox{\hyperlink{lio__iq_8h_a7a8baba01e32a87bd344a3ec2c8f703a}{LIO\_IQ\_SEND\_FAILED}}) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00391}00391                 \mbox{\hyperlink{lio__bsd_8h_ae98de25aa714ca601589b31d9364062a}{lio\_dev\_info}}(oct,}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00392}00392                              \textcolor{stringliteral}{"{}Failed to send MTU update Control message\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00393}00393                 retval = EBUSY;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00394}00394                 \textcolor{keywordflow}{goto} mtu\_updation\_failed;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00395}00395         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00397}00397         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00398}00398 \textcolor{comment}{         * Sleep on a wait queue till the cond flag indicates that the}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00399}00399 \textcolor{comment}{         * response arrived or timed-\/out.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00400}00400 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00401}00401         \mbox{\hyperlink{lio__main_8h_ac82f1f60442fef9cf0258d63ff64cafe}{lio\_sleep\_cond}}(oct, mtu\_sc\_ctx);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00403}00403         \textcolor{keywordflow}{if} (*mtu\_sc\_ctx < 0) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00404}00404                 retval = EBUSY;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00405}00405                 \textcolor{keywordflow}{goto} mtu\_updation\_failed;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00406}00406         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00407}00407         \mbox{\hyperlink{lio__bsd_8h_ae98de25aa714ca601589b31d9364062a}{lio\_dev\_info}}(oct, \textcolor{stringliteral}{"{}MTU Changed from \%d to \%d\(\backslash\)n"{}}, if\_getmtu(ifp),}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00408}00408                      new\_mtu);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00409}00409         if\_setmtu(ifp, new\_mtu);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00410}00410         \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a2c9f94ccb0cc0cf6c75af8d35e604ef4}{mtu}} = new\_mtu;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00411}00411         retval = 0;                     \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00412}00412 \textcolor{comment}{                                         * this updation is make sure that LIO\_IQ\_SEND\_STOP case}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00413}00413 \textcolor{comment}{                                         * also success}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00414}00414 \textcolor{comment}{                                         */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00415}00415 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00416}00416 mtu\_updation\_failed:}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00417}00417         \mbox{\hyperlink{lio__iq_8h_aeacdddc60eaf524a3482cbd54a8e6fb0}{lio\_free\_soft\_command}}(oct, sc);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00418}00418 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00419}00419         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00420}00420 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00422}00422 \textcolor{comment}{/* @param ifp network device */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00423}00423 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00424}\mbox{\hyperlink{lio__ioctl_8c_a762754c9066773104ef6ad5ecd9897e1}{00424}} \mbox{\hyperlink{lio__ioctl_8c_a762754c9066773104ef6ad5ecd9897e1}{lio\_set\_mac}}(\textcolor{keyword}{struct} ifnet *ifp, uint8\_t *p)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00425}00425 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00426}00426         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__ctrl__pkt}{lio\_ctrl\_pkt}} nctrl;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00427}00427         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}           *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00428}00428         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}       *oct = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00429}00429         \textcolor{keywordtype}{int}     ret = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00431}00431         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{lio__ioctl_8c_accf7d62b9298ba05c08a475f0c43c0b5}{lio\_is\_valid\_ether\_addr}}(p))}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00432}00432                 \textcolor{keywordflow}{return} (EADDRNOTAVAIL);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00434}00434         bzero(\&nctrl, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__ctrl__pkt}{lio\_ctrl\_pkt}}));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00435}00435 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00436}00436         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_abdc7441d60674e269cc22b4a1facb233}{cmd64}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00437}00437         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_ae8a289a502362b98e550d65d3986dc3f}{cmd}} = \mbox{\hyperlink{lio__common_8h_a0516725c85d1f664576a0f68ad825015}{LIO\_CMD\_CHANGE\_MACADDR}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00438}00438         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_aa4b02c6bc773b809463ceb325e8fdc5f}{param1}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00439}00439         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_a48075978cb26b25ae85be6484106c67e}{more}} = 1;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00440}00440         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a8a585822f4eb70f431c7db4606c50a50}{iq\_no}} = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aea3442e0b2b012f49360d68d80e30323}{linfo}}.\mbox{\hyperlink{structocteon__link__info_ab81ea307e028882d131992fd679923d7}{txpciq}}[0].\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_a036a1f65fa239c8b4dbdcca730c8e47a}{q\_no}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00441}00441         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a8ed757510cd56d869fbc2a281008b91f}{lio}} = \mbox{\hyperlink{structlio}{lio}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00442}00442         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_adcc5ed7ab9f23d57202ceff098fa2146}{cb\_fn}} = \mbox{\hyperlink{lio__core_8c_a48c1e67dffbf88a354e7ef45e0261674}{lio\_ctrl\_cmd\_completion}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00443}00443         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a4415355127c5111f0570276c84d198a6}{wait\_time}} = 100;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00445}00445         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a28267e63df880b3b6db971acee391cf5}{udd}}[0] = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00446}00446         \textcolor{comment}{/* The MAC Address is presented in network byte order. */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00447}00447         memcpy((uint8\_t *)\&nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a28267e63df880b3b6db971acee391cf5}{udd}}[0] + 2, p, ETHER\_HDR\_LEN);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00448}00448 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00449}00449         ret = \mbox{\hyperlink{lio__ctrl_8c_a93d515939a6aef78b9f008a414e73940}{lio\_send\_ctrl\_pkt}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \&nctrl);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00450}00450         \textcolor{keywordflow}{if} (ret < 0) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00451}00451                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}MAC Address change failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00452}00452                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00453}00453         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00454}00454 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00455}00455         memcpy(((uint8\_t *)\&\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aea3442e0b2b012f49360d68d80e30323}{linfo}}.\mbox{\hyperlink{structocteon__link__info_a16254b8f1d571201181c412795cc33a5}{hw\_addr}}) + 2, p, ETHER\_HDR\_LEN);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00456}00456 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00457}00457         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00458}00458 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00459}00459 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00460}00460 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00461}00461 \textcolor{comment}{ * \(\backslash\)brief Converts a mask based on ifp flags}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00462}00462 \textcolor{comment}{ * @param ifp network device}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00463}00463 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00464}00464 \textcolor{comment}{ * This routine generates a lio\_ifflags mask from the ifp flags}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00465}00465 \textcolor{comment}{ * received from the OS.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00466}00466 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00467}00467 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{enum} \mbox{\hyperlink{lio__common_8h_aa4169cf3f2c021d524235d8b72daad75}{lio\_ifflags}}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00468}\mbox{\hyperlink{lio__ioctl_8c_a990be2bc9ef548536974058f982f7b59}{00468}} \mbox{\hyperlink{lio__ioctl_8c_a990be2bc9ef548536974058f982f7b59}{lio\_get\_new\_flags}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00469}00469 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00470}00470         \textcolor{keyword}{enum} \mbox{\hyperlink{lio__common_8h_aa4169cf3f2c021d524235d8b72daad75}{lio\_ifflags}} f = \mbox{\hyperlink{lio__common_8h_aa4169cf3f2c021d524235d8b72daad75adbd145c58d42570c844a41f00d872d3a}{LIO\_IFFLAG\_UNICAST}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00472}00472         \textcolor{keywordflow}{if} (if\_getflags(ifp) \& IFF\_PROMISC)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00473}00473                 f |= \mbox{\hyperlink{lio__common_8h_aa4169cf3f2c021d524235d8b72daad75ab27484b3aaeb6cd75ce297c961d50681}{LIO\_IFFLAG\_PROMISC}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00474}00474 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00475}00475         \textcolor{keywordflow}{if} (if\_getflags(ifp) \& IFF\_ALLMULTI)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00476}00476                 f |= \mbox{\hyperlink{lio__common_8h_aa4169cf3f2c021d524235d8b72daad75a1ee3ba2f6a1135c1d46c1b318d1094f5}{LIO\_IFFLAG\_ALLMULTI}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00477}00477 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00478}00478         \textcolor{keywordflow}{if} (if\_getflags(ifp) \& IFF\_MULTICAST) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00479}00479                 f |= \mbox{\hyperlink{lio__common_8h_aa4169cf3f2c021d524235d8b72daad75a4b7ba6ab85742563750ffd2bd7b8d703}{LIO\_IFFLAG\_MULTICAST}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00481}00481                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00482}00482 \textcolor{comment}{                 * Accept all multicast addresses if there are more than we}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00483}00483 \textcolor{comment}{                 * can handle}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00484}00484 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00485}00485                 \textcolor{keywordflow}{if} (if\_getamcount(ifp) > \mbox{\hyperlink{lio__config_8h_a2d1d410a4846a91c11fb08072d621698}{LIO\_MAX\_MULTICAST\_ADDR}})}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00486}00486                         f |= \mbox{\hyperlink{lio__common_8h_aa4169cf3f2c021d524235d8b72daad75a1ee3ba2f6a1135c1d46c1b318d1094f5}{LIO\_IFFLAG\_ALLMULTI}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00487}00487         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00488}00488         \textcolor{keywordflow}{if} (if\_getflags(ifp) \& IFF\_BROADCAST)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00489}00489                 f |= \mbox{\hyperlink{lio__common_8h_aa4169cf3f2c021d524235d8b72daad75a57a213eed3529361397f55234bd797b5}{LIO\_IFFLAG\_BROADCAST}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00490}00490 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00491}00491         \textcolor{keywordflow}{return} (f);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00492}00492 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00493}00493 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00494}00494 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00495}\mbox{\hyperlink{lio__ioctl_8c_aed12d2db375e927861d8077cc0062307}{00495}} \mbox{\hyperlink{lio__ioctl_8c_aed12d2db375e927861d8077cc0062307}{lio\_copy\_maddr}}(\textcolor{keywordtype}{void} *arg, \textcolor{keyword}{struct} sockaddr\_dl *sdl, u\_int cnt)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00496}00496 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00497}00497         uint64\_t *mc = arg;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00498}00498 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00499}00499         \textcolor{keywordflow}{if} (cnt == \mbox{\hyperlink{lio__config_8h_a2d1d410a4846a91c11fb08072d621698}{LIO\_MAX\_MULTICAST\_ADDR}})}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00500}00500                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00501}00501 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00502}00502         mc += cnt;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00503}00503         *mc = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00504}00504         memcpy(((uint8\_t *)mc) + 2, LLADDR(sdl), ETHER\_ADDR\_LEN);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00505}00505         \textcolor{comment}{/* no need to swap bytes */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00506}00506 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00507}00507         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00508}00508 \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00509}00509 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00510}00510 \textcolor{comment}{/* @param ifp network device */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00511}00511 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00512}\mbox{\hyperlink{lio__ioctl_8c_a7a332ce8942d1b77ed68b3c7a6ccea75}{00512}} \mbox{\hyperlink{lio__ioctl_8c_a7a332ce8942d1b77ed68b3c7a6ccea75}{lio\_set\_mcast\_list}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00513}00513 \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00514}00514         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}           *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00515}00515         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}       *oct = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00516}00516         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__ctrl__pkt}{lio\_ctrl\_pkt}} nctrl;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00517}00517         \textcolor{keywordtype}{int}     mc\_count;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00518}00518         \textcolor{keywordtype}{int}     ret;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00520}00520         bzero(\&nctrl, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__ctrl__pkt}{lio\_ctrl\_pkt}}));}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00521}00521 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00522}00522         \textcolor{comment}{/* Create a ctrl pkt command to be sent to core app. */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00523}00523         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_abdc7441d60674e269cc22b4a1facb233}{cmd64}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00524}00524         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_ae8a289a502362b98e550d65d3986dc3f}{cmd}} = \mbox{\hyperlink{lio__common_8h_aba12f6b0f1a28528c4d9ded7430146c2}{LIO\_CMD\_SET\_MULTI\_LIST}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00525}00525         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_aa4b02c6bc773b809463ceb325e8fdc5f}{param1}} = \mbox{\hyperlink{lio__ioctl_8c_a990be2bc9ef548536974058f982f7b59}{lio\_get\_new\_flags}}(ifp);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00526}00526         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a8a585822f4eb70f431c7db4606c50a50}{iq\_no}} = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aea3442e0b2b012f49360d68d80e30323}{linfo}}.\mbox{\hyperlink{structocteon__link__info_ab81ea307e028882d131992fd679923d7}{txpciq}}[0].\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_a036a1f65fa239c8b4dbdcca730c8e47a}{q\_no}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00527}00527         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a8ed757510cd56d869fbc2a281008b91f}{lio}} = \mbox{\hyperlink{structlio__ctrl__pkt_a8ed757510cd56d869fbc2a281008b91f}{lio}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00528}00528         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_adcc5ed7ab9f23d57202ceff098fa2146}{cb\_fn}} = \mbox{\hyperlink{lio__core_8c_a48c1e67dffbf88a354e7ef45e0261674}{lio\_ctrl\_cmd\_completion}};}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00529}00529 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00530}00530         \textcolor{comment}{/* copy all the addresses into the udd */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00531}00531         mc\_count = if\_foreach\_llmaddr(ifp, \mbox{\hyperlink{lio__ioctl_8c_aed12d2db375e927861d8077cc0062307}{lio\_copy\_maddr}}, \&nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a28267e63df880b3b6db971acee391cf5}{udd}}[0]);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00532}00532 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00533}00533         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00534}00534 \textcolor{comment}{         * Apparently, any activity in this call from the kernel has to}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00535}00535 \textcolor{comment}{         * be atomic. So we won't wait for response.}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00536}00536 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00537}00537         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a4415355127c5111f0570276c84d198a6}{wait\_time}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00538}00538         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_a11beda62171b3f621cd95d01cd1957ed}{param2}} = mc\_count;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00539}00539         nctrl.\mbox{\hyperlink{structlio__ctrl__pkt_a5ba377c8c6282ebc84f072360d28a1f7}{ncmd}}.\mbox{\hyperlink{unionocteon__cmd_ad5cae7e8f601a66277962156b10a211e}{s}}.\mbox{\hyperlink{unionocteon__cmd_a48075978cb26b25ae85be6484106c67e}{more}} = mc\_count;}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00540}00540 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00541}00541         ret = \mbox{\hyperlink{lio__ctrl_8c_a93d515939a6aef78b9f008a414e73940}{lio\_send\_ctrl\_pkt}}(\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}}, \&nctrl);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00542}00542         \textcolor{keywordflow}{if} (ret < 0) \{}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00543}00543                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}DEVFLAGS change failed in core (ret: 0x\%x)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00544}00544                             ret);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00545}00545         \}}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00546}00546 }
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00547}00547         \textcolor{keywordflow}{return} ((ret) ? EINVAL : 0);}
\DoxyCodeLine{\Hypertarget{lio__ioctl_8c_source_l00548}00548 \}}

\end{DoxyCode}
