\hypertarget{xgbe__osdep_8h_source}{}\doxysection{xgbe\+\_\+osdep.\+h}
\label{xgbe__osdep_8h_source}\index{dev/axgbe/xgbe\_osdep.h@{dev/axgbe/xgbe\_osdep.h}}
\mbox{\hyperlink{xgbe__osdep_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2016,2017 SoftIron Inc.}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2020 Advanced Micro Devices, Inc.}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00007}00007 \textcolor{comment}{ * This software was developed by Andrew Turner under}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00008}00008 \textcolor{comment}{ * the sponsorship of SoftIron Inc.}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00010}00010 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00011}00011 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00012}00012 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00013}00013 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00015}00015 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00016}00016 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00017}00017 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00019}00019 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00020}00020 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00021}00021 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00022}00022 \textcolor{comment}{ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00023}00023 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00024}00024 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00025}00025 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00026}00026 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00027}00027 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00028}00028 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00029}00029 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00030}00030 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00031}00031 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00032}00032 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00034}00034 \textcolor{preprocessor}{\#ifndef \_XGBE\_OSDEP\_H\_}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00035}00035 \textcolor{preprocessor}{\#define \_XGBE\_OSDEP\_H\_}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00040}00040 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00041}00041 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00042}00042 \textcolor{preprocessor}{\#include <net/if\_var.h>}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00043}00043 \textcolor{preprocessor}{\#include <net/iflib.h>}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00045}\mbox{\hyperlink{xgbe__osdep_8h_ae0d5038004c807b3d24883114127ef2c}{00045}} \mbox{\hyperlink{xgbe__osdep_8h_ae0d5038004c807b3d24883114127ef2c}{MALLOC\_DECLARE}}(M\_AXGBE);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00047}\mbox{\hyperlink{xgbe__osdep_8h_a8aa175c7b0e2a159ed2820988f9bb5f1}{00047}} \textcolor{keyword}{typedef} uint16\_t \mbox{\hyperlink{xgbe__osdep_8h_a8aa175c7b0e2a159ed2820988f9bb5f1}{\_\_le16}};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00048}\mbox{\hyperlink{xgbe__osdep_8h_a96dbe1d4c138ab30ecf80a430fd5b307}{00048}} \textcolor{keyword}{typedef} uint16\_t \mbox{\hyperlink{xgbe__osdep_8h_a96dbe1d4c138ab30ecf80a430fd5b307}{\_\_be16}};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00049}\mbox{\hyperlink{xgbe__osdep_8h_ad69331506820763dddbdff4f209fb280}{00049}} \textcolor{keyword}{typedef} uint32\_t \mbox{\hyperlink{xgbe__osdep_8h_ad69331506820763dddbdff4f209fb280}{\_\_le32}};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00051}\mbox{\hyperlink{xgbe__osdep_8h_a83ee7fd3f13e5f09c1285246a3ea2a38}{00051}} \textcolor{preprocessor}{\#define BIT(pos)                (1ul << pos)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00053}\mbox{\hyperlink{xgbe__osdep_8h_af42a6506135fe9e671c40973bacc849f}{00053}} \textcolor{preprocessor}{\#define cpu\_to\_be16(x)          be16toh(x)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00054}\mbox{\hyperlink{xgbe__osdep_8h_a48f33ad7b3de0010e5c802ced48f8a7b}{00054}} \textcolor{preprocessor}{\#define be16\_to\_cpu(x)          htobe16(x)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00055}\mbox{\hyperlink{xgbe__osdep_8h_ace18523e214784ff4a8f11582746661c}{00055}} \textcolor{preprocessor}{\#define lower\_32\_bits(x)        ((x) \& 0xffffffffu)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00056}\mbox{\hyperlink{xgbe__osdep_8h_af3c86c386d6a6424c946d95ff796df52}{00056}} \textcolor{preprocessor}{\#define upper\_32\_bits(x)        (((x) >> 32) \& 0xffffffffu)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00057}\mbox{\hyperlink{xgbe__osdep_8h_a1d5ae0c36d519a1b0a789db69a598f28}{00057}} \textcolor{preprocessor}{\#define cpu\_to\_le32(x)          le32toh(x)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00058}\mbox{\hyperlink{xgbe__osdep_8h_a48f527b00bc1d5e46366d720280a1039}{00058}} \textcolor{preprocessor}{\#define le32\_to\_cpu(x)          htole32(x)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00059}\mbox{\hyperlink{xgbe__osdep_8h_aeda3065f344779edb9023e22d84d5f92}{00059}} \textcolor{preprocessor}{\#define cpu\_to\_le16(x)          htole16(x)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00061}\mbox{\hyperlink{xgbe__osdep_8h_a0040062245451c4a61289208acded957}{00061}} \textcolor{preprocessor}{\#define for\_each\_set\_bit(bit, addr, size) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00062}00062 \textcolor{preprocessor}{        for ((bit) = find\_first\_bit((addr), (size));            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00063}00063 \textcolor{preprocessor}{             (bit) < (size);                                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00064}00064 \textcolor{preprocessor}{             (bit) = find\_next\_bit((addr), (size), (bit) + 1))}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00066}\mbox{\hyperlink{xgbe__osdep_8h_ab9fe351b4fcde6dab96a68588203f5c2}{00066}} \textcolor{keyword}{typedef} \textcolor{keyword}{struct }mtx \mbox{\hyperlink{xgbe__osdep_8h_ab9fe351b4fcde6dab96a68588203f5c2}{spinlock\_t}};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00068}00068 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00069}\mbox{\hyperlink{xgbe__osdep_8h_a67ec4ad6dda168ffd43ae9d4d0de9608}{00069}} \mbox{\hyperlink{xgbe__osdep_8h_a67ec4ad6dda168ffd43ae9d4d0de9608}{spin\_lock\_init}}(\mbox{\hyperlink{xgbe__osdep_8h_ab9fe351b4fcde6dab96a68588203f5c2}{spinlock\_t}} *spinlock)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00070}00070 \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00071}00071         mtx\_init(spinlock, \textcolor{stringliteral}{"{}axgbe\_spin"{}}, NULL, MTX\_SPIN);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00072}00072 \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00074}\mbox{\hyperlink{xgbe__osdep_8h_add1a8c59697c388b4ee85efde2969743}{00074}} \textcolor{preprocessor}{\#define spin\_lock\_irqsave(spinlock, flags)                              \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00075}00075 \textcolor{preprocessor}{do \{                                                                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00076}00076 \textcolor{preprocessor}{        (flags) = intr\_disable();                                       \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00077}00077 \textcolor{preprocessor}{        mtx\_lock\_spin(spinlock);                                        \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00078}00078 \textcolor{preprocessor}{\} while (0)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00080}\mbox{\hyperlink{xgbe__osdep_8h_af7a5e8c5d43db05af07867c8d3bce322}{00080}} \textcolor{preprocessor}{\#define spin\_unlock\_irqrestore(spinlock, flags)                         \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00081}00081 \textcolor{preprocessor}{do \{                                                                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00082}00082 \textcolor{preprocessor}{        mtx\_unlock\_spin(spinlock);                                      \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00083}00083 \textcolor{preprocessor}{        intr\_restore(flags);                                            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00084}00084 \textcolor{preprocessor}{\} while (0)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00086}\mbox{\hyperlink{xgbe__osdep_8h_a19bc1b4974b67635f507eaf0ac755b80}{00086}} \textcolor{preprocessor}{\#define ADVERTISED\_Pause                (1 << 0)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00087}\mbox{\hyperlink{xgbe__osdep_8h_aee2eeffdcc45a932a3acd74540fc7727}{00087}} \textcolor{preprocessor}{\#define ADVERTISED\_Asym\_Pause           (1 << 1)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00088}\mbox{\hyperlink{xgbe__osdep_8h_a57e00bdb377f59f6843f3ad68a8f900b}{00088}} \textcolor{preprocessor}{\#define ADVERTISED\_Autoneg              (1 << 2)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00089}\mbox{\hyperlink{xgbe__osdep_8h_abbe5f62137b880dfb7171158b1cd82e6}{00089}} \textcolor{preprocessor}{\#define ADVERTISED\_Backplane            (1 << 3)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00090}\mbox{\hyperlink{xgbe__osdep_8h_a8049148a1c5cdf7ccc20d7c781f333e8}{00090}} \textcolor{preprocessor}{\#define ADVERTISED\_10000baseKR\_Full     (1 << 4)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00091}\mbox{\hyperlink{xgbe__osdep_8h_acfaba0496d25a7aa1c36ae350d65165e}{00091}} \textcolor{preprocessor}{\#define ADVERTISED\_2500baseX\_Full       (1 << 5)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00092}\mbox{\hyperlink{xgbe__osdep_8h_a4ea87bf83188c2dc5cd599cc131c083d}{00092}} \textcolor{preprocessor}{\#define ADVERTISED\_1000baseKX\_Full      (1 << 6)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00093}\mbox{\hyperlink{xgbe__osdep_8h_a76d7b7691ea4ed4f54af7f09a05e2ed5}{00093}} \textcolor{preprocessor}{\#define ADVERTISED\_100baseT\_Full        (1 << 7)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00094}\mbox{\hyperlink{xgbe__osdep_8h_aff2acfb6b776d7e47482c3ec11209e45}{00094}} \textcolor{preprocessor}{\#define ADVERTISED\_10000baseR\_FEC       (1 << 8)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00095}\mbox{\hyperlink{xgbe__osdep_8h_a1df98b8e1d48bbfb9b5f9cb7901de6e8}{00095}} \textcolor{preprocessor}{\#define ADVERTISED\_10000baseT\_Full      (1 << 9)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00096}\mbox{\hyperlink{xgbe__osdep_8h_ad91c070879c86c908d1cdbfb9d9cca4e}{00096}} \textcolor{preprocessor}{\#define ADVERTISED\_2500baseT\_Full       (1 << 10)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00097}\mbox{\hyperlink{xgbe__osdep_8h_a0fb7f52668e94490d1d5e785de51d8ea}{00097}} \textcolor{preprocessor}{\#define ADVERTISED\_1000baseT\_Full       (1 << 11)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00098}\mbox{\hyperlink{xgbe__osdep_8h_ae8443fa0af93dd87f6b4011f76514abc}{00098}} \textcolor{preprocessor}{\#define ADVERTISED\_TP                   (1 << 12)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00099}\mbox{\hyperlink{xgbe__osdep_8h_a521db078bf5906ecf01b7ba3607b2f8b}{00099}} \textcolor{preprocessor}{\#define ADVERTISED\_FIBRE                (1 << 13)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00100}\mbox{\hyperlink{xgbe__osdep_8h_acd15fc2a4ae1767b16ebe845c450fc37}{00100}} \textcolor{preprocessor}{\#define ADVERTISED\_1000baseX\_Full       (1 << 14)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00101}\mbox{\hyperlink{xgbe__osdep_8h_adb4884df7b4d117f4fefb6a9c4d48099}{00101}} \textcolor{preprocessor}{\#define ADVERTISED\_10000baseSR\_Full     (1 << 15)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00102}\mbox{\hyperlink{xgbe__osdep_8h_ac97b30d9a4f676f16028fc402a78ba4c}{00102}} \textcolor{preprocessor}{\#define ADVERTISED\_10000baseLR\_Full     (1 << 16)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00103}\mbox{\hyperlink{xgbe__osdep_8h_aad91fb1de8e17de1a498745119dc3920}{00103}} \textcolor{preprocessor}{\#define ADVERTISED\_10000baseLRM\_Full    (1 << 17)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00104}\mbox{\hyperlink{xgbe__osdep_8h_adcdc1a3c1c26a9f589b1b2e0df500ff9}{00104}} \textcolor{preprocessor}{\#define ADVERTISED\_10000baseER\_Full     (1 << 18)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00105}\mbox{\hyperlink{xgbe__osdep_8h_a976429d065fda882a9dbb5c1ec88126a}{00105}} \textcolor{preprocessor}{\#define ADVERTISED\_10000baseCR\_Full     (1 << 19)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00106}\mbox{\hyperlink{xgbe__osdep_8h_a6e1bbf7e882217db59719ff32b005956}{00106}} \textcolor{preprocessor}{\#define ADVERTISED\_100baseT\_Half        (1 << 20)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00107}\mbox{\hyperlink{xgbe__osdep_8h_ac074958eeb647e230121c4cb766b2d3d}{00107}} \textcolor{preprocessor}{\#define ADVERTISED\_1000baseT\_Half       (1 << 21)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00109}\mbox{\hyperlink{xgbe__osdep_8h_a1a4c332010265d3c0ab224f961edbb74}{00109}} \textcolor{preprocessor}{\#define SUPPORTED\_Pause                 (1 << 0)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00110}\mbox{\hyperlink{xgbe__osdep_8h_ac4ea32439d9765b9d49d028daf19500b}{00110}} \textcolor{preprocessor}{\#define SUPPORTED\_Asym\_Pause            (1 << 1)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00111}\mbox{\hyperlink{xgbe__osdep_8h_a6dfd02d762ece33c871c26362e023fcf}{00111}} \textcolor{preprocessor}{\#define SUPPORTED\_Autoneg               (1 << 2)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00112}\mbox{\hyperlink{xgbe__osdep_8h_a187019a7dcfa4a9ce5751bee1e458680}{00112}} \textcolor{preprocessor}{\#define SUPPORTED\_Backplane             (1 << 3)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00113}\mbox{\hyperlink{xgbe__osdep_8h_ac4d04a33868ef23462368a473512353a}{00113}} \textcolor{preprocessor}{\#define SUPPORTED\_10000baseKR\_Full      (1 << 4)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00114}\mbox{\hyperlink{xgbe__osdep_8h_a4935d2549848c7b3aa0cbf2fb72d055c}{00114}} \textcolor{preprocessor}{\#define SUPPORTED\_2500baseX\_Full        (1 << 5)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00115}\mbox{\hyperlink{xgbe__osdep_8h_a0c7725832cd6b12de642727718475905}{00115}} \textcolor{preprocessor}{\#define SUPPORTED\_1000baseKX\_Full       (1 << 6)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00116}\mbox{\hyperlink{xgbe__osdep_8h_aded166b48aa9fa3d35ccd02118efa5e9}{00116}} \textcolor{preprocessor}{\#define SUPPORTED\_100baseT\_Full         (1 << 7)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00117}\mbox{\hyperlink{xgbe__osdep_8h_a88eb8c8531e5df1d659715360b6c7746}{00117}} \textcolor{preprocessor}{\#define SUPPORTED\_10000baseR\_FEC        (1 << 8)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00118}\mbox{\hyperlink{xgbe__osdep_8h_a693f47efb52e1b03c3053d2d0691c015}{00118}} \textcolor{preprocessor}{\#define SUPPORTED\_10000baseT\_Full       (1 << 9)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00119}\mbox{\hyperlink{xgbe__osdep_8h_a3b7d257b8a4a3ea76a73ec031fcd5297}{00119}} \textcolor{preprocessor}{\#define SUPPORTED\_2500baseT\_Full        (1 << 10)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00120}\mbox{\hyperlink{xgbe__osdep_8h_a9cc19d5d6a0a44830e153ea38782f02c}{00120}} \textcolor{preprocessor}{\#define SUPPORTED\_1000baseT\_Full        (1 << 11)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00121}\mbox{\hyperlink{xgbe__osdep_8h_a54c754b7a49e5fc6dc069ffc8c00c40b}{00121}} \textcolor{preprocessor}{\#define SUPPORTED\_TP                    (1 << 12)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00122}\mbox{\hyperlink{xgbe__osdep_8h_a4eb8850f63528913886b955963c1cdd4}{00122}} \textcolor{preprocessor}{\#define SUPPORTED\_FIBRE                 (1 << 13)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00123}\mbox{\hyperlink{xgbe__osdep_8h_a7d8800896e9a7a4d6c38c310f96fe890}{00123}} \textcolor{preprocessor}{\#define SUPPORTED\_1000baseX\_Full        (1 << 14)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00124}\mbox{\hyperlink{xgbe__osdep_8h_a389705b748d1319b31c4a17e8d247002}{00124}} \textcolor{preprocessor}{\#define SUPPORTED\_10000baseSR\_Full      (1 << 15)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00125}\mbox{\hyperlink{xgbe__osdep_8h_af66ebee1ab2a5922a023940b8fef3065}{00125}} \textcolor{preprocessor}{\#define SUPPORTED\_10000baseLR\_Full      (1 << 16)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00126}\mbox{\hyperlink{xgbe__osdep_8h_a9a8dccaee3be846f27b429821f2367c5}{00126}} \textcolor{preprocessor}{\#define SUPPORTED\_10000baseLRM\_Full     (1 << 17)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00127}\mbox{\hyperlink{xgbe__osdep_8h_a5f69f45a90c025e2244bb9d446250eae}{00127}} \textcolor{preprocessor}{\#define SUPPORTED\_10000baseER\_Full      (1 << 18)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00128}\mbox{\hyperlink{xgbe__osdep_8h_a17838c7bb694dd17d11f4361d25c6f94}{00128}} \textcolor{preprocessor}{\#define SUPPORTED\_10000baseCR\_Full      (1 << 19)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00129}\mbox{\hyperlink{xgbe__osdep_8h_a9856250c8c97b6583613255ad2062ce8}{00129}} \textcolor{preprocessor}{\#define SUPPORTED\_100baseT\_Half         (1 << 20)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00130}\mbox{\hyperlink{xgbe__osdep_8h_af762f1705daaa4da19e1fe177700c247}{00130}} \textcolor{preprocessor}{\#define SUPPORTED\_1000baseT\_Half        (1 << 21)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00132}\mbox{\hyperlink{xgbe__osdep_8h_a99751f2cf2b9393ffcfccac8564cc871}{00132}} \textcolor{preprocessor}{\#define LPA\_PAUSE\_ASYM                  0x0800}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00134}\mbox{\hyperlink{xgbe__osdep_8h_a38309c389333892852dada22a6915e3f}{00134}} \textcolor{preprocessor}{\#define AUTONEG\_DISABLE                 0}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00135}\mbox{\hyperlink{xgbe__osdep_8h_a3a8d88b4deb60e5ee0feb07f156ab2d5}{00135}} \textcolor{preprocessor}{\#define AUTONEG\_ENABLE                  1}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00137}\mbox{\hyperlink{xgbe__osdep_8h_a78e587cd5254958b6e299dd542c5e22a}{00137}} \textcolor{preprocessor}{\#define DUPLEX\_UNKNOWN                  1}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00138}\mbox{\hyperlink{xgbe__osdep_8h_a6c8f66942aa4680d437e148526b7e65c}{00138}} \textcolor{preprocessor}{\#define DUPLEX\_FULL                     2}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00139}\mbox{\hyperlink{xgbe__osdep_8h_aa2975313d10f8114370435d1bf11e879}{00139}} \textcolor{preprocessor}{\#define DUPLEX\_HALF                     3}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00141}\mbox{\hyperlink{xgbe__osdep_8h_a657820bbd3501b55446f36b257073bae}{00141}} \textcolor{preprocessor}{\#define SPEED\_UNKNOWN                   1}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00142}\mbox{\hyperlink{xgbe__osdep_8h_a8faae1c4e8d606cc1edf9131252d9fbc}{00142}} \textcolor{preprocessor}{\#define SPEED\_10000                     2}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00143}\mbox{\hyperlink{xgbe__osdep_8h_a591d4f62d20b4ae6439fc540848e6148}{00143}} \textcolor{preprocessor}{\#define SPEED\_2500                      3}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00144}\mbox{\hyperlink{xgbe__osdep_8h_a4a779d35380578e71d9b3015e3441ab1}{00144}} \textcolor{preprocessor}{\#define SPEED\_1000                      4}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00145}\mbox{\hyperlink{xgbe__osdep_8h_a336e90e6c7a7d8bc7925752a13faf849}{00145}} \textcolor{preprocessor}{\#define SPEED\_100                       5}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00146}\mbox{\hyperlink{xgbe__osdep_8h_ab830e8b55930052c8706c5aeae2497d0}{00146}} \textcolor{preprocessor}{\#define SPEED\_10                        6}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00148}\mbox{\hyperlink{xgbe__osdep_8h_a1f472360951f531b07ec2b518103af3d}{00148}} \textcolor{preprocessor}{\#define BMCR\_SPEED100                   0x2000}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00150}\mbox{\hyperlink{xgbe__osdep_8h_a2aa490a7b68e2ad92d01440a240c118e}{00150}} \textcolor{preprocessor}{\#define MDIO\_MMD\_PMAPMD                 1}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00151}\mbox{\hyperlink{xgbe__osdep_8h_ab071c192b965230e107b7111fa901c23}{00151}} \textcolor{preprocessor}{\#define MDIO\_MMD\_PCS                    3}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00152}\mbox{\hyperlink{xgbe__osdep_8h_a47459e9e120969a7fc3a7ada2abdd440}{00152}} \textcolor{preprocessor}{\#define MDIO\_MMD\_AN                     7}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00153}\mbox{\hyperlink{xgbe__osdep_8h_a0a14d54ddb8fa5596af8402ddb27c3cc}{00153}} \textcolor{preprocessor}{\#define MDIO\_MMD\_VEND1                  30      }\textcolor{comment}{/* Vendor specific 1 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00154}\mbox{\hyperlink{xgbe__osdep_8h_a4c664e1186d1aeae205d5ddb98a4981b}{00154}} \textcolor{preprocessor}{\#define MDIO\_MMD\_VEND2                  31      }\textcolor{comment}{/* Vendor specific 2 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00156}\mbox{\hyperlink{xgbe__osdep_8h_a46bd1a73d18b062005278dbee025f20a}{00156}} \textcolor{preprocessor}{\#define MDIO\_PMA\_10GBR\_FECABLE          170}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00157}\mbox{\hyperlink{xgbe__osdep_8h_a35b79267a6f96aac7ccf4b55d7914313}{00157}} \textcolor{preprocessor}{\#define MDIO\_PMA\_10GBR\_FECABLE\_ABLE     0x0001}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00158}\mbox{\hyperlink{xgbe__osdep_8h_a223e76406e5a230c42814a5e533b446c}{00158}} \textcolor{preprocessor}{\#define MDIO\_PMA\_10GBR\_FECABLE\_ERRABLE  0x0002}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00159}\mbox{\hyperlink{xgbe__osdep_8h_a6a14da32acc7b08f74d3248d2a2fe258}{00159}} \textcolor{preprocessor}{\#define MII\_ADDR\_C45                    (1<<30)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00161}\mbox{\hyperlink{xgbe__osdep_8h_aab4d7fa609d78bb982f2e0baae2facc9}{00161}} \textcolor{preprocessor}{\#define MDIO\_CTRL1                      0x00 }\textcolor{comment}{/* MII\_BMCR */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00162}\mbox{\hyperlink{xgbe__osdep_8h_a791e6430b6e4f751ef5b4b9d7da875b0}{00162}} \textcolor{preprocessor}{\#define MDIO\_CTRL1\_RESET                0x8000 }\textcolor{comment}{/* BMCR\_RESET */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00163}\mbox{\hyperlink{xgbe__osdep_8h_a761d7c84e1a938a67035b720e8b95012}{00163}} \textcolor{preprocessor}{\#define MDIO\_CTRL1\_SPEEDSELEXT          0x2040 }\textcolor{comment}{/* BMCR\_SPEED1000|BMCR\_SPEED100*/}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00164}\mbox{\hyperlink{xgbe__osdep_8h_aeeed0949399bdc5570796092cb926967}{00164}} \textcolor{preprocessor}{\#define MDIO\_CTRL1\_SPEEDSEL             (MDIO\_CTRL1\_SPEEDSELEXT | 0x3c)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00165}\mbox{\hyperlink{xgbe__osdep_8h_a16844563748a29302d99723878096ea7}{00165}} \textcolor{preprocessor}{\#define MDIO\_AN\_CTRL1\_ENABLE            0x1000 }\textcolor{comment}{/* BMCR\_AUTOEN */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00166}\mbox{\hyperlink{xgbe__osdep_8h_a5dcdc36b43849406fd9e60664cb5805c}{00166}} \textcolor{preprocessor}{\#define MDIO\_CTRL1\_LPOWER               0x0800 }\textcolor{comment}{/* BMCR\_PDOWN */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00167}\mbox{\hyperlink{xgbe__osdep_8h_a0244b5a2010f8f2538836da71d745e58}{00167}} \textcolor{preprocessor}{\#define MDIO\_AN\_CTRL1\_RESTART           0x0200 }\textcolor{comment}{/* BMCR\_STARTNEG */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00169}\mbox{\hyperlink{xgbe__osdep_8h_a249f7faa62d0c0bed403cf7fd015afc3}{00169}} \textcolor{preprocessor}{\#define MDIO\_CTRL1\_SPEED10G             (MDIO\_CTRL1\_SPEEDSELEXT | 0x00)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00171}\mbox{\hyperlink{xgbe__osdep_8h_a684cd28a49124170c327f279db8ba512}{00171}} \textcolor{preprocessor}{\#define MDIO\_STAT1                      1 }\textcolor{comment}{/* MII\_BMSR */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00172}\mbox{\hyperlink{xgbe__osdep_8h_a5d1cd45bb5b5117eb33e2f8102a35923}{00172}} \textcolor{preprocessor}{\#define MDIO\_STAT1\_LSTATUS              0x0004 }\textcolor{comment}{/* BMSR\_LINK */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00174}\mbox{\hyperlink{xgbe__osdep_8h_a8a63e5b18fa478566b230f22172e998f}{00174}} \textcolor{preprocessor}{\#define MDIO\_DEVID1                     2 }\textcolor{comment}{/* MII\_PHYSID1 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00175}\mbox{\hyperlink{xgbe__osdep_8h_aafa088ec5cbe2a4b4023a2c8310b1ae1}{00175}} \textcolor{preprocessor}{\#define MDIO\_DEVID2                     3 }\textcolor{comment}{/* MII\_PHYSID2 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00176}\mbox{\hyperlink{xgbe__osdep_8h_a75c8d4845abbcb0d0b283dcf24ea684a}{00176}} \textcolor{preprocessor}{\#define MDIO\_SPEED                      4}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00177}\mbox{\hyperlink{xgbe__osdep_8h_a210f57aa1971b2f77765fdc47a2b00f2}{00177}} \textcolor{preprocessor}{\#define MDIO\_DEVS1                      5}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00178}\mbox{\hyperlink{xgbe__osdep_8h_a4d095f2392dd8d94ff014e510e164a16}{00178}} \textcolor{preprocessor}{\#define MDIO\_DEVS2                      6}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00179}\mbox{\hyperlink{xgbe__osdep_8h_a3c3d4c2f16cfdd4f2a4f6781069b2395}{00179}} \textcolor{preprocessor}{\#define MDIO\_CTRL2                      0x07}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00180}\mbox{\hyperlink{xgbe__osdep_8h_a38f6ad7f8567f6663c9821a43e310529}{00180}} \textcolor{preprocessor}{\#define MDIO\_PCS\_CTRL2\_10GBR            0x0000}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00181}\mbox{\hyperlink{xgbe__osdep_8h_a6610a4c57643faa00101917a93a94982}{00181}} \textcolor{preprocessor}{\#define MDIO\_PCS\_CTRL2\_10GBX            0x0001}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00182}\mbox{\hyperlink{xgbe__osdep_8h_a8fd8d44e408edfbf74397ec28c0df86e}{00182}} \textcolor{preprocessor}{\#define MDIO\_PCS\_CTRL2\_TYPE             0x0003}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00184}\mbox{\hyperlink{xgbe__osdep_8h_a5445bc3340ee863d3ef467904a780a20}{00184}} \textcolor{preprocessor}{\#define MDIO\_AN\_ADVERTISE               16}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00186}\mbox{\hyperlink{xgbe__osdep_8h_a328cd2e7a783994621fabb3435f96fc2}{00186}} \textcolor{preprocessor}{\#define MDIO\_AN\_LPA                     19}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00188}\mbox{\hyperlink{xgbe__osdep_8h_a9822d89774e0d6ddaa06503950130423}{00188}} \textcolor{preprocessor}{\#define ETH\_ALEN                        ETHER\_ADDR\_LEN}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00189}\mbox{\hyperlink{xgbe__osdep_8h_adec6db76cf213beb1c4ad4e7bf4d466d}{00189}} \textcolor{preprocessor}{\#define ETH\_HLEN                        ETHER\_HDR\_LEN}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00190}\mbox{\hyperlink{xgbe__osdep_8h_ac611e8e76f382ae7020960ba5f8c8a4d}{00190}} \textcolor{preprocessor}{\#define ETH\_FCS\_LEN                     4}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00191}\mbox{\hyperlink{xgbe__osdep_8h_a0a381d2534972044eccae2ab96806991}{00191}} \textcolor{preprocessor}{\#define VLAN\_HLEN                       ETHER\_VLAN\_ENCAP\_LEN}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00192}\mbox{\hyperlink{xgbe__osdep_8h_a7a1605903213bf7985f7cfb70bd97095}{00192}} \textcolor{preprocessor}{\#define VLAN\_NVID                       4096}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00193}\mbox{\hyperlink{xgbe__osdep_8h_aed074544b771eb808f1cd02a9f3c8b46}{00193}} \textcolor{preprocessor}{\#define VLAN\_VID\_MASK                   0x0FFF}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00195}\mbox{\hyperlink{xgbe__osdep_8h_a1ac47b35ccbf24dd4e876aaca0868b37}{00195}} \textcolor{preprocessor}{\#define CRC32\_POLY\_LE                   0xedb88320}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00197}\mbox{\hyperlink{xgbe__osdep_8h_a6242a25f9d996f0cc4f4cdb911218b75}{00197}} \textcolor{preprocessor}{\#define ARRAY\_SIZE(x)                   nitems(x)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00199}\mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{00199}} \textcolor{preprocessor}{\#define BITS\_PER\_LONG                   (sizeof(long) * CHAR\_BIT)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00200}\mbox{\hyperlink{xgbe__osdep_8h_a420cb06a7b5b6f9ee249a745ba2e5437}{00200}} \textcolor{preprocessor}{\#define BITS\_TO\_LONGS(n)                howmany((n), BITS\_PER\_LONG)}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00202}\mbox{\hyperlink{xgbe__osdep_8h_a30f00d0e50d0628301ece3fac21adff8}{00202}} \textcolor{preprocessor}{\#define BITMAP\_LAST\_WORD\_MASK(n)        (\string~0UL >> (BITS\_PER\_LONG -\/ (n)))}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00204}\mbox{\hyperlink{xgbe__osdep_8h_a9b9eacaa4532e549c07a3694b6e78dae}{00204}} \textcolor{preprocessor}{\#define min\_t(t, a, b)                  MIN((t)(a), (t)(b))}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00205}\mbox{\hyperlink{xgbe__osdep_8h_a1a382192307006105d2d2405ee34f395}{00205}} \textcolor{preprocessor}{\#define max\_t(t, a, b)                  MAX((t)(a), (t)(b))}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00207}00207 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00208}\mbox{\hyperlink{xgbe__osdep_8h_a3d73937290015b2c70367f4d53f8aca3}{00208}} \mbox{\hyperlink{xgbe__osdep_8h_a3d73937290015b2c70367f4d53f8aca3}{clear\_bit}}(\textcolor{keywordtype}{int} pos, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *p)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00209}00209 \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00211}00211         atomic\_clear\_long(p, 1ul << pos);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00212}00212 \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00214}00214 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00215}\mbox{\hyperlink{xgbe__osdep_8h_a97358b7e858dadddebe8ec1c94e50251}{00215}} \mbox{\hyperlink{xgbe__osdep_8h_a97358b7e858dadddebe8ec1c94e50251}{test\_bit}}(\textcolor{keywordtype}{int} pos, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *p)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00216}00216 \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00217}00217         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} val;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00219}00219         val = *p;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00220}00220         \textcolor{keywordflow}{return} ((val \& 1ul << pos) != 0);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00221}00221 \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00223}00223 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00224}\mbox{\hyperlink{xgbe__osdep_8h_acc6eaf7b169686b714ce54cf2dde1b84}{00224}} \mbox{\hyperlink{xgbe__osdep_8h_acc6eaf7b169686b714ce54cf2dde1b84}{set\_bit}}(\textcolor{keywordtype}{int} pos, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *p)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00225}00225 \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00227}00227         atomic\_set\_long(p, 1ul << pos);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00228}00228 \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00230}00230 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00231}\mbox{\hyperlink{xgbe__osdep_8h_a70273eae479d0a9ae2f97667909979f5}{00231}} \mbox{\hyperlink{xgbe__osdep_8h_a70273eae479d0a9ae2f97667909979f5}{\_\_ffsl}}(\textcolor{keywordtype}{long} mask)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00232}00232 \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00234}00234         \textcolor{keywordflow}{return} (ffsl(mask) -\/ 1);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00235}00235 \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00236}00236 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00237}00237 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00238}\mbox{\hyperlink{xgbe__osdep_8h_a2e299131e326b854ccfd0d0b86896bb1}{00238}} \mbox{\hyperlink{xgbe__osdep_8h_a2e299131e326b854ccfd0d0b86896bb1}{fls64}}(uint64\_t mask)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00239}00239 \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00241}00241         \textcolor{keywordflow}{return} (flsll(mask));}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00242}00242 \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00243}00243 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00244}00244 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00245}\mbox{\hyperlink{xgbe__osdep_8h_a9b63057e25717010d3e960eeaf2f233e}{00245}} \mbox{\hyperlink{xgbe__osdep_8h_a9b63057e25717010d3e960eeaf2f233e}{get\_bitmask\_order}}(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} count)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00246}00246 \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00247}00247         \textcolor{keywordtype}{int} order;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00249}00249         order = fls(count);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00250}00250         \textcolor{keywordflow}{return} (order); \textcolor{comment}{/* We could be slightly more clever with -\/1 here... */}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00251}00251 \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00253}00253 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00254}\mbox{\hyperlink{xgbe__osdep_8h_ab5e1f45917802682cdcfdfbbbf4e8621}{00254}} \mbox{\hyperlink{xgbe__osdep_8h_ab5e1f45917802682cdcfdfbbbf4e8621}{find\_next\_bit}}(\textcolor{keyword}{const} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *addr, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} size, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} offset)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00255}00255 \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00256}00256         \textcolor{keywordtype}{long} mask;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00257}00257         \textcolor{keywordtype}{int} offs;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00258}00258         \textcolor{keywordtype}{int} bit;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00259}00259         \textcolor{keywordtype}{int} pos;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00260}00260 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00261}00261         \textcolor{keywordflow}{if} (offset >= size)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00262}00262                 \textcolor{keywordflow}{return} (size);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00263}00263         pos = offset / \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00264}00264         offs = offset \% \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00265}00265         bit = \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}} * pos;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00266}00266         addr += pos;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00267}00267         \textcolor{keywordflow}{if} (offs) \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00268}00268                 mask = (*addr) \& \string~BITMAP\_LAST\_WORD\_MASK(offs);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00269}00269                 \textcolor{keywordflow}{if} (mask)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00270}00270                         \textcolor{keywordflow}{return} (bit + \mbox{\hyperlink{xgbe__osdep_8h_a70273eae479d0a9ae2f97667909979f5}{\_\_ffsl}}(mask));}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00271}00271                 \textcolor{keywordflow}{if} (size -\/ bit <= \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}})}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00272}00272                         \textcolor{keywordflow}{return} (size);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00273}00273                 bit += \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00274}00274                 addr++;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00275}00275         \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00276}00276         \textcolor{keywordflow}{for} (size -\/= bit; size >= \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00277}00277             size -\/= \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}}, bit += \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}}, addr++) \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00278}00278                 \textcolor{keywordflow}{if} (*addr == 0)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00279}00279                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00280}00280                 \textcolor{keywordflow}{return} (bit + \mbox{\hyperlink{xgbe__osdep_8h_a70273eae479d0a9ae2f97667909979f5}{\_\_ffsl}}(*addr));}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00281}00281         \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00282}00282         \textcolor{keywordflow}{if} (size) \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00283}00283                 mask = (*addr) \& \mbox{\hyperlink{xgbe__osdep_8h_a30f00d0e50d0628301ece3fac21adff8}{BITMAP\_LAST\_WORD\_MASK}}(size);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00284}00284                 \textcolor{keywordflow}{if} (mask)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00285}00285                         bit += \mbox{\hyperlink{xgbe__osdep_8h_a70273eae479d0a9ae2f97667909979f5}{\_\_ffsl}}(mask);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00286}00286                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00287}00287                         bit += size;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00288}00288         \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00289}00289         \textcolor{keywordflow}{return} (bit);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00290}00290 \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00292}00292 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00293}\mbox{\hyperlink{xgbe__osdep_8h_adde3442351e6a015a062e95d3f64edba}{00293}} \mbox{\hyperlink{xgbe__osdep_8h_adde3442351e6a015a062e95d3f64edba}{find\_first\_bit}}(\textcolor{keyword}{const} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} *addr, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} size)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00294}00294 \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00295}00295         \textcolor{keywordtype}{long} mask;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00296}00296         \textcolor{keywordtype}{int} bit;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00297}00297 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00298}00298         \textcolor{keywordflow}{for} (bit = 0; size >= \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00299}00299             size -\/= \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}}, bit += \mbox{\hyperlink{xgbe__osdep_8h_a2f660aa23a5dbc0f4b8df48b4302b8c3}{BITS\_PER\_LONG}}, addr++) \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00300}00300                 \textcolor{keywordflow}{if} (*addr == 0)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00301}00301                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00302}00302                 \textcolor{keywordflow}{return} (bit + \mbox{\hyperlink{xgbe__osdep_8h_a70273eae479d0a9ae2f97667909979f5}{\_\_ffsl}}(*addr));}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00303}00303         \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00304}00304         \textcolor{keywordflow}{if} (size) \{}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00305}00305                 mask = (*addr) \& \mbox{\hyperlink{xgbe__osdep_8h_a30f00d0e50d0628301ece3fac21adff8}{BITMAP\_LAST\_WORD\_MASK}}(size);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00306}00306                 \textcolor{keywordflow}{if} (mask)}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00307}00307                         bit += \mbox{\hyperlink{xgbe__osdep_8h_a70273eae479d0a9ae2f97667909979f5}{\_\_ffsl}}(mask);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00308}00308                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00309}00309                         bit += size;}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00310}00310         \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00311}00311         \textcolor{keywordflow}{return} (bit);}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00312}00312 \}}
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{xgbe__osdep_8h_source_l00314}00314 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \_XGBE\_OSDEP\_H\_ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
