\hypertarget{al__eth_8c_source}{}\doxysection{al\+\_\+eth.\+c}
\label{al__eth_8c_source}\index{dev/al\_eth/al\_eth.c@{dev/al\_eth/al\_eth.c}}
\mbox{\hyperlink{al__eth_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2015,2016 Annapurna Labs Ltd. and affiliates}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00003}00003 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00005}00005 \textcolor{comment}{ * Developed by Semihalf.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00030}\mbox{\hyperlink{al__eth_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00030}} \mbox{\hyperlink{al__eth_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/kthread.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/sockio.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/taskqueue.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <machine/atomic.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00049}00049 \textcolor{preprocessor}{\#include "{}opt\_inet.h"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00050}00050 \textcolor{preprocessor}{\#include "{}opt\_inet6.h"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <net/if\_var.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <net/if\_arp.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <net/if\_dl.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <net/if\_types.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <netinet/in.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <net/if\_vlan\_var.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <netinet/tcp.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <netinet/tcp\_lro.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00064}00064 \textcolor{preprocessor}{\#ifdef INET}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <netinet/in.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <netinet/in\_systm.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <netinet/in\_var.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00068}00068 \textcolor{preprocessor}{\#include <netinet/ip.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00069}00069 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00071}00071 \textcolor{preprocessor}{\#ifdef INET6}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <netinet/ip6.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00073}00073 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00075}00075 \textcolor{preprocessor}{\#include <sys/sockio.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <dev/pci/pcireg.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00078}00078 \textcolor{preprocessor}{\#include <dev/pci/pcivar.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00080}00080 \textcolor{preprocessor}{\#include <dev/mii/mii.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00081}00081 \textcolor{preprocessor}{\#include <dev/mii/miivar.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00083}00083 \textcolor{preprocessor}{\#include <al\_hal\_common.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00084}00084 \textcolor{preprocessor}{\#include <al\_hal\_plat\_services.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00085}00085 \textcolor{preprocessor}{\#include <al\_hal\_udma\_config.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00086}00086 \textcolor{preprocessor}{\#include <al\_hal\_udma\_iofic.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00087}00087 \textcolor{preprocessor}{\#include <al\_hal\_udma\_debug.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00088}00088 \textcolor{preprocessor}{\#include <al\_hal\_eth.h>}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00090}00090 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{al__eth_8h}{al\_eth.h}}"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00091}00091 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{al__init__eth__lm_8h}{al\_init\_eth\_lm.h}}"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00092}00092 \textcolor{preprocessor}{\#include "{}arm/annapurna/alpine/alpine\_serdes.h"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00094}00094 \textcolor{preprocessor}{\#include "{}miibus\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00096}\mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{00096}} \textcolor{preprocessor}{\#define device\_printf\_dbg(fmt, ...) do \{                                \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00097}00097 \textcolor{preprocessor}{        if (AL\_DBG\_LEVEL >= AL\_DBG\_LEVEL\_DBG) \{ AL\_DBG\_LOCK();          \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00098}00098 \textcolor{preprocessor}{            device\_printf(fmt, \_\_VA\_ARGS\_\_); AL\_DBG\_UNLOCK();\}          \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00099}00099 \textcolor{preprocessor}{        \} while (0)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00101}\mbox{\hyperlink{al__eth_8c_a6b36f6855494a0b25e3a83e5a7b3e17b}{00101}} \mbox{\hyperlink{al__eth_8c_a6b36f6855494a0b25e3a83e5a7b3e17b}{MALLOC\_DEFINE}}(M\_IFAL, \textcolor{stringliteral}{"{}if\_al\_malloc"{}}, \textcolor{stringliteral}{"{}All allocated data for AL ETH driver"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00103}00103 \textcolor{comment}{/* move out to some pci header file */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00104}\mbox{\hyperlink{al__eth_8c_a7fc3cab080bd6ff87b0ba5c9184d8f21}{00104}} \textcolor{preprocessor}{\#define PCI\_VENDOR\_ID\_ANNAPURNA\_LABS    0x1c36}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00105}\mbox{\hyperlink{al__eth_8c_a0225a73623348bfb1dca9aed3e3c4fe4}{00105}} \textcolor{preprocessor}{\#define PCI\_DEVICE\_ID\_AL\_ETH            0x0001}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00106}\mbox{\hyperlink{al__eth_8c_a26b965ee5fd8cfa1149c5ee411b6cc05}{00106}} \textcolor{preprocessor}{\#define PCI\_DEVICE\_ID\_AL\_ETH\_ADVANCED   0x0002}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00107}\mbox{\hyperlink{al__eth_8c_a8f74b6ca6a4e90e7d7e829b0c8c9bc4b}{00107}} \textcolor{preprocessor}{\#define PCI\_DEVICE\_ID\_AL\_ETH\_NIC        0x0003}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00108}\mbox{\hyperlink{al__eth_8c_a5ca588a7269ba6d4068696d4cb780121}{00108}} \textcolor{preprocessor}{\#define PCI\_DEVICE\_ID\_AL\_ETH\_FPGA\_NIC   0x0030}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00109}\mbox{\hyperlink{al__eth_8c_a876a59dcc77f77b1e935dee8c022ce72}{00109}} \textcolor{preprocessor}{\#define PCI\_DEVICE\_ID\_AL\_CRYPTO         0x0011}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00110}\mbox{\hyperlink{al__eth_8c_a07eb0d1c0630a53b34b1ac40a17d1c1f}{00110}} \textcolor{preprocessor}{\#define PCI\_DEVICE\_ID\_AL\_CRYPTO\_VF      0x8011}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00111}\mbox{\hyperlink{al__eth_8c_a0982169aebc900bf5e7ab009530a540c}{00111}} \textcolor{preprocessor}{\#define PCI\_DEVICE\_ID\_AL\_RAID\_DMA       0x0021}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00112}\mbox{\hyperlink{al__eth_8c_a550b382085a66d9fdcc681bc3ff92059}{00112}} \textcolor{preprocessor}{\#define PCI\_DEVICE\_ID\_AL\_RAID\_DMA\_VF    0x8021}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00113}\mbox{\hyperlink{al__eth_8c_a9c693317bfa8a45b96e325ac417cf697}{00113}} \textcolor{preprocessor}{\#define PCI\_DEVICE\_ID\_AL\_USB            0x0041}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00115}\mbox{\hyperlink{al__eth_8c_a93bcbeadec0087b89db687db8708681b}{00115}} \textcolor{preprocessor}{\#define MAC\_ADDR\_STR "{}\%02x:\%02x:\%02x:\%02x:\%02x:\%02x"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00116}\mbox{\hyperlink{al__eth_8c_aba49d51e0ee390449a8b6c913458329b}{00116}} \textcolor{preprocessor}{\#define MAC\_ADDR(addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00118}\mbox{\hyperlink{al__eth_8c_aa8dbf3732e7b4d83920f8629eee6d452}{00118}} \textcolor{preprocessor}{\#define AL\_ETH\_MAC\_TABLE\_UNICAST\_IDX\_BASE       0}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00119}\mbox{\hyperlink{al__eth_8c_a92ffc816dee7675e51ee6b710d67a251}{00119}} \textcolor{preprocessor}{\#define AL\_ETH\_MAC\_TABLE\_UNICAST\_MAX\_COUNT      4}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00120}\mbox{\hyperlink{al__eth_8c_aa0ec5678807cc41021d6e7b6d27dbfef}{00120}} \textcolor{preprocessor}{\#define AL\_ETH\_MAC\_TABLE\_ALL\_MULTICAST\_IDX      (AL\_ETH\_MAC\_TABLE\_UNICAST\_IDX\_BASE + \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00121}00121 \textcolor{preprocessor}{                                                 AL\_ETH\_MAC\_TABLE\_UNICAST\_MAX\_COUNT)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00123}\mbox{\hyperlink{al__eth_8c_a6607f6e13c4913c0146532c66d86a438}{00123}} \textcolor{preprocessor}{\#define AL\_ETH\_MAC\_TABLE\_DROP\_IDX               (AL\_ETH\_FWD\_MAC\_NUM -\/ 1)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00124}\mbox{\hyperlink{al__eth_8c_a591a430e8597cca86504e990d3f669be}{00124}} \textcolor{preprocessor}{\#define AL\_ETH\_MAC\_TABLE\_BROADCAST\_IDX          (AL\_ETH\_MAC\_TABLE\_DROP\_IDX -\/ 1)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00126}\mbox{\hyperlink{al__eth_8c_aae23cd1f55ec57336a2b9860b077f3ee}{00126}} \textcolor{preprocessor}{\#define AL\_ETH\_THASH\_UDMA\_SHIFT         0}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00127}\mbox{\hyperlink{al__eth_8c_ad12f482d5ec9fed2a475c5f80457180f}{00127}} \textcolor{preprocessor}{\#define AL\_ETH\_THASH\_UDMA\_MASK          (0xF << AL\_ETH\_THASH\_UDMA\_SHIFT)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00128}00128 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00129}\mbox{\hyperlink{al__eth_8c_ab91cbde753490fe4c8dc279db91032d4}{00129}} \textcolor{preprocessor}{\#define AL\_ETH\_THASH\_Q\_SHIFT            4}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00130}\mbox{\hyperlink{al__eth_8c_a2caba5450ca800f9234e39056096baa4}{00130}} \textcolor{preprocessor}{\#define AL\_ETH\_THASH\_Q\_MASK             (0x3 << AL\_ETH\_THASH\_Q\_SHIFT)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00132}00132 \textcolor{comment}{/* the following defines should be moved to hal */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00133}\mbox{\hyperlink{al__eth_8c_a5104f4a4b276a7a56e857b500fdd59e9}{00133}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_ENTRY\_IPV4\_TCP               0}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00134}\mbox{\hyperlink{al__eth_8c_a9e7561f779494789e15905cd3d78502c}{00134}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_ENTRY\_IPV4\_UDP               1}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00135}\mbox{\hyperlink{al__eth_8c_a5c619807ed688fc557651d2c36efe7f7}{00135}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_ENTRY\_IPV6\_TCP               2}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00136}\mbox{\hyperlink{al__eth_8c_a1bf07d874f7c384471678430edd330f6}{00136}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_ENTRY\_IPV6\_UDP               3}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00137}\mbox{\hyperlink{al__eth_8c_a5cab0361f7e504ad50930ee6fa03d4a0}{00137}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_ENTRY\_IPV6\_NO\_UDP\_TCP        4}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00138}\mbox{\hyperlink{al__eth_8c_a36419ed607103027a67bbfc56ed97b6b}{00138}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_ENTRY\_IPV4\_NO\_UDP\_TCP        5}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00140}00140 \textcolor{comment}{/* FSM DATA format */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00141}\mbox{\hyperlink{al__eth_8c_a01d393b5fd8f05248400c08104344dbf}{00141}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_DATA\_OUTER\_2\_TUPLE   0}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00142}\mbox{\hyperlink{al__eth_8c_aedc5c157d9e8cff309ecca3214b065ae}{00142}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_DATA\_OUTER\_4\_TUPLE   1}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00143}\mbox{\hyperlink{al__eth_8c_a9f952c7606645e46347dd61285b84092}{00143}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_DATA\_INNER\_2\_TUPLE   2}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00144}\mbox{\hyperlink{al__eth_8c_a1602ccf8be3c449e5b101960ce85ea15}{00144}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_DATA\_INNER\_4\_TUPLE   3}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00146}\mbox{\hyperlink{al__eth_8c_ad75b982828b197c2f899b61a603ac723}{00146}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_DATA\_HASH\_SEL        (1 << 2)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00148}\mbox{\hyperlink{al__eth_8c_a42bda5ae1eaef24deabbe73bb426715d}{00148}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_DATA\_DEFAULT\_Q       0}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00149}\mbox{\hyperlink{al__eth_8c_a85ef182fffc189cb7057508209118c79}{00149}} \textcolor{preprocessor}{\#define AL\_ETH\_FSM\_DATA\_DEFAULT\_UDMA    0}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00151}\mbox{\hyperlink{al__eth_8c_acebf7d87114307d0b777faa6287f7df7}{00151}} \textcolor{preprocessor}{\#define AL\_BR\_SIZE      512}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00152}\mbox{\hyperlink{al__eth_8c_ae33c0bc2a31b08ec0c1f79581ccf68ae}{00152}} \textcolor{preprocessor}{\#define AL\_TSO\_SIZE     65500}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00153}\mbox{\hyperlink{al__eth_8c_a5a6640bff6a0128d04479f0c0c202a0a}{00153}} \textcolor{preprocessor}{\#define AL\_DEFAULT\_MTU  1500}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00155}\mbox{\hyperlink{al__eth_8c_abdc7e3793723e377ac8a115be054b274}{00155}} \textcolor{preprocessor}{\#define CSUM\_OFFLOAD            (CSUM\_IP|CSUM\_TCP|CSUM\_UDP|CSUM\_SCTP)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00157}\mbox{\hyperlink{al__eth_8c_a1dc79a98b0e8d6c72afabc89cc59897c}{00157}} \textcolor{preprocessor}{\#define AL\_IP\_ALIGNMENT\_OFFSET  2}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00159}\mbox{\hyperlink{al__eth_8c_a3feb731a7adaa7a544395eaaf56bb004}{00159}} \textcolor{preprocessor}{\#define SFP\_I2C\_ADDR            0x50}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00161}\mbox{\hyperlink{al__eth_8c_ad49222a81f0cccaed5f7441dd89797d0}{00161}} \textcolor{preprocessor}{\#define AL\_MASK\_GROUP\_A\_INT     0x7}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00162}\mbox{\hyperlink{al__eth_8c_a1919b49e5147bde8ccd753da0a6af82a}{00162}} \textcolor{preprocessor}{\#define AL\_MASK\_GROUP\_B\_INT     0xF}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00163}\mbox{\hyperlink{al__eth_8c_ad69638f05484b613dd5b102403b216c6}{00163}} \textcolor{preprocessor}{\#define AL\_MASK\_GROUP\_C\_INT     0xF}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00164}\mbox{\hyperlink{al__eth_8c_ad2fa1a78737d38167a2db5852c262411}{00164}} \textcolor{preprocessor}{\#define AL\_MASK\_GROUP\_D\_INT     0xFFFFFFFF}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00166}\mbox{\hyperlink{al__eth_8c_a1d9ce96c3f6412c9379f02dfe4093a2a}{00166}} \textcolor{preprocessor}{\#define AL\_REG\_OFFSET\_FORWARD\_INTR      (0x1800000 + 0x1210)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00167}\mbox{\hyperlink{al__eth_8c_a70c3cc33437de621488468287762bd89}{00167}} \textcolor{preprocessor}{\#define AL\_EN\_FORWARD\_INTR      0x1FFFF}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00168}\mbox{\hyperlink{al__eth_8c_ad3a15208b4fb266dd9a6bb6865dfb3c4}{00168}} \textcolor{preprocessor}{\#define AL\_DIS\_FORWARD\_INTR     0}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00169}00169 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00170}\mbox{\hyperlink{al__eth_8c_a9abbef5002e6188139b3bce7e45cc3ab}{00170}} \textcolor{preprocessor}{\#define AL\_M2S\_MASK\_INIT        0x480}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00171}\mbox{\hyperlink{al__eth_8c_a47c1bb5875915f4fdeebc6fe0c358995}{00171}} \textcolor{preprocessor}{\#define AL\_S2M\_MASK\_INIT        0x1E0}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00172}\mbox{\hyperlink{al__eth_8c_a17e2b1d5f872b691cd91cf6b5dfb5e9e}{00172}} \textcolor{preprocessor}{\#define AL\_M2S\_S2M\_MASK\_NOT\_INT (0x3f << 25)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00174}\mbox{\hyperlink{al__eth_8c_a09eff3009462825ce2b1a07801d7852a}{00174}} \textcolor{preprocessor}{\#define AL\_10BASE\_T\_SPEED       10}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00175}\mbox{\hyperlink{al__eth_8c_a618c2d8625bcb0fe42c40f195144f4e1}{00175}} \textcolor{preprocessor}{\#define AL\_100BASE\_TX\_SPEED     100}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00176}\mbox{\hyperlink{al__eth_8c_a27525e5828f78bc4938d3cb3a30e86f5}{00176}} \textcolor{preprocessor}{\#define AL\_1000BASE\_T\_SPEED     1000}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00178}\mbox{\hyperlink{al__eth_8c_af41845916ddc7f0b26efd6279f60854a}{00178}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{al__eth_8c_af41845916ddc7f0b26efd6279f60854a}{al\_devclass}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00180}\mbox{\hyperlink{al__eth_8c_af0774d8565dbc9db30e5f93f17ef30d6}{00180}} \textcolor{preprocessor}{\#define AL\_RX\_LOCK\_INIT(\_sc)    mtx\_init(\&((\_sc)-\/>if\_rx\_lock), "{}ALRXL"{}}, "{}ALRXL"{}, MTX\_DEF)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00181}\mbox{\hyperlink{al__eth_8c_a2900caecabc04076f8da8601ecfa2333}{00181}} \textcolor{preprocessor}{\#define AL\_RX\_LOCK(\_sc)         mtx\_lock(\&((\_sc)-\/>if\_rx\_lock))}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00182}\mbox{\hyperlink{al__eth_8c_a7af538a4743ae7465b760fa0d0dab9d2}{00182}} \textcolor{preprocessor}{\#define AL\_RX\_UNLOCK(\_sc)       mtx\_unlock(\&((\_sc)-\/>if\_rx\_lock))}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00184}00184 \textcolor{comment}{/* helper functions */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00185}00185 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a06a8ce939e45eeb8386ac8718459211f}{al\_is\_device\_supported}}(device\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00187}00187 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_ae1c015d44fe16c39fa14f36e174e0a1f}{al\_eth\_init\_rings}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00188}00188 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a8e4d5913d2a2a93af126cff2b7aec8c7}{al\_eth\_flow\_ctrl\_disable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00189}00189 \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_ae5d904a47a00aa0502ed9e703463c4eb}{al\_eth\_fpga\_read\_pci\_config}}(\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int}, uint32\_t *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00190}00190 \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a3fe7f38392487d606d0a4d5bd5ad5918}{al\_eth\_fpga\_write\_pci\_config}}(\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int}, uint32\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00191}00191 \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_afeff5e2211915216e1300ed99b13b011}{al\_eth\_read\_pci\_config}}(\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int}, uint32\_t *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00192}00192 \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a721d648b2f25f87e2a95e7006c362d8b}{al\_eth\_write\_pci\_config}}(\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int}, uint32\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00193}00193 \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a95ad99d16fc637d848c639121d327a2d}{al\_eth\_irq\_config}}(uint32\_t *, uint32\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00194}00194 \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_aba4ec50b0803da6b352d5bbab0a54a2e}{al\_eth\_forward\_int\_config}}(uint32\_t *, uint32\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00195}00195 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a45c765bd1ad88ed2540ab0845cb4185e}{al\_eth\_start\_xmit}}(\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00196}00196 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a478c022f2a05ca7f4a359068ee92c028}{al\_eth\_rx\_recv\_work}}(\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00197}00197 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a4c16389147c0f1fd1d31a2cc17c65f48}{al\_eth\_up}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00198}00198 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a2511d605f21e0a4e99f5a432cebf324c}{al\_eth\_down}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00199}00199 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a7e28ed28b9af55a378069d705f2adf88}{al\_eth\_interrupts\_unmask}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00200}00200 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a30afd1f945df82686f9856c32ea67843}{al\_eth\_interrupts\_mask}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00201}00201 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a23e9cb6b44b3f91fe13fcf3e0666e3da}{al\_eth\_check\_mtu}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00202}00202 \textcolor{keyword}{static} uint64\_t \mbox{\hyperlink{al__eth_8c_a5570ced882c7cb338eb05619c51a2ef6}{al\_get\_counter}}(\textcolor{keyword}{struct} ifnet *, ift\_counter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00203}00203 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a930ce6b61e3494421667796e0991172f}{al\_eth\_req\_rx\_buff\_size}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00204}00204 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a3d85e6c6893685aaf9f089a0cf4e5c5f}{al\_eth\_board\_params\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00205}00205 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_ae530391e153510f1c68252293e6b34b7}{al\_media\_update}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00206}00206 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a7e02bbd51ef5a6cdf98088d9bfba1cd7}{al\_media\_status}}(\textcolor{keyword}{struct} ifnet *, \textcolor{keyword}{struct} ifmediareq *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00207}00207 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a049732a0792444b060c0b6759a9c316c}{al\_eth\_function\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00208}00208 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a40d600fd4d572b8f7014c8f236c17575}{al\_eth\_hw\_init\_adapter}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00209}00209 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_afa47ffd700a030a69c015eac43b3ccbd}{al\_eth\_serdes\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00210}00210 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_ac2c91d2dad62363644b93e83f38d71d7}{al\_eth\_lm\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00211}00211 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_aa782e32cbeab4cfa1b7f6cc9cda435c5}{al\_eth\_hw\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00212}00212 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00213}00213 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a92d0ca7738a2e0f7c0989002e872c8c5}{al\_tick\_stats}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00215}00215 \textcolor{comment}{/* ifnet entry points */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00216}00216 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a72dd112b571e01ec89e41bfda049bbd2}{al\_init}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00217}00217 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a5592d7eb2b6453fe3e3373009d970a49}{al\_mq\_start}}(\textcolor{keyword}{struct} ifnet *, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00218}00218 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_a4ccc23f856791228f9bc191c076517ba}{al\_qflush}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00219}00219 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a5db70fc47f61dbe4c6c920f6919f01d4}{al\_ioctl}}(\textcolor{keyword}{struct} ifnet * ifp, u\_long, caddr\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00220}00220 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00221}00221 \textcolor{comment}{/* bus entry points */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00222}00222 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a5ff7e6d4fab130a9edff186fa1712d1a}{al\_probe}}(device\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00223}00223 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a43c2653ad08cb1efe947e54dae90dcae}{al\_attach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00224}00224 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a55c202c1d08fa01bba2aef4d5bfd13d9}{al\_detach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00225}00225 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a2f8c46e11a6aec27b78fa0b422b27da4}{al\_shutdown}}(device\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00227}00227 \textcolor{comment}{/* mii bus support routines */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00228}00228 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_a1ca56909be3bdc082efd0a722fe9eea9}{al\_miibus\_readreg}}(device\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00229}00229 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_ab9930624216f2f5667b2cadb702b80ba}{al\_miibus\_writereg}}(device\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00230}00230 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_aebb53e2f81fe6ba9201825ef19f356c2}{al\_miibus\_statchg}}(device\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00231}00231 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{al__eth_8c_ae0572b2dd663de09037a4dc4ae196b01}{al\_miibus\_linkchg}}(device\_t);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00232}00232 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00233}\mbox{\hyperlink{al__eth_8c_a00c74ce2103b45590552e554ceb5548e}{00233}} \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}}* \mbox{\hyperlink{al__eth_8c_a00c74ce2103b45590552e554ceb5548e}{g\_adapters}}[16];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00234}\mbox{\hyperlink{al__eth_8c_a4c6fe3bd66a8b24c5c7a87b175edc924}{00234}} uint32\_t \mbox{\hyperlink{al__eth_8c_a4c6fe3bd66a8b24c5c7a87b175edc924}{g\_adapters\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00235}00235 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00236}00236 \textcolor{comment}{/* flag for napi-\/like mbuf processing, controlled from sysctl */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00237}\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{00237}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00238}00238 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00239}\mbox{\hyperlink{al__eth_8c_a6d2bca257c08200e09780970aaf4ee22}{00239}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{al__eth_8c_a6d2bca257c08200e09780970aaf4ee22}{al\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00240}00240         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00241}00241         DEVMETHOD(device\_probe,         \mbox{\hyperlink{al__eth_8c_a5ff7e6d4fab130a9edff186fa1712d1a}{al\_probe}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00242}00242         DEVMETHOD(device\_attach,        \mbox{\hyperlink{al__eth_8c_a43c2653ad08cb1efe947e54dae90dcae}{al\_attach}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00243}00243         DEVMETHOD(device\_detach,        \mbox{\hyperlink{al__eth_8c_a55c202c1d08fa01bba2aef4d5bfd13d9}{al\_detach}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00244}00244         DEVMETHOD(device\_shutdown,      \mbox{\hyperlink{al__eth_8c_a2f8c46e11a6aec27b78fa0b422b27da4}{al\_shutdown}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00246}00246         DEVMETHOD(miibus\_readreg,       \mbox{\hyperlink{al__eth_8c_a1ca56909be3bdc082efd0a722fe9eea9}{al\_miibus\_readreg}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00247}00247         DEVMETHOD(miibus\_writereg,      \mbox{\hyperlink{al__eth_8c_ab9930624216f2f5667b2cadb702b80ba}{al\_miibus\_writereg}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00248}00248         DEVMETHOD(miibus\_statchg,       \mbox{\hyperlink{al__eth_8c_aebb53e2f81fe6ba9201825ef19f356c2}{al\_miibus\_statchg}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00249}00249         DEVMETHOD(miibus\_linkchg,       \mbox{\hyperlink{al__eth_8c_ae0572b2dd663de09037a4dc4ae196b01}{al\_miibus\_linkchg}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00250}00250         \{ 0, 0 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00251}00251 \};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00253}\mbox{\hyperlink{al__eth_8c_a9e8f1ff800cce6b686b607e9754ccc69}{00253}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{al__eth_8c_a9e8f1ff800cce6b686b607e9754ccc69}{al\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00254}00254         \textcolor{stringliteral}{"{}al"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00255}00255         \mbox{\hyperlink{al__eth_8c_a6d2bca257c08200e09780970aaf4ee22}{al\_methods}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00256}00256         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00257}00257 \};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00259}\mbox{\hyperlink{al__eth_8c_a572ea4899cecfec9231bb7e4db34197f}{00259}} \mbox{\hyperlink{al__eth_8c_a572ea4899cecfec9231bb7e4db34197f}{DRIVER\_MODULE}}(al, pci, \mbox{\hyperlink{al__eth_8c_a9e8f1ff800cce6b686b607e9754ccc69}{al\_driver}}, \mbox{\hyperlink{al__eth_8c_af41845916ddc7f0b26efd6279f60854a}{al\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00260}\mbox{\hyperlink{al__eth_8c_a6a3f3b86e44060f4364dc8fd3fbdbbda}{00260}} \mbox{\hyperlink{al__eth_8c_a572ea4899cecfec9231bb7e4db34197f}{DRIVER\_MODULE}}(\mbox{\hyperlink{structal__eth__adapter_a67a62b4c86ada7558095242bdcedd863}{miibus}}, al, miibus\_driver, miibus\_devclass, 0, 0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00262}00262 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00263}\mbox{\hyperlink{al__eth_8c_a5ff7e6d4fab130a9edff186fa1712d1a}{00263}} \mbox{\hyperlink{al__eth_8c_a5ff7e6d4fab130a9edff186fa1712d1a}{al\_probe}}(device\_t \mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00264}00264 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00265}00265         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{al__eth_8c_a06a8ce939e45eeb8386ac8718459211f}{al\_is\_device\_supported}}(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}})) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00266}00266                 device\_set\_desc(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}al"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00267}00267                 \textcolor{keywordflow}{return} (BUS\_PROBE\_DEFAULT);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00268}00268         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00269}00269         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00270}00270 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00271}00271 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00272}00272 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00273}\mbox{\hyperlink{al__eth_8c_a43c2653ad08cb1efe947e54dae90dcae}{00273}} \mbox{\hyperlink{al__eth_8c_a43c2653ad08cb1efe947e54dae90dcae}{al\_attach}}(device\_t \mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00274}00274 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00275}00275         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00276}00276         \textcolor{keyword}{struct }sysctl\_oid\_list *child;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00277}00277         \textcolor{keyword}{struct }sysctl\_ctx\_list *ctx;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00278}00278         \textcolor{keyword}{struct }sysctl\_oid *tree;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00279}00279         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00280}00280         uint32\_t dev\_id;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00281}00281         uint32\_t rev\_id;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00282}00282         \textcolor{keywordtype}{int} bar\_udma;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00283}00283         \textcolor{keywordtype}{int} bar\_mac;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00284}00284         \textcolor{keywordtype}{int} bar\_ec;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00285}00285         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00286}00286 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00287}00287         err = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00288}00288         ifp = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00289}00289         dev\_id = rev\_id = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00290}00290         ctx = device\_get\_sysctl\_ctx(dev);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00291}00291         tree = SYSCTL\_PARENT(device\_get\_sysctl\_tree(dev));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00292}00292         child = SYSCTL\_CHILDREN(tree);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00293}00293 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00294}00294         \textcolor{keywordflow}{if} (\mbox{\hyperlink{al__eth_8c_a4c6fe3bd66a8b24c5c7a87b175edc924}{g\_adapters\_count}} == 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00295}00295                 SYSCTL\_ADD\_INT(ctx, child, OID\_AUTO, \textcolor{stringliteral}{"{}napi"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00296}00296                     CTLFLAG\_RW, \&\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}}, 0, \textcolor{stringliteral}{"{}Use pseudo-\/napi mechanism"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00297}00297         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00298}00298         adapter = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00299}00299         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}} = dev;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00300}00300         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} = \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98ac0bf0d18cbc54259261779d6055dc443}{ALPINE\_INTEGRATED}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00301}00301         snprintf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0c5d6ba15b955301419c921e37ff2b84}{name}}, \mbox{\hyperlink{al__eth_8h_aa04b43713f13bf3b752d672ea4dd37e4}{AL\_ETH\_NAME\_MAX\_LEN}}, \textcolor{stringliteral}{"{}\%s"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00302}00302             device\_get\_nameunit(dev));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00303}00303         \mbox{\hyperlink{al__eth_8c_af0774d8565dbc9db30e5f93f17ef30d6}{AL\_RX\_LOCK\_INIT}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00304}00304 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00305}00305         \mbox{\hyperlink{al__eth_8c_a00c74ce2103b45590552e554ceb5548e}{g\_adapters}}[\mbox{\hyperlink{al__eth_8c_a4c6fe3bd66a8b24c5c7a87b175edc924}{g\_adapters\_count}}] = adapter;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00307}00307         bar\_udma = PCIR\_BAR(AL\_ETH\_UDMA\_BAR);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00308}00308         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a9386ad84842a5db39d665770fcfad7ab}{udma\_res}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_MEMORY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00309}00309             \&bar\_udma, RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00310}00310         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a9386ad84842a5db39d665770fcfad7ab}{udma\_res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00311}00311                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00312}00312                     \textcolor{stringliteral}{"{}could not allocate memory resources for DMA.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00313}00313                 err = ENOMEM;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00314}00314                 \textcolor{keywordflow}{goto} err\_res\_dma;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00315}00315         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00316}00316         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}} = al\_bus\_dma\_to\_va(rman\_get\_bustag(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a9386ad84842a5db39d665770fcfad7ab}{udma\_res}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00317}00317             rman\_get\_bushandle(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a9386ad84842a5db39d665770fcfad7ab}{udma\_res}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00318}00318         bar\_mac = PCIR\_BAR(AL\_ETH\_MAC\_BAR);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00319}00319         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adc48bfd824fc511da4e2c3a1e688ad33}{mac\_res}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_MEMORY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00320}00320             \&bar\_mac, RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00321}00321         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adc48bfd824fc511da4e2c3a1e688ad33}{mac\_res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00322}00322                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00323}00323                     \textcolor{stringliteral}{"{}could not allocate memory resources for MAC.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00324}00324                 err = ENOMEM;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00325}00325                 \textcolor{keywordflow}{goto} err\_res\_mac;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00326}00326         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00327}00327         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_abb3eecf9d7a88361388c0fa0a80dc5b5}{mac\_base}} = al\_bus\_dma\_to\_va(rman\_get\_bustag(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adc48bfd824fc511da4e2c3a1e688ad33}{mac\_res}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00328}00328             rman\_get\_bushandle(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adc48bfd824fc511da4e2c3a1e688ad33}{mac\_res}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00330}00330         bar\_ec = PCIR\_BAR(AL\_ETH\_EC\_BAR);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00331}00331         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_af38353556c91a0f8ad453cb4ac4b4dae}{ec\_res}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_MEMORY, \&bar\_ec,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00332}00332             RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00333}00333         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_af38353556c91a0f8ad453cb4ac4b4dae}{ec\_res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00334}00334                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00335}00335                     \textcolor{stringliteral}{"{}could not allocate memory resources for EC.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00336}00336                 err = ENOMEM;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00337}00337                 \textcolor{keywordflow}{goto} err\_res\_ec;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00338}00338         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00339}00339         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aa8997e1d7aa72035dcff502b34154179}{ec\_base}} = al\_bus\_dma\_to\_va(rman\_get\_bustag(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_af38353556c91a0f8ad453cb4ac4b4dae}{ec\_res}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00340}00340             rman\_get\_bushandle(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_af38353556c91a0f8ad453cb4ac4b4dae}{ec\_res}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00342}00342         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}} = ifp = if\_alloc(IFT\_ETHER);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00344}00344         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_link\_state = LINK\_STATE\_DOWN;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00346}00346         ifp-\/>if\_softc = adapter;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00347}00347         if\_initname(ifp, device\_get\_name(dev), device\_get\_unit(dev));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00348}00348         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_OACTIVE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00349}00349         ifp-\/>if\_flags = ifp-\/>if\_drv\_flags;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00350}00350         ifp-\/>if\_flags |= IFF\_BROADCAST | IFF\_SIMPLEX | IFF\_MULTICAST | IFF\_ALLMULTI;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00351}00351         ifp-\/>if\_transmit = \mbox{\hyperlink{al__eth_8c_a5592d7eb2b6453fe3e3373009d970a49}{al\_mq\_start}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00352}00352         ifp-\/>if\_qflush = \mbox{\hyperlink{al__eth_8c_a4ccc23f856791228f9bc191c076517ba}{al\_qflush}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00353}00353         ifp-\/>if\_ioctl = \mbox{\hyperlink{al__eth_8c_a5db70fc47f61dbe4c6c920f6919f01d4}{al\_ioctl}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00354}00354         ifp-\/>if\_init = \mbox{\hyperlink{al__eth_8c_a72dd112b571e01ec89e41bfda049bbd2}{al\_init}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00355}00355         ifp-\/>if\_get\_counter = \mbox{\hyperlink{al__eth_8c_a5570ced882c7cb338eb05619c51a2ef6}{al\_get\_counter}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00356}00356         ifp-\/>if\_mtu = \mbox{\hyperlink{al__eth_8c_a5a6640bff6a0128d04479f0c0c202a0a}{AL\_DEFAULT\_MTU}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00357}00357 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00358}00358         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3b2327ff4fc2556acbbb3f3818635af1}{if\_flags}} = ifp-\/>if\_flags;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00360}00360         ifp-\/>if\_capabilities = ifp-\/>if\_capenable = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00361}00361 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00362}00362         ifp-\/>if\_capabilities |= IFCAP\_HWCSUM |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00363}00363             IFCAP\_HWCSUM\_IPV6 | IFCAP\_TSO |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00364}00364             IFCAP\_LRO | IFCAP\_JUMBO\_MTU;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00365}00365 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00366}00366         ifp-\/>if\_capenable = ifp-\/>if\_capabilities;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00367}00367 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00368}00368         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a48ddafe1ed658a46810cd0daedb377b6}{id\_number}} = \mbox{\hyperlink{al__eth_8c_a4c6fe3bd66a8b24c5c7a87b175edc924}{g\_adapters\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00370}00370         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98ac0bf0d18cbc54259261779d6055dc443}{ALPINE\_INTEGRATED}}) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00371}00371                 dev\_id = pci\_get\_device(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00372}00372                 rev\_id = pci\_get\_revid(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00373}00373         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00374}00374                 \mbox{\hyperlink{al__eth_8c_ae5d904a47a00aa0502ed9e703463c4eb}{al\_eth\_fpga\_read\_pci\_config}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab5779e54ea1ceef98f3f8558028f044c}{internal\_pcie\_base}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00375}00375                     PCIR\_DEVICE, \&dev\_id);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00376}00376                 \mbox{\hyperlink{al__eth_8c_ae5d904a47a00aa0502ed9e703463c4eb}{al\_eth\_fpga\_read\_pci\_config}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab5779e54ea1ceef98f3f8558028f044c}{internal\_pcie\_base}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00377}00377                     PCIR\_REVID, \&rev\_id);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00378}00378         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00380}00380         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a40bf11a095804b68df42858dcaa331db}{dev\_id}} = dev\_id;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00381}00381         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7ce79966ec48fbf316125de78a22e73b}{rev\_id}} = rev\_id;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00382}00382 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00383}00383         \textcolor{comment}{/* set default ring sizes */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00384}00384         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aeafd84b71004a857e6a306b6faa96dee}{tx\_ring\_count}} = \mbox{\hyperlink{al__eth_8h_a55eb9819c24f80120445d6028c3c0da1}{AL\_ETH\_DEFAULT\_TX\_SW\_DESCS}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00385}00385         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7bf9ea7dc58407faa56cebfcbb2b153a}{tx\_descs\_count}} = \mbox{\hyperlink{al__eth_8h_a305e716297774e2fe97bd1181a281626}{AL\_ETH\_DEFAULT\_TX\_HW\_DESCS}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00386}00386         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0b79b8bbe34c7f50fbc4708dd8a7540f}{rx\_ring\_count}} = \mbox{\hyperlink{al__eth_8h_a7ce67eba73e7d26f17e8f63e1dc447bd}{AL\_ETH\_DEFAULT\_RX\_DESCS}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00387}00387         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aa4b504a0a151af2839273d3916ec5723}{rx\_descs\_count}} = \mbox{\hyperlink{al__eth_8h_a7ce67eba73e7d26f17e8f63e1dc447bd}{AL\_ETH\_DEFAULT\_RX\_DESCS}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00388}00388 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00389}00389         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}} = \mbox{\hyperlink{al__eth_8h_aa5db01dd25cc6b5b9f463ca0686ca1b5}{AL\_ETH\_NUM\_QUEUES}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00390}00390         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}} = \mbox{\hyperlink{al__eth_8h_aa5db01dd25cc6b5b9f463ca0686ca1b5}{AL\_ETH\_NUM\_QUEUES}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00391}00391 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00392}00392         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a6fa3c8ea1b17a187009d3b6ae4c02b06}{small\_copy\_len}}   = \mbox{\hyperlink{al__eth_8h_a3a3448f113279481acdf5ed1dbf6fca9}{AL\_ETH\_DEFAULT\_SMALL\_PACKET\_LEN}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00393}00393         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a65d15325c4d1c2ede15cf861263292be}{link\_poll\_interval}} = \mbox{\hyperlink{al__eth_8h_a19028d928a5b528b1579ffe1d4527527}{AL\_ETH\_DEFAULT\_LINK\_POLL\_INTERVAL}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00394}00394         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7c6cdaed7f93b8259d8607726a65d14c}{max\_rx\_buff\_alloc\_size}} = \mbox{\hyperlink{al__eth_8h_a5b14dce5582568c6ae884d70658b310b}{AL\_ETH\_DEFAULT\_MAX\_RX\_BUFF\_ALLOC\_SIZE}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00395}00395 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00396}00396         \mbox{\hyperlink{al__eth_8c_a930ce6b61e3494421667796e0991172f}{al\_eth\_req\_rx\_buff\_size}}(adapter, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_mtu);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00397}00397 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00398}00398         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_a36d6423209bc7bff0d2b650e12ef218a}{force\_1000\_base\_x}} = \mbox{\hyperlink{al__eth_8h_a987461c563987fdef63585536daf9f32}{AL\_ETH\_DEFAULT\_FORCE\_1000\_BASEX}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00399}00399 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00400}00400         err = \mbox{\hyperlink{al__eth_8c_a3d85e6c6893685aaf9f089a0cf4e5c5f}{al\_eth\_board\_params\_init}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00401}00401         \textcolor{keywordflow}{if} (err != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00402}00402                 \textcolor{keywordflow}{goto} err;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00403}00403 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00404}00404         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} == AL\_ETH\_MAC\_MODE\_10GbE\_Serial) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00405}00405                 ifmedia\_init(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8c6afc17f22102e718f43968b4c9aa9d}{media}}, IFM\_IMASK,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00406}00406                     \mbox{\hyperlink{al__eth_8c_ae530391e153510f1c68252293e6b34b7}{al\_media\_update}}, \mbox{\hyperlink{al__eth_8c_a7e02bbd51ef5a6cdf98088d9bfba1cd7}{al\_media\_status}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00407}00407                 ifmedia\_add(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8c6afc17f22102e718f43968b4c9aa9d}{media}}, IFM\_ETHER | IFM\_1000\_LX, 0, NULL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00408}00408                 ifmedia\_add(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8c6afc17f22102e718f43968b4c9aa9d}{media}}, IFM\_ETHER | IFM\_10G\_LR, 0, NULL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00409}00409                 ifmedia\_add(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8c6afc17f22102e718f43968b4c9aa9d}{media}}, IFM\_ETHER | IFM\_AUTO, 0, NULL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00410}00410                 ifmedia\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8c6afc17f22102e718f43968b4c9aa9d}{media}}, IFM\_ETHER | IFM\_AUTO);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00411}00411         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00412}00412 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00413}00413         \mbox{\hyperlink{al__eth_8c_a049732a0792444b060c0b6759a9c316c}{al\_eth\_function\_reset}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00414}00414 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00415}00415         err = \mbox{\hyperlink{al__eth_8c_a40d600fd4d572b8f7014c8f236c17575}{al\_eth\_hw\_init\_adapter}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00416}00416         \textcolor{keywordflow}{if} (err != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00417}00417                 \textcolor{keywordflow}{goto} err;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00418}00418 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00419}00419         \mbox{\hyperlink{al__eth_8c_ae1c015d44fe16c39fa14f36e174e0a1f}{al\_eth\_init\_rings}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00420}00420         \mbox{\hyperlink{al__eth_8c_a4c6fe3bd66a8b24c5c7a87b175edc924}{g\_adapters\_count}}++;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00422}00422         \mbox{\hyperlink{al__eth_8c_ac2c91d2dad62363644b93e83f38d71d7}{al\_eth\_lm\_config}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00423}00423         mtx\_init(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab60e8d48d54e894f61f3ea6b805f1991}{stats\_mtx}}, \textcolor{stringliteral}{"{}AlStatsMtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00424}00424         mtx\_init(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adaad12c5723c9d3509d549e7d7b8196c}{wd\_mtx}}, \textcolor{stringliteral}{"{}AlWdMtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00425}00425         callout\_init\_mtx(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_acec4cc09d2cfe25a5ce42c28843aadbf}{stats\_callout}}, \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab60e8d48d54e894f61f3ea6b805f1991}{stats\_mtx}}, 0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00426}00426         callout\_init\_mtx(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a44431cdbba74692b6cec56c19b780ef1}{wd\_callout}}, \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adaad12c5723c9d3509d549e7d7b8196c}{wd\_mtx}}, 0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00427}00427 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00428}00428         ether\_ifattach(ifp, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad9224fc1783926b2724dde417d6e1e67}{mac\_addr}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00429}00429         ifp-\/>if\_mtu = \mbox{\hyperlink{al__eth_8c_a5a6640bff6a0128d04479f0c0c202a0a}{AL\_DEFAULT\_MTU}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00431}00431         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} == AL\_ETH\_MAC\_MODE\_RGMII) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00432}00432                 \mbox{\hyperlink{al__eth_8c_aa782e32cbeab4cfa1b7f6cc9cda435c5}{al\_eth\_hw\_init}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00434}00434                 \textcolor{comment}{/* Attach PHY(s) */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00435}00435                 err = mii\_attach(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a67a62b4c86ada7558095242bdcedd863}{miibus}}, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00436}00436                     \mbox{\hyperlink{al__eth_8c_ae530391e153510f1c68252293e6b34b7}{al\_media\_update}}, \mbox{\hyperlink{al__eth_8c_a7e02bbd51ef5a6cdf98088d9bfba1cd7}{al\_media\_status}}, BMSR\_DEFCAPMASK, 0,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00437}00437                     MII\_OFFSET\_ANY, 0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00438}00438                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00439}00439                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}attaching PHYs failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00440}00440                         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00441}00441                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00442}00442 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00443}00443                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}} = device\_get\_softc(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a67a62b4c86ada7558095242bdcedd863}{miibus}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00444}00444         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00445}00445 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00446}00446         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00447}00447 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00448}00448 err:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00449}00449         bus\_release\_resource(dev, SYS\_RES\_MEMORY, bar\_ec, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_af38353556c91a0f8ad453cb4ac4b4dae}{ec\_res}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00450}00450 err\_res\_ec:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00451}00451         bus\_release\_resource(dev, SYS\_RES\_MEMORY, bar\_mac, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adc48bfd824fc511da4e2c3a1e688ad33}{mac\_res}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00452}00452 err\_res\_mac:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00453}00453         bus\_release\_resource(dev, SYS\_RES\_MEMORY, bar\_udma, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a9386ad84842a5db39d665770fcfad7ab}{udma\_res}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00454}00454 err\_res\_dma:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00455}00455         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00456}00456 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00457}00457 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00458}00458 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00459}\mbox{\hyperlink{al__eth_8c_a55c202c1d08fa01bba2aef4d5bfd13d9}{00459}} \mbox{\hyperlink{al__eth_8c_a55c202c1d08fa01bba2aef4d5bfd13d9}{al\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00460}00460 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00461}00461         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00462}00462 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00463}00463         adapter = device\_get\_softc(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00464}00464         ether\_ifdetach(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00465}00465 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00466}00466         mtx\_destroy(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab60e8d48d54e894f61f3ea6b805f1991}{stats\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00467}00467         mtx\_destroy(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adaad12c5723c9d3509d549e7d7b8196c}{wd\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00468}00468 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00469}00469         \mbox{\hyperlink{al__eth_8c_a2511d605f21e0a4e99f5a432cebf324c}{al\_eth\_down}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00470}00470 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00471}00471         bus\_release\_resource(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, SYS\_RES\_IRQ,    0, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aede47e5957b4938f9469c29a5d8cf432}{irq\_res}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00472}00472         bus\_release\_resource(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, SYS\_RES\_MEMORY, 0, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_af38353556c91a0f8ad453cb4ac4b4dae}{ec\_res}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00473}00473         bus\_release\_resource(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, SYS\_RES\_MEMORY, 0, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adc48bfd824fc511da4e2c3a1e688ad33}{mac\_res}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00474}00474         bus\_release\_resource(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, SYS\_RES\_MEMORY, 0, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a9386ad84842a5db39d665770fcfad7ab}{udma\_res}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00476}00476         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00477}00477 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00478}00478 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00479}00479 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00480}\mbox{\hyperlink{al__eth_8c_ae5d904a47a00aa0502ed9e703463c4eb}{00480}} \mbox{\hyperlink{al__eth_8c_ae5d904a47a00aa0502ed9e703463c4eb}{al\_eth\_fpga\_read\_pci\_config}}(\textcolor{keywordtype}{void} *handle, \textcolor{keywordtype}{int} where, uint32\_t *val)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00481}00481 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00483}00483         \textcolor{comment}{/* handle is the base address of the adapter */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00484}00484         *val = al\_reg\_read32((\textcolor{keywordtype}{void}*)((u\_long)handle + where));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00485}00485 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00486}00486         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00487}00487 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00489}00489 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00490}\mbox{\hyperlink{al__eth_8c_a3fe7f38392487d606d0a4d5bd5ad5918}{00490}} \mbox{\hyperlink{al__eth_8c_a3fe7f38392487d606d0a4d5bd5ad5918}{al\_eth\_fpga\_write\_pci\_config}}(\textcolor{keywordtype}{void} *handle, \textcolor{keywordtype}{int} where, uint32\_t val)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00491}00491 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00492}00492 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00493}00493         \textcolor{comment}{/* handle is the base address of the adapter */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00494}00494         al\_reg\_write32((\textcolor{keywordtype}{void}*)((u\_long)handle + where), val);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00495}00495         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00496}00496 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00498}00498 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00499}\mbox{\hyperlink{al__eth_8c_afeff5e2211915216e1300ed99b13b011}{00499}} \mbox{\hyperlink{al__eth_8c_afeff5e2211915216e1300ed99b13b011}{al\_eth\_read\_pci\_config}}(\textcolor{keywordtype}{void} *handle, \textcolor{keywordtype}{int} where, uint32\_t *val)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00500}00500 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00501}00501 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00502}00502         \textcolor{comment}{/* handle is a pci\_dev */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00503}00503         *val = pci\_read\_config((device\_t)handle, where, \textcolor{keyword}{sizeof}(*val));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00504}00504         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00505}00505 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00506}00506 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00507}00507 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00508}\mbox{\hyperlink{al__eth_8c_a721d648b2f25f87e2a95e7006c362d8b}{00508}} \mbox{\hyperlink{al__eth_8c_a721d648b2f25f87e2a95e7006c362d8b}{al\_eth\_write\_pci\_config}}(\textcolor{keywordtype}{void} *handle, \textcolor{keywordtype}{int} where, uint32\_t val)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00509}00509 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00510}00510 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00511}00511         \textcolor{comment}{/* handle is a pci\_dev */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00512}00512         pci\_write\_config((device\_t)handle, where, val, \textcolor{keyword}{sizeof}(val));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00513}00513         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00514}00514 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00515}00515 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00516}00516 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00517}\mbox{\hyperlink{al__eth_8c_a95ad99d16fc637d848c639121d327a2d}{00517}} \mbox{\hyperlink{al__eth_8c_a95ad99d16fc637d848c639121d327a2d}{al\_eth\_irq\_config}}(uint32\_t *offset, uint32\_t value)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00518}00518 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00520}00520         al\_reg\_write32\_relaxed(offset, value);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00521}00521 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00522}00522 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00523}00523 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00524}\mbox{\hyperlink{al__eth_8c_aba4ec50b0803da6b352d5bbab0a54a2e}{00524}} \mbox{\hyperlink{al__eth_8c_aba4ec50b0803da6b352d5bbab0a54a2e}{al\_eth\_forward\_int\_config}}(uint32\_t *offset, uint32\_t value)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00525}00525 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00526}00526 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00527}00527         al\_reg\_write32(offset, value);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00528}00528 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00529}00529 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00530}00530 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00531}\mbox{\hyperlink{al__eth_8c_afa47ffd700a030a69c015eac43b3ccbd}{00531}} \mbox{\hyperlink{al__eth_8c_afa47ffd700a030a69c015eac43b3ccbd}{al\_eth\_serdes\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00532}00532 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00533}00533         \textcolor{keywordtype}{void} \_\_iomem    *serdes\_base;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00534}00534 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00535}00535         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aa09a4c6aea80070fe7fca01f78dd7860}{serdes\_init}} = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00536}00536 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00537}00537         serdes\_base = alpine\_serdes\_resource\_get(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5ab4043e27545bd254874399f246429}{serdes\_grp}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00538}00538         \textcolor{keywordflow}{if} (serdes\_base == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00539}00539                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}serdes\_base get failed!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00540}00540                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00541}00541         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00542}00542 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00543}00543         serdes\_base = al\_bus\_dma\_to\_va(serdes\_tag, serdes\_base);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00544}00544 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00545}00545         al\_serdes\_handle\_grp\_init(serdes\_base, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5ab4043e27545bd254874399f246429}{serdes\_grp}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00546}00546             \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_abdc0bc22e87336fb86edcbccf4a791d0}{serdes\_obj}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00547}00547 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00548}00548         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aa09a4c6aea80070fe7fca01f78dd7860}{serdes\_init}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00549}00549 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00551}00551 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00552}\mbox{\hyperlink{al__eth_8c_aa54ecf5c4ada951c735cd60c96c91d0c}{00552}} \mbox{\hyperlink{al__eth_8c_aa54ecf5c4ada951c735cd60c96c91d0c}{al\_dma\_map\_addr}}(\textcolor{keywordtype}{void} *arg, bus\_dma\_segment\_t *segs, \textcolor{keywordtype}{int} nseg, \textcolor{keywordtype}{int} error)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00553}00553 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00554}00554         bus\_addr\_t *paddr;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00556}00556         paddr = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00557}00557         *paddr = segs-\/>ds\_addr;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00558}00558 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00559}00559 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00560}00560 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00561}\mbox{\hyperlink{al__eth_8c_ae39cd17fbd365e3cfc5ac498e8034804}{00561}} \mbox{\hyperlink{al__eth_8c_ae39cd17fbd365e3cfc5ac498e8034804}{al\_dma\_alloc\_coherent}}(device\_t \mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, bus\_dma\_tag\_t *tag, bus\_dmamap\_t *map,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00562}00562     bus\_addr\_t *baddr, \textcolor{keywordtype}{void} **vaddr, uint32\_t size)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00563}00563 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00564}00564         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00565}00565         uint32\_t maxsize = ((size -\/ 1)/PAGE\_SIZE + 1) * PAGE\_SIZE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00566}00566 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00567}00567         ret = bus\_dma\_tag\_create(bus\_get\_dma\_tag(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}), 8, 0,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00568}00568             BUS\_SPACE\_MAXADDR, BUS\_SPACE\_MAXADDR, NULL, NULL,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00569}00569             maxsize, 1, maxsize, BUS\_DMA\_COHERENT, NULL, NULL, tag);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00570}00570         \textcolor{keywordflow}{if} (ret != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00571}00571                 device\_printf(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00572}00572                     \textcolor{stringliteral}{"{}failed to create bus tag, ret = \%d\(\backslash\)n"{}}, ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00573}00573                 \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00574}00574         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00575}00575 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00576}00576         ret = bus\_dmamem\_alloc(*tag, vaddr,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00577}00577             BUS\_DMA\_COHERENT | BUS\_DMA\_ZERO, map);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00578}00578         \textcolor{keywordflow}{if} (ret != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00579}00579                 device\_printf(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00580}00580                     \textcolor{stringliteral}{"{}failed to allocate dmamem, ret = \%d\(\backslash\)n"{}}, ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00581}00581                 \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00582}00582         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00584}00584         ret = bus\_dmamap\_load(*tag, *map, *vaddr,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00585}00585             size, \mbox{\hyperlink{al__eth_8c_aa54ecf5c4ada951c735cd60c96c91d0c}{al\_dma\_map\_addr}}, baddr, 0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00586}00586         \textcolor{keywordflow}{if} (ret != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00587}00587                 device\_printf(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00588}00588                     \textcolor{stringliteral}{"{}failed to allocate bus\_dmamap\_load, ret = \%d\(\backslash\)n"{}}, ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00589}00589                 \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00590}00590         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00591}00591 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00592}00592         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00593}00593 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00594}00594 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00595}00595 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00596}\mbox{\hyperlink{al__eth_8c_a57f113fa4f2c26198ad53eb26f987fff}{00596}} \mbox{\hyperlink{al__eth_8c_a57f113fa4f2c26198ad53eb26f987fff}{al\_dma\_free\_coherent}}(bus\_dma\_tag\_t tag, bus\_dmamap\_t map, \textcolor{keywordtype}{void} *vaddr)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00597}00597 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00598}00598 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00599}00599         bus\_dmamap\_unload(tag, map);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00600}00600         bus\_dmamem\_free(tag, vaddr, map);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00601}00601         bus\_dma\_tag\_destroy(tag);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00602}00602 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00603}00603 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00604}00604 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00605}\mbox{\hyperlink{al__eth_8c_a9507f7787cd541573969d39dd501ce40}{00605}} \mbox{\hyperlink{al__eth_8c_a9507f7787cd541573969d39dd501ce40}{al\_eth\_mac\_table\_unicast\_add}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00606}00606     uint8\_t idx, uint8\_t udma\_mask)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00607}00607 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00608}00608         \textcolor{keyword}{struct }al\_eth\_fwd\_mac\_table\_entry entry = \{ \{ 0 \} \};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00609}00609 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00610}00610         memcpy(entry.addr, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad9224fc1783926b2724dde417d6e1e67}{mac\_addr}}, \textcolor{keyword}{sizeof}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad9224fc1783926b2724dde417d6e1e67}{mac\_addr}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00611}00611 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00612}00612         memset(entry.mask, 0xff, \textcolor{keyword}{sizeof}(entry.mask));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00613}00613         entry.rx\_valid = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00614}00614         entry.tx\_valid = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00615}00615         entry.udma\_mask = udma\_mask;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00616}00616         entry.filter = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00617}00617 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00618}00618         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00619}00619             \textcolor{stringliteral}{"{}\%s: [\%d]: addr "{}}\mbox{\hyperlink{al__eth_8c_a93bcbeadec0087b89db687db8708681b}{MAC\_ADDR\_STR}}\textcolor{stringliteral}{"{} mask "{}}\mbox{\hyperlink{al__eth_8c_a93bcbeadec0087b89db687db8708681b}{MAC\_ADDR\_STR}}\textcolor{stringliteral}{"{}\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00620}00620             \_\_func\_\_, idx, \mbox{\hyperlink{al__eth_8c_aba49d51e0ee390449a8b6c913458329b}{MAC\_ADDR}}(entry.addr), \mbox{\hyperlink{al__eth_8c_aba49d51e0ee390449a8b6c913458329b}{MAC\_ADDR}}(entry.mask));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00622}00622         al\_eth\_fwd\_mac\_table\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, idx, \&entry);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00623}00623 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00624}00624 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00625}00625 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00626}\mbox{\hyperlink{al__eth_8c_aeb94dfffc6a3d8c6de662f2edf8d6f0f}{00626}} \mbox{\hyperlink{al__eth_8c_aeb94dfffc6a3d8c6de662f2edf8d6f0f}{al\_eth\_mac\_table\_all\_multicast\_add}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, uint8\_t idx,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00627}00627     uint8\_t udma\_mask)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00628}00628 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00629}00629         \textcolor{keyword}{struct }al\_eth\_fwd\_mac\_table\_entry entry = \{ \{ 0 \} \};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00630}00630 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00631}00631         memset(entry.addr, 0x00, \textcolor{keyword}{sizeof}(entry.addr));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00632}00632         memset(entry.mask, 0x00, \textcolor{keyword}{sizeof}(entry.mask));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00633}00633         entry.mask[0] |= 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00634}00634         entry.addr[0] |= 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00635}00635 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00636}00636         entry.rx\_valid = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00637}00637         entry.tx\_valid = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00638}00638         entry.udma\_mask = udma\_mask;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00639}00639         entry.filter = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00640}00640 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00641}00641         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00642}00642             \textcolor{stringliteral}{"{}\%s: [\%d]: addr "{}}\mbox{\hyperlink{al__eth_8c_a93bcbeadec0087b89db687db8708681b}{MAC\_ADDR\_STR}}\textcolor{stringliteral}{"{} mask "{}}\mbox{\hyperlink{al__eth_8c_a93bcbeadec0087b89db687db8708681b}{MAC\_ADDR\_STR}}\textcolor{stringliteral}{"{}\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00643}00643             \_\_func\_\_, idx, \mbox{\hyperlink{al__eth_8c_aba49d51e0ee390449a8b6c913458329b}{MAC\_ADDR}}(entry.addr), \mbox{\hyperlink{al__eth_8c_aba49d51e0ee390449a8b6c913458329b}{MAC\_ADDR}}(entry.mask));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00644}00644 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00645}00645         al\_eth\_fwd\_mac\_table\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, idx, \&entry);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00646}00646 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00647}00647 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00648}00648 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00649}\mbox{\hyperlink{al__eth_8c_a77538340dc9599194f38ff4fd4be0b82}{00649}} \mbox{\hyperlink{al__eth_8c_a77538340dc9599194f38ff4fd4be0b82}{al\_eth\_mac\_table\_broadcast\_add}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00650}00650     uint8\_t idx, uint8\_t udma\_mask)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00651}00651 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00652}00652         \textcolor{keyword}{struct }al\_eth\_fwd\_mac\_table\_entry entry = \{ \{ 0 \} \};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00653}00653 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00654}00654         memset(entry.addr, 0xff, \textcolor{keyword}{sizeof}(entry.addr));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00655}00655         memset(entry.mask, 0xff, \textcolor{keyword}{sizeof}(entry.mask));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00656}00656 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00657}00657         entry.rx\_valid = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00658}00658         entry.tx\_valid = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00659}00659         entry.udma\_mask = udma\_mask;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00660}00660         entry.filter = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00661}00661 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00662}00662         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00663}00663             \textcolor{stringliteral}{"{}\%s: [\%d]: addr "{}}\mbox{\hyperlink{al__eth_8c_a93bcbeadec0087b89db687db8708681b}{MAC\_ADDR\_STR}}\textcolor{stringliteral}{"{} mask "{}}\mbox{\hyperlink{al__eth_8c_a93bcbeadec0087b89db687db8708681b}{MAC\_ADDR\_STR}}\textcolor{stringliteral}{"{}\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00664}00664             \_\_func\_\_, idx, \mbox{\hyperlink{al__eth_8c_aba49d51e0ee390449a8b6c913458329b}{MAC\_ADDR}}(entry.addr), \mbox{\hyperlink{al__eth_8c_aba49d51e0ee390449a8b6c913458329b}{MAC\_ADDR}}(entry.mask));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00665}00665 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00666}00666         al\_eth\_fwd\_mac\_table\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, idx, \&entry);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00667}00667 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00668}00668 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00669}00669 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00670}\mbox{\hyperlink{al__eth_8c_a608058f45cc19207e6c335093802b882}{00670}} \mbox{\hyperlink{al__eth_8c_a608058f45cc19207e6c335093802b882}{al\_eth\_mac\_table\_promiscuous\_set}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00671}00671     boolean\_t promiscuous)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00672}00672 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00673}00673         \textcolor{keyword}{struct }al\_eth\_fwd\_mac\_table\_entry entry = \{ \{ 0 \} \};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00674}00674 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00675}00675         memset(entry.addr, 0x00, \textcolor{keyword}{sizeof}(entry.addr));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00676}00676         memset(entry.mask, 0x00, \textcolor{keyword}{sizeof}(entry.mask));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00677}00677 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00678}00678         entry.rx\_valid = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00679}00679         entry.tx\_valid = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00680}00680         entry.udma\_mask = (promiscuous) ? 1 : 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00681}00681         entry.filter = (promiscuous) ? \textcolor{keyword}{false} : \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00683}00683         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s: \%s promiscuous mode\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00684}00684             \_\_func\_\_, (promiscuous) ? \textcolor{stringliteral}{"{}enter"{}} : \textcolor{stringliteral}{"{}exit"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00685}00685 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00686}00686         al\_eth\_fwd\_mac\_table\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00687}00687             \mbox{\hyperlink{al__eth_8c_a6607f6e13c4913c0146532c66d86a438}{AL\_ETH\_MAC\_TABLE\_DROP\_IDX}}, \&entry);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00688}00688 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00689}00689 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00690}00690 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00691}\mbox{\hyperlink{al__eth_8c_a9ab04b2d3c8d5fb59baecef999d167dc}{00691}} \mbox{\hyperlink{al__eth_8c_a9ab04b2d3c8d5fb59baecef999d167dc}{al\_eth\_set\_thash\_table\_entry}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, uint8\_t idx,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00692}00692     uint8\_t udma, uint32\_t queue)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00693}00693 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00694}00694 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00695}00695         \textcolor{keywordflow}{if} (udma != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00696}00696                 panic(\textcolor{stringliteral}{"{}only UDMA0 is supporter"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00697}00697 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00698}00698         \textcolor{keywordflow}{if} (queue >= \mbox{\hyperlink{al__eth_8h_aa5db01dd25cc6b5b9f463ca0686ca1b5}{AL\_ETH\_NUM\_QUEUES}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00699}00699                 panic(\textcolor{stringliteral}{"{}invalid queue number"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00700}00700 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00701}00701         al\_eth\_thash\_table\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, idx, udma, queue);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00702}00702 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00703}00703 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00704}00704 \textcolor{comment}{/* init FSM, no tunneling supported yet, if packet is tcp/udp over ipv4/ipv6, use 4 tuple hash */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00705}00705 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00706}\mbox{\hyperlink{al__eth_8c_a4517579f378d460da5ea5de342d69559}{00706}} \mbox{\hyperlink{al__eth_8c_a4517579f378d460da5ea5de342d69559}{al\_eth\_fsm\_table\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00707}00707 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00708}00708         uint32\_t val;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00709}00709         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00710}00710 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00711}00711         \textcolor{keywordflow}{for} (i = 0; i < AL\_ETH\_RX\_FSM\_TABLE\_SIZE; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00712}00712                 uint8\_t outer\_type = AL\_ETH\_FSM\_ENTRY\_OUTER(i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00713}00713                 \textcolor{keywordflow}{switch} (outer\_type) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00714}00714                 \textcolor{keywordflow}{case} \mbox{\hyperlink{al__eth_8c_a5104f4a4b276a7a56e857b500fdd59e9}{AL\_ETH\_FSM\_ENTRY\_IPV4\_TCP}}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00715}00715                 \textcolor{keywordflow}{case} \mbox{\hyperlink{al__eth_8c_a9e7561f779494789e15905cd3d78502c}{AL\_ETH\_FSM\_ENTRY\_IPV4\_UDP}}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00716}00716                 \textcolor{keywordflow}{case} \mbox{\hyperlink{al__eth_8c_a5c619807ed688fc557651d2c36efe7f7}{AL\_ETH\_FSM\_ENTRY\_IPV6\_TCP}}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00717}00717                 \textcolor{keywordflow}{case} \mbox{\hyperlink{al__eth_8c_a1bf07d874f7c384471678430edd330f6}{AL\_ETH\_FSM\_ENTRY\_IPV6\_UDP}}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00718}00718                         val = \mbox{\hyperlink{al__eth_8c_aedc5c157d9e8cff309ecca3214b065ae}{AL\_ETH\_FSM\_DATA\_OUTER\_4\_TUPLE}} |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00719}00719                             \mbox{\hyperlink{al__eth_8c_ad75b982828b197c2f899b61a603ac723}{AL\_ETH\_FSM\_DATA\_HASH\_SEL}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00720}00720                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00721}00721                 \textcolor{keywordflow}{case} \mbox{\hyperlink{al__eth_8c_a5cab0361f7e504ad50930ee6fa03d4a0}{AL\_ETH\_FSM\_ENTRY\_IPV6\_NO\_UDP\_TCP}}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00722}00722                 \textcolor{keywordflow}{case} \mbox{\hyperlink{al__eth_8c_a36419ed607103027a67bbfc56ed97b6b}{AL\_ETH\_FSM\_ENTRY\_IPV4\_NO\_UDP\_TCP}}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00723}00723                         val = \mbox{\hyperlink{al__eth_8c_a01d393b5fd8f05248400c08104344dbf}{AL\_ETH\_FSM\_DATA\_OUTER\_2\_TUPLE}} |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00724}00724                             \mbox{\hyperlink{al__eth_8c_ad75b982828b197c2f899b61a603ac723}{AL\_ETH\_FSM\_DATA\_HASH\_SEL}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00725}00725                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00726}00726                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00727}00727                         val = \mbox{\hyperlink{al__eth_8c_a42bda5ae1eaef24deabbe73bb426715d}{AL\_ETH\_FSM\_DATA\_DEFAULT\_Q}} |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00728}00728                             \mbox{\hyperlink{al__eth_8c_a85ef182fffc189cb7057508209118c79}{AL\_ETH\_FSM\_DATA\_DEFAULT\_UDMA}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00729}00729                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00730}00730                 al\_eth\_fsm\_table\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, i, val);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00731}00731         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00732}00732 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00734}00734 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00735}\mbox{\hyperlink{al__eth_8c_a1f0f39ab7303a149dd7a0090f46be7ab}{00735}} \mbox{\hyperlink{al__eth_8c_a1f0f39ab7303a149dd7a0090f46be7ab}{al\_eth\_mac\_table\_entry\_clear}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00736}00736     uint8\_t idx)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00737}00737 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00738}00738         \textcolor{keyword}{struct }al\_eth\_fwd\_mac\_table\_entry entry = \{ \{ 0 \} \};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00739}00739 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00740}00740         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s: clear entry \%d\(\backslash\)n"{}}, \_\_func\_\_, idx);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00741}00741 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00742}00742         al\_eth\_fwd\_mac\_table\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, idx, \&entry);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00743}00743 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00744}00744 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00745}00745 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00746}\mbox{\hyperlink{al__eth_8c_a40d600fd4d572b8f7014c8f236c17575}{00746}} \mbox{\hyperlink{al__eth_8c_a40d600fd4d572b8f7014c8f236c17575}{al\_eth\_hw\_init\_adapter}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00747}00747 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00748}00748         \textcolor{keyword}{struct }al\_eth\_adapter\_params *params = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aedbd24e4724ae07ff5a04f0e969888f8}{eth\_hal\_params}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00749}00749         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00750}00750 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00751}00751         \textcolor{comment}{/* params-\/>dev\_id = adapter-\/>dev\_id; */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00752}00752         params-\/>rev\_id = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7ce79966ec48fbf316125de78a22e73b}{rev\_id}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00753}00753         params-\/>udma\_id = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00754}00754         params-\/>enable\_rx\_parser = 1; \textcolor{comment}{/* enable rx epe parser*/}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00755}00755         params-\/>udma\_regs\_base = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}}; \textcolor{comment}{/* UDMA register base address */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00756}00756         params-\/>ec\_regs\_base = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aa8997e1d7aa72035dcff502b34154179}{ec\_base}}; \textcolor{comment}{/* Ethernet controller registers base address */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00757}00757         params-\/>mac\_regs\_base = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_abb3eecf9d7a88361388c0fa0a80dc5b5}{mac\_base}}; \textcolor{comment}{/* Ethernet MAC registers base address */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00758}00758         params-\/>name = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0c5d6ba15b955301419c921e37ff2b84}{name}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00759}00759         params-\/>serdes\_lane = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8256bc35e328cb0aebeace5436d2d9b2}{serdes\_lane}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00760}00760 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00761}00761         rc = al\_eth\_adapter\_init(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, params);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00762}00762         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00763}00763                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s failed at hal init!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00764}00764                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00765}00765 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00766}00766         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98a27bdc8e2bbd4f4a3fed70b6d2bb45a4d}{ALPINE\_NIC}}) ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00767}00767             (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98a01564e7eed37e58991cc530b148efed4}{ALPINE\_FPGA\_NIC}})) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00768}00768                 \textcolor{comment}{/* in pcie NIC mode, force eth UDMA to access PCIE0 using the vmid */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00769}00769                 \textcolor{keyword}{struct }al\_udma\_gen\_tgtid\_conf conf;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00770}00770                 \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00771}00771                 \textcolor{keywordflow}{for} (i = 0; i < DMA\_MAX\_Q; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00772}00772                         conf.tx\_q\_conf[i].queue\_en = AL\_TRUE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00773}00773                         conf.tx\_q\_conf[i].desc\_en = AL\_FALSE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00774}00774                         conf.tx\_q\_conf[i].tgtid = 0x100; \textcolor{comment}{/* for access from PCIE0 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00775}00775                         conf.rx\_q\_conf[i].queue\_en = AL\_TRUE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00776}00776                         conf.rx\_q\_conf[i].desc\_en = AL\_FALSE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00777}00777                         conf.rx\_q\_conf[i].tgtid = 0x100; \textcolor{comment}{/* for access from PCIE0 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00778}00778                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00779}00779                 al\_udma\_gen\_tgtid\_conf\_set(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}}, \&conf);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00780}00780         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00782}00782         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00783}00783 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00785}00785 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00786}\mbox{\hyperlink{al__eth_8c_ac2c91d2dad62363644b93e83f38d71d7}{00786}} \mbox{\hyperlink{al__eth_8c_ac2c91d2dad62363644b93e83f38d71d7}{al\_eth\_lm\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00787}00787 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00788}00788         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__lm__init__params}{al\_eth\_lm\_init\_params}} params = \{0\};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00789}00789 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00790}00790         params.\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}} = \&\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>hal\_adapter;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00791}00791         params.\mbox{\hyperlink{structal__eth__lm__init__params_a2b9540164388779235456cb80d6cb795}{serdes\_obj}} = \&\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>serdes\_obj;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00792}00792         params.\mbox{\hyperlink{structal__eth__lm__init__params_ad6526edbbade45a249f64d1b26e5b87e}{lane}} = \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>serdes\_lane;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00793}00793         params.\mbox{\hyperlink{structal__eth__lm__init__params_af8fe21fb5a27d8cbac2e72f0c1fc62d2}{sfp\_detection}} = \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>sfp\_detection\_needed;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00794}00794         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>sfp\_detection\_needed == \textcolor{keyword}{true}) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00795}00795                 params.\mbox{\hyperlink{structal__eth__lm__init__params_ae2c03bf4fcfebbbe3a7a4389a7c5fb0a}{sfp\_bus\_id}} = \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>i2c\_adapter\_id;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00796}00796                 params.\mbox{\hyperlink{structal__eth__lm__init__params_a6bf6372059c360f278ee29d85009ff33}{sfp\_i2c\_addr}} = \mbox{\hyperlink{al__eth_8c_a3feb731a7adaa7a544395eaaf56bb004}{SFP\_I2C\_ADDR}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00797}00797         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00798}00798 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00799}00799         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>sfp\_detection\_needed == \textcolor{keyword}{false}) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00800}00800                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>mac\_mode) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00801}00801                 \textcolor{keywordflow}{case} AL\_ETH\_MAC\_MODE\_10GbE\_Serial:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00802}00802                         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>lt\_en != 0) \&\& (\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>an\_en != 0))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00803}00803                                 params.\mbox{\hyperlink{structal__eth__lm__init__params_a00dd658ef599dd3aaca27b4b2d16ac94}{default\_mode}} = \mbox{\hyperlink{al__init__eth__lm_8h_a7e8774743fd2bdfe1edd0c17559a97bea2973b8946ad15e4ec39f9726d2e64358}{AL\_ETH\_LM\_MODE\_10G\_DA}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00804}00804                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00805}00805                                 params.\mbox{\hyperlink{structal__eth__lm__init__params_a00dd658ef599dd3aaca27b4b2d16ac94}{default\_mode}} = \mbox{\hyperlink{al__init__eth__lm_8h_a7e8774743fd2bdfe1edd0c17559a97bea3c3c51398fbb22f6f796b57297c5c0e1}{AL\_ETH\_LM\_MODE\_10G\_OPTIC}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00806}00806                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00807}00807                 \textcolor{keywordflow}{case} AL\_ETH\_MAC\_MODE\_SGMII:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00808}00808                         params.\mbox{\hyperlink{structal__eth__lm__init__params_a00dd658ef599dd3aaca27b4b2d16ac94}{default\_mode}} = \mbox{\hyperlink{al__init__eth__lm_8h_a7e8774743fd2bdfe1edd0c17559a97bea2df6dfb1e5738457e13a34acc8cd1f1f}{AL\_ETH\_LM\_MODE\_1G}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00809}00809                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00810}00810                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00811}00811                         params.\mbox{\hyperlink{structal__eth__lm__init__params_a00dd658ef599dd3aaca27b4b2d16ac94}{default\_mode}} = \mbox{\hyperlink{al__init__eth__lm_8h_a7e8774743fd2bdfe1edd0c17559a97bea2973b8946ad15e4ec39f9726d2e64358}{AL\_ETH\_LM\_MODE\_10G\_DA}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00812}00812                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00813}00813         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00814}00814                 params.\mbox{\hyperlink{structal__eth__lm__init__params_a00dd658ef599dd3aaca27b4b2d16ac94}{default\_mode}} = \mbox{\hyperlink{al__init__eth__lm_8h_a7e8774743fd2bdfe1edd0c17559a97bea2973b8946ad15e4ec39f9726d2e64358}{AL\_ETH\_LM\_MODE\_10G\_DA}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00815}00815 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00816}00816         params.\mbox{\hyperlink{structal__eth__lm__init__params_ad3a12ef758fe5f5f03bb58b52b2814ad}{link\_training}} = \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>lt\_en;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00817}00817         params.\mbox{\hyperlink{structal__eth__lm__init__params_a9d75b19139f27530c6c239bec15d5e2f}{rx\_equal}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00818}00818         params.\mbox{\hyperlink{structal__eth__lm__init__params_a26d0c357d873eb614f1e3d108e892a5e}{static\_values}} = !\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>dont\_override\_serdes;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00819}00819         params.\mbox{\hyperlink{structal__eth__lm__init__params_ab432281919af6928a5d33c226f93aeb8}{i2c\_context}} = \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00820}00820         params.\mbox{\hyperlink{structal__eth__lm__init__params_aff3f196d8bf7c8b65d1efdc169f50255}{kr\_fec\_enable}} = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00821}00821 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00822}00822         params.\mbox{\hyperlink{structal__eth__lm__init__params_aad9e14af72d6cec0426329e0c6a4216b}{retimer\_exist}} = \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>retimer.exist;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00823}00823         params.\mbox{\hyperlink{structal__eth__lm__init__params_ad12398c543e1141c2e883f3a61ae9ed3}{retimer\_bus\_id}} = \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>retimer.bus\_id;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00824}00824         params.\mbox{\hyperlink{structal__eth__lm__init__params_a02a13e365518941ecf4e3e2e493a95e2}{retimer\_i2c\_addr}} = \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>retimer.i2c\_addr;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00825}00825         params.\mbox{\hyperlink{structal__eth__lm__init__params_ab9df977d613287d7f1cdd96e59b9d531}{retimer\_channel}} = \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>retimer.channel;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00826}00826 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00827}00827         \mbox{\hyperlink{al__init__eth__lm_8c_aa1d688f3b1a5188a0876c370f9f5788b}{al\_eth\_lm\_init}}(\&\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>lm\_context, \&params);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00828}00828 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00829}00829 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00830}00830 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00831}\mbox{\hyperlink{al__eth_8c_a3d85e6c6893685aaf9f089a0cf4e5c5f}{00831}} \mbox{\hyperlink{al__eth_8c_a3d85e6c6893685aaf9f089a0cf4e5c5f}{al\_eth\_board\_params\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00832}00832 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00833}00833 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00834}00834         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>board\_type == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98a27bdc8e2bbd4f4a3fed70b6d2bb45a4d}{ALPINE\_NIC}}) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00835}00835                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>mac\_mode = AL\_ETH\_MAC\_MODE\_10GbE\_Serial;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00836}00836                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>sfp\_detection\_needed = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00837}00837                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>phy\_exist = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00838}00838                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>an\_en = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00839}00839                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>lt\_en = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00840}00840                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>ref\_clk\_freq = AL\_ETH\_REF\_FREQ\_375\_MHZ;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00841}00841                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>mdio\_freq = \mbox{\hyperlink{al__eth_8h_af774f0253bf6e06c78324a071e013be7}{AL\_ETH\_DEFAULT\_MDIO\_FREQ\_KHZ}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00842}00842         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>board\_type == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98a01564e7eed37e58991cc530b148efed4}{ALPINE\_FPGA\_NIC}}) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00843}00843                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>mac\_mode = AL\_ETH\_MAC\_MODE\_SGMII;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00844}00844                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>sfp\_detection\_needed = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00845}00845                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>phy\_exist = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00846}00846                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>an\_en = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00847}00847                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>lt\_en = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00848}00848                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>ref\_clk\_freq = AL\_ETH\_REF\_FREQ\_375\_MHZ;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00849}00849                 \mbox{\hyperlink{structal__eth__lm__init__params_a8fa701271142c9816400904f8967d550}{adapter}}-\/>mdio\_freq = \mbox{\hyperlink{al__eth_8h_af774f0253bf6e06c78324a071e013be7}{AL\_ETH\_DEFAULT\_MDIO\_FREQ\_KHZ}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00850}00850         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00851}00851                 \textcolor{keyword}{struct }al\_eth\_board\_params params;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00852}00852                 \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00853}00853 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00854}00854                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ac49da6b3192dfb8531c441084c029319}{auto\_speed}} = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00855}00855 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00856}00856                 rc = al\_eth\_board\_params\_get(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_abb3eecf9d7a88361388c0fa0a80dc5b5}{mac\_base}}, \&params);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00857}00857                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00858}00858                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00859}00859                             \textcolor{stringliteral}{"{}board info not available\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00860}00860                         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00861}00861                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00862}00862 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00863}00863                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_af74de21d391c1e935d66d01d6bd84e88}{phy\_exist}} = params.phy\_exist == TRUE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00864}00864                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8576032ca22740731cc5153d0a6be21b}{phy\_addr}} = params.phy\_mdio\_addr;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00865}00865                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8ecee15d105b4c3e41f4002d98b41537}{an\_en}} = params.autoneg\_enable;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00866}00866                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2e0daf6eaf3c9cb6fcad2f901b221138}{lt\_en}} = params.kr\_lt\_enable;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00867}00867                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5ab4043e27545bd254874399f246429}{serdes\_grp}} = params.serdes\_grp;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00868}00868                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8256bc35e328cb0aebeace5436d2d9b2}{serdes\_lane}} = params.serdes\_lane;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00869}00869                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3cf650f4c528ac82ec0034d29ca39509}{sfp\_detection\_needed}} = params.sfp\_plus\_module\_exist;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00870}00870                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad8721ce04a4ac71088e5d3b339023cb9}{i2c\_adapter\_id}} = params.i2c\_adapter\_id;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00871}00871                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a104ebe54e16bd7801046c663aea2202a}{ref\_clk\_freq}} = params.ref\_clk\_freq;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00872}00872                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a9e786ba65509cf54756ade469ad2abf2}{dont\_override\_serdes}} = params.dont\_override\_serdes;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00873}00873                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_afe914408ee1a68768d0ed2d4e4796e98}{active\_duplex}} = !params.half\_duplex;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00874}00874                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_aec60f521153a3619ebd22fa8f796e889}{autoneg}} = !params.an\_disable;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00875}00875                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_a36d6423209bc7bff0d2b650e12ef218a}{force\_1000\_base\_x}} = params.force\_1000\_base\_x;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00876}00876                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4ca592f99002a04dc470b0f7b548e0b4}{retimer}}.\mbox{\hyperlink{structal__eth__retimer__params_af523c936aa219d0d2b9ffefec887cfb1}{exist}} = params.retimer\_exist;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00877}00877                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4ca592f99002a04dc470b0f7b548e0b4}{retimer}}.\mbox{\hyperlink{structal__eth__retimer__params_a5df479ef4b0c6eb638930884785358a5}{bus\_id}} = params.retimer\_bus\_id;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00878}00878                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4ca592f99002a04dc470b0f7b548e0b4}{retimer}}.\mbox{\hyperlink{structal__eth__retimer__params_a258aa2c543d37d9c0a00afd6ca677254}{i2c\_addr}} = params.retimer\_i2c\_addr;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00879}00879                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4ca592f99002a04dc470b0f7b548e0b4}{retimer}}.\mbox{\hyperlink{structal__eth__retimer__params_af2d81d9bd3b88b6b26289d8c105e3e38}{channel}} = params.retimer\_channel;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00880}00880 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00881}00881                 \textcolor{keywordflow}{switch} (params.speed) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00882}00882                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00883}00883                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00884}00884                             \textcolor{stringliteral}{"{}\%s: invalid speed (\%d)\(\backslash\)n"{}}, \_\_func\_\_, params.speed);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00885}00885                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_1G\_SPEED\_1000M:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00886}00886                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_ad22b343b4f310bb0df2f60ff2ef69a10}{active\_speed}} = 1000;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00887}00887                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00888}00888                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_1G\_SPEED\_100M:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00889}00889                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_ad22b343b4f310bb0df2f60ff2ef69a10}{active\_speed}} = 100;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00890}00890                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00891}00891                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_1G\_SPEED\_10M:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00892}00892                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_ad22b343b4f310bb0df2f60ff2ef69a10}{active\_speed}} = 10;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00893}00893                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00894}00894                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00895}00895 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00896}00896                 \textcolor{keywordflow}{switch} (params.mdio\_freq) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00897}00897                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00898}00898                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00899}00899                             \textcolor{stringliteral}{"{}\%s: invalid mdio freq (\%d)\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00900}00900                             params.mdio\_freq);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00901}00901                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_MDIO\_FREQ\_2\_5\_MHZ:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00902}00902                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a49d70ef171a09e5897e80577386a1efb}{mdio\_freq}} = \mbox{\hyperlink{al__eth_8h_af774f0253bf6e06c78324a071e013be7}{AL\_ETH\_DEFAULT\_MDIO\_FREQ\_KHZ}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00903}00903                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00904}00904                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_MDIO\_FREQ\_1\_MHZ:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00905}00905                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a49d70ef171a09e5897e80577386a1efb}{mdio\_freq}} = \mbox{\hyperlink{al__eth_8h_ac6249c18a9dda92caa69a32ff7fa47da}{AL\_ETH\_MDIO\_FREQ\_1000\_KHZ}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00906}00906                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00907}00907                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00908}00908 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00909}00909                 \textcolor{keywordflow}{switch} (params.media\_type) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00910}00910                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_MEDIA\_TYPE\_RGMII:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00911}00911                         \textcolor{keywordflow}{if} (params.sfp\_plus\_module\_exist == TRUE)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00912}00912                                 \textcolor{comment}{/* Backward compatibility */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00913}00913                                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} = AL\_ETH\_MAC\_MODE\_SGMII;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00914}00914                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00915}00915                                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} = AL\_ETH\_MAC\_MODE\_RGMII;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00916}00916 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00917}00917                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a81fb1035a6dc08800e1531fe2d1b968e}{use\_lm}} = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00918}00918                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00919}00919                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_MEDIA\_TYPE\_SGMII:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00920}00920                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} = AL\_ETH\_MAC\_MODE\_SGMII;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00921}00921                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a81fb1035a6dc08800e1531fe2d1b968e}{use\_lm}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00922}00922                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00923}00923                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_MEDIA\_TYPE\_10GBASE\_SR:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00924}00924                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} = AL\_ETH\_MAC\_MODE\_10GbE\_Serial;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00925}00925                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a81fb1035a6dc08800e1531fe2d1b968e}{use\_lm}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00926}00926                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00927}00927                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_MEDIA\_TYPE\_AUTO\_DETECT:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00928}00928                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3cf650f4c528ac82ec0034d29ca39509}{sfp\_detection\_needed}} = TRUE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00929}00929                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ac49da6b3192dfb8531c441084c029319}{auto\_speed}} = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00930}00930                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a81fb1035a6dc08800e1531fe2d1b968e}{use\_lm}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00931}00931                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00932}00932                 \textcolor{keywordflow}{case} AL\_ETH\_BOARD\_MEDIA\_TYPE\_AUTO\_DETECT\_AUTO\_SPEED:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00933}00933                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3cf650f4c528ac82ec0034d29ca39509}{sfp\_detection\_needed}} = TRUE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00934}00934                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ac49da6b3192dfb8531c441084c029319}{auto\_speed}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00935}00935                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_afc42b46fde33f1355327bfa2f283b0dd}{mac\_mode\_set}} = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00936}00936                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a81fb1035a6dc08800e1531fe2d1b968e}{use\_lm}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00937}00937 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00938}00938                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} = AL\_ETH\_MAC\_MODE\_10GbE\_Serial;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00939}00939                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00940}00940                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00941}00941                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00942}00942                             \textcolor{stringliteral}{"{}\%s: unsupported media type \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00943}00943                             \_\_func\_\_, params.media\_type);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00944}00944                         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00945}00945                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00946}00946 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00947}00947                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00948}00948                     \textcolor{stringliteral}{"{}Board info: phy exist \%s. phy addr \%d. mdio freq \%u Khz. "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00949}00949                     \textcolor{stringliteral}{"{}SFP connected \%s. media \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00950}00950                     params.phy\_exist == TRUE ? \textcolor{stringliteral}{"{}Yes"{}} : \textcolor{stringliteral}{"{}No"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00951}00951                     params.phy\_mdio\_addr, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a49d70ef171a09e5897e80577386a1efb}{mdio\_freq}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00952}00952                     params.sfp\_plus\_module\_exist == TRUE ? \textcolor{stringliteral}{"{}Yes"{}} : \textcolor{stringliteral}{"{}No"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00953}00953                     params.media\_type);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00954}00954         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00955}00955 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00956}00956         al\_eth\_mac\_addr\_read(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aa8997e1d7aa72035dcff502b34154179}{ec\_base}}, 0, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad9224fc1783926b2724dde417d6e1e67}{mac\_addr}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00957}00957 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00958}00958         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00959}00959 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00960}00960 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00961}00961 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00962}\mbox{\hyperlink{al__eth_8c_a049732a0792444b060c0b6759a9c316c}{00962}} \mbox{\hyperlink{al__eth_8c_a049732a0792444b060c0b6759a9c316c}{al\_eth\_function\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00963}00963 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00964}00964         \textcolor{keyword}{struct }al\_eth\_board\_params params;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00965}00965         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00966}00966 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00967}00967         \textcolor{comment}{/* save board params so we restore it after reset */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00968}00968         al\_eth\_board\_params\_get(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_abb3eecf9d7a88361388c0fa0a80dc5b5}{mac\_base}}, \&params);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00969}00969         al\_eth\_mac\_addr\_read(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aa8997e1d7aa72035dcff502b34154179}{ec\_base}}, 0, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad9224fc1783926b2724dde417d6e1e67}{mac\_addr}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00970}00970         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98ac0bf0d18cbc54259261779d6055dc443}{ALPINE\_INTEGRATED}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00971}00971                 rc = al\_eth\_flr\_rmn(\&\mbox{\hyperlink{al__eth_8c_afeff5e2211915216e1300ed99b13b011}{al\_eth\_read\_pci\_config}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00972}00972                     \&\mbox{\hyperlink{al__eth_8c_a721d648b2f25f87e2a95e7006c362d8b}{al\_eth\_write\_pci\_config}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00973}00973                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_abb3eecf9d7a88361388c0fa0a80dc5b5}{mac\_base}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00974}00974         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00975}00975                 rc = al\_eth\_flr\_rmn(\&\mbox{\hyperlink{al__eth_8c_ae5d904a47a00aa0502ed9e703463c4eb}{al\_eth\_fpga\_read\_pci\_config}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00976}00976                     \&\mbox{\hyperlink{al__eth_8c_a3fe7f38392487d606d0a4d5bd5ad5918}{al\_eth\_fpga\_write\_pci\_config}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00977}00977                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab5779e54ea1ceef98f3f8558028f044c}{internal\_pcie\_base}}, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_abb3eecf9d7a88361388c0fa0a80dc5b5}{mac\_base}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00978}00978 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00979}00979         \textcolor{comment}{/* restore params */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00980}00980         al\_eth\_board\_params\_set(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_abb3eecf9d7a88361388c0fa0a80dc5b5}{mac\_base}}, \&params);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00981}00981         al\_eth\_mac\_addr\_store(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aa8997e1d7aa72035dcff502b34154179}{ec\_base}}, 0, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad9224fc1783926b2724dde417d6e1e67}{mac\_addr}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00982}00982 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00983}00983         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00984}00984 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00985}00985 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00986}00986 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00987}\mbox{\hyperlink{al__eth_8c_ae1c015d44fe16c39fa14f36e174e0a1f}{00987}} \mbox{\hyperlink{al__eth_8c_ae1c015d44fe16c39fa14f36e174e0a1f}{al\_eth\_init\_rings}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00988}00988 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00989}00989         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00990}00990 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00991}00991         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00992}00992                 \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *ring = \&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a6e0fe16b81a9f8f2f2d67d15dc34e0a3}{tx\_ring}}[i];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00993}00993 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00994}00994                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a31a3db30074dd588079a8af06c3cafb5}{ring\_id}} = i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00995}00995                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00996}00996                 ring-\/>\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00997}00997                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a8a9759078e6781f292be7df95030fbc1}{netdev}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00998}00998                 al\_udma\_q\_handle\_get(\&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}.tx\_udma, i,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l00999}00999                     \&ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01000}01000                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a3c47474a76c859d5ec14de965da4686f}{sw\_count}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_aeafd84b71004a857e6a306b6faa96dee}{tx\_ring\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01001}01001                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a4d86ee27da993c0640244b55bd246e55}{hw\_count}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a7bf9ea7dc58407faa56cebfcbb2b153a}{tx\_descs\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01002}01002                 ring-\/>\mbox{\hyperlink{structal__eth__ring_ae949c612e54451dac7ce703f802eff02}{unmask\_reg\_offset}} = al\_udma\_iofic\_unmask\_offset\_get((\textcolor{keyword}{struct} unit\_regs *)\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}}, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY, AL\_INT\_GROUP\_C);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01003}01003                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a6112f4de9b1d2190c2147b8aa6fe6605}{unmask\_val}} = \string~(1 << i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01004}01004         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01005}01005 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01006}01006         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01007}01007                 \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *ring = \&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a83f78b04e69b907725a5f79e5b1de1af}{rx\_ring}}[i];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01008}01008 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01009}01009                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a31a3db30074dd588079a8af06c3cafb5}{ring\_id}} = i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01010}01010                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01011}01011                 ring-\/>\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01012}01012                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a8a9759078e6781f292be7df95030fbc1}{netdev}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01013}01013                 al\_udma\_q\_handle\_get(\&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}.rx\_udma, i, \&ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01014}01014                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a3c47474a76c859d5ec14de965da4686f}{sw\_count}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a0b79b8bbe34c7f50fbc4708dd8a7540f}{rx\_ring\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01015}01015                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a4d86ee27da993c0640244b55bd246e55}{hw\_count}} = \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_aa4b504a0a151af2839273d3916ec5723}{rx\_descs\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01016}01016                 ring-\/>\mbox{\hyperlink{structal__eth__ring_ae949c612e54451dac7ce703f802eff02}{unmask\_reg\_offset}} = al\_udma\_iofic\_unmask\_offset\_get(}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01017}01017                     (\textcolor{keyword}{struct} unit\_regs *)\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01018}01018                     AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY, AL\_INT\_GROUP\_B);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01019}01019                 ring-\/>\mbox{\hyperlink{structal__eth__ring_a6112f4de9b1d2190c2147b8aa6fe6605}{unmask\_val}} = \string~(1 << i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01020}01020         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01021}01021 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01022}01022 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01023}01023 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01024}\mbox{\hyperlink{al__eth_8c_ae17efaee71a19e483517d9465c49de09}{01024}} \mbox{\hyperlink{al__eth_8c_ae17efaee71a19e483517d9465c49de09}{al\_init\_locked}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01025}01025 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01026}01026         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01027}01027         if\_t ifp = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01028}01028         \textcolor{keywordtype}{int} rc = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01029}01029 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01030}01030         \mbox{\hyperlink{al__eth_8c_a2511d605f21e0a4e99f5a432cebf324c}{al\_eth\_down}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01031}01031         rc = \mbox{\hyperlink{al__eth_8c_a4c16389147c0f1fd1d31a2cc17c65f48}{al\_eth\_up}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01032}01032 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01033}01033         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_OACTIVE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01034}01034         \textcolor{keywordflow}{if} (rc == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01035}01035                 ifp-\/>if\_drv\_flags |= IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01036}01036 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01037}01037 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01038}01038 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01039}\mbox{\hyperlink{al__eth_8c_a72dd112b571e01ec89e41bfda049bbd2}{01039}} \mbox{\hyperlink{al__eth_8c_a72dd112b571e01ec89e41bfda049bbd2}{al\_init}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01040}01040 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01041}01041         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01042}01042 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01043}01043         \mbox{\hyperlink{al__eth_8c_ae17efaee71a19e483517d9465c49de09}{al\_init\_locked}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01044}01044 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01045}01045 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01046}01046 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01047}\mbox{\hyperlink{al__eth_8c_a8cbaf2a3cb187a252d09e2429c794e3d}{01047}} \mbox{\hyperlink{al__eth_8c_a8cbaf2a3cb187a252d09e2429c794e3d}{al\_eth\_alloc\_rx\_buf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01048}01048     \textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *\mbox{\hyperlink{structal__eth__adapter_a83f78b04e69b907725a5f79e5b1de1af}{rx\_ring}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01049}01049     \textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__rx__buffer}{al\_eth\_rx\_buffer}} *rx\_info)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01050}01050 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01051}01051         \textcolor{keyword}{struct }al\_buf *al\_buf;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01052}01052         bus\_dma\_segment\_t segs[2];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01053}01053         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01054}01054         \textcolor{keywordtype}{int} nsegs;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01055}01055 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01056}01056         \textcolor{keywordflow}{if} (rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}} != NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01057}01057                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01058}01058 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01059}01059         rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_a394f839c21b817b5f05ffeecc002c44d}{data\_size}} = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a08d89e0a5e28ce759deea434c9d08841}{rx\_mbuf\_sz}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01060}01060 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01061}01061         \mbox{\hyperlink{al__eth_8c_a2900caecabc04076f8da8601ecfa2333}{AL\_RX\_LOCK}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01062}01062 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01063}01063         \textcolor{comment}{/* Get mbuf using UMA allocator */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01064}01064         rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}} = m\_getjcl(M\_NOWAIT, MT\_DATA, M\_PKTHDR,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01065}01065             rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_a394f839c21b817b5f05ffeecc002c44d}{data\_size}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01066}01066         \mbox{\hyperlink{al__eth_8c_a7af538a4743ae7465b760fa0d0dab9d2}{AL\_RX\_UNLOCK}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01067}01067 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01068}01068         \textcolor{keywordflow}{if} (rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}} == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01069}01069                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01070}01070 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01071}01071         rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}}-\/>m\_pkthdr.len = rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}}-\/>m\_len = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a08d89e0a5e28ce759deea434c9d08841}{rx\_mbuf\_sz}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01072}01072 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01073}01073         \textcolor{comment}{/* Map packets for DMA */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01074}01074         error = bus\_dmamap\_load\_mbuf\_sg(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}}, rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_a00ff1e1715a99c7731fb3b2467e70c60}{dma\_map}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01075}01075             rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}}, segs, \&nsegs, BUS\_DMA\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01076}01076         \textcolor{keywordflow}{if} (\_\_predict\_false(error)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01077}01077                 device\_printf(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}}, \textcolor{stringliteral}{"{}failed to map mbuf, error = \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01078}01078                     error);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01079}01079                 m\_freem(rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01080}01080                 rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01081}01081                 \textcolor{keywordflow}{return} (EFAULT);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01082}01082         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01083}01083 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01084}01084         al\_buf = \&rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ab876a0293f3115731e1d8002ed415038}{al\_buf}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01085}01085         al\_buf-\/>addr = segs[0].ds\_addr + \mbox{\hyperlink{al__eth_8c_a1dc79a98b0e8d6c72afabc89cc59897c}{AL\_IP\_ALIGNMENT\_OFFSET}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01086}01086         al\_buf-\/>len = rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_a394f839c21b817b5f05ffeecc002c44d}{data\_size}} -\/ \mbox{\hyperlink{al__eth_8c_a1dc79a98b0e8d6c72afabc89cc59897c}{AL\_IP\_ALIGNMENT\_OFFSET}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01087}01087 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01088}01088         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01089}01089 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01090}01090 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01091}01091 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01092}\mbox{\hyperlink{al__eth_8c_aaa3addf3fccbe7093478867ea56156a2}{01092}} \mbox{\hyperlink{al__eth_8c_aaa3addf3fccbe7093478867ea56156a2}{al\_eth\_refill\_rx\_bufs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} qid,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01093}01093     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} num)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01094}01094 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01095}01095         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *rx\_ring = \&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a83f78b04e69b907725a5f79e5b1de1af}{rx\_ring}}[qid];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01096}01096         uint16\_t \mbox{\hyperlink{structal__eth__ring_ad5cc0f1b2aaaf4a65c491e9faf59788f}{next\_to\_use}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01097}01097         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01098}01098 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01099}01099         \mbox{\hyperlink{structal__eth__ring_ad5cc0f1b2aaaf4a65c491e9faf59788f}{next\_to\_use}} = rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad5cc0f1b2aaaf4a65c491e9faf59788f}{next\_to\_use}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01100}01100 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01101}01101         \textcolor{keywordflow}{for} (i = 0; i < num; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01102}01102                 \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01103}01103                 \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__rx__buffer}{al\_eth\_rx\_buffer}} *rx\_info =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01104}01104                     \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}}[next\_to\_use];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01105}01105 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01106}01106                 \textcolor{keywordflow}{if} (\_\_predict\_false(\mbox{\hyperlink{al__eth_8c_a8cbaf2a3cb187a252d09e2429c794e3d}{al\_eth\_alloc\_rx\_buf}}(adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01107}01107                     rx\_ring, rx\_info) < 0)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01108}01108                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01109}01109                             \textcolor{stringliteral}{"{}failed to alloc buffer for rx queue \%d\(\backslash\)n"{}}, qid);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01110}01110                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01111}01111                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01112}01112 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01113}01113                 rc = al\_eth\_rx\_buffer\_add(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01114}01114                     \&rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ab876a0293f3115731e1d8002ed415038}{al\_buf}}, AL\_ETH\_RX\_FLAGS\_INT, NULL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01115}01115                 \textcolor{keywordflow}{if} (\_\_predict\_false(rc)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01116}01116                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01117}01117                             \textcolor{stringliteral}{"{}failed to add buffer for rx queue \%d\(\backslash\)n"{}}, qid);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01118}01118                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01119}01119                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01120}01120 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01121}01121                 next\_to\_use = \mbox{\hyperlink{al__eth_8h_aaf6283595203424ba0f62f6c1f7a03e9}{AL\_ETH\_RX\_RING\_IDX\_NEXT}}(rx\_ring, next\_to\_use);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01122}01122         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01123}01123 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01124}01124         \textcolor{keywordflow}{if} (\_\_predict\_false(i < num))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01125}01125                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01126}01126                     \textcolor{stringliteral}{"{}refilled rx queue \%d with \%d pages only -\/ available \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01127}01127                     qid, i, al\_udma\_available\_get(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01128}01128 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01129}01129         \textcolor{keywordflow}{if} (\_\_predict\_true(i))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01130}01130                 al\_eth\_rx\_buffer\_action(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}}, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01131}01131 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01132}01132         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad5cc0f1b2aaaf4a65c491e9faf59788f}{next\_to\_use}} = next\_to\_use;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01133}01133 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01134}01134         \textcolor{keywordflow}{return} (i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01135}01135 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01136}01136 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01137}01137 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01138}01138 \textcolor{comment}{ * al\_eth\_refill\_all\_rx\_bufs -\/ allocate all queues Rx buffers}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01139}01139 \textcolor{comment}{ * @adapter: board private structure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01140}01140 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01141}01141 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01142}\mbox{\hyperlink{al__eth_8c_a406f256ff47c09648524ae6e994c2fd2}{01142}} \mbox{\hyperlink{al__eth_8c_a406f256ff47c09648524ae6e994c2fd2}{al\_eth\_refill\_all\_rx\_bufs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01143}01143 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01144}01144         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01145}01145 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01146}01146         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}}; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01147}01147                 \mbox{\hyperlink{al__eth_8c_aaa3addf3fccbe7093478867ea56156a2}{al\_eth\_refill\_rx\_bufs}}(adapter, i, \mbox{\hyperlink{al__eth_8h_a7ce67eba73e7d26f17e8f63e1dc447bd}{AL\_ETH\_DEFAULT\_RX\_DESCS}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01148}01148 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01149}01149 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01150}01150 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01151}\mbox{\hyperlink{al__eth_8c_afa15c4485a50133a35fdafc93c4386ae}{01151}} \mbox{\hyperlink{al__eth_8c_afa15c4485a50133a35fdafc93c4386ae}{al\_eth\_tx\_do\_cleanup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *tx\_ring)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01152}01152 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01153}01153         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} total\_done;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01154}01154         uint16\_t next\_to\_clean;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01155}01155         \textcolor{keywordtype}{int} qid = tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a31a3db30074dd588079a8af06c3cafb5}{ring\_id}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01156}01156 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01157}01157         total\_done = al\_eth\_comp\_tx\_get(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01158}01158         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01159}01159             \textcolor{stringliteral}{"{}tx\_poll: q \%d total completed descs \%x\(\backslash\)n"{}}, qid, total\_done);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01160}01160         next\_to\_clean = tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ade6cba10a94fcb42435b069e81d12c1e}{next\_to\_clean}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01161}01161 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01162}01162         \textcolor{keywordflow}{while} (total\_done != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01163}01163                 \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__tx__buffer}{al\_eth\_tx\_buffer}} *tx\_info;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01164}01164                 \textcolor{keyword}{struct }mbuf *mbuf;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01165}01165 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01166}01166                 tx\_info = \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}}[next\_to\_clean];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01167}01167                 \textcolor{comment}{/* stop if not all descriptors of the packet are completed */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01168}01168                 \textcolor{keywordflow}{if} (tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_a1c73d50eb71ef3175c8a61121973d116}{tx\_descs}} > total\_done)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01169}01169                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01170}01170 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01171}01171                 mbuf = tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_ae5ba95eb67e6a3f4fe5b20b85db85e45}{m}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01172}01172 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01173}01173                 tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_ae5ba95eb67e6a3f4fe5b20b85db85e45}{m}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01174}01174 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01175}01175                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01176}01176                     \textcolor{stringliteral}{"{}tx\_poll: q \%d mbuf \%p completed\(\backslash\)n"{}}, qid, mbuf);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01177}01177 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01178}01178                 \textcolor{comment}{/* map is no longer required */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01179}01179                 bus\_dmamap\_unload(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}}, tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_ac80f7a1ea9bdc83732a687667024c40d}{dma\_map}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01180}01180 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01181}01181                 m\_freem(mbuf);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01182}01182                 total\_done -\/= tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_a1c73d50eb71ef3175c8a61121973d116}{tx\_descs}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01183}01183                 next\_to\_clean = \mbox{\hyperlink{al__eth_8h_a23821a8967f7347476acb0868e3d168c}{AL\_ETH\_TX\_RING\_IDX\_NEXT}}(tx\_ring, next\_to\_clean);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01184}01184         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01185}01185 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01186}01186         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ade6cba10a94fcb42435b069e81d12c1e}{next\_to\_clean}} = next\_to\_clean;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01187}01187 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01188}01188         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}}, \textcolor{stringliteral}{"{}tx\_poll: q \%d done next to clean \%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01189}01189             qid, next\_to\_clean);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01190}01190 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01191}01191         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01192}01192 \textcolor{comment}{         * need to make the rings circular update visible to}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01193}01193 \textcolor{comment}{         * al\_eth\_start\_xmit() before checking for netif\_queue\_stopped().}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01194}01194 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01195}01195         al\_smp\_data\_memory\_barrier();}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01196}01196 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01197}01197 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01198}01198 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01199}\mbox{\hyperlink{al__eth_8c_a94294a263e1c71756becdf2a7afd48d2}{01199}} \mbox{\hyperlink{al__eth_8c_a94294a263e1c71756becdf2a7afd48d2}{al\_eth\_tx\_csum}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *tx\_ring, \textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__tx__buffer}{al\_eth\_tx\_buffer}} *tx\_info,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01200}01200     \textcolor{keyword}{struct} al\_eth\_pkt *hal\_pkt, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01201}01201 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01202}01202         uint32\_t mss = m-\/>m\_pkthdr.tso\_segsz;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01203}01203         \textcolor{keyword}{struct }ether\_vlan\_header *eh;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01204}01204         uint16\_t etype;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01205}01205 \textcolor{preprocessor}{\#ifdef INET}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01206}01206         \textcolor{keyword}{struct }ip *ip;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01207}01207 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01208}01208 \textcolor{preprocessor}{\#ifdef INET6}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01209}01209         \textcolor{keyword}{struct }ip6\_hdr *ip6;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01210}01210 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01211}01211         \textcolor{keyword}{struct }tcphdr *th = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01212}01212         \textcolor{keywordtype}{int}     ehdrlen, ip\_hlen = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01213}01213         uint8\_t ipproto = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01214}01214         uint32\_t offload = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01215}01215 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01216}01216         \textcolor{keywordflow}{if} (mss != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01217}01217                 offload = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01218}01218 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01219}01219         \textcolor{keywordflow}{if} ((m-\/>m\_pkthdr.csum\_flags \& CSUM\_TSO) != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01220}01220                 offload = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01221}01221 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01222}01222         \textcolor{keywordflow}{if} ((m-\/>m\_pkthdr.csum\_flags \& \mbox{\hyperlink{al__eth_8c_abdc7e3793723e377ac8a115be054b274}{CSUM\_OFFLOAD}}) != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01223}01223                 offload = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01224}01224 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01225}01225         \textcolor{keywordflow}{if} (offload != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01226}01226                 \textcolor{keyword}{struct }al\_eth\_meta\_data *meta = \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a9a6ef84fd79df36d64e670cc430743a7}{hal\_meta}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01227}01227 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01228}01228                 \textcolor{keywordflow}{if} (mss != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01229}01229                         hal\_pkt-\/>flags |= (AL\_ETH\_TX\_FLAGS\_TSO |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01230}01230                             AL\_ETH\_TX\_FLAGS\_L4\_CSUM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01231}01231                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01232}01232                         hal\_pkt-\/>flags |= (AL\_ETH\_TX\_FLAGS\_L4\_CSUM |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01233}01233                             AL\_ETH\_TX\_FLAGS\_L4\_PARTIAL\_CSUM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01234}01234 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01235}01235                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01236}01236 \textcolor{comment}{                 * Determine where frame payload starts.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01237}01237 \textcolor{comment}{                 * Jump over vlan headers if already present,}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01238}01238 \textcolor{comment}{                 * helpful for QinQ too.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01239}01239 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01240}01240                 eh = mtod(m, \textcolor{keyword}{struct} ether\_vlan\_header *);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01241}01241                 \textcolor{keywordflow}{if} (eh-\/>evl\_encap\_proto == htons(ETHERTYPE\_VLAN)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01242}01242                         etype = ntohs(eh-\/>evl\_proto);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01243}01243                         ehdrlen = ETHER\_HDR\_LEN + ETHER\_VLAN\_ENCAP\_LEN;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01244}01244                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01245}01245                         etype = ntohs(eh-\/>evl\_encap\_proto);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01246}01246                         ehdrlen = ETHER\_HDR\_LEN;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01247}01247                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01248}01248 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01249}01249                 \textcolor{keywordflow}{switch} (etype) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01250}01250 \textcolor{preprocessor}{\#ifdef INET}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01251}01251                 \textcolor{keywordflow}{case} ETHERTYPE\_IP:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01252}01252                         ip = (\textcolor{keyword}{struct }ip *)(m-\/>m\_data + ehdrlen);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01253}01253                         ip\_hlen = ip-\/>ip\_hl << 2;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01254}01254                         ipproto = ip-\/>ip\_p;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01255}01255                         hal\_pkt-\/>l3\_proto\_idx = AL\_ETH\_PROTO\_ID\_IPv4;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01256}01256                         th = (\textcolor{keyword}{struct }tcphdr *)((caddr\_t)ip + ip\_hlen);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01257}01257                         \textcolor{keywordflow}{if} (mss != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01258}01258                                 hal\_pkt-\/>flags |= AL\_ETH\_TX\_FLAGS\_IPV4\_L3\_CSUM;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01259}01259                         \textcolor{keywordflow}{if} (ipproto == IPPROTO\_TCP)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01260}01260                                 hal\_pkt-\/>l4\_proto\_idx = AL\_ETH\_PROTO\_ID\_TCP;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01261}01261                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01262}01262                                 hal\_pkt-\/>l4\_proto\_idx = AL\_ETH\_PROTO\_ID\_UDP;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01263}01263                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01264}01264 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* INET */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01265}01265 \textcolor{preprocessor}{\#ifdef INET6}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01266}01266                 \textcolor{keywordflow}{case} ETHERTYPE\_IPV6:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01267}01267                         ip6 = (\textcolor{keyword}{struct }ip6\_hdr *)(m-\/>m\_data + ehdrlen);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01268}01268                         hal\_pkt-\/>l3\_proto\_idx = AL\_ETH\_PROTO\_ID\_IPv6;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01269}01269                         ip\_hlen = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }ip6\_hdr);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01270}01270                         th = (\textcolor{keyword}{struct }tcphdr *)((caddr\_t)ip6 + ip\_hlen);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01271}01271                         ipproto = ip6-\/>ip6\_nxt;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01272}01272                         \textcolor{keywordflow}{if} (ipproto == IPPROTO\_TCP)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01273}01273                                 hal\_pkt-\/>l4\_proto\_idx = AL\_ETH\_PROTO\_ID\_TCP;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01274}01274                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01275}01275                                 hal\_pkt-\/>l4\_proto\_idx = AL\_ETH\_PROTO\_ID\_UDP;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01276}01276                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01277}01277 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* INET6 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01278}01278                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01279}01279                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01280}01280                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01281}01281 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01282}01282                 meta-\/>words\_valid = 4;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01283}01283                 meta-\/>l3\_header\_len = ip\_hlen;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01284}01284                 meta-\/>l3\_header\_offset = ehdrlen;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01285}01285                 \textcolor{keywordflow}{if} (th != NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01286}01286                         meta-\/>l4\_header\_len = th-\/>th\_off; \textcolor{comment}{/* this param needed only for TSO */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01287}01287                 meta-\/>mss\_idx\_sel = 0;                  \textcolor{comment}{/* check how to select MSS */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01288}01288                 meta-\/>mss\_val = mss;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01289}01289                 hal\_pkt-\/>meta = meta;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01290}01290         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01291}01291                 hal\_pkt-\/>meta = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01292}01292 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01293}01293 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01294}\mbox{\hyperlink{al__eth_8c_a2710a4b76fc0202d624cd6e6b8efd6db}{01294}} \textcolor{preprocessor}{\#define XMIT\_QUEUE\_TIMEOUT      100}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01295}01295 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01296}01296 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01297}\mbox{\hyperlink{al__eth_8c_a7ef2a46a7df22c86de7d0e003a40c96b}{01297}} \mbox{\hyperlink{al__eth_8c_a7ef2a46a7df22c86de7d0e003a40c96b}{al\_eth\_xmit\_mbuf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *tx\_ring, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01298}01298 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01299}01299         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__tx__buffer}{al\_eth\_tx\_buffer}} *tx\_info;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01300}01300         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01301}01301         \textcolor{keywordtype}{int} nsegs, a;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01302}01302         uint16\_t next\_to\_use;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01303}01303         bus\_dma\_segment\_t segs[AL\_ETH\_PKT\_MAX\_BUFS + 1];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01304}01304         \textcolor{keyword}{struct }al\_eth\_pkt *hal\_pkt;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01305}01305         \textcolor{keyword}{struct }al\_buf *al\_buf;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01306}01306         boolean\_t remap;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01307}01307 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01308}01308         \textcolor{comment}{/* Check if queue is ready */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01309}01309         \textcolor{keywordflow}{if} (unlikely(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a48cfea1f281cc9510bd6b700b9b40de1}{stall}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01310}01310                 \textcolor{keywordflow}{for} (a = 0; a < \mbox{\hyperlink{al__eth_8c_a2710a4b76fc0202d624cd6e6b8efd6db}{XMIT\_QUEUE\_TIMEOUT}}; a++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01311}01311                         \textcolor{keywordflow}{if} (al\_udma\_available\_get(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}}) >=}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01312}01312                             (\mbox{\hyperlink{al__eth_8h_a305e716297774e2fe97bd1181a281626}{AL\_ETH\_DEFAULT\_TX\_HW\_DESCS}} -\/}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01313}01313                             \mbox{\hyperlink{al__eth_8h_abda7afff3ca266b0baadb5dfe1e0801d}{AL\_ETH\_TX\_WAKEUP\_THRESH}})) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01314}01314                                 tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a48cfea1f281cc9510bd6b700b9b40de1}{stall}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01315}01315                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01316}01316                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01317}01317                         pause(\textcolor{stringliteral}{"{}stall"{}}, 1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01318}01318                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01319}01319                 \textcolor{keywordflow}{if} (a == \mbox{\hyperlink{al__eth_8c_a2710a4b76fc0202d624cd6e6b8efd6db}{XMIT\_QUEUE\_TIMEOUT}}) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01320}01320                         device\_printf(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01321}01321                             \textcolor{stringliteral}{"{}timeout waiting for queue \%d ready!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01322}01322                             tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a31a3db30074dd588079a8af06c3cafb5}{ring\_id}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01323}01323                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01324}01324                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01325}01325                         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01326}01326                             \textcolor{stringliteral}{"{}queue \%d is ready!\(\backslash\)n"{}}, tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a31a3db30074dd588079a8af06c3cafb5}{ring\_id}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01327}01327                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01328}01328         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01329}01329 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01330}01330         next\_to\_use = tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad5cc0f1b2aaaf4a65c491e9faf59788f}{next\_to\_use}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01331}01331         tx\_info = \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}}[next\_to\_use];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01332}01332         tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_ae5ba95eb67e6a3f4fe5b20b85db85e45}{m}} = m;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01333}01333         hal\_pkt = \&tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_a08e23584ad66ab8d43527e04223a211d}{hal\_pkt}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01334}01334 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01335}01335         \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01336}01336                 device\_printf(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}}, \textcolor{stringliteral}{"{}mbuf is NULL\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01337}01337                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01338}01338         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01339}01339 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01340}01340         remap = TRUE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01341}01341         \textcolor{comment}{/* Map packets for DMA */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01342}01342 retry:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01343}01343         error = bus\_dmamap\_load\_mbuf\_sg(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}}, tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_ac80f7a1ea9bdc83732a687667024c40d}{dma\_map}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01344}01344             m, segs, \&nsegs, BUS\_DMA\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01345}01345         \textcolor{keywordflow}{if} (\_\_predict\_false(error)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01346}01346                 \textcolor{keyword}{struct }mbuf *m\_new;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01347}01347 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01348}01348                 \textcolor{keywordflow}{if} (error == EFBIG) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01349}01349                         \textcolor{comment}{/* Try it again? -\/ one try */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01350}01350                         \textcolor{keywordflow}{if} (remap == TRUE) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01351}01351                                 remap = FALSE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01352}01352                                 m\_new = m\_defrag(m, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01353}01353                                 \textcolor{keywordflow}{if} (m\_new == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01354}01354                                         device\_printf(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01355}01355                                             \textcolor{stringliteral}{"{}failed to defrag mbuf\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01356}01356                                         \textcolor{keywordflow}{goto} exit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01357}01357                                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01358}01358                                 m = m\_new;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01359}01359                                 \textcolor{keywordflow}{goto} retry;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01360}01360                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01361}01361                                 device\_printf(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01362}01362                                     \textcolor{stringliteral}{"{}failed to map mbuf, error \%d\(\backslash\)n"{}}, error);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01363}01363                                 \textcolor{keywordflow}{goto} exit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01364}01364                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01365}01365                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01366}01366                         device\_printf(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01367}01367                             \textcolor{stringliteral}{"{}failed to map mbuf, error \%d\(\backslash\)n"{}}, error);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01368}01368                         \textcolor{keywordflow}{goto} exit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01369}01369                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01370}01370         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01371}01371 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01372}01372         \textcolor{comment}{/* set flags and meta data */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01373}01373         hal\_pkt-\/>flags = AL\_ETH\_TX\_FLAGS\_INT;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01374}01374         \mbox{\hyperlink{al__eth_8c_a94294a263e1c71756becdf2a7afd48d2}{al\_eth\_tx\_csum}}(tx\_ring, tx\_info, hal\_pkt, m);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01375}01375 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01376}01376         al\_buf = hal\_pkt-\/>bufs;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01377}01377         \textcolor{keywordflow}{for} (a = 0; a < nsegs; a++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01378}01378                 al\_buf-\/>addr = segs[a].ds\_addr;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01379}01379                 al\_buf-\/>len = segs[a].ds\_len;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01380}01380 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01381}01381                 al\_buf++;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01382}01382         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01383}01383 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01384}01384         hal\_pkt-\/>num\_of\_bufs = nsegs;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01385}01385 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01386}01386         \textcolor{comment}{/* prepare the packet's descriptors to dma engine */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01387}01387         tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_a1c73d50eb71ef3175c8a61121973d116}{tx\_descs}} = al\_eth\_tx\_pkt\_prepare(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}}, hal\_pkt);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01388}01388 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01389}01389         \textcolor{keywordflow}{if} (tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_a1c73d50eb71ef3175c8a61121973d116}{tx\_descs}} == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01390}01390                 \textcolor{keywordflow}{goto} exit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01391}01391 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01392}01392         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01393}01393 \textcolor{comment}{         * stop the queue when no more space available, the packet can have up}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01394}01394 \textcolor{comment}{         * to AL\_ETH\_PKT\_MAX\_BUFS + 1 buffers and a meta descriptor}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01395}01395 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01396}01396         \textcolor{keywordflow}{if} (unlikely(al\_udma\_available\_get(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}}) <}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01397}01397             (AL\_ETH\_PKT\_MAX\_BUFS + 2))) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01398}01398                 tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a48cfea1f281cc9510bd6b700b9b40de1}{stall}} = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01399}01399                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}}, \textcolor{stringliteral}{"{}stall, stopping queue \%d...\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01400}01400                     tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a31a3db30074dd588079a8af06c3cafb5}{ring\_id}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01401}01401                 al\_data\_memory\_barrier();}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01402}01402         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01403}01403 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01404}01404         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad5cc0f1b2aaaf4a65c491e9faf59788f}{next\_to\_use}} = \mbox{\hyperlink{al__eth_8h_a23821a8967f7347476acb0868e3d168c}{AL\_ETH\_TX\_RING\_IDX\_NEXT}}(tx\_ring, next\_to\_use);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01405}01405 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01406}01406         \textcolor{comment}{/* trigger the dma engine */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01407}01407         al\_eth\_tx\_dma\_action(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}}, tx\_info-\/>\mbox{\hyperlink{structal__eth__tx__buffer_a1c73d50eb71ef3175c8a61121973d116}{tx\_descs}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01408}01408         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01409}01409 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01410}01410 exit:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01411}01411         m\_freem(m);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01412}01412 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01413}01413 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01414}01414 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01415}\mbox{\hyperlink{al__eth_8c_a616df89fb45cf0c4ebd757c3fb55108e}{01415}} \mbox{\hyperlink{al__eth_8c_a616df89fb45cf0c4ebd757c3fb55108e}{al\_eth\_tx\_cmpl\_work}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} pending)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01416}01416 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01417}01417         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *tx\_ring = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01418}01418 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01419}01419         \textcolor{keywordflow}{if} (\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01420}01420                 tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab99bb436e440f15e1b74fd4d5e20b325}{cmpl\_is\_running}} = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01421}01421                 al\_data\_memory\_barrier();}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01422}01422         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01423}01423 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01424}01424         \mbox{\hyperlink{al__eth_8c_afa15c4485a50133a35fdafc93c4386ae}{al\_eth\_tx\_do\_cleanup}}(tx\_ring);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01425}01425 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01426}01426         \textcolor{keywordflow}{if} (\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01427}01427                 tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab99bb436e440f15e1b74fd4d5e20b325}{cmpl\_is\_running}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01428}01428                 al\_data\_memory\_barrier();}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01429}01429         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01430}01430         \textcolor{comment}{/* all work done, enable IRQs */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01431}01431         \mbox{\hyperlink{al__eth_8c_a95ad99d16fc637d848c639121d327a2d}{al\_eth\_irq\_config}}(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae949c612e54451dac7ce703f802eff02}{unmask\_reg\_offset}}, tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6112f4de9b1d2190c2147b8aa6fe6605}{unmask\_val}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01432}01432 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01433}01433 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01434}01434 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01435}\mbox{\hyperlink{al__eth_8c_abc872fb40598d7b30700c66d5d1c8c73}{01435}} \mbox{\hyperlink{al__eth_8c_abc872fb40598d7b30700c66d5d1c8c73}{al\_eth\_tx\_cmlp\_irq\_filter}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01436}01436 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01437}01437         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *tx\_ring = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01438}01438 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01439}01439         \textcolor{comment}{/* Interrupt should be auto-\/masked upon arrival */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01440}01440 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01441}01441         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}}, \textcolor{stringliteral}{"{}\%s for ring ID = \%d\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01442}01442             tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a31a3db30074dd588079a8af06c3cafb5}{ring\_id}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01443}01443 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01444}01444         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01445}01445 \textcolor{comment}{         * For napi, if work is not running, schedule it. Always schedule}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01446}01446 \textcolor{comment}{         * for casual (non-\/napi) packet handling.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01447}01447 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01448}01448         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} == 0) || (\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} \&\& tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab99bb436e440f15e1b74fd4d5e20b325}{cmpl\_is\_running}} == 0))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01449}01449                 taskqueue\_enqueue(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a75b559e2f8cdf073f28972021c991723}{cmpl\_tq}}, \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a42309f2f6ed3deb2bfe726fd8545f9dc}{cmpl\_task}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01450}01450 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01451}01451         \textcolor{comment}{/* Do not run bottom half */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01452}01452         \textcolor{keywordflow}{return} (FILTER\_HANDLED);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01453}01453 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01454}01454 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01455}01455 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01456}\mbox{\hyperlink{al__eth_8c_ae2b849d6e3ad00586013179baea9a007}{01456}} \mbox{\hyperlink{al__eth_8c_ae2b849d6e3ad00586013179baea9a007}{al\_eth\_rx\_recv\_irq\_filter}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01457}01457 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01458}01458         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *rx\_ring = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01459}01459 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01460}01460         \textcolor{comment}{/* Interrupt should be auto-\/masked upon arrival */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01461}01461 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01462}01462         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}}, \textcolor{stringliteral}{"{}\%s for ring ID = \%d\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01463}01463             rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a31a3db30074dd588079a8af06c3cafb5}{ring\_id}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01464}01464 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01465}01465         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01466}01466 \textcolor{comment}{         * For napi, if work is not running, schedule it. Always schedule}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01467}01467 \textcolor{comment}{         * for casual (non-\/napi) packet handling.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01468}01468 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01469}01469         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} == 0) || (\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} \&\& rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a1712001ae24f5eabc3946b5af6da4238}{enqueue\_is\_running}} == 0))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01470}01470                 taskqueue\_enqueue(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}}, \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad650c3a01cb7b0c8050fa3301cd31514}{enqueue\_task}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01471}01471 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01472}01472         \textcolor{comment}{/* Do not run bottom half */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01473}01473         \textcolor{keywordflow}{return} (FILTER\_HANDLED);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01474}01474 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01475}01475 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01476}01476 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01477}01477 \textcolor{comment}{ * al\_eth\_rx\_checksum -\/ indicate in mbuf if hw indicated a good cksum}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01478}01478 \textcolor{comment}{ * @adapter: structure containing adapter specific data}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01479}01479 \textcolor{comment}{ * @hal\_pkt: HAL structure for the packet}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01480}01480 \textcolor{comment}{ * @mbuf: mbuf currently being received and modified}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01481}01481 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01482}01482 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01483}\mbox{\hyperlink{al__eth_8c_ab90a455d877008ee1d915f38cc1307ca}{01483}} \mbox{\hyperlink{al__eth_8c_ab90a455d877008ee1d915f38cc1307ca}{al\_eth\_rx\_checksum}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01484}01484     \textcolor{keyword}{struct} al\_eth\_pkt *\mbox{\hyperlink{structal__eth__ring_a44df8a826671dba8453556038fedc263}{hal\_pkt}}, \textcolor{keyword}{struct} mbuf *mbuf)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01485}01485 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01486}01486 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01487}01487         \textcolor{comment}{/* if IPv4 and error */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01488}01488         \textcolor{keywordflow}{if} (unlikely((\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_capenable \& IFCAP\_RXCSUM) \&\&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01489}01489             (\mbox{\hyperlink{structal__eth__ring_a44df8a826671dba8453556038fedc263}{hal\_pkt}}-\/>l3\_proto\_idx == AL\_ETH\_PROTO\_ID\_IPv4) \&\&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01490}01490             (\mbox{\hyperlink{structal__eth__ring_a44df8a826671dba8453556038fedc263}{hal\_pkt}}-\/>flags \& AL\_ETH\_RX\_FLAGS\_L3\_CSUM\_ERR))) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01491}01491                 device\_printf(\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},\textcolor{stringliteral}{"{}rx ipv4 header checksum error\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01492}01492                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01493}01493         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01494}01494 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01495}01495         \textcolor{comment}{/* if IPv6 and error */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01496}01496         \textcolor{keywordflow}{if} (unlikely((\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_capenable \& IFCAP\_RXCSUM\_IPV6) \&\&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01497}01497             (\mbox{\hyperlink{structal__eth__ring_a44df8a826671dba8453556038fedc263}{hal\_pkt}}-\/>l3\_proto\_idx == AL\_ETH\_PROTO\_ID\_IPv6) \&\&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01498}01498             (\mbox{\hyperlink{structal__eth__ring_a44df8a826671dba8453556038fedc263}{hal\_pkt}}-\/>flags \& AL\_ETH\_RX\_FLAGS\_L3\_CSUM\_ERR))) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01499}01499                 device\_printf(\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},\textcolor{stringliteral}{"{}rx ipv6 header checksum error\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01500}01500                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01501}01501         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01502}01502 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01503}01503         \textcolor{comment}{/* if TCP/UDP */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01504}01504         \textcolor{keywordflow}{if} (likely((\mbox{\hyperlink{structal__eth__ring_a44df8a826671dba8453556038fedc263}{hal\_pkt}}-\/>l4\_proto\_idx == AL\_ETH\_PROTO\_ID\_TCP) ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01505}01505            (\mbox{\hyperlink{structal__eth__ring_a44df8a826671dba8453556038fedc263}{hal\_pkt}}-\/>l4\_proto\_idx == AL\_ETH\_PROTO\_ID\_UDP))) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01506}01506                 \textcolor{keywordflow}{if} (unlikely(\mbox{\hyperlink{structal__eth__ring_a44df8a826671dba8453556038fedc263}{hal\_pkt}}-\/>flags \& AL\_ETH\_RX\_FLAGS\_L4\_CSUM\_ERR)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01507}01507                         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}rx L4 checksum error\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01508}01508 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01509}01509                         \textcolor{comment}{/* TCP/UDP checksum error */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01510}01510                         mbuf-\/>m\_pkthdr.csum\_flags = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01511}01511                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01512}01512                         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}rx checksum correct\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01513}01513 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01514}01514                         \textcolor{comment}{/* IP Checksum Good */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01515}01515                         mbuf-\/>m\_pkthdr.csum\_flags = CSUM\_IP\_CHECKED;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01516}01516                         mbuf-\/>m\_pkthdr.csum\_flags |= CSUM\_IP\_VALID;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01517}01517                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01518}01518         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01519}01519 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01520}01520 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01521}01521 \textcolor{keyword}{static} \textcolor{keyword}{struct }mbuf*}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01522}\mbox{\hyperlink{al__eth_8c_a81dcbaf10e88b2428ef65a682a092c9f}{01522}} \mbox{\hyperlink{al__eth_8c_a81dcbaf10e88b2428ef65a682a092c9f}{al\_eth\_rx\_mbuf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01523}01523     \textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *rx\_ring, \textcolor{keyword}{struct} al\_eth\_pkt *hal\_pkt,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01524}01524     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} descs, uint16\_t *next\_to\_clean)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01525}01525 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01526}01526         \textcolor{keyword}{struct }mbuf *mbuf;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01527}01527         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__rx__buffer}{al\_eth\_rx\_buffer}} *rx\_info =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01528}01528             \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}}[*next\_to\_clean];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01529}01529         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} len;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01530}01530 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01531}01531         len = hal\_pkt-\/>bufs[0].len;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01532}01532         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}rx\_info \%p data \%p\(\backslash\)n"{}}, rx\_info,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01533}01533            rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01534}01534 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01535}01535         \textcolor{keywordflow}{if} (rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01536}01536                 *next\_to\_clean = \mbox{\hyperlink{al__eth_8h_aaf6283595203424ba0f62f6c1f7a03e9}{AL\_ETH\_RX\_RING\_IDX\_NEXT}}(rx\_ring,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01537}01537                     *next\_to\_clean);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01538}01538                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01539}01539         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01540}01540 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01541}01541         mbuf = rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01542}01542         mbuf-\/>m\_pkthdr.len = len;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01543}01543         mbuf-\/>m\_len = len;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01544}01544         mbuf-\/>m\_pkthdr.rcvif = rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a8a9759078e6781f292be7df95030fbc1}{netdev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01545}01545         mbuf-\/>m\_flags |= M\_PKTHDR;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01546}01546 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01547}01547         \textcolor{keywordflow}{if} (len <= adapter-\/>small\_copy\_len) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01548}01548                 \textcolor{keyword}{struct }mbuf *smbuf;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01549}01549                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}rx small packet. len \%d\(\backslash\)n"{}}, len);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01550}01550 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01551}01551                 \mbox{\hyperlink{al__eth_8c_a2900caecabc04076f8da8601ecfa2333}{AL\_RX\_LOCK}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01552}01552                 smbuf = m\_gethdr(M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01553}01553                 \mbox{\hyperlink{al__eth_8c_a7af538a4743ae7465b760fa0d0dab9d2}{AL\_RX\_UNLOCK}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01554}01554                 \textcolor{keywordflow}{if} (\_\_predict\_false(smbuf == NULL)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01555}01555                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}smbuf is NULL\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01556}01556                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01557}01557                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01558}01558 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01559}01559                 smbuf-\/>m\_data = smbuf-\/>m\_data + \mbox{\hyperlink{al__eth_8c_a1dc79a98b0e8d6c72afabc89cc59897c}{AL\_IP\_ALIGNMENT\_OFFSET}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01560}01560                 memcpy(smbuf-\/>m\_data, mbuf-\/>m\_data + \mbox{\hyperlink{al__eth_8c_a1dc79a98b0e8d6c72afabc89cc59897c}{AL\_IP\_ALIGNMENT\_OFFSET}}, len);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01561}01561 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01562}01562                 smbuf-\/>m\_len = len;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01563}01563                 smbuf-\/>m\_pkthdr.rcvif = rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a8a9759078e6781f292be7df95030fbc1}{netdev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01564}01564 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01565}01565                 \textcolor{comment}{/* first desc of a non-\/ps chain */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01566}01566                 smbuf-\/>m\_flags |= M\_PKTHDR;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01567}01567                 smbuf-\/>m\_pkthdr.len = smbuf-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01568}01568 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01569}01569                 *next\_to\_clean = \mbox{\hyperlink{al__eth_8h_aaf6283595203424ba0f62f6c1f7a03e9}{AL\_ETH\_RX\_RING\_IDX\_NEXT}}(rx\_ring,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01570}01570                     *next\_to\_clean);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01571}01571 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01572}01572                 \textcolor{keywordflow}{return} (smbuf);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01573}01573         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01574}01574         mbuf-\/>m\_data = mbuf-\/>m\_data + \mbox{\hyperlink{al__eth_8c_a1dc79a98b0e8d6c72afabc89cc59897c}{AL\_IP\_ALIGNMENT\_OFFSET}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01575}01575 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01576}01576         \textcolor{comment}{/* Unmap the buffer */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01577}01577         bus\_dmamap\_unload(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}}, rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_a00ff1e1715a99c7731fb3b2467e70c60}{dma\_map}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01578}01578 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01579}01579         rx\_info-\/>\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01580}01580         *next\_to\_clean = \mbox{\hyperlink{al__eth_8h_aaf6283595203424ba0f62f6c1f7a03e9}{AL\_ETH\_RX\_RING\_IDX\_NEXT}}(rx\_ring, *next\_to\_clean);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01581}01581 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01582}01582         \textcolor{keywordflow}{return} (mbuf);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01583}01583 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01584}01584 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01585}01585 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01586}\mbox{\hyperlink{al__eth_8c_a478c022f2a05ca7f4a359068ee92c028}{01586}} \mbox{\hyperlink{al__eth_8c_a478c022f2a05ca7f4a359068ee92c028}{al\_eth\_rx\_recv\_work}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} pending)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01587}01587 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01588}01588         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *rx\_ring = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01589}01589         \textcolor{keyword}{struct }mbuf *mbuf;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01590}01590         \textcolor{keyword}{struct }lro\_entry *queued;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01591}01591         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} qid = rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a31a3db30074dd588079a8af06c3cafb5}{ring\_id}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01592}01592         \textcolor{keyword}{struct }al\_eth\_pkt *hal\_pkt = \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a44df8a826671dba8453556038fedc263}{hal\_pkt}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01593}01593         uint16\_t next\_to\_clean = rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ade6cba10a94fcb42435b069e81d12c1e}{next\_to\_clean}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01594}01594         uint32\_t refill\_required;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01595}01595         uint32\_t refill\_actual;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01596}01596         uint32\_t do\_if\_input;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01597}01597 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01598}01598         \textcolor{keywordflow}{if} (\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01599}01599                 rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a1712001ae24f5eabc3946b5af6da4238}{enqueue\_is\_running}} = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01600}01600                 al\_data\_memory\_barrier();}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01601}01601         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01602}01602 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01603}01603         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01604}01604                 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} descs;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01605}01605 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01606}01606                 descs = al\_eth\_pkt\_rx(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}}, hal\_pkt);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01607}01607                 \textcolor{keywordflow}{if} (unlikely(descs == 0))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01608}01608                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01609}01609 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01610}01610                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}}, \textcolor{stringliteral}{"{}rx\_poll: q \%d got packet "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01611}01611                     \textcolor{stringliteral}{"{}from hal. descs \%d\(\backslash\)n"{}}, qid, descs);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01612}01612                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}}, \textcolor{stringliteral}{"{}rx\_poll: q \%d flags \%x. "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01613}01613                     \textcolor{stringliteral}{"{}l3 proto \%d l4 proto \%d\(\backslash\)n"{}}, qid, hal\_pkt-\/>flags,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01614}01614                     hal\_pkt-\/>l3\_proto\_idx, hal\_pkt-\/>l4\_proto\_idx);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01615}01615 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01616}01616                 \textcolor{comment}{/* ignore if detected dma or eth controller errors */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01617}01617                 \textcolor{keywordflow}{if} ((hal\_pkt-\/>flags \& (AL\_ETH\_RX\_ERROR |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01618}01618                     AL\_UDMA\_CDESC\_ERROR)) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01619}01619                         device\_printf(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}}, \textcolor{stringliteral}{"{}receive packet with error. "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01620}01620                             \textcolor{stringliteral}{"{}flags = 0x\%x\(\backslash\)n"{}}, hal\_pkt-\/>flags);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01621}01621                         next\_to\_clean = \mbox{\hyperlink{al__eth_8h_a9aff7fd164d3983cef82936bca8ea326}{AL\_ETH\_RX\_RING\_IDX\_ADD}}(rx\_ring,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01622}01622                             next\_to\_clean, descs);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01623}01623                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01624}01624                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01625}01625 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01626}01626                 \textcolor{comment}{/* allocate mbuf and fill it */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01627}01627                 mbuf = \mbox{\hyperlink{al__eth_8c_a81dcbaf10e88b2428ef65a682a092c9f}{al\_eth\_rx\_mbuf}}(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}, rx\_ring, hal\_pkt, descs,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01628}01628                     \&next\_to\_clean);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01629}01629 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01630}01630                 \textcolor{comment}{/* exit if we failed to retrieve a buffer */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01631}01631                 \textcolor{keywordflow}{if} (unlikely(mbuf == NULL)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01632}01632                         next\_to\_clean = \mbox{\hyperlink{al__eth_8h_a9aff7fd164d3983cef82936bca8ea326}{AL\_ETH\_RX\_RING\_IDX\_ADD}}(rx\_ring,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01633}01633                             next\_to\_clean, descs);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01634}01634                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01635}01635                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01636}01636 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01637}01637                 \textcolor{keywordflow}{if} (\_\_predict\_true(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a8a9759078e6781f292be7df95030fbc1}{netdev}}-\/>if\_capenable \& IFCAP\_RXCSUM ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01638}01638                     rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a8a9759078e6781f292be7df95030fbc1}{netdev}}-\/>if\_capenable \& IFCAP\_RXCSUM\_IPV6)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01639}01639                         \mbox{\hyperlink{al__eth_8c_ab90a455d877008ee1d915f38cc1307ca}{al\_eth\_rx\_checksum}}(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}, hal\_pkt, mbuf);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01640}01640                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01641}01641 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01642}01642                 mbuf-\/>m\_pkthdr.flowid = qid;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01643}01643                 M\_HASHTYPE\_SET(mbuf, M\_HASHTYPE\_OPAQUE);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01644}01644 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01645}01645                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01646}01646 \textcolor{comment}{                 * LRO is only for IP/TCP packets and TCP checksum of the packet}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01647}01647 \textcolor{comment}{                 * should be computed by hardware.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01648}01648 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01649}01649                 do\_if\_input = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01650}01650                 \textcolor{keywordflow}{if} ((rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae18e8b32f0e3bb7188686d448aaf8b1f}{lro\_enabled}} != 0) \&\&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01651}01651                     ((mbuf-\/>m\_pkthdr.csum\_flags \& CSUM\_IP\_VALID) != 0) \&\&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01652}01652                     hal\_pkt-\/>l4\_proto\_idx == AL\_ETH\_PROTO\_ID\_TCP) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01653}01653                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01654}01654 \textcolor{comment}{                         * Send to the stack if:}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01655}01655 \textcolor{comment}{                         *  -\/ LRO not enabled, or}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01656}01656 \textcolor{comment}{                         *  -\/ no LRO resources, or}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01657}01657 \textcolor{comment}{                         *  -\/ lro enqueue fails}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01658}01658 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01659}01659                         \textcolor{keywordflow}{if} (rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a7f064e251e30d4311b45a394edcbd458}{lro}}.lro\_cnt != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01660}01660                                 \textcolor{keywordflow}{if} (tcp\_lro\_rx(\&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a7f064e251e30d4311b45a394edcbd458}{lro}}, mbuf, 0) == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01661}01661                                         do\_if\_input = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01662}01662                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01663}01663                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01664}01664 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01665}01665                 \textcolor{keywordflow}{if} (do\_if\_input)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01666}01666                         (*rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a8a9759078e6781f292be7df95030fbc1}{netdev}}-\/>if\_input)(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a8a9759078e6781f292be7df95030fbc1}{netdev}}, mbuf);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01667}01667 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01668}01668         \} \textcolor{keywordflow}{while} (1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01669}01669 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01670}01670         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ade6cba10a94fcb42435b069e81d12c1e}{next\_to\_clean}} = next\_to\_clean;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01671}01671 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01672}01672         refill\_required = al\_udma\_available\_get(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ab2ba94d13c51b994b571857d7579919b}{dma\_q}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01673}01673         refill\_actual = \mbox{\hyperlink{al__eth_8c_aaa3addf3fccbe7093478867ea56156a2}{al\_eth\_refill\_rx\_bufs}}(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}, qid,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01674}01674             refill\_required);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01675}01675 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01676}01676         \textcolor{keywordflow}{if} (unlikely(refill\_actual < refill\_required)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01677}01677                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01678}01678                     \textcolor{stringliteral}{"{}\%s: not filling rx queue \%d\(\backslash\)n"{}}, \_\_func\_\_, qid);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01679}01679         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01680}01680 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01681}01681         \textcolor{keywordflow}{while} (((queued = LIST\_FIRST(\&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a7f064e251e30d4311b45a394edcbd458}{lro}}.lro\_active)) != NULL)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01682}01682                 LIST\_REMOVE(queued, next);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01683}01683                 tcp\_lro\_flush(\&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a7f064e251e30d4311b45a394edcbd458}{lro}}, queued);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01684}01684         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01685}01685 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01686}01686         \textcolor{keywordflow}{if} (\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01687}01687                 rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a1712001ae24f5eabc3946b5af6da4238}{enqueue\_is\_running}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01688}01688                 al\_data\_memory\_barrier();}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01689}01689         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01690}01690         \textcolor{comment}{/* unmask irq */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01691}01691         \mbox{\hyperlink{al__eth_8c_a95ad99d16fc637d848c639121d327a2d}{al\_eth\_irq\_config}}(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae949c612e54451dac7ce703f802eff02}{unmask\_reg\_offset}}, rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6112f4de9b1d2190c2147b8aa6fe6605}{unmask\_val}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01692}01692 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01693}01693 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01694}01694 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01695}\mbox{\hyperlink{al__eth_8c_a45c765bd1ad88ed2540ab0845cb4185e}{01695}} \mbox{\hyperlink{al__eth_8c_a45c765bd1ad88ed2540ab0845cb4185e}{al\_eth\_start\_xmit}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} pending)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01696}01696 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01697}01697         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *tx\_ring = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01698}01698         \textcolor{keyword}{struct }mbuf *mbuf;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01699}01699 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01700}01700         \textcolor{keywordflow}{if} (\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01701}01701                 tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a1712001ae24f5eabc3946b5af6da4238}{enqueue\_is\_running}} = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01702}01702                 al\_data\_memory\_barrier();}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01703}01703         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01704}01704 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01705}01705         \textcolor{keywordflow}{while} (1) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01706}01706                 mtx\_lock(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ac5132502d2fcc4253586b979dee0ee61}{br\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01707}01707                 mbuf = drbr\_dequeue(NULL, tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6a2de1b0f68a7ffb9c8213694267f960}{br}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01708}01708                 mtx\_unlock(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ac5132502d2fcc4253586b979dee0ee61}{br\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01709}01709 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01710}01710                 \textcolor{keywordflow}{if} (mbuf == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01711}01711                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01712}01712 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01713}01713                 \mbox{\hyperlink{al__eth_8c_a7ef2a46a7df22c86de7d0e003a40c96b}{al\_eth\_xmit\_mbuf}}(tx\_ring, mbuf);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01714}01714         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01715}01715 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01716}01716         \textcolor{keywordflow}{if} (\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01717}01717                 tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a1712001ae24f5eabc3946b5af6da4238}{enqueue\_is\_running}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01718}01718                 al\_data\_memory\_barrier();}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01719}01719                 \textcolor{keywordflow}{while} (1) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01720}01720                         mtx\_lock(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ac5132502d2fcc4253586b979dee0ee61}{br\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01721}01721                         mbuf = drbr\_dequeue(NULL, tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6a2de1b0f68a7ffb9c8213694267f960}{br}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01722}01722                         mtx\_unlock(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ac5132502d2fcc4253586b979dee0ee61}{br\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01723}01723                         \textcolor{keywordflow}{if} (mbuf == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01724}01724                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01725}01725                         \mbox{\hyperlink{al__eth_8c_a7ef2a46a7df22c86de7d0e003a40c96b}{al\_eth\_xmit\_mbuf}}(tx\_ring, mbuf);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01726}01726                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01727}01727         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01728}01728 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01729}01729 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01730}01730 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01731}\mbox{\hyperlink{al__eth_8c_a5592d7eb2b6453fe3e3373009d970a49}{01731}} \mbox{\hyperlink{al__eth_8c_a5592d7eb2b6453fe3e3373009d970a49}{al\_mq\_start}}(\textcolor{keyword}{struct} ifnet *ifp, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01732}01732 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01733}01733         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01734}01734         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *tx\_ring;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01735}01735         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01736}01736         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01737}01737 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01738}01738         \textcolor{comment}{/* Which queue to use */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01739}01739         \textcolor{keywordflow}{if} (M\_HASHTYPE\_GET(m) != M\_HASHTYPE\_NONE)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01740}01740                 i = m-\/>m\_pkthdr.flowid \% \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01741}01741         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01742}01742                 i = curcpu \% \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01743}01743 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01744}01744         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& (IFF\_DRV\_RUNNING|IFF\_DRV\_OACTIVE)) !=}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01745}01745             IFF\_DRV\_RUNNING) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01746}01746                 \textcolor{keywordflow}{return} (EFAULT);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01747}01747         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01748}01748 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01749}01749         tx\_ring = \&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a6e0fe16b81a9f8f2f2d67d15dc34e0a3}{tx\_ring}}[i];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01750}01750 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01751}01751         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}dgb start() -\/ assuming link is active, "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01752}01752             \textcolor{stringliteral}{"{}sending packet to queue \%d\(\backslash\)n"{}}, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01753}01753 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01754}01754         ret = drbr\_enqueue(ifp, tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6a2de1b0f68a7ffb9c8213694267f960}{br}}, m);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01755}01755 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01756}01756         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01757}01757 \textcolor{comment}{         * For napi, if work is not running, schedule it. Always schedule}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01758}01758 \textcolor{comment}{         * for casual (non-\/napi) packet handling.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01759}01759 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01760}01760         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} == 0) || ((\mbox{\hyperlink{al__eth_8c_ac4f7d18e46b1d06902681af7b620340f}{napi}} != 0) \&\& (tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a1712001ae24f5eabc3946b5af6da4238}{enqueue\_is\_running}} == 0)))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01761}01761                 taskqueue\_enqueue(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}}, \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad650c3a01cb7b0c8050fa3301cd31514}{enqueue\_task}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01762}01762 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01763}01763         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01764}01764 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01765}01765 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01766}01766 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01767}\mbox{\hyperlink{al__eth_8c_a4ccc23f856791228f9bc191c076517ba}{01767}} \mbox{\hyperlink{al__eth_8c_a4ccc23f856791228f9bc191c076517ba}{al\_qflush}}(\textcolor{keyword}{struct} ifnet * ifp)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01768}01768 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01769}01769 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01770}01770         \textcolor{comment}{/* unused */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01771}01771 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01772}01772 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01773}01773 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01774}\mbox{\hyperlink{al__eth_8c_a979b1abdb8772d29f8d25b3420916461}{01774}} \mbox{\hyperlink{al__eth_8c_a979b1abdb8772d29f8d25b3420916461}{al\_eth\_flow\_ctrl\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01775}01775 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01776}01776         uint8\_t default\_flow\_ctrl;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01777}01777 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01778}01778         default\_flow\_ctrl = \mbox{\hyperlink{al__eth_8h_a9dec2a3bfd799d5641cf0008cf9e461e}{AL\_ETH\_FLOW\_CTRL\_TX\_PAUSE}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01779}01779         default\_flow\_ctrl |= \mbox{\hyperlink{al__eth_8h_a90dd84361ce73c3e58f9ee1987bfe689}{AL\_ETH\_FLOW\_CTRL\_RX\_PAUSE}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01780}01780 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01781}01781         \mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_ae7a1dd4737878cab4f4816734c5d479e}{flow\_ctrl\_supported}} = default\_flow\_ctrl;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01782}01782 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01783}01783 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01784}01784 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01785}\mbox{\hyperlink{al__eth_8c_a8c69dce9ecd2d5e2c79a32c671061e14}{01785}} \mbox{\hyperlink{al__eth_8c_a8c69dce9ecd2d5e2c79a32c671061e14}{al\_eth\_flow\_ctrl\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01786}01786 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01787}01787         \textcolor{keyword}{struct }al\_eth\_flow\_control\_params *flow\_ctrl\_params;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01788}01788         uint8\_t active = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_a9a7da3f7159826898122b0aa1659f99c}{flow\_ctrl\_active}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01789}01789         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01790}01790 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01791}01791         flow\_ctrl\_params = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2e438655a0cae7548f4232017e3b1116}{flow\_ctrl\_params}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01792}01792 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01793}01793         flow\_ctrl\_params-\/>type = AL\_ETH\_FLOW\_CONTROL\_TYPE\_LINK\_PAUSE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01794}01794         flow\_ctrl\_params-\/>obay\_enable =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01795}01795             ((active \& \mbox{\hyperlink{al__eth_8h_a90dd84361ce73c3e58f9ee1987bfe689}{AL\_ETH\_FLOW\_CTRL\_RX\_PAUSE}}) != 0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01796}01796         flow\_ctrl\_params-\/>gen\_enable =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01797}01797             ((active \& \mbox{\hyperlink{al__eth_8h_a9dec2a3bfd799d5641cf0008cf9e461e}{AL\_ETH\_FLOW\_CTRL\_TX\_PAUSE}}) != 0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01798}01798 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01799}01799         flow\_ctrl\_params-\/>rx\_fifo\_th\_high = \mbox{\hyperlink{al__eth_8h_a82d0a7281a57048c216c88c3fea43221}{AL\_ETH\_FLOW\_CTRL\_RX\_FIFO\_TH\_HIGH}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01800}01800         flow\_ctrl\_params-\/>rx\_fifo\_th\_low = \mbox{\hyperlink{al__eth_8h_a4c2de82d79714b67d35b02240d2d66a5}{AL\_ETH\_FLOW\_CTRL\_RX\_FIFO\_TH\_LOW}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01801}01801         flow\_ctrl\_params-\/>quanta = \mbox{\hyperlink{al__eth_8h_a8c74e1ea1e1d834e659bfc2b6ce9a355}{AL\_ETH\_FLOW\_CTRL\_QUANTA}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01802}01802         flow\_ctrl\_params-\/>quanta\_th = \mbox{\hyperlink{al__eth_8h_a3e676f67dce5e44e746fe40532c29b92}{AL\_ETH\_FLOW\_CTRL\_QUANTA\_TH}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01803}01803 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01804}01804         \textcolor{comment}{/* map priority to queue index, queue id = priority/2 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01805}01805         \textcolor{keywordflow}{for} (i = 0; i < AL\_ETH\_FWD\_PRIO\_TABLE\_NUM; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01806}01806                 flow\_ctrl\_params-\/>prio\_q\_map[0][i] =  1 << (i >> 1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01807}01807 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01808}01808         al\_eth\_flow\_control\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, flow\_ctrl\_params);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01809}01809 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01810}01810         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01811}01811 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01812}01812 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01813}01813 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01814}\mbox{\hyperlink{al__eth_8c_ab914e5256390b10b6a865493f8c7dcf6}{01814}} \mbox{\hyperlink{al__eth_8c_ab914e5256390b10b6a865493f8c7dcf6}{al\_eth\_flow\_ctrl\_enable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01815}01815 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01816}01816 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01817}01817         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01818}01818 \textcolor{comment}{         * change the active configuration to the default / force by ethtool}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01819}01819 \textcolor{comment}{         * and call to configure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01820}01820 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01821}01821         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_a9a7da3f7159826898122b0aa1659f99c}{flow\_ctrl\_active}} =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01822}01822             adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_ae7a1dd4737878cab4f4816734c5d479e}{flow\_ctrl\_supported}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01823}01823 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01824}01824         \mbox{\hyperlink{al__eth_8c_a8c69dce9ecd2d5e2c79a32c671061e14}{al\_eth\_flow\_ctrl\_config}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01825}01825 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01826}01826 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01827}01827 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01828}\mbox{\hyperlink{al__eth_8c_a8e4d5913d2a2a93af126cff2b7aec8c7}{01828}} \mbox{\hyperlink{al__eth_8c_a8e4d5913d2a2a93af126cff2b7aec8c7}{al\_eth\_flow\_ctrl\_disable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01829}01829 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01830}01830 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01831}01831         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_a9a7da3f7159826898122b0aa1659f99c}{flow\_ctrl\_active}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01832}01832         \mbox{\hyperlink{al__eth_8c_a8c69dce9ecd2d5e2c79a32c671061e14}{al\_eth\_flow\_ctrl\_config}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01833}01833 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01834}01834 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01835}01835 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01836}\mbox{\hyperlink{al__eth_8c_aa782e32cbeab4cfa1b7f6cc9cda435c5}{01836}} \mbox{\hyperlink{al__eth_8c_aa782e32cbeab4cfa1b7f6cc9cda435c5}{al\_eth\_hw\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01837}01837 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01838}01838         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01839}01839 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01840}01840         rc = \mbox{\hyperlink{al__eth_8c_a40d600fd4d572b8f7014c8f236c17575}{al\_eth\_hw\_init\_adapter}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01841}01841         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01842}01842                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01843}01843 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01844}01844         rc = al\_eth\_mac\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01845}01845         \textcolor{keywordflow}{if} (rc < 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01846}01846                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s failed to configure mac!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01847}01847                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01848}01848                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01849}01849         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01850}01850 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01851}01851         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} == AL\_ETH\_MAC\_MODE\_SGMII) ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01852}01852             (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} == AL\_ETH\_MAC\_MODE\_RGMII \&\&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01853}01853              adapter-\/>\mbox{\hyperlink{structal__eth__adapter_af74de21d391c1e935d66d01d6bd84e88}{phy\_exist}} == FALSE)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01854}01854                 rc = al\_eth\_mac\_link\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01855}01855                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_a36d6423209bc7bff0d2b650e12ef218a}{force\_1000\_base\_x}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01856}01856                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_aec60f521153a3619ebd22fa8f796e889}{autoneg}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01857}01857                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_ad22b343b4f310bb0df2f60ff2ef69a10}{active\_speed}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01858}01858                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae1a8b96677caaf611b699b7fc63d71f1}{link\_config}}.\mbox{\hyperlink{structal__eth__link__config_afe914408ee1a68768d0ed2d4e4796e98}{active\_duplex}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01859}01859                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01860}01860                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01861}01861                             \textcolor{stringliteral}{"{}\%s failed to configure link parameters!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01862}01862                             \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01863}01863                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01864}01864                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01865}01865         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01866}01866 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01867}01867         rc = al\_eth\_mdio\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01868}01868             AL\_ETH\_MDIO\_TYPE\_CLAUSE\_22, TRUE \textcolor{comment}{/* shared\_mdio\_if */},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01869}01869             adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a104ebe54e16bd7801046c663aea2202a}{ref\_clk\_freq}}, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a49d70ef171a09e5897e80577386a1efb}{mdio\_freq}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01870}01870         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01871}01871                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s failed at mdio config!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01872}01872                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01873}01873                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01874}01874         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01875}01875 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01876}01876         \mbox{\hyperlink{al__eth_8c_a979b1abdb8772d29f8d25b3420916461}{al\_eth\_flow\_ctrl\_init}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01877}01877 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01878}01878         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01879}01879 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01880}01880 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01881}01881 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01882}\mbox{\hyperlink{al__eth_8c_ac9a2bde486c476eb96293250eb207519}{01882}} \mbox{\hyperlink{al__eth_8c_ac9a2bde486c476eb96293250eb207519}{al\_eth\_hw\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01883}01883 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01884}01884 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01885}01885         al\_eth\_mac\_stop(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01886}01886 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01887}01887         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01888}01888 \textcolor{comment}{         * wait till pending rx packets written and UDMA becomes idle,}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01889}01889 \textcolor{comment}{         * the MAC has \string~10KB fifo, 10us should be enought time for the}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01890}01890 \textcolor{comment}{         * UDMA to write to the memory}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01891}01891 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01892}01892         DELAY(10);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01893}01893 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01894}01894         al\_eth\_adapter\_stop(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01895}01895 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01896}01896         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a314e32b05cfee98d945e7f64a85ee279}{flags}} |= \mbox{\hyperlink{al__eth_8h_a6d661e69a714893677b87a3b80e2ba0e}{AL\_ETH\_FLAG\_RESET\_REQUESTED}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01897}01897 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01898}01898         \textcolor{comment}{/* disable flow ctrl to avoid pause packets*/}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01899}01899         \mbox{\hyperlink{al__eth_8c_a8e4d5913d2a2a93af126cff2b7aec8c7}{al\_eth\_flow\_ctrl\_disable}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01900}01900 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01901}01901         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01902}01902 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01903}01903 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01904}01904 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01905}01905 \textcolor{comment}{ * al\_eth\_intr\_intx\_all -\/ Legacy Interrupt Handler for all interrupts}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01906}01906 \textcolor{comment}{ * @irq: interrupt number}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01907}01907 \textcolor{comment}{ * @data: pointer to a network interface device structure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01908}01908 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01909}01909 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01910}\mbox{\hyperlink{al__eth_8c_a1ea12496565f1b9b478481c3742175ae}{01910}} \mbox{\hyperlink{al__eth_8c_a1ea12496565f1b9b478481c3742175ae}{al\_eth\_intr\_intx\_all}}(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01911}01911 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01912}01912         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = data;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01913}01913 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01914}01914         \textcolor{keyword}{struct }unit\_regs \_\_iomem *regs\_base =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01915}01915             (\textcolor{keyword}{struct }unit\_regs \_\_iomem *)adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01916}01916         uint32\_t reg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01917}01917 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01918}01918         reg = al\_udma\_iofic\_read\_cause(regs\_base, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01919}01919             AL\_INT\_GROUP\_A);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01920}01920         \textcolor{keywordflow}{if} (likely(reg))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01921}01921                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s group A cause \%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01922}01922                     \_\_func\_\_, reg);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01923}01923 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01924}01924         \textcolor{keywordflow}{if} (unlikely(reg \& AL\_INT\_GROUP\_A\_GROUP\_D\_SUM)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01925}01925                 \textcolor{keyword}{struct }al\_iofic\_grp\_ctrl \_\_iomem *sec\_ints\_base;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01926}01926                 uint32\_t cause\_d =  al\_udma\_iofic\_read\_cause(regs\_base,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01927}01927                     AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY, AL\_INT\_GROUP\_D);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01928}01928 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01929}01929                 sec\_ints\_base =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01930}01930                     \&regs\_base-\/>gen.interrupt\_regs.secondary\_iofic\_ctrl[0];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01931}01931                 \textcolor{keywordflow}{if} (cause\_d != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01932}01932                         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01933}01933                             \textcolor{stringliteral}{"{}got interrupt from group D. cause \%x\(\backslash\)n"{}}, cause\_d);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01934}01934 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01935}01935                         cause\_d = al\_iofic\_read\_cause(sec\_ints\_base,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01936}01936                             AL\_INT\_GROUP\_A);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01937}01937                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01938}01938                             \textcolor{stringliteral}{"{}secondary A cause \%x\(\backslash\)n"{}}, cause\_d);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01939}01939 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01940}01940                         cause\_d = al\_iofic\_read\_cause(sec\_ints\_base,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01941}01941                             AL\_INT\_GROUP\_B);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01942}01942 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01943}01943                         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01944}01944                             \textcolor{stringliteral}{"{}secondary B cause \%x\(\backslash\)n"{}}, cause\_d);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01945}01945                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01946}01946         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01947}01947         \textcolor{keywordflow}{if} ((reg \& AL\_INT\_GROUP\_A\_GROUP\_B\_SUM) != 0 ) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01948}01948                 uint32\_t cause\_b = al\_udma\_iofic\_read\_cause(regs\_base,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01949}01949                     AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY, AL\_INT\_GROUP\_B);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01950}01950                 \textcolor{keywordtype}{int} qid;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01951}01951                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}secondary B cause \%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01952}01952                     cause\_b);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01953}01953                 \textcolor{keywordflow}{for} (qid = 0; qid < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}}; qid++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01954}01954                         \textcolor{keywordflow}{if} (cause\_b \& (1 << qid)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01955}01955                                 \textcolor{comment}{/* mask */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01956}01956                                 al\_udma\_iofic\_mask(}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01957}01957                                     (\textcolor{keyword}{struct} unit\_regs \_\_iomem *)adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01958}01958                                     AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01959}01959                                     AL\_INT\_GROUP\_B, 1 << qid);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01960}01960                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01961}01961                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01962}01962         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01963}01963         \textcolor{keywordflow}{if} ((reg \& AL\_INT\_GROUP\_A\_GROUP\_C\_SUM) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01964}01964                 uint32\_t cause\_c = al\_udma\_iofic\_read\_cause(regs\_base,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01965}01965                     AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY, AL\_INT\_GROUP\_C);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01966}01966                 \textcolor{keywordtype}{int} qid;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01967}01967                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}secondary C cause \%x\(\backslash\)n"{}}, cause\_c);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01968}01968                 \textcolor{keywordflow}{for} (qid = 0; qid < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}}; qid++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01969}01969                         \textcolor{keywordflow}{if} ((cause\_c \& (1 << qid)) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01970}01970                                 al\_udma\_iofic\_mask(}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01971}01971                                     (\textcolor{keyword}{struct} unit\_regs \_\_iomem *)adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01972}01972                                     AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01973}01973                                     AL\_INT\_GROUP\_C, 1 << qid);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01974}01974                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01975}01975                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01976}01976         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01977}01977 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01978}01978         \mbox{\hyperlink{al__eth_8c_abc872fb40598d7b30700c66d5d1c8c73}{al\_eth\_tx\_cmlp\_irq\_filter}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a6e0fe16b81a9f8f2f2d67d15dc34e0a3}{tx\_ring}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01979}01979 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01980}01980         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01981}01981 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01982}01982 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01983}01983 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01984}\mbox{\hyperlink{al__eth_8c_a251b2b94aa48378505d6d663562c6274}{01984}} \mbox{\hyperlink{al__eth_8c_a251b2b94aa48378505d6d663562c6274}{al\_eth\_intr\_msix\_all}}(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01985}01985 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01986}01986         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = data;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01987}01987 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01988}01988         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01989}01989         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01990}01990 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01991}01991 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01992}01992 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01993}\mbox{\hyperlink{al__eth_8c_a3319ef11044697374c73f79e5856427e}{01993}} \mbox{\hyperlink{al__eth_8c_a3319ef11044697374c73f79e5856427e}{al\_eth\_intr\_msix\_mgmt}}(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01994}01994 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01995}01995         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = data;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01996}01996 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01997}01997         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01998}01998         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l01999}01999 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02000}02000 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02001}02001 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02002}\mbox{\hyperlink{al__eth_8c_acb8a01981f1530d75124f4b46acacebf}{02002}} \mbox{\hyperlink{al__eth_8c_acb8a01981f1530d75124f4b46acacebf}{al\_eth\_enable\_msix}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02003}02003 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02004}02004         \textcolor{keywordtype}{int} i, \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}}, rc, count;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02005}02005 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02006}02006         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02007}02007         \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} = 1 + adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}} + adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02008}02008 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02009}02009         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02010}02010             \textcolor{stringliteral}{"{}Try to enable MSIX, vector numbers = \%d\(\backslash\)n"{}}, \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02011}02011 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02012}02012         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}} = malloc(\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}}*\textcolor{keyword}{sizeof}(*adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02013}02013             M\_IFAL, M\_ZERO | M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02014}02014 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02015}02015         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02016}02016                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}failed to allocate"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02017}02017                     \textcolor{stringliteral}{"{} msix\_entries \%d\(\backslash\)n"{}}, \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02018}02018                 rc = ENOMEM;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02019}02019                 \textcolor{keywordflow}{goto} exit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02020}02020         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02021}02021 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02022}02022         \textcolor{comment}{/* management vector (GROUP\_A) @2*/}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02023}02023         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structmsix__entry_a500c3c26e9d6718e48a168e882c1ec14}{entry}} = 2;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02024}02024         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structmsix__entry_acaa137fef59bcdf23ab20f97ca08d5a2}{vector}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02025}02025 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02026}02026         \textcolor{comment}{/* rx queues start @3 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02027}02027         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02028}02028                 \textcolor{keywordtype}{int} irq\_idx = \mbox{\hyperlink{al__eth_8h_af8114f57542c8bfaad38f3df5fb70ccf}{AL\_ETH\_RXQ\_IRQ\_IDX}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02029}02029 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02030}02030                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[irq\_idx].\mbox{\hyperlink{structmsix__entry_a500c3c26e9d6718e48a168e882c1ec14}{entry}} = 3 + i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02031}02031                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[irq\_idx].\mbox{\hyperlink{structmsix__entry_acaa137fef59bcdf23ab20f97ca08d5a2}{vector}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02032}02032         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02033}02033         \textcolor{comment}{/* tx queues start @7 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02034}02034         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02035}02035                 \textcolor{keywordtype}{int} irq\_idx = \mbox{\hyperlink{al__eth_8h_ae8caa97f03e0397477a2f9b1b0da85f7}{AL\_ETH\_TXQ\_IRQ\_IDX}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02036}02036 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02037}02037                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[irq\_idx].\mbox{\hyperlink{structmsix__entry_a500c3c26e9d6718e48a168e882c1ec14}{entry}} = 3 +}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02038}02038                     \mbox{\hyperlink{al__eth_8h_a9e06ba148e6cb874ca79f8136af95230}{AL\_ETH\_MAX\_HW\_QUEUES}} + i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02039}02039                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[irq\_idx].\mbox{\hyperlink{structmsix__entry_acaa137fef59bcdf23ab20f97ca08d5a2}{vector}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02040}02040         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02041}02041 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02042}02042         count = \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} + 2; \textcolor{comment}{/* entries start from 2 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02043}02043         rc = pci\_alloc\_msix(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \&count);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02044}02044 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02045}02045         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02046}02046                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}failed to allocate MSIX "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02047}02047                     \textcolor{stringliteral}{"{}vectors \%d\(\backslash\)n"{}}, \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}}+2);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02048}02048                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}ret = \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02049}02049                 \textcolor{keywordflow}{goto} msix\_entries\_exit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02050}02050         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02051}02051 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02052}02052         \textcolor{keywordflow}{if} (count != \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} + 2) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02053}02053                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}failed to allocate all MSIX "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02054}02054                     \textcolor{stringliteral}{"{}vectors \%d, allocated \%d\(\backslash\)n"{}}, \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}}+2, count);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02055}02055                 rc = ENOSPC;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02056}02056                 \textcolor{keywordflow}{goto} msix\_entries\_exit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02057}02057         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02058}02058 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02059}02059         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}}; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02060}02060             adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[i].\mbox{\hyperlink{structmsix__entry_acaa137fef59bcdf23ab20f97ca08d5a2}{vector}} = 2 + 1 + i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02061}02061 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02062}02062         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}successfully enabled MSIX,"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02063}02063             \textcolor{stringliteral}{"{} vectors \%d\(\backslash\)n"{}}, \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02064}02064 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02065}02065         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} = \mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02066}02066         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a314e32b05cfee98d945e7f64a85ee279}{flags}} |= \mbox{\hyperlink{al__eth_8h_a359dc9443dc01da9eaa560f4c201eb3c}{AL\_ETH\_FLAG\_MSIX\_ENABLED}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02067}02067         \textcolor{keywordflow}{goto} exit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02068}02068 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02069}02069 msix\_entries\_exit:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02070}02070         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02071}02071         free(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}, M\_IFAL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02072}02072         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02073}02073 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02074}02074 exit:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02075}02075         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02076}02076 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02077}02077 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02078}02078 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02079}\mbox{\hyperlink{al__eth_8c_a46fc33b2ddcda7b233e08360463e8ecb}{02079}} \mbox{\hyperlink{al__eth_8c_a46fc33b2ddcda7b233e08360463e8ecb}{al\_eth\_setup\_int\_mode}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02080}02080 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02081}02081         \textcolor{keywordtype}{int} i, rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02082}02082 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02083}02083         rc = \mbox{\hyperlink{al__eth_8c_acb8a01981f1530d75124f4b46acacebf}{al\_eth\_enable\_msix}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02084}02084         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02085}02085                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}Failed to enable MSIX mode.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02086}02086                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02087}02087         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02088}02088 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02089}02089         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a5b0a5ee72f019f3bdc52698e0e0710b0}{irq\_vecs}} = max(1, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02090}02090         \textcolor{comment}{/* single INTX mode */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02091}02091         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} == 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02092}02092                 snprintf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a0e944e64d8c5f3495cba58a7609ff986}{name}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02093}02093                     \mbox{\hyperlink{al__eth_8h_a56b89e3471c54102bd836ba8014bd472}{AL\_ETH\_IRQNAME\_SIZE}}, \textcolor{stringliteral}{"{}al-\/eth-\/intx-\/all@pci:\%s"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02094}02094                     device\_get\_name(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02095}02095                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a1d73a99ae5bffbe334cee7afa276451f}{handler}} =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02096}02096                     \mbox{\hyperlink{al__eth_8c_a1ea12496565f1b9b478481c3742175ae}{al\_eth\_intr\_intx\_all}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02097}02097                 \textcolor{comment}{/* IRQ vector will be resolved from device resources */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02098}02098                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02099}02099                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_ae7cd98bdd0d6068b2aa7d0e6e0c94e90}{data}} = adapter;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02100}02100 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02101}02101                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}\%s and vector \%d \(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02102}02102                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02103}02103 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02104}02104                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02105}02105         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02106}02106         \textcolor{comment}{/* single MSI-\/X mode */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02107}02107         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} == 1) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02108}02108                 snprintf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a0e944e64d8c5f3495cba58a7609ff986}{name}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02109}02109                     \mbox{\hyperlink{al__eth_8h_a56b89e3471c54102bd836ba8014bd472}{AL\_ETH\_IRQNAME\_SIZE}}, \textcolor{stringliteral}{"{}al-\/eth-\/msix-\/all@pci:\%s"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02110}02110                     device\_get\_name(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02111}02111                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a1d73a99ae5bffbe334cee7afa276451f}{handler}} =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02112}02112                     \mbox{\hyperlink{al__eth_8c_a251b2b94aa48378505d6d663562c6274}{al\_eth\_intr\_msix\_all}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02113}02113                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}} =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02114}02114                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structmsix__entry_acaa137fef59bcdf23ab20f97ca08d5a2}{vector}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02115}02115                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_ae7cd98bdd0d6068b2aa7d0e6e0c94e90}{data}} = adapter;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02116}02116 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02117}02117                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02118}02118         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02119}02119         \textcolor{comment}{/* MSI-\/X per queue */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02120}02120         snprintf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a0e944e64d8c5f3495cba58a7609ff986}{name}}, \mbox{\hyperlink{al__eth_8h_a56b89e3471c54102bd836ba8014bd472}{AL\_ETH\_IRQNAME\_SIZE}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02121}02121             \textcolor{stringliteral}{"{}al-\/eth-\/msix-\/mgmt@pci:\%s"{}}, device\_get\_name(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02122}02122         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a1d73a99ae5bffbe334cee7afa276451f}{handler}} = \mbox{\hyperlink{al__eth_8c_a3319ef11044697374c73f79e5856427e}{al\_eth\_intr\_msix\_mgmt}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02123}02123 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02124}02124         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_ae7cd98bdd0d6068b2aa7d0e6e0c94e90}{data}} = adapter;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02125}02125         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}} =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02126}02126             adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[\mbox{\hyperlink{al__eth_8h_ad8599675e9edc622b49264cb277d7160}{AL\_ETH\_MGMT\_IRQ\_IDX}}].\mbox{\hyperlink{structmsix__entry_acaa137fef59bcdf23ab20f97ca08d5a2}{vector}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02127}02127 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02128}02128         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02129}02129                 \textcolor{keywordtype}{int} irq\_idx = \mbox{\hyperlink{al__eth_8h_af8114f57542c8bfaad38f3df5fb70ccf}{AL\_ETH\_RXQ\_IRQ\_IDX}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02130}02130 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02131}02131                 snprintf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[irq\_idx].\mbox{\hyperlink{structal__eth__irq_a0e944e64d8c5f3495cba58a7609ff986}{name}}, \mbox{\hyperlink{al__eth_8h_a56b89e3471c54102bd836ba8014bd472}{AL\_ETH\_IRQNAME\_SIZE}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02132}02132                     \textcolor{stringliteral}{"{}al-\/eth-\/rx-\/comp-\/\%d@pci:\%s"{}}, i,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02133}02133                     device\_get\_name(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02134}02134                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[irq\_idx].\mbox{\hyperlink{structal__eth__irq_a1d73a99ae5bffbe334cee7afa276451f}{handler}} = \mbox{\hyperlink{al__eth_8c_ae2b849d6e3ad00586013179baea9a007}{al\_eth\_rx\_recv\_irq\_filter}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02135}02135                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[irq\_idx].\mbox{\hyperlink{structal__eth__irq_ae7cd98bdd0d6068b2aa7d0e6e0c94e90}{data}} = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a83f78b04e69b907725a5f79e5b1de1af}{rx\_ring}}[i];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02136}02136                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[irq\_idx].\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}} =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02137}02137                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[irq\_idx].\mbox{\hyperlink{structmsix__entry_acaa137fef59bcdf23ab20f97ca08d5a2}{vector}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02138}02138         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02139}02139 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02140}02140         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02141}02141                 \textcolor{keywordtype}{int} irq\_idx = \mbox{\hyperlink{al__eth_8h_ae8caa97f03e0397477a2f9b1b0da85f7}{AL\_ETH\_TXQ\_IRQ\_IDX}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02142}02142 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02143}02143                 snprintf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[irq\_idx].\mbox{\hyperlink{structal__eth__irq_a0e944e64d8c5f3495cba58a7609ff986}{name}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02144}02144                     \mbox{\hyperlink{al__eth_8h_a56b89e3471c54102bd836ba8014bd472}{AL\_ETH\_IRQNAME\_SIZE}}, \textcolor{stringliteral}{"{}al-\/eth-\/tx-\/comp-\/\%d@pci:\%s"{}}, i,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02145}02145                     device\_get\_name(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02146}02146                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[irq\_idx].\mbox{\hyperlink{structal__eth__irq_a1d73a99ae5bffbe334cee7afa276451f}{handler}} = \mbox{\hyperlink{al__eth_8c_abc872fb40598d7b30700c66d5d1c8c73}{al\_eth\_tx\_cmlp\_irq\_filter}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02147}02147                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[irq\_idx].\mbox{\hyperlink{structal__eth__irq_ae7cd98bdd0d6068b2aa7d0e6e0c94e90}{data}} = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a6e0fe16b81a9f8f2f2d67d15dc34e0a3}{tx\_ring}}[i];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02148}02148                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[irq\_idx].\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}} =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02149}02149                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}[irq\_idx].\mbox{\hyperlink{structmsix__entry_acaa137fef59bcdf23ab20f97ca08d5a2}{vector}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02150}02150         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02151}02151 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02152}02152         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02153}02153 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02154}02154 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02155}02155 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02156}\mbox{\hyperlink{al__eth_8c_a26b3f592c33ee4eb14142ad4d0a1a610}{02156}} \mbox{\hyperlink{al__eth_8c_a26b3f592c33ee4eb14142ad4d0a1a610}{\_\_al\_eth\_free\_irq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02157}02157 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02158}02158         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__irq}{al\_eth\_irq}} *irq;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02159}02159         \textcolor{keywordtype}{int} i, rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02160}02160 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02161}02161         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a5b0a5ee72f019f3bdc52698e0e0710b0}{irq\_vecs}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02162}02162                 irq = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[i];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02163}02163                 \textcolor{keywordflow}{if} (irq-\/>\mbox{\hyperlink{structal__eth__irq_a209ac1c08429b5ea32004add61ddc61c}{requested}} != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02164}02164                         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}tear down irq: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02165}02165                             irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02166}02166                         rc = bus\_teardown\_intr(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02167}02167                             irq-\/>\mbox{\hyperlink{structal__eth__irq_ae93aa125ceb9d797da75ff9dd6c7120a}{cookie}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02168}02168                         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02169}02169                                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}failed to tear "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02170}02170                                     \textcolor{stringliteral}{"{}down irq: \%d\(\backslash\)n"{}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02171}02171                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02172}02172                 irq-\/>\mbox{\hyperlink{structal__eth__irq_a209ac1c08429b5ea32004add61ddc61c}{requested}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02173}02173         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02174}02174 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02175}02175 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02176}02176 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02177}\mbox{\hyperlink{al__eth_8c_a8c5a6284fcc731ea9957c6371be0ff62}{02177}} \mbox{\hyperlink{al__eth_8c_a8c5a6284fcc731ea9957c6371be0ff62}{al\_eth\_free\_irq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02178}02178 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02179}02179         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__irq}{al\_eth\_irq}} *irq;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02180}02180         \textcolor{keywordtype}{int} i, rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02181}02181 \textcolor{preprocessor}{\#ifdef CONFIG\_RFS\_ACCEL}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02182}02182         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} >= 1) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02183}02183                 free\_irq\_cpu\_rmap(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>rx\_cpu\_rmap);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02184}02184                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>rx\_cpu\_rmap = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02185}02185         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02186}02186 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02187}02187 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02188}02188         \mbox{\hyperlink{al__eth_8c_a26b3f592c33ee4eb14142ad4d0a1a610}{\_\_al\_eth\_free\_irq}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02189}02189 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02190}02190         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a5b0a5ee72f019f3bdc52698e0e0710b0}{irq\_vecs}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02191}02191                 irq = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[i];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02192}02192                 \textcolor{keywordflow}{if} (irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}} == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02193}02193                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02194}02194                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}release resource irq: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02195}02195                     irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02196}02196                 rc = bus\_release\_resource(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, SYS\_RES\_IRQ, irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02197}02197                     irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02198}02198                 irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02199}02199                 \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02200}02200                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}dev has no parent while "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02201}02201                             \textcolor{stringliteral}{"{}releasing res for irq: \%d\(\backslash\)n"{}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02202}02202         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02203}02203 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02204}02204         pci\_release\_msi(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02205}02205 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02206}02206         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a314e32b05cfee98d945e7f64a85ee279}{flags}} \&= \string~AL\_ETH\_FLAG\_MSIX\_ENABLED;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02207}02207 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02208}02208         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02209}02209         free(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}}, M\_IFAL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02210}02210         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a4c5f6a2748dc5f3dd1c0fbf34113ce14}{msix\_entries}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02211}02211 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02212}02212 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02213}02213 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02214}\mbox{\hyperlink{al__eth_8c_adab8e61340d2b5b0d374698d4f5a239b}{02214}} \mbox{\hyperlink{al__eth_8c_adab8e61340d2b5b0d374698d4f5a239b}{al\_eth\_request\_irq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02215}02215 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02216}02216         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02217}02217         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__irq}{al\_eth\_irq}} *irq;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02218}02218         \textcolor{keywordtype}{int} rc = 0, i, v;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02219}02219 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02220}02220         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a314e32b05cfee98d945e7f64a85ee279}{flags}} \& \mbox{\hyperlink{al__eth_8h_a359dc9443dc01da9eaa560f4c201eb3c}{AL\_ETH\_FLAG\_MSIX\_ENABLED}}) != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02221}02221                 flags = RF\_ACTIVE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02222}02222         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02223}02223                 flags = RF\_ACTIVE | RF\_SHAREABLE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02224}02224 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02225}02225         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a5b0a5ee72f019f3bdc52698e0e0710b0}{irq\_vecs}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02226}02226                 irq = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[i];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02227}02227 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02228}02228                 \textcolor{keywordflow}{if} (irq-\/>\mbox{\hyperlink{structal__eth__irq_a209ac1c08429b5ea32004add61ddc61c}{requested}} != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02229}02229                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02230}02230 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02231}02231                 irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}} = bus\_alloc\_resource\_any(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, SYS\_RES\_IRQ,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02232}02232                     \&irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}}, flags);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02233}02233                 \textcolor{keywordflow}{if} (irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02234}02234                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}could not allocate "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02235}02235                             \textcolor{stringliteral}{"{}irq vector=\%d\(\backslash\)n"{}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02236}02236                         rc = ENXIO;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02237}02237                         \textcolor{keywordflow}{goto} exit\_res;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02238}02238                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02239}02239 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02240}02240                 \textcolor{keywordflow}{if} ((rc = bus\_setup\_intr(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02241}02241                     INTR\_TYPE\_NET | INTR\_MPSAFE, irq-\/>\mbox{\hyperlink{structal__eth__irq_a1d73a99ae5bffbe334cee7afa276451f}{handler}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02242}02242                     NULL, irq-\/>\mbox{\hyperlink{structal__eth__irq_ae7cd98bdd0d6068b2aa7d0e6e0c94e90}{data}}, \&irq-\/>\mbox{\hyperlink{structal__eth__irq_ae93aa125ceb9d797da75ff9dd6c7120a}{cookie}})) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02243}02243                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}failed to register "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02244}02244                             \textcolor{stringliteral}{"{}interrupt handler for irq \%ju: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02245}02245                             (uintmax\_t)rman\_get\_start(irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}}), rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02246}02246                         \textcolor{keywordflow}{goto} exit\_intr;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02247}02247                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02248}02248                 irq-\/>\mbox{\hyperlink{structal__eth__irq_a209ac1c08429b5ea32004add61ddc61c}{requested}} = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02249}02249         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02250}02250         \textcolor{keywordflow}{goto} exit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02251}02251 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02252}02252 exit\_intr:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02253}02253         v = i -\/ 1; \textcolor{comment}{/* -\/1 because we omit the operation that failed */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02254}02254         \textcolor{keywordflow}{while} (v-\/-\/ >= 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02255}02255                 \textcolor{keywordtype}{int} bti;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02256}02256                 irq = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[v];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02257}02257                 bti = bus\_teardown\_intr(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_ae93aa125ceb9d797da75ff9dd6c7120a}{cookie}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02258}02258                 \textcolor{keywordflow}{if} (bti != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02259}02259                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}failed to tear "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02260}02260                             \textcolor{stringliteral}{"{}down irq: \%d\(\backslash\)n"{}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02261}02261                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02262}02262 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02263}02263                 irq-\/>\mbox{\hyperlink{structal__eth__irq_a209ac1c08429b5ea32004add61ddc61c}{requested}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02264}02264                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}exit\_intr: releasing irq \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02265}02265                     irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02266}02266         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02267}02267 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02268}02268 exit\_res:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02269}02269         v = i -\/ 1; \textcolor{comment}{/* -\/1 because we omit the operation that failed */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02270}02270         \textcolor{keywordflow}{while} (v-\/-\/ >= 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02271}02271                 \textcolor{keywordtype}{int} brr;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02272}02272                 irq = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a288d720d0014e36c116d5a56c50d6ec2}{irq\_tbl}}[v];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02273}02273                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}exit\_res: releasing resource"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02274}02274                     \textcolor{stringliteral}{"{} for irq \%d\(\backslash\)n"{}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02275}02275                 brr = bus\_release\_resource(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, SYS\_RES\_IRQ,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02276}02276                     irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02277}02277                 \textcolor{keywordflow}{if} (brr != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02278}02278                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}dev has no parent while "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02279}02279                             \textcolor{stringliteral}{"{}releasing res for irq: \%d\(\backslash\)n"{}}, irq-\/>\mbox{\hyperlink{structal__eth__irq_a6a2af1d458f603209b53700549dbdc26}{vector}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02280}02280                 irq-\/>\mbox{\hyperlink{structal__eth__irq_a06ef50d5bc4187831d91592093698fd4}{res}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02281}02281         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02282}02282 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02283}02283 exit:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02284}02284         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02285}02285 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02286}02286 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02294}02294 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02295}\mbox{\hyperlink{al__eth_8c_a30f0af2e544afddf3677b7bfd5dc533d}{02295}} \mbox{\hyperlink{al__eth_8c_a30f0af2e544afddf3677b7bfd5dc533d}{al\_eth\_setup\_tx\_resources}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, \textcolor{keywordtype}{int} qid)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02296}02296 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02297}02297         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *tx\_ring = \&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a6e0fe16b81a9f8f2f2d67d15dc34e0a3}{tx\_ring}}[qid];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02298}02298         device\_t \mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}} = tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02299}02299         \textcolor{keyword}{struct }al\_udma\_q\_params *q\_params = \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae2b8ff9e46bd5a4c0a67d3c716f73709}{q\_params}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02300}02300         \textcolor{keywordtype}{int} size;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02301}02301         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02302}02302 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02303}02303         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ac6c6cc2942cd87bfe2b75260962b4602}{up}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02304}02304                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02305}02305 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02306}02306         size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__tx__buffer}{al\_eth\_tx\_buffer}}) * tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a3c47474a76c859d5ec14de965da4686f}{sw\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02307}02307 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02308}02308         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}} = malloc(size, M\_IFAL, M\_ZERO | M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02309}02309         \textcolor{keywordflow}{if} (tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}} == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02310}02310                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02311}02311 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02312}02312         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6cfbd9982109cbab45c069785bec69de}{descs\_size}} = tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a4d86ee27da993c0640244b55bd246e55}{hw\_count}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{union }al\_udma\_desc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02313}02313         q\_params-\/>size = tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a4d86ee27da993c0640244b55bd246e55}{hw\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02314}02314 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02315}02315         ret = \mbox{\hyperlink{al__eth_8c_ae39cd17fbd365e3cfc5ac498e8034804}{al\_dma\_alloc\_coherent}}(dev, \&q\_params-\/>desc\_phy\_base\_tag,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02316}02316             (bus\_dmamap\_t *)\&q\_params-\/>desc\_phy\_base\_map,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02317}02317             (bus\_addr\_t *)\&q\_params-\/>desc\_phy\_base,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02318}02318             (\textcolor{keywordtype}{void}**)\&q\_params-\/>desc\_base, tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6cfbd9982109cbab45c069785bec69de}{descs\_size}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02319}02319         \textcolor{keywordflow}{if} (ret != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02320}02320                 device\_printf(dev, \textcolor{stringliteral}{"{}failed to al\_dma\_alloc\_coherent,"{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02321}02321                     \textcolor{stringliteral}{"{} ret = \%d\(\backslash\)n"{}}, ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02322}02322                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02323}02323         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02324}02324 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02325}02325         \textcolor{keywordflow}{if} (q\_params-\/>desc\_base == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02326}02326                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02327}02327 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02328}02328         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(dev, \textcolor{stringliteral}{"{}Initializing ring queues \%d\(\backslash\)n"{}}, qid);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02329}02329 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02330}02330         \textcolor{comment}{/* Allocate Ring Queue */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02331}02331         mtx\_init(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ac5132502d2fcc4253586b979dee0ee61}{br\_mtx}}, \textcolor{stringliteral}{"{}AlRingMtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02332}02332         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6a2de1b0f68a7ffb9c8213694267f960}{br}} = buf\_ring\_alloc(\mbox{\hyperlink{al__eth_8c_acebf7d87114307d0b777faa6287f7df7}{AL\_BR\_SIZE}}, M\_DEVBUF, M\_WAITOK,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02333}02333             \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ac5132502d2fcc4253586b979dee0ee61}{br\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02334}02334         \textcolor{keywordflow}{if} (tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6a2de1b0f68a7ffb9c8213694267f960}{br}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02335}02335                 device\_printf(dev, \textcolor{stringliteral}{"{}Critical Failure setting up buf ring\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02336}02336                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02337}02337         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02338}02338 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02339}02339         \textcolor{comment}{/* Allocate taskqueues */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02340}02340         TASK\_INIT(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad650c3a01cb7b0c8050fa3301cd31514}{enqueue\_task}}, 0, \mbox{\hyperlink{al__eth_8c_a45c765bd1ad88ed2540ab0845cb4185e}{al\_eth\_start\_xmit}}, tx\_ring);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02341}02341         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}} = taskqueue\_create\_fast(\textcolor{stringliteral}{"{}al\_tx\_enque"{}}, M\_NOWAIT,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02342}02342             taskqueue\_thread\_enqueue, \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02343}02343         taskqueue\_start\_threads(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}}, 1, PI\_NET, \textcolor{stringliteral}{"{}\%s txeq"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02344}02344             device\_get\_nameunit(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02345}02345         TASK\_INIT(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a42309f2f6ed3deb2bfe726fd8545f9dc}{cmpl\_task}}, 0, \mbox{\hyperlink{al__eth_8c_a616df89fb45cf0c4ebd757c3fb55108e}{al\_eth\_tx\_cmpl\_work}}, tx\_ring);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02346}02346         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a75b559e2f8cdf073f28972021c991723}{cmpl\_tq}} = taskqueue\_create\_fast(\textcolor{stringliteral}{"{}al\_tx\_cmpl"{}}, M\_NOWAIT,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02347}02347             taskqueue\_thread\_enqueue, \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a75b559e2f8cdf073f28972021c991723}{cmpl\_tq}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02348}02348         taskqueue\_start\_threads(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a75b559e2f8cdf073f28972021c991723}{cmpl\_tq}}, 1, PI\_REALTIME, \textcolor{stringliteral}{"{}\%s txcq"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02349}02349             device\_get\_nameunit(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02350}02350 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02351}02351         \textcolor{comment}{/* Setup DMA descriptor areas. */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02352}02352         ret = bus\_dma\_tag\_create(bus\_get\_dma\_tag(dev),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02353}02353             1, 0,                       \textcolor{comment}{/* alignment, bounds */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02354}02354             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* lowaddr */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02355}02355             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* highaddr */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02356}02356             NULL, NULL,                 \textcolor{comment}{/* filter, filterarg */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02357}02357             \mbox{\hyperlink{al__eth_8c_ae33c0bc2a31b08ec0c1f79581ccf68ae}{AL\_TSO\_SIZE}},             \textcolor{comment}{/* maxsize */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02358}02358             AL\_ETH\_PKT\_MAX\_BUFS,        \textcolor{comment}{/* nsegments */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02359}02359             PAGE\_SIZE,                  \textcolor{comment}{/* maxsegsize */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02360}02360             0,                          \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02361}02361             NULL,                       \textcolor{comment}{/* lockfunc */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02362}02362             NULL,                       \textcolor{comment}{/* lockfuncarg */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02363}02363             \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02364}02364 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02365}02365         \textcolor{keywordflow}{if} (ret != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02366}02366                 device\_printf(dev,\textcolor{stringliteral}{"{}Unable to allocate dma\_buf\_tag, ret = \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02367}02367                     ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02368}02368                 \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02369}02369         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02370}02370 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02371}02371         \textcolor{keywordflow}{for} (size = 0; size < tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a3c47474a76c859d5ec14de965da4686f}{sw\_count}}; size++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02372}02372                 ret = bus\_dmamap\_create(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}}, 0,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02373}02373                     \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__tx__buffer_ac80f7a1ea9bdc83732a687667024c40d}{dma\_map}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02374}02374                 \textcolor{keywordflow}{if} (ret != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02375}02375                         device\_printf(dev, \textcolor{stringliteral}{"{}Unable to map DMA TX "{}}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02376}02376                             \textcolor{stringliteral}{"{}buffer memory [iter=\%d]\(\backslash\)n"{}}, size);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02377}02377                         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02378}02378                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02379}02379         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02380}02380 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02381}02381         \textcolor{comment}{/* completion queue not used for tx */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02382}02382         q\_params-\/>cdesc\_base = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02383}02383         \textcolor{comment}{/* size in bytes of the udma completion ring descriptor */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02384}02384         q\_params-\/>cdesc\_size = 8;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02385}02385         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad5cc0f1b2aaaf4a65c491e9faf59788f}{next\_to\_use}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02386}02386         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ade6cba10a94fcb42435b069e81d12c1e}{next\_to\_clean}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02387}02387 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02388}02388         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02389}02389 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02390}02390 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02391}02391 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02392}02392 \textcolor{comment}{ * al\_eth\_free\_tx\_resources -\/ Free Tx Resources per Queue}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02393}02393 \textcolor{comment}{ * @adapter: network interface device structure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02394}02394 \textcolor{comment}{ * @qid: queue index}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02395}02395 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02396}02396 \textcolor{comment}{ * Free all transmit software resources}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02397}02397 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02398}02398 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02399}\mbox{\hyperlink{al__eth_8c_a8dda8e45efbf83a79ae5e9a365a1ebe6}{02399}} \mbox{\hyperlink{al__eth_8c_a8dda8e45efbf83a79ae5e9a365a1ebe6}{al\_eth\_free\_tx\_resources}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, \textcolor{keywordtype}{int} qid)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02400}02400 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02401}02401         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *tx\_ring = \&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a6e0fe16b81a9f8f2f2d67d15dc34e0a3}{tx\_ring}}[qid];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02402}02402         \textcolor{keyword}{struct }al\_udma\_q\_params *q\_params = \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae2b8ff9e46bd5a4c0a67d3c716f73709}{q\_params}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02403}02403         \textcolor{keywordtype}{int} size;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02404}02404 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02405}02405         \textcolor{comment}{/* At this point interrupts' handlers must be deactivated */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02406}02406         \textcolor{keywordflow}{while} (taskqueue\_cancel(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a75b559e2f8cdf073f28972021c991723}{cmpl\_tq}}, \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a42309f2f6ed3deb2bfe726fd8545f9dc}{cmpl\_task}}, NULL))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02407}02407                 taskqueue\_drain(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a75b559e2f8cdf073f28972021c991723}{cmpl\_tq}}, \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a42309f2f6ed3deb2bfe726fd8545f9dc}{cmpl\_task}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02408}02408 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02409}02409         taskqueue\_free(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a75b559e2f8cdf073f28972021c991723}{cmpl\_tq}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02410}02410         \textcolor{keywordflow}{while} (taskqueue\_cancel(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02411}02411             \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad650c3a01cb7b0c8050fa3301cd31514}{enqueue\_task}}, NULL)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02412}02412                 taskqueue\_drain(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}}, \&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad650c3a01cb7b0c8050fa3301cd31514}{enqueue\_task}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02413}02413         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02414}02414 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02415}02415         taskqueue\_free(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02416}02416 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02417}02417         \textcolor{keywordflow}{if} (tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6a2de1b0f68a7ffb9c8213694267f960}{br}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02418}02418                 drbr\_flush(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}, tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6a2de1b0f68a7ffb9c8213694267f960}{br}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02419}02419                 buf\_ring\_free(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6a2de1b0f68a7ffb9c8213694267f960}{br}}, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02420}02420         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02421}02421 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02422}02422         \textcolor{keywordflow}{for} (size = 0; size < tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a3c47474a76c859d5ec14de965da4686f}{sw\_count}}; size++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02423}02423                 m\_freem(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__tx__buffer_ae5ba95eb67e6a3f4fe5b20b85db85e45}{m}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02424}02424                 tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__tx__buffer_ae5ba95eb67e6a3f4fe5b20b85db85e45}{m}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02425}02425 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02426}02426                 bus\_dmamap\_unload(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02427}02427                     tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__tx__buffer_ac80f7a1ea9bdc83732a687667024c40d}{dma\_map}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02428}02428                 bus\_dmamap\_destroy(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02429}02429                     tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__tx__buffer_ac80f7a1ea9bdc83732a687667024c40d}{dma\_map}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02430}02430         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02431}02431         bus\_dma\_tag\_destroy(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02432}02432 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02433}02433         free(tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}}, M\_IFAL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02434}02434         tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a0f4dfb9030f1fc790d0a19717d5dc7e4}{tx\_buffer\_info}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02435}02435 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02436}02436         mtx\_destroy(\&tx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ac5132502d2fcc4253586b979dee0ee61}{br\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02437}02437 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02438}02438         \textcolor{comment}{/* if not set, then don't free */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02439}02439         \textcolor{keywordflow}{if} (q\_params-\/>desc\_base == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02440}02440                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02441}02441 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02442}02442         \mbox{\hyperlink{al__eth_8c_a57f113fa4f2c26198ad53eb26f987fff}{al\_dma\_free\_coherent}}(q\_params-\/>desc\_phy\_base\_tag,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02443}02443             q\_params-\/>desc\_phy\_base\_map, q\_params-\/>desc\_base);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02444}02444 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02445}02445         q\_params-\/>desc\_base = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02446}02446 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02447}02447 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02448}02448 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02449}02449 \textcolor{comment}{ * al\_eth\_free\_all\_tx\_resources -\/ Free Tx Resources for All Queues}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02450}02450 \textcolor{comment}{ * @adapter: board private structure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02451}02451 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02452}02452 \textcolor{comment}{ * Free all transmit software resources}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02453}02453 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02454}02454 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02455}\mbox{\hyperlink{al__eth_8c_a9b45dc6dd204875884171a48a56c3201}{02455}} \mbox{\hyperlink{al__eth_8c_a9b45dc6dd204875884171a48a56c3201}{al\_eth\_free\_all\_tx\_resources}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02456}02456 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02457}02457         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02458}02458 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02459}02459         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}}; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02460}02460                 \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a6e0fe16b81a9f8f2f2d67d15dc34e0a3}{tx\_ring}}[i].\mbox{\hyperlink{structal__eth__ring_ae2b8ff9e46bd5a4c0a67d3c716f73709}{q\_params}}.desc\_base)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02461}02461                         \mbox{\hyperlink{al__eth_8c_a8dda8e45efbf83a79ae5e9a365a1ebe6}{al\_eth\_free\_tx\_resources}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02462}02462 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02463}02463 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02464}02464 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02465}02465 \textcolor{comment}{ * al\_eth\_setup\_rx\_resources -\/ allocate Rx resources (Descriptors)}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02466}02466 \textcolor{comment}{ * @adapter: network interface device structure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02467}02467 \textcolor{comment}{ * @qid: queue index}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02468}02468 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02469}02469 \textcolor{comment}{ * Returns 0 on success, negative on failure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02470}02470 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02471}02471 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02472}\mbox{\hyperlink{al__eth_8c_a61aee2e95e32a18004566984826f384d}{02472}} \mbox{\hyperlink{al__eth_8c_a61aee2e95e32a18004566984826f384d}{al\_eth\_setup\_rx\_resources}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} qid)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02473}02473 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02474}02474         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *rx\_ring = \&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a83f78b04e69b907725a5f79e5b1de1af}{rx\_ring}}[qid];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02475}02475         device\_t \mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}} = rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a861b308e32703469cfbb002e4e4abffc}{dev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02476}02476         \textcolor{keyword}{struct }al\_udma\_q\_params *q\_params = \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae2b8ff9e46bd5a4c0a67d3c716f73709}{q\_params}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02477}02477         \textcolor{keywordtype}{int} size;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02478}02478         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02479}02479 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02480}02480         size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__rx__buffer}{al\_eth\_rx\_buffer}}) * rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a3c47474a76c859d5ec14de965da4686f}{sw\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02481}02481 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02482}02482         \textcolor{comment}{/* alloc extra element so in rx path we can always prefetch rx\_info + 1 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02483}02483         size += 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02484}02484 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02485}02485         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}} = malloc(size, M\_IFAL, M\_ZERO | M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02486}02486         \textcolor{keywordflow}{if} (rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}} == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02487}02487                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02488}02488 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02489}02489         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6cfbd9982109cbab45c069785bec69de}{descs\_size}} = rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a4d86ee27da993c0640244b55bd246e55}{hw\_count}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{union }al\_udma\_desc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02490}02490         q\_params-\/>size = rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a4d86ee27da993c0640244b55bd246e55}{hw\_count}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02491}02491 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02492}02492         ret = \mbox{\hyperlink{al__eth_8c_ae39cd17fbd365e3cfc5ac498e8034804}{al\_dma\_alloc\_coherent}}(dev, \&q\_params-\/>desc\_phy\_base\_tag,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02493}02493             \&q\_params-\/>desc\_phy\_base\_map,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02494}02494             (bus\_addr\_t *)\&q\_params-\/>desc\_phy\_base,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02495}02495             (\textcolor{keywordtype}{void}**)\&q\_params-\/>desc\_base, rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a6cfbd9982109cbab45c069785bec69de}{descs\_size}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02496}02496 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02497}02497         \textcolor{keywordflow}{if} ((q\_params-\/>desc\_base == NULL) || (ret != 0))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02498}02498                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02499}02499 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02500}02500         \textcolor{comment}{/* size in bytes of the udma completion ring descriptor */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02501}02501         q\_params-\/>cdesc\_size = 16;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02502}02502         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a63d3c45c3a6fbfea6da2320c16d31289}{cdescs\_size}} = rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a4d86ee27da993c0640244b55bd246e55}{hw\_count}} * q\_params-\/>cdesc\_size;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02503}02503         ret = \mbox{\hyperlink{al__eth_8c_ae39cd17fbd365e3cfc5ac498e8034804}{al\_dma\_alloc\_coherent}}(dev, \&q\_params-\/>cdesc\_phy\_base\_tag,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02504}02504             \&q\_params-\/>cdesc\_phy\_base\_map,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02505}02505             (bus\_addr\_t *)\&q\_params-\/>cdesc\_phy\_base,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02506}02506             (\textcolor{keywordtype}{void}**)\&q\_params-\/>cdesc\_base, rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a63d3c45c3a6fbfea6da2320c16d31289}{cdescs\_size}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02507}02507 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02508}02508         \textcolor{keywordflow}{if} ((q\_params-\/>cdesc\_base == NULL) || (ret != 0))}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02509}02509                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02510}02510 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02511}02511         \textcolor{comment}{/* Allocate taskqueues */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02512}02512         NET\_TASK\_INIT(\&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad650c3a01cb7b0c8050fa3301cd31514}{enqueue\_task}}, 0, \mbox{\hyperlink{al__eth_8c_a478c022f2a05ca7f4a359068ee92c028}{al\_eth\_rx\_recv\_work}}, rx\_ring);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02513}02513         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}} = taskqueue\_create\_fast(\textcolor{stringliteral}{"{}al\_rx\_enque"{}}, M\_NOWAIT,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02514}02514             taskqueue\_thread\_enqueue, \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02515}02515         taskqueue\_start\_threads(\&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}}, 1, PI\_NET, \textcolor{stringliteral}{"{}\%s rxeq"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02516}02516             device\_get\_nameunit(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02517}02517 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02518}02518         \textcolor{comment}{/* Setup DMA descriptor areas. */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02519}02519         ret = bus\_dma\_tag\_create(bus\_get\_dma\_tag(dev),}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02520}02520             1, 0,                       \textcolor{comment}{/* alignment, bounds */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02521}02521             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* lowaddr */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02522}02522             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* highaddr */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02523}02523             NULL, NULL,                 \textcolor{comment}{/* filter, filterarg */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02524}02524             \mbox{\hyperlink{al__eth_8c_ae33c0bc2a31b08ec0c1f79581ccf68ae}{AL\_TSO\_SIZE}},             \textcolor{comment}{/* maxsize */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02525}02525             1,                          \textcolor{comment}{/* nsegments */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02526}02526             \mbox{\hyperlink{al__eth_8c_ae33c0bc2a31b08ec0c1f79581ccf68ae}{AL\_TSO\_SIZE}},             \textcolor{comment}{/* maxsegsize */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02527}02527             0,                          \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02528}02528             NULL,                       \textcolor{comment}{/* lockfunc */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02529}02529             NULL,                       \textcolor{comment}{/* lockfuncarg */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02530}02530             \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02531}02531 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02532}02532         \textcolor{keywordflow}{if} (ret != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02533}02533                 device\_printf(dev,\textcolor{stringliteral}{"{}Unable to allocate RX dma\_buf\_tag\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02534}02534                 \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02535}02535         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02536}02536 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02537}02537         \textcolor{keywordflow}{for} (size = 0; size < rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a3c47474a76c859d5ec14de965da4686f}{sw\_count}}; size++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02538}02538                 ret = bus\_dmamap\_create(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}}, 0,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02539}02539                     \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__rx__buffer_a00ff1e1715a99c7731fb3b2467e70c60}{dma\_map}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02540}02540                 \textcolor{keywordflow}{if} (ret != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02541}02541                         device\_printf(dev,\textcolor{stringliteral}{"{}Unable to map DMA RX buffer memory\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02542}02542                         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02543}02543                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02544}02544         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02545}02545 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02546}02546         \textcolor{comment}{/* Zero out the descriptor ring */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02547}02547         memset(q\_params-\/>cdesc\_base, 0, rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a63d3c45c3a6fbfea6da2320c16d31289}{cdescs\_size}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02548}02548 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02549}02549         \textcolor{comment}{/* Create LRO for the ring */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02550}02550         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_capenable \& IFCAP\_LRO) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02551}02551                 \textcolor{keywordtype}{int} err = tcp\_lro\_init(\&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a7f064e251e30d4311b45a394edcbd458}{lro}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02552}02552                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02553}02553                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02554}02554                             \textcolor{stringliteral}{"{}LRO[\%d] Initialization failed!\(\backslash\)n"{}}, qid);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02555}02555                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02556}02556                         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02557}02557                             \textcolor{stringliteral}{"{}RX Soft LRO[\%d] Initialized\(\backslash\)n"{}}, qid);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02558}02558                         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae18e8b32f0e3bb7188686d448aaf8b1f}{lro\_enabled}} = TRUE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02559}02559                         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a7f064e251e30d4311b45a394edcbd458}{lro}}.ifp = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02560}02560                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02561}02561         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02562}02562 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02563}02563         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ade6cba10a94fcb42435b069e81d12c1e}{next\_to\_clean}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02564}02564         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad5cc0f1b2aaaf4a65c491e9faf59788f}{next\_to\_use}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02565}02565 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02566}02566         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02567}02567 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02568}02568 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02569}02569 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02570}02570 \textcolor{comment}{ * al\_eth\_free\_rx\_resources -\/ Free Rx Resources}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02571}02571 \textcolor{comment}{ * @adapter: network interface device structure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02572}02572 \textcolor{comment}{ * @qid: queue index}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02573}02573 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02574}02574 \textcolor{comment}{ * Free all receive software resources}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02575}02575 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02576}02576 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02577}\mbox{\hyperlink{al__eth_8c_af593bde03c1d077c42cd1787bbeffd66}{02577}} \mbox{\hyperlink{al__eth_8c_af593bde03c1d077c42cd1787bbeffd66}{al\_eth\_free\_rx\_resources}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} qid)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02578}02578 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02579}02579         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__ring}{al\_eth\_ring}} *rx\_ring = \&\mbox{\hyperlink{structal__eth__ring_af293b59b16db0b0e71d7f9742eb0527a}{adapter}}-\/>\mbox{\hyperlink{structal__eth__adapter_a83f78b04e69b907725a5f79e5b1de1af}{rx\_ring}}[qid];}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02580}02580         \textcolor{keyword}{struct }al\_udma\_q\_params *q\_params = \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae2b8ff9e46bd5a4c0a67d3c716f73709}{q\_params}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02581}02581         \textcolor{keywordtype}{int} size;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02582}02582 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02583}02583         \textcolor{comment}{/* At this point interrupts' handlers must be deactivated */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02584}02584         \textcolor{keywordflow}{while} (taskqueue\_cancel(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02585}02585             \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad650c3a01cb7b0c8050fa3301cd31514}{enqueue\_task}}, NULL)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02586}02586                 taskqueue\_drain(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}}, \&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ad650c3a01cb7b0c8050fa3301cd31514}{enqueue\_task}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02587}02587         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02588}02588 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02589}02589         taskqueue\_free(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a5001adedf6f4c3d5fe343cb030378a7c}{enqueue\_tq}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02590}02590 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02591}02591         \textcolor{keywordflow}{for} (size = 0; size < rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a3c47474a76c859d5ec14de965da4686f}{sw\_count}}; size++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02592}02592                 m\_freem(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02593}02593                 rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__rx__buffer_ae65b9b98dc9a85ddfa233b3e0511ed24}{m}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02594}02594                 bus\_dmamap\_unload(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02595}02595                     rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__rx__buffer_a00ff1e1715a99c7731fb3b2467e70c60}{dma\_map}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02596}02596                 bus\_dmamap\_destroy(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02597}02597                     rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}}[size].\mbox{\hyperlink{structal__eth__rx__buffer_a00ff1e1715a99c7731fb3b2467e70c60}{dma\_map}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02598}02598         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02599}02599         bus\_dma\_tag\_destroy(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a879de4f8e2d40a7e84f19ec803a801cf}{dma\_buf\_tag}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02600}02600 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02601}02601         free(rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}}, M\_IFAL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02602}02602         rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_ae885263ab84195c8a10b57370730590e}{rx\_buffer\_info}} = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02603}02603 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02604}02604         \textcolor{comment}{/* if not set, then don't free */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02605}02605         \textcolor{keywordflow}{if} (q\_params-\/>desc\_base == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02606}02606                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02607}02607 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02608}02608         \mbox{\hyperlink{al__eth_8c_a57f113fa4f2c26198ad53eb26f987fff}{al\_dma\_free\_coherent}}(q\_params-\/>desc\_phy\_base\_tag,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02609}02609             q\_params-\/>desc\_phy\_base\_map, q\_params-\/>desc\_base);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02610}02610 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02611}02611         q\_params-\/>desc\_base = NULL;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02612}02612 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02613}02613         \textcolor{comment}{/* if not set, then don't free */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02614}02614         \textcolor{keywordflow}{if} (q\_params-\/>cdesc\_base == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02615}02615                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02616}02616 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02617}02617         \mbox{\hyperlink{al__eth_8c_a57f113fa4f2c26198ad53eb26f987fff}{al\_dma\_free\_coherent}}(q\_params-\/>cdesc\_phy\_base\_tag,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02618}02618             q\_params-\/>cdesc\_phy\_base\_map, q\_params-\/>cdesc\_base);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02619}02619 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02620}02620         q\_params-\/>cdesc\_phy\_base = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02621}02621 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02622}02622         \textcolor{comment}{/* Free LRO resources */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02623}02623         tcp\_lro\_free(\&rx\_ring-\/>\mbox{\hyperlink{structal__eth__ring_a7f064e251e30d4311b45a394edcbd458}{lro}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02624}02624 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02625}02625 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02626}02626 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02627}02627 \textcolor{comment}{ * al\_eth\_free\_all\_rx\_resources -\/ Free Rx Resources for All Queues}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02628}02628 \textcolor{comment}{ * @adapter: board private structure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02629}02629 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02630}02630 \textcolor{comment}{ * Free all receive software resources}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02631}02631 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02632}02632 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02633}\mbox{\hyperlink{al__eth_8c_a2f417956a9b9a75ead7be3ea8bef5614}{02633}} \mbox{\hyperlink{al__eth_8c_a2f417956a9b9a75ead7be3ea8bef5614}{al\_eth\_free\_all\_rx\_resources}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02634}02634 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02635}02635         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02636}02636 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02637}02637         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}}; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02638}02638                 \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a83f78b04e69b907725a5f79e5b1de1af}{rx\_ring}}[i].\mbox{\hyperlink{structal__eth__ring_ae2b8ff9e46bd5a4c0a67d3c716f73709}{q\_params}}.desc\_base != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02639}02639                         \mbox{\hyperlink{al__eth_8c_af593bde03c1d077c42cd1787bbeffd66}{al\_eth\_free\_rx\_resources}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02640}02640 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02641}02641 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02642}02642 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02643}02643 \textcolor{comment}{ * al\_eth\_setup\_all\_rx\_resources -\/ allocate all queues Rx resources}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02644}02644 \textcolor{comment}{ * @adapter: board private structure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02645}02645 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02646}02646 \textcolor{comment}{ * Return 0 on success, negative on failure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02647}02647 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02648}02648 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02649}\mbox{\hyperlink{al__eth_8c_a3476efe5e5f3140aa8abffdd41a663e7}{02649}} \mbox{\hyperlink{al__eth_8c_a3476efe5e5f3140aa8abffdd41a663e7}{al\_eth\_setup\_all\_rx\_resources}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02650}02650 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02651}02651         \textcolor{keywordtype}{int} i, rc = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02652}02652 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02653}02653         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02654}02654                 rc = \mbox{\hyperlink{al__eth_8c_a61aee2e95e32a18004566984826f384d}{al\_eth\_setup\_rx\_resources}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02655}02655                 \textcolor{keywordflow}{if} (rc == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02656}02656                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02657}02657 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02658}02658                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}Allocation for Rx Queue \%u failed\(\backslash\)n"{}}, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02659}02659                 \textcolor{keywordflow}{goto} err\_setup\_rx;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02660}02660         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02661}02661         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02662}02662 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02663}02663 err\_setup\_rx:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02664}02664         \textcolor{comment}{/* rewind the index freeing the rings as we go */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02665}02665         \textcolor{keywordflow}{while} (i-\/-\/)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02666}02666                 \mbox{\hyperlink{al__eth_8c_af593bde03c1d077c42cd1787bbeffd66}{al\_eth\_free\_rx\_resources}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02667}02667         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02668}02668 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02669}02669 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02670}02670 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02671}02671 \textcolor{comment}{ * al\_eth\_setup\_all\_tx\_resources -\/ allocate all queues Tx resources}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02672}02672 \textcolor{comment}{ * @adapter: private structure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02673}02673 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02674}02674 \textcolor{comment}{ * Return 0 on success, negative on failure}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02675}02675 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02676}02676 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02677}\mbox{\hyperlink{al__eth_8c_ac67e42c8c29de5af98b1498a5e2ddb50}{02677}} \mbox{\hyperlink{al__eth_8c_ac67e42c8c29de5af98b1498a5e2ddb50}{al\_eth\_setup\_all\_tx\_resources}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02678}02678 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02679}02679         \textcolor{keywordtype}{int} i, rc = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02680}02680 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02681}02681         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02682}02682                 rc = \mbox{\hyperlink{al__eth_8c_a30f0af2e544afddf3677b7bfd5dc533d}{al\_eth\_setup\_tx\_resources}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02683}02683                 \textcolor{keywordflow}{if} (rc == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02684}02684                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02685}02685 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02686}02686                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02687}02687                     \textcolor{stringliteral}{"{}Allocation for Tx Queue \%u failed\(\backslash\)n"{}}, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02688}02688                 \textcolor{keywordflow}{goto} err\_setup\_tx;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02689}02689         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02690}02690 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02691}02691         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02692}02692 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02693}02693 err\_setup\_tx:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02694}02694         \textcolor{comment}{/* rewind the index freeing the rings as we go */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02695}02695         \textcolor{keywordflow}{while} (i-\/-\/)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02696}02696                 \mbox{\hyperlink{al__eth_8c_a8dda8e45efbf83a79ae5e9a365a1ebe6}{al\_eth\_free\_tx\_resources}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02697}02697 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02698}02698         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02699}02699 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02700}02700 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02701}02701 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02702}\mbox{\hyperlink{al__eth_8c_a3f593239934c1006efd8483343311c99}{02702}} \mbox{\hyperlink{al__eth_8c_a3f593239934c1006efd8483343311c99}{al\_eth\_disable\_int\_sync}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02703}02703 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02704}02704 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02705}02705         \textcolor{comment}{/* disable forwarding interrupts from eth through pci end point */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02706}02706         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98a01564e7eed37e58991cc530b148efed4}{ALPINE\_FPGA\_NIC}}) ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02707}02707             (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98a27bdc8e2bbd4f4a3fed70b6d2bb45a4d}{ALPINE\_NIC}})) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02708}02708                 \mbox{\hyperlink{al__eth_8c_aba4ec50b0803da6b352d5bbab0a54a2e}{al\_eth\_forward\_int\_config}}((uint32\_t*)adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab5779e54ea1ceef98f3f8558028f044c}{internal\_pcie\_base}} +}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02709}02709                     \mbox{\hyperlink{al__eth_8c_a1d9ce96c3f6412c9379f02dfe4093a2a}{AL\_REG\_OFFSET\_FORWARD\_INTR}}, \mbox{\hyperlink{al__eth_8c_ad3a15208b4fb266dd9a6bb6865dfb3c4}{AL\_DIS\_FORWARD\_INTR}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02710}02710         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02711}02711 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02712}02712         \textcolor{comment}{/* mask hw interrupts */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02713}02713         \mbox{\hyperlink{al__eth_8c_a30afd1f945df82686f9856c32ea67843}{al\_eth\_interrupts\_mask}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02714}02714 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02715}02715 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02716}02716 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02717}\mbox{\hyperlink{al__eth_8c_a7e28ed28b9af55a378069d705f2adf88}{02717}} \mbox{\hyperlink{al__eth_8c_a7e28ed28b9af55a378069d705f2adf88}{al\_eth\_interrupts\_unmask}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02718}02718 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02719}02719         uint32\_t group\_a\_mask = AL\_INT\_GROUP\_A\_GROUP\_D\_SUM; \textcolor{comment}{/* enable group D summery */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02720}02720         uint32\_t group\_b\_mask = (1 << adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}}) -\/ 1;\textcolor{comment}{/* bit per Rx q*/}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02721}02721         uint32\_t group\_c\_mask = (1 << adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}}) -\/ 1;\textcolor{comment}{/* bit per Tx q*/}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02722}02722         uint32\_t group\_d\_mask = 3 << 8;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02723}02723         \textcolor{keyword}{struct }unit\_regs \_\_iomem *regs\_base =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02724}02724             (\textcolor{keyword}{struct }unit\_regs \_\_iomem *)adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02725}02725 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02726}02726         if (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a221a2cc22627d2b4b7045a16c914ff91}{int\_mode}} == AL\_IOFIC\_MODE\_LEGACY)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02727}02727                 group\_a\_mask |= AL\_INT\_GROUP\_A\_GROUP\_B\_SUM |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02728}02728                     AL\_INT\_GROUP\_A\_GROUP\_C\_SUM |}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02729}02729                     AL\_INT\_GROUP\_A\_GROUP\_D\_SUM;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02730}02730 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02731}02731         al\_udma\_iofic\_unmask(regs\_base, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02732}02732             AL\_INT\_GROUP\_A, group\_a\_mask);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02733}02733         al\_udma\_iofic\_unmask(regs\_base, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02734}02734             AL\_INT\_GROUP\_B, group\_b\_mask);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02735}02735         al\_udma\_iofic\_unmask(regs\_base, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02736}02736             AL\_INT\_GROUP\_C, group\_c\_mask);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02737}02737         al\_udma\_iofic\_unmask(regs\_base, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02738}02738             AL\_INT\_GROUP\_D, group\_d\_mask);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02739}02739 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02740}02740 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02741}02741 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02742}\mbox{\hyperlink{al__eth_8c_a30afd1f945df82686f9856c32ea67843}{02742}} \mbox{\hyperlink{al__eth_8c_a30afd1f945df82686f9856c32ea67843}{al\_eth\_interrupts\_mask}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02743}02743 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02744}02744         \textcolor{keyword}{struct }unit\_regs \_\_iomem *regs\_base =}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02745}02745             (\textcolor{keyword}{struct }unit\_regs \_\_iomem *)adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02746}02746 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02747}02747         \textcolor{comment}{/* mask all interrupts */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02748}02748         al\_udma\_iofic\_mask(regs\_base, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02749}02749             AL\_INT\_GROUP\_A, \mbox{\hyperlink{al__eth_8c_ad49222a81f0cccaed5f7441dd89797d0}{AL\_MASK\_GROUP\_A\_INT}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02750}02750         al\_udma\_iofic\_mask(regs\_base, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02751}02751             AL\_INT\_GROUP\_B, \mbox{\hyperlink{al__eth_8c_a1919b49e5147bde8ccd753da0a6af82a}{AL\_MASK\_GROUP\_B\_INT}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02752}02752         al\_udma\_iofic\_mask(regs\_base, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02753}02753             AL\_INT\_GROUP\_C, \mbox{\hyperlink{al__eth_8c_ad69638f05484b613dd5b102403b216c6}{AL\_MASK\_GROUP\_C\_INT}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02754}02754         al\_udma\_iofic\_mask(regs\_base, AL\_UDMA\_IOFIC\_LEVEL\_PRIMARY,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02755}02755             AL\_INT\_GROUP\_D, \mbox{\hyperlink{al__eth_8c_ad2fa1a78737d38167a2db5852c262411}{AL\_MASK\_GROUP\_D\_INT}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02756}02756 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02757}02757 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02758}02758 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02759}\mbox{\hyperlink{al__eth_8c_a5c4103b36d86f1a99f1803f399f54d77}{02759}} \mbox{\hyperlink{al__eth_8c_a5c4103b36d86f1a99f1803f399f54d77}{al\_eth\_configure\_int\_mode}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02760}02760 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02761}02761         \textcolor{keyword}{enum} al\_iofic\_mode int\_mode;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02762}02762         uint32\_t m2s\_errors\_disable = \mbox{\hyperlink{al__eth_8c_a9abbef5002e6188139b3bce7e45cc3ab}{AL\_M2S\_MASK\_INIT}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02763}02763         uint32\_t m2s\_aborts\_disable = \mbox{\hyperlink{al__eth_8c_a9abbef5002e6188139b3bce7e45cc3ab}{AL\_M2S\_MASK\_INIT}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02764}02764         uint32\_t s2m\_errors\_disable = \mbox{\hyperlink{al__eth_8c_a47c1bb5875915f4fdeebc6fe0c358995}{AL\_S2M\_MASK\_INIT}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02765}02765         uint32\_t s2m\_aborts\_disable = \mbox{\hyperlink{al__eth_8c_a47c1bb5875915f4fdeebc6fe0c358995}{AL\_S2M\_MASK\_INIT}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02766}02766 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02767}02767         \textcolor{comment}{/* single INTX mode */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02768}02768         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02769}02769                 int\_mode = AL\_IOFIC\_MODE\_LEGACY;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02770}02770         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a0bdcbfaf195d63e5bdcd1a684bc203d8}{msix\_vecs}} > 1)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02771}02771                 int\_mode = AL\_IOFIC\_MODE\_MSIX\_PER\_Q;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02772}02772         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02773}02773                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02774}02774                     \textcolor{stringliteral}{"{}udma doesn't support single MSI-\/X mode yet.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02775}02775                 \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02776}02776         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02777}02777 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02778}02778         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} != \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98ac0bf0d18cbc54259261779d6055dc443}{ALPINE\_INTEGRATED}}) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02779}02779                 m2s\_errors\_disable |= \mbox{\hyperlink{al__eth_8c_a17e2b1d5f872b691cd91cf6b5dfb5e9e}{AL\_M2S\_S2M\_MASK\_NOT\_INT}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02780}02780                 m2s\_errors\_disable |= \mbox{\hyperlink{al__eth_8c_a17e2b1d5f872b691cd91cf6b5dfb5e9e}{AL\_M2S\_S2M\_MASK\_NOT\_INT}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02781}02781                 s2m\_aborts\_disable |= \mbox{\hyperlink{al__eth_8c_a17e2b1d5f872b691cd91cf6b5dfb5e9e}{AL\_M2S\_S2M\_MASK\_NOT\_INT}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02782}02782                 s2m\_aborts\_disable |= \mbox{\hyperlink{al__eth_8c_a17e2b1d5f872b691cd91cf6b5dfb5e9e}{AL\_M2S\_S2M\_MASK\_NOT\_INT}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02783}02783         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02784}02784 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02785}02785         \textcolor{keywordflow}{if} (al\_udma\_iofic\_config((\textcolor{keyword}{struct} unit\_regs \_\_iomem *)adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02786}02786             int\_mode, m2s\_errors\_disable, m2s\_aborts\_disable,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02787}02787             s2m\_errors\_disable, s2m\_aborts\_disable)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02788}02788                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02789}02789                     \textcolor{stringliteral}{"{}al\_udma\_unit\_int\_config failed!.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02790}02790                 \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02791}02791         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02792}02792         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a221a2cc22627d2b4b7045a16c914ff91}{int\_mode}} = int\_mode;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02793}02793         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}using \%s interrupt mode\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02794}02794             int\_mode == AL\_IOFIC\_MODE\_LEGACY ? \textcolor{stringliteral}{"{}INTx"{}} :}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02795}02795             int\_mode == AL\_IOFIC\_MODE\_MSIX\_PER\_Q ? \textcolor{stringliteral}{"{}MSI-\/X per Queue"{}} : \textcolor{stringliteral}{"{}Unknown"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02796}02796         \textcolor{comment}{/* set interrupt moderation resolution to 15us */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02797}02797         al\_iofic\_moder\_res\_config(\&((\textcolor{keyword}{struct} unit\_regs *)(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}}))-\/>gen.interrupt\_regs.main\_iofic, AL\_INT\_GROUP\_B, 15);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02798}02798         al\_iofic\_moder\_res\_config(\&((\textcolor{keyword}{struct} unit\_regs *)(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ae9bd6c23bfeb549f64b9a422ecd9619d}{udma\_base}}))-\/>gen.interrupt\_regs.main\_iofic, AL\_INT\_GROUP\_C, 15);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02799}02799         \textcolor{comment}{/* by default interrupt coalescing is disabled */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02800}02800         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a36f1844432c4741b75470c5ee7333dd3}{tx\_usecs}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02801}02801         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a28269c92e1f5ba54c81d67ab841cf2fe}{rx\_usecs}} = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02802}02802 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02803}02803         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02804}02804 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02805}02805 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02806}02806 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02807}02807 \textcolor{comment}{ * ethtool\_rxfh\_indir\_default -\/ get default value for RX flow hash indirection}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02808}02808 \textcolor{comment}{ * @index: Index in RX flow hash indirection table}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02809}02809 \textcolor{comment}{ * @n\_rx\_rings: Number of RX rings to use}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02810}02810 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02811}02811 \textcolor{comment}{ * This function provides the default policy for RX flow hash indirection.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02812}02812 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02813}02813 \textcolor{keyword}{static} \textcolor{keyword}{inline} uint32\_t}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02814}\mbox{\hyperlink{al__eth_8c_ae750e3cc571f160310c867e468fd05cb}{02814}} \mbox{\hyperlink{al__eth_8c_ae750e3cc571f160310c867e468fd05cb}{ethtool\_rxfh\_indir\_default}}(uint32\_t index, uint32\_t n\_rx\_rings)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02815}02815 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02816}02816 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02817}02817         \textcolor{keywordflow}{return} (index \% n\_rx\_rings);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02818}02818 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02819}02819 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02820}02820 \textcolor{keyword}{static} \textcolor{keywordtype}{void}*}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02821}\mbox{\hyperlink{al__eth_8c_ac520d1e72de90c8e42b6f96b7aeccd89}{02821}} \mbox{\hyperlink{al__eth_8c_ac520d1e72de90c8e42b6f96b7aeccd89}{al\_eth\_update\_stats}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02822}02822 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02823}02823         \textcolor{keyword}{struct }al\_eth\_mac\_stats *mac\_stats = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a396230a89db2dfb225708ba1c83a24c0}{mac\_stats}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02824}02824 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02825}02825         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ac6c6cc2942cd87bfe2b75260962b4602}{up}} == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02826}02826                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02827}02827 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02828}02828         al\_eth\_mac\_stats\_get(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, mac\_stats);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02829}02829 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02830}02830         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02831}02831 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02832}02832 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02833}02833 \textcolor{keyword}{static} uint64\_t}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02834}\mbox{\hyperlink{al__eth_8c_a5570ced882c7cb338eb05619c51a2ef6}{02834}} \mbox{\hyperlink{al__eth_8c_a5570ced882c7cb338eb05619c51a2ef6}{al\_get\_counter}}(\textcolor{keyword}{struct} ifnet *ifp, ift\_counter cnt)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02835}02835 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02836}02836         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02837}02837         \textcolor{keyword}{struct }al\_eth\_mac\_stats *mac\_stats;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02838}02838         uint64\_t rv;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02839}02839 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02840}02840         adapter = if\_getsoftc(ifp);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02841}02841         mac\_stats = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a396230a89db2dfb225708ba1c83a24c0}{mac\_stats}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02842}02842 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02843}02843         \textcolor{keywordflow}{switch} (cnt) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02844}02844         \textcolor{keywordflow}{case} IFCOUNTER\_IPACKETS:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02845}02845                 \textcolor{keywordflow}{return} (mac\_stats-\/>aFramesReceivedOK); \textcolor{comment}{/* including pause frames */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02846}02846         \textcolor{keywordflow}{case} IFCOUNTER\_OPACKETS:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02847}02847                 \textcolor{keywordflow}{return} (mac\_stats-\/>aFramesTransmittedOK);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02848}02848         \textcolor{keywordflow}{case} IFCOUNTER\_IBYTES:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02849}02849                 \textcolor{keywordflow}{return} (mac\_stats-\/>aOctetsReceivedOK);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02850}02850         \textcolor{keywordflow}{case} IFCOUNTER\_OBYTES:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02851}02851                 \textcolor{keywordflow}{return} (mac\_stats-\/>aOctetsTransmittedOK);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02852}02852         \textcolor{keywordflow}{case} IFCOUNTER\_IMCASTS:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02853}02853                 \textcolor{keywordflow}{return} (mac\_stats-\/>ifInMulticastPkts);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02854}02854         \textcolor{keywordflow}{case} IFCOUNTER\_OMCASTS:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02855}02855                 \textcolor{keywordflow}{return} (mac\_stats-\/>ifOutMulticastPkts);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02856}02856         \textcolor{keywordflow}{case} IFCOUNTER\_COLLISIONS:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02857}02857                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02858}02858         \textcolor{keywordflow}{case} IFCOUNTER\_IQDROPS:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02859}02859                 \textcolor{keywordflow}{return} (mac\_stats-\/>etherStatsDropEvents);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02860}02860         \textcolor{keywordflow}{case} IFCOUNTER\_IERRORS:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02861}02861                 rv = mac\_stats-\/>ifInErrors +}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02862}02862                     mac\_stats-\/>etherStatsUndersizePkts + \textcolor{comment}{/* good but short */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02863}02863                     mac\_stats-\/>etherStatsFragments + \textcolor{comment}{/* short and bad*/}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02864}02864                     mac\_stats-\/>etherStatsJabbers + \textcolor{comment}{/* with crc errors */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02865}02865                     mac\_stats-\/>etherStatsOversizePkts +}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02866}02866                     mac\_stats-\/>aFrameCheckSequenceErrors +}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02867}02867                     mac\_stats-\/>aAlignmentErrors;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02868}02868                 \textcolor{keywordflow}{return} (rv);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02869}02869         \textcolor{keywordflow}{case} IFCOUNTER\_OERRORS:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02870}02870                 \textcolor{keywordflow}{return} (mac\_stats-\/>ifOutErrors);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02871}02871         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02872}02872                 \textcolor{keywordflow}{return} (if\_get\_counter\_default(ifp, cnt));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02873}02873         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02874}02874 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02875}02875 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02876}02876 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02877}\mbox{\hyperlink{al__eth_8c_adfb1a56c7d07f6de6dffbfcb27aad21c}{02877}} \mbox{\hyperlink{al__eth_8c_adfb1a56c7d07f6de6dffbfcb27aad21c}{al\_count\_maddr}}(\textcolor{keywordtype}{void} *arg, \textcolor{keyword}{struct} sockaddr\_dl *sdl, u\_int cnt)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02878}02878 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02879}02879         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *mac;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02880}02880 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02881}02881         mac = LLADDR(sdl);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02882}02882         \textcolor{comment}{/* default mc address inside mac address */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02883}02883         \textcolor{keywordflow}{if} (mac[3] != 0 \&\& mac[4] != 0 \&\& mac[5] != 1)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02884}02884                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02885}02885         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02886}02886                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02887}02887 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02888}02888 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02889}02889 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02890}\mbox{\hyperlink{al__eth_8c_a9d0f4d97de85926804ae384719e9ab97}{02890}} \mbox{\hyperlink{al__eth_8c_a9d0f4d97de85926804ae384719e9ab97}{al\_program\_addr}}(\textcolor{keywordtype}{void} *arg, \textcolor{keyword}{struct} sockaddr\_dl *sdl, u\_int cnt)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02891}02891 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02892}02892         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02893}02893 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02894}02894         \mbox{\hyperlink{al__eth_8c_a9507f7787cd541573969d39dd501ce40}{al\_eth\_mac\_table\_unicast\_add}}(adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02895}02895             \mbox{\hyperlink{al__eth_8c_aa8dbf3732e7b4d83920f8629eee6d452}{AL\_ETH\_MAC\_TABLE\_UNICAST\_IDX\_BASE}} + 1 + cnt, 1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02896}02896 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02897}02897         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02898}02898 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02899}02899 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02900}02900 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02901}02901 \textcolor{comment}{ *  Unicast, Multicast and Promiscuous mode set}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02902}02902 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02903}02903 \textcolor{comment}{ *  The set\_rx\_mode entry point is called whenever the unicast or multicast}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02904}02904 \textcolor{comment}{ *  address lists or the network interface flags are updated.  This routine is}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02905}02905 \textcolor{comment}{ *  responsible for configuring the hardware for proper unicast, multicast,}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02906}02906 \textcolor{comment}{ *  promiscuous mode, and all-\/multi behavior.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02907}02907 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02908}02908 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02909}\mbox{\hyperlink{al__eth_8c_a5a8cd0abc4a9859825d50a34803a1af7}{02909}} \mbox{\hyperlink{al__eth_8c_a5a8cd0abc4a9859825d50a34803a1af7}{al\_eth\_set\_rx\_mode}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02910}02910 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02911}02911         \textcolor{keyword}{struct }ifnet *ifp = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02912}02912         \textcolor{keywordtype}{int} mc, uc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02913}02913         uint8\_t i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02914}02914 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02915}02915         \textcolor{comment}{/* XXXGL: why generic count won't work? */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02916}02916         mc = if\_foreach\_llmaddr(ifp, \mbox{\hyperlink{al__eth_8c_adfb1a56c7d07f6de6dffbfcb27aad21c}{al\_count\_maddr}}, NULL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02917}02917         uc = if\_lladdr\_count(ifp);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02918}02918 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02919}02919         \textcolor{keywordflow}{if} ((ifp-\/>if\_flags \& IFF\_PROMISC) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02920}02920                 \mbox{\hyperlink{al__eth_8c_a608058f45cc19207e6c335093802b882}{al\_eth\_mac\_table\_promiscuous\_set}}(adapter, \textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02921}02921         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02922}02922                 \textcolor{keywordflow}{if} ((ifp-\/>if\_flags \& IFF\_ALLMULTI) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02923}02923                         \textcolor{comment}{/* This interface is in all-\/multicasts mode (used by multicast routers). */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02924}02924                         \mbox{\hyperlink{al__eth_8c_aeb94dfffc6a3d8c6de662f2edf8d6f0f}{al\_eth\_mac\_table\_all\_multicast\_add}}(adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02925}02925                             \mbox{\hyperlink{al__eth_8c_aa0ec5678807cc41021d6e7b6d27dbfef}{AL\_ETH\_MAC\_TABLE\_ALL\_MULTICAST\_IDX}}, 1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02926}02926                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02927}02927                         \textcolor{keywordflow}{if} (mc == 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02928}02928                                 \mbox{\hyperlink{al__eth_8c_a1f0f39ab7303a149dd7a0090f46be7ab}{al\_eth\_mac\_table\_entry\_clear}}(adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02929}02929                                     \mbox{\hyperlink{al__eth_8c_aa0ec5678807cc41021d6e7b6d27dbfef}{AL\_ETH\_MAC\_TABLE\_ALL\_MULTICAST\_IDX}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02930}02930                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02931}02931                                 \mbox{\hyperlink{al__eth_8c_aeb94dfffc6a3d8c6de662f2edf8d6f0f}{al\_eth\_mac\_table\_all\_multicast\_add}}(adapter,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02932}02932                                     \mbox{\hyperlink{al__eth_8c_aa0ec5678807cc41021d6e7b6d27dbfef}{AL\_ETH\_MAC\_TABLE\_ALL\_MULTICAST\_IDX}}, 1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02933}02933                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02934}02934                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02935}02935                 \textcolor{keywordflow}{if} (uc != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02936}02936                         i = \mbox{\hyperlink{al__eth_8c_aa8dbf3732e7b4d83920f8629eee6d452}{AL\_ETH\_MAC\_TABLE\_UNICAST\_IDX\_BASE}} + 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02937}02937                         \textcolor{keywordflow}{if} (uc > \mbox{\hyperlink{al__eth_8c_a92ffc816dee7675e51ee6b710d67a251}{AL\_ETH\_MAC\_TABLE\_UNICAST\_MAX\_COUNT}}) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02938}02938                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02939}02939 \textcolor{comment}{                                 * In this case there are more addresses then}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02940}02940 \textcolor{comment}{                                 * entries in the mac table -\/ set promiscuous}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02941}02941 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02942}02942                                 \mbox{\hyperlink{al__eth_8c_a608058f45cc19207e6c335093802b882}{al\_eth\_mac\_table\_promiscuous\_set}}(adapter, \textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02943}02943                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02944}02944                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02945}02945 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02946}02946                         \textcolor{comment}{/* clear the last configuration */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02947}02947                         \textcolor{keywordflow}{while} (i < (\mbox{\hyperlink{al__eth_8c_aa8dbf3732e7b4d83920f8629eee6d452}{AL\_ETH\_MAC\_TABLE\_UNICAST\_IDX\_BASE}} +}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02948}02948                                     \mbox{\hyperlink{al__eth_8c_a92ffc816dee7675e51ee6b710d67a251}{AL\_ETH\_MAC\_TABLE\_UNICAST\_MAX\_COUNT}})) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02949}02949                                 \mbox{\hyperlink{al__eth_8c_a1f0f39ab7303a149dd7a0090f46be7ab}{al\_eth\_mac\_table\_entry\_clear}}(adapter, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02950}02950                                 i++;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02951}02951                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02952}02952 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02953}02953                         \textcolor{comment}{/* set new addresses */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02954}02954                         if\_foreach\_lladdr(ifp, \mbox{\hyperlink{al__eth_8c_a9d0f4d97de85926804ae384719e9ab97}{al\_program\_addr}}, adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02955}02955                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02956}02956                 \mbox{\hyperlink{al__eth_8c_a608058f45cc19207e6c335093802b882}{al\_eth\_mac\_table\_promiscuous\_set}}(adapter, \textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02957}02957         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02958}02958 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02959}02959 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02960}02960 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02961}\mbox{\hyperlink{al__eth_8c_a42e41cd33795e344e9f4e71237cbbee8}{02961}} \mbox{\hyperlink{al__eth_8c_a42e41cd33795e344e9f4e71237cbbee8}{al\_eth\_config\_rx\_fwd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02962}02962 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02963}02963         \textcolor{keyword}{struct }al\_eth\_fwd\_ctrl\_table\_entry entry;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02964}02964         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02965}02965 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02966}02966         \textcolor{comment}{/* let priority be equal to pbits */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02967}02967         \textcolor{keywordflow}{for} (i = 0; i < AL\_ETH\_FWD\_PBITS\_TABLE\_NUM; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02968}02968                 al\_eth\_fwd\_pbits\_table\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, i, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02969}02969 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02970}02970         \textcolor{comment}{/* map priority to queue index, queue id = priority/2 */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02971}02971         \textcolor{keywordflow}{for} (i = 0; i < AL\_ETH\_FWD\_PRIO\_TABLE\_NUM; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02972}02972                 al\_eth\_fwd\_priority\_table\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, i, i >> 1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02973}02973 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02974}02974         entry.prio\_sel = AL\_ETH\_CTRL\_TABLE\_PRIO\_SEL\_VAL\_0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02975}02975         entry.queue\_sel\_1 = AL\_ETH\_CTRL\_TABLE\_QUEUE\_SEL\_1\_THASH\_TABLE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02976}02976         entry.queue\_sel\_2 = AL\_ETH\_CTRL\_TABLE\_QUEUE\_SEL\_2\_NO\_PRIO;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02977}02977         entry.udma\_sel = AL\_ETH\_CTRL\_TABLE\_UDMA\_SEL\_MAC\_TABLE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02978}02978         entry.filter = FALSE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02979}02979 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02980}02980         al\_eth\_ctrl\_table\_def\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, FALSE, \&entry);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02981}02981 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02982}02982         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02983}02983 \textcolor{comment}{         * By default set the mac table to forward all unicast packets to our}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02984}02984 \textcolor{comment}{         * MAC address and all broadcast. all the rest will be dropped.}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02985}02985 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02986}02986         \mbox{\hyperlink{al__eth_8c_a9507f7787cd541573969d39dd501ce40}{al\_eth\_mac\_table\_unicast\_add}}(adapter, \mbox{\hyperlink{al__eth_8c_aa8dbf3732e7b4d83920f8629eee6d452}{AL\_ETH\_MAC\_TABLE\_UNICAST\_IDX\_BASE}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02987}02987             1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02988}02988         \mbox{\hyperlink{al__eth_8c_a77538340dc9599194f38ff4fd4be0b82}{al\_eth\_mac\_table\_broadcast\_add}}(adapter, \mbox{\hyperlink{al__eth_8c_a591a430e8597cca86504e990d3f669be}{AL\_ETH\_MAC\_TABLE\_BROADCAST\_IDX}}, 1);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02989}02989         \mbox{\hyperlink{al__eth_8c_a608058f45cc19207e6c335093802b882}{al\_eth\_mac\_table\_promiscuous\_set}}(adapter, \textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02990}02990 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02991}02991         \textcolor{comment}{/* set toeplitz hash keys */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02992}02992         \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1115adb22f19aabda001e999c362a772}{toeplitz\_hash\_key}}); i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02993}02993                 *((uint8\_t*)adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1115adb22f19aabda001e999c362a772}{toeplitz\_hash\_key}} + i) = (uint8\_t)random();}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02994}02994 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02995}02995         \textcolor{keywordflow}{for} (i = 0; i < AL\_ETH\_RX\_HASH\_KEY\_NUM; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02996}02996                 al\_eth\_hash\_key\_set(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, i,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02997}02997                     htonl(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1115adb22f19aabda001e999c362a772}{toeplitz\_hash\_key}}[i]));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02998}02998 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l02999}02999         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{al__eth_8h_aeb65b5e5017b98f7cf8d844d8f6ac4d8}{AL\_ETH\_RX\_RSS\_TABLE\_SIZE}}; i++) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03000}03000                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a588ce66eba2eb0f078ae776f8e99b40b}{rss\_ind\_tbl}}[i] = \mbox{\hyperlink{al__eth_8c_ae750e3cc571f160310c867e468fd05cb}{ethtool\_rxfh\_indir\_default}}(i,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03001}03001                     \mbox{\hyperlink{al__eth_8h_aa5db01dd25cc6b5b9f463ca0686ca1b5}{AL\_ETH\_NUM\_QUEUES}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03002}03002                 \mbox{\hyperlink{al__eth_8c_a9ab04b2d3c8d5fb59baecef999d167dc}{al\_eth\_set\_thash\_table\_entry}}(adapter, i, 0,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03003}03003                     adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a588ce66eba2eb0f078ae776f8e99b40b}{rss\_ind\_tbl}}[i]);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03004}03004         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03005}03005 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03006}03006         \mbox{\hyperlink{al__eth_8c_a4517579f378d460da5ea5de342d69559}{al\_eth\_fsm\_table\_init}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03007}03007 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03008}03008 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03009}03009 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03010}\mbox{\hyperlink{al__eth_8c_a930ce6b61e3494421667796e0991172f}{03010}} \mbox{\hyperlink{al__eth_8c_a930ce6b61e3494421667796e0991172f}{al\_eth\_req\_rx\_buff\_size}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, \textcolor{keywordtype}{int} size)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03011}03011 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03012}03012 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03013}03013         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03014}03014 \textcolor{comment}{        * Determine the correct mbuf pool}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03015}03015 \textcolor{comment}{        * for doing jumbo frames}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03016}03016 \textcolor{comment}{        * Try from the smallest up to maximum supported}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03017}03017 \textcolor{comment}{        */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03018}03018         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a08d89e0a5e28ce759deea434c9d08841}{rx\_mbuf\_sz}} = MCLBYTES;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03019}03019         \textcolor{keywordflow}{if} (size > 2048) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03020}03020                 \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7c6cdaed7f93b8259d8607726a65d14c}{max\_rx\_buff\_alloc\_size}} > 2048)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03021}03021                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a08d89e0a5e28ce759deea434c9d08841}{rx\_mbuf\_sz}} = MJUMPAGESIZE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03022}03022                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03023}03023                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03024}03024         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03025}03025         \textcolor{keywordflow}{if} (size > 4096) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03026}03026                 \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7c6cdaed7f93b8259d8607726a65d14c}{max\_rx\_buff\_alloc\_size}} > 4096)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03027}03027                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a08d89e0a5e28ce759deea434c9d08841}{rx\_mbuf\_sz}} = MJUM9BYTES;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03028}03028                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03029}03029                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03030}03030         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03031}03031         \textcolor{keywordflow}{if} (size > 9216) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03032}03032                 \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7c6cdaed7f93b8259d8607726a65d14c}{max\_rx\_buff\_alloc\_size}} > 9216)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03033}03033                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a08d89e0a5e28ce759deea434c9d08841}{rx\_mbuf\_sz}} = MJUM16BYTES;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03034}03034                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03035}03035                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03036}03036         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03037}03037 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03038}03038 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03039}03039 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03040}\mbox{\hyperlink{al__eth_8c_a4099eb4adc1ce90ab25aa704b2a08bcc}{03040}} \mbox{\hyperlink{al__eth_8c_a4099eb4adc1ce90ab25aa704b2a08bcc}{al\_eth\_change\_mtu}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, \textcolor{keywordtype}{int} new\_mtu)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03041}03041 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03042}03042         \textcolor{keywordtype}{int} max\_frame = new\_mtu + ETHER\_HDR\_LEN + ETHER\_CRC\_LEN +}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03043}03043             ETHER\_VLAN\_ENCAP\_LEN;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03044}03044 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03045}03045         \mbox{\hyperlink{al__eth_8c_a930ce6b61e3494421667796e0991172f}{al\_eth\_req\_rx\_buff\_size}}(adapter, new\_mtu);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03046}03046 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03047}03047         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}set MTU to \%d\(\backslash\)n"{}}, new\_mtu);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03048}03048         al\_eth\_rx\_pkt\_limit\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03049}03049             AL\_ETH\_MIN\_FRAME\_LEN, max\_frame);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03050}03050 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03051}03051         al\_eth\_tso\_mss\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, 0, new\_mtu -\/ 100);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03052}03052 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03053}03053         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03054}03054 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03055}03055 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03056}03056 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03057}\mbox{\hyperlink{al__eth_8c_a23e9cb6b44b3f91fe13fcf3e0666e3da}{03057}} \mbox{\hyperlink{al__eth_8c_a23e9cb6b44b3f91fe13fcf3e0666e3da}{al\_eth\_check\_mtu}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, \textcolor{keywordtype}{int} new\_mtu)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03058}03058 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03059}03059         \textcolor{keywordtype}{int} max\_frame = new\_mtu + ETHER\_HDR\_LEN + ETHER\_CRC\_LEN + ETHER\_VLAN\_ENCAP\_LEN;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03060}03060 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03061}03061         \textcolor{keywordflow}{if} ((new\_mtu < AL\_ETH\_MIN\_FRAME\_LEN) ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03062}03062             (max\_frame > AL\_ETH\_MAX\_FRAME\_LEN)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03063}03063                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03064}03064         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03065}03065 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03066}03066         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03067}03067 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03068}03068 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03069}03069 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03070}\mbox{\hyperlink{al__eth_8c_a863b5eff65f4d7e300ff4de7375f80b5}{03070}} \mbox{\hyperlink{al__eth_8c_a863b5eff65f4d7e300ff4de7375f80b5}{al\_eth\_udma\_queue\_enable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter, \textcolor{keyword}{enum} al\_udma\_type type,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03071}03071     \textcolor{keywordtype}{int} qid)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03072}03072 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03073}03073         \textcolor{keywordtype}{int} rc = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03074}03074         \textcolor{keywordtype}{char} *name = (type == UDMA\_TX) ? \textcolor{stringliteral}{"{}Tx"{}} : \textcolor{stringliteral}{"{}Rx"{}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03075}03075         \textcolor{keyword}{struct }al\_udma\_q\_params *q\_params;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03076}03076 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03077}03077         \textcolor{keywordflow}{if} (type == UDMA\_TX)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03078}03078                 q\_params = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a6e0fe16b81a9f8f2f2d67d15dc34e0a3}{tx\_ring}}[qid].\mbox{\hyperlink{structal__eth__ring_ae2b8ff9e46bd5a4c0a67d3c716f73709}{q\_params}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03079}03079         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03080}03080                 q\_params = \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a83f78b04e69b907725a5f79e5b1de1af}{rx\_ring}}[qid].\mbox{\hyperlink{structal__eth__ring_ae2b8ff9e46bd5a4c0a67d3c716f73709}{q\_params}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03081}03081 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03082}03082         rc = al\_eth\_queue\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, type, qid, q\_params);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03083}03083         \textcolor{keywordflow}{if} (rc < 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03084}03084                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}config \%s queue \%u failed\(\backslash\)n"{}}, name,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03085}03085                     qid);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03086}03086                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03087}03087         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03088}03088         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03089}03089 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03090}03090 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03091}03091 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03092}\mbox{\hyperlink{al__eth_8c_acf9071476a376863d14e902feadf8e76}{03092}} \mbox{\hyperlink{al__eth_8c_acf9071476a376863d14e902feadf8e76}{al\_eth\_udma\_queues\_enable\_all}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03093}03093 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03094}03094         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03095}03095 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03096}03096         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a09defd463c88450eac69fbd9e12cfa3c}{num\_tx\_queues}}; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03097}03097                 \mbox{\hyperlink{al__eth_8c_a863b5eff65f4d7e300ff4de7375f80b5}{al\_eth\_udma\_queue\_enable}}(adapter, UDMA\_TX, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03098}03098 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03099}03099         \textcolor{keywordflow}{for} (i = 0; i < adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a2139c2db30a24308127cdef015d40c13}{num\_rx\_queues}}; i++)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03100}03100                 \mbox{\hyperlink{al__eth_8c_a863b5eff65f4d7e300ff4de7375f80b5}{al\_eth\_udma\_queue\_enable}}(adapter, UDMA\_RX, i);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03101}03101 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03102}03102         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03103}03103 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03104}03104 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03105}03105 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03106}\mbox{\hyperlink{al__eth_8c_a0a7ab166314ea703b4affcff563ed7bb}{03106}} \mbox{\hyperlink{al__eth_8c_a0a7ab166314ea703b4affcff563ed7bb}{al\_eth\_up\_complete}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03107}03107 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03108}03108 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03109}03109         \mbox{\hyperlink{al__eth_8c_a5c4103b36d86f1a99f1803f399f54d77}{al\_eth\_configure\_int\_mode}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03110}03110         \mbox{\hyperlink{al__eth_8c_a42e41cd33795e344e9f4e71237cbbee8}{al\_eth\_config\_rx\_fwd}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03111}03111         \mbox{\hyperlink{al__eth_8c_a4099eb4adc1ce90ab25aa704b2a08bcc}{al\_eth\_change\_mtu}}(adapter, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_mtu);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03112}03112         \mbox{\hyperlink{al__eth_8c_acf9071476a376863d14e902feadf8e76}{al\_eth\_udma\_queues\_enable\_all}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03113}03113         \mbox{\hyperlink{al__eth_8c_a406f256ff47c09648524ae6e994c2fd2}{al\_eth\_refill\_all\_rx\_bufs}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03114}03114         \mbox{\hyperlink{al__eth_8c_a7e28ed28b9af55a378069d705f2adf88}{al\_eth\_interrupts\_unmask}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03115}03115 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03116}03116         \textcolor{comment}{/* enable forwarding interrupts from eth through pci end point */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03117}03117         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98a01564e7eed37e58991cc530b148efed4}{ALPINE\_FPGA\_NIC}}) ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03118}03118             (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a7641ad192c197a6c214dbaa6d42b7e69}{board\_type}} == \mbox{\hyperlink{al__eth_8h_aba568a02d4f18a03878fca58ba5d1b98a27bdc8e2bbd4f4a3fed70b6d2bb45a4d}{ALPINE\_NIC}})) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03119}03119                 \mbox{\hyperlink{al__eth_8c_aba4ec50b0803da6b352d5bbab0a54a2e}{al\_eth\_forward\_int\_config}}((uint32\_t*)adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab5779e54ea1ceef98f3f8558028f044c}{internal\_pcie\_base}} +}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03120}03120                     \mbox{\hyperlink{al__eth_8c_a1d9ce96c3f6412c9379f02dfe4093a2a}{AL\_REG\_OFFSET\_FORWARD\_INTR}}, \mbox{\hyperlink{al__eth_8c_a70c3cc33437de621488468287762bd89}{AL\_EN\_FORWARD\_INTR}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03121}03121         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03122}03122 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03123}03123         \mbox{\hyperlink{al__eth_8c_ab914e5256390b10b6a865493f8c7dcf6}{al\_eth\_flow\_ctrl\_enable}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03124}03124 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03125}03125         mtx\_lock(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab60e8d48d54e894f61f3ea6b805f1991}{stats\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03126}03126         callout\_reset(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_acec4cc09d2cfe25a5ce42c28843aadbf}{stats\_callout}}, hz, \mbox{\hyperlink{al__eth_8c_a92d0ca7738a2e0f7c0989002e872c8c5}{al\_tick\_stats}}, (\textcolor{keywordtype}{void}*)adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03127}03127         mtx\_unlock(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab60e8d48d54e894f61f3ea6b805f1991}{stats\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03128}03128 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03129}03129         al\_eth\_mac\_start(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03130}03130 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03131}03131 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03132}03132 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03133}\mbox{\hyperlink{al__eth_8c_ae530391e153510f1c68252293e6b34b7}{03133}} \mbox{\hyperlink{al__eth_8c_ae530391e153510f1c68252293e6b34b7}{al\_media\_update}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03134}03134 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03135}03135         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03136}03136 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03137}03137         \textcolor{keywordflow}{if} ((ifp-\/>if\_flags \& IFF\_UP) != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03138}03138                 mii\_mediachg(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03139}03139 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03140}03140         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03141}03141 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03142}03142 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03143}03143 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03144}\mbox{\hyperlink{al__eth_8c_a7e02bbd51ef5a6cdf98088d9bfba1cd7}{03144}} \mbox{\hyperlink{al__eth_8c_a7e02bbd51ef5a6cdf98088d9bfba1cd7}{al\_media\_status}}(\textcolor{keyword}{struct} ifnet *ifp, \textcolor{keyword}{struct} ifmediareq *ifmr)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03145}03145 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03146}03146         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03147}03147         \textcolor{keyword}{struct }mii\_data *mii;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03148}03148 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03149}03149         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03150}03150                 ifmr-\/>ifm\_active = IFM\_ETHER | IFM\_NONE;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03151}03151                 ifmr-\/>ifm\_status = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03152}03152 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03153}03153                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03154}03154         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03155}03155 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03156}03156         mii = sc-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03157}03157         mii\_pollstat(mii);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03158}03158 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03159}03159         ifmr-\/>ifm\_active = mii-\/>mii\_media\_active;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03160}03160         ifmr-\/>ifm\_status = mii-\/>mii\_media\_status;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03161}03161 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03162}03162 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03163}03163 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03164}\mbox{\hyperlink{al__eth_8c_a33a32b61bc0cbb91aaee60913ad0622d}{03164}} \mbox{\hyperlink{al__eth_8c_a33a32b61bc0cbb91aaee60913ad0622d}{al\_tick}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03165}03165 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03166}03166         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03167}03167 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03168}03168         mii\_tick(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03169}03169 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03170}03170         \textcolor{comment}{/* Schedule another timeout one second from now */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03171}03171         callout\_schedule(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a44431cdbba74692b6cec56c19b780ef1}{wd\_callout}}, hz);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03172}03172 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03173}03173 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03174}03174 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03175}\mbox{\hyperlink{al__eth_8c_a92d0ca7738a2e0f7c0989002e872c8c5}{03175}} \mbox{\hyperlink{al__eth_8c_a92d0ca7738a2e0f7c0989002e872c8c5}{al\_tick\_stats}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03176}03176 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03177}03177         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = arg;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03178}03178 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03179}03179         \mbox{\hyperlink{al__eth_8c_ac520d1e72de90c8e42b6f96b7aeccd89}{al\_eth\_update\_stats}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03180}03180 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03181}03181         callout\_schedule(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_acec4cc09d2cfe25a5ce42c28843aadbf}{stats\_callout}}, hz);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03182}03182 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03183}03183 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03184}03184 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03185}\mbox{\hyperlink{al__eth_8c_a4c16389147c0f1fd1d31a2cc17c65f48}{03185}} \mbox{\hyperlink{al__eth_8c_a4c16389147c0f1fd1d31a2cc17c65f48}{al\_eth\_up}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03186}03186 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03187}03187         \textcolor{keyword}{struct }ifnet *ifp = adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03188}03188         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03189}03189 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03190}03190         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ac6c6cc2942cd87bfe2b75260962b4602}{up}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03191}03191                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03192}03192 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03193}03193         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a314e32b05cfee98d945e7f64a85ee279}{flags}} \& \mbox{\hyperlink{al__eth_8h_a6d661e69a714893677b87a3b80e2ba0e}{AL\_ETH\_FLAG\_RESET\_REQUESTED}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03194}03194                 \mbox{\hyperlink{al__eth_8c_a049732a0792444b060c0b6759a9c316c}{al\_eth\_function\_reset}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03195}03195                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a314e32b05cfee98d945e7f64a85ee279}{flags}} \&= \string~AL\_ETH\_FLAG\_RESET\_REQUESTED;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03196}03196         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03197}03197 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03198}03198         ifp-\/>if\_hwassist = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03199}03199         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_TSO) != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03200}03200                 ifp-\/>if\_hwassist |= CSUM\_TSO;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03201}03201         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_TXCSUM) != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03202}03202                 ifp-\/>if\_hwassist |= (CSUM\_TCP | CSUM\_UDP);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03203}03203         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_TXCSUM\_IPV6) != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03204}03204                 ifp-\/>if\_hwassist |= (CSUM\_TCP\_IPV6 | CSUM\_UDP\_IPV6);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03205}03205 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03206}03206         \mbox{\hyperlink{al__eth_8c_afa47ffd700a030a69c015eac43b3ccbd}{al\_eth\_serdes\_init}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03207}03207 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03208}03208         rc = \mbox{\hyperlink{al__eth_8c_aa782e32cbeab4cfa1b7f6cc9cda435c5}{al\_eth\_hw\_init}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03209}03209         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03210}03210                 \textcolor{keywordflow}{goto} err\_hw\_init\_open;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03211}03211 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03212}03212         rc = \mbox{\hyperlink{al__eth_8c_a46fc33b2ddcda7b233e08360463e8ecb}{al\_eth\_setup\_int\_mode}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03213}03213         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03214}03214                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03215}03215                     \textcolor{stringliteral}{"{}\%s failed at setup interrupt mode!\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03216}03216                 \textcolor{keywordflow}{goto} err\_setup\_int;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03217}03217         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03218}03218 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03219}03219         \textcolor{comment}{/* allocate transmit descriptors */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03220}03220         rc = \mbox{\hyperlink{al__eth_8c_ac67e42c8c29de5af98b1498a5e2ddb50}{al\_eth\_setup\_all\_tx\_resources}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03221}03221         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03222}03222                 \textcolor{keywordflow}{goto} err\_setup\_tx;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03223}03223 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03224}03224         \textcolor{comment}{/* allocate receive descriptors */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03225}03225         rc = \mbox{\hyperlink{al__eth_8c_a3476efe5e5f3140aa8abffdd41a663e7}{al\_eth\_setup\_all\_rx\_resources}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03226}03226         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03227}03227                 \textcolor{keywordflow}{goto} err\_setup\_rx;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03228}03228 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03229}03229         rc = \mbox{\hyperlink{al__eth_8c_adab8e61340d2b5b0d374698d4f5a239b}{al\_eth\_request\_irq}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03230}03230         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03231}03231                 \textcolor{keywordflow}{goto} err\_req\_irq;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03232}03232 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03233}03233         \mbox{\hyperlink{al__eth_8c_a0a7ab166314ea703b4affcff563ed7bb}{al\_eth\_up\_complete}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03234}03234 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03235}03235         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ac6c6cc2942cd87bfe2b75260962b4602}{up}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03236}03236 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03237}03237         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} == AL\_ETH\_MAC\_MODE\_10GbE\_Serial)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03238}03238                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_link\_state = LINK\_STATE\_UP;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03239}03239 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03240}03240         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3f61b82e327844e87d7752eb989fe38d}{mac\_mode}} == AL\_ETH\_MAC\_MODE\_RGMII) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03241}03241                 mii\_mediachg(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03242}03242 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03243}03243                 \textcolor{comment}{/* Schedule watchdog timeout */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03244}03244                 mtx\_lock(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adaad12c5723c9d3509d549e7d7b8196c}{wd\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03245}03245                 callout\_reset(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a44431cdbba74692b6cec56c19b780ef1}{wd\_callout}}, hz, \mbox{\hyperlink{al__eth_8c_a33a32b61bc0cbb91aaee60913ad0622d}{al\_tick}}, adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03246}03246                 mtx\_unlock(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adaad12c5723c9d3509d549e7d7b8196c}{wd\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03247}03247 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03248}03248                 mii\_pollstat(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03249}03249         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03250}03250 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03251}03251         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03252}03252 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03253}03253 err\_req\_irq:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03254}03254         \mbox{\hyperlink{al__eth_8c_a2f417956a9b9a75ead7be3ea8bef5614}{al\_eth\_free\_all\_rx\_resources}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03255}03255 err\_setup\_rx:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03256}03256         \mbox{\hyperlink{al__eth_8c_a9b45dc6dd204875884171a48a56c3201}{al\_eth\_free\_all\_tx\_resources}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03257}03257 err\_setup\_tx:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03258}03258         \mbox{\hyperlink{al__eth_8c_a8c5a6284fcc731ea9957c6371be0ff62}{al\_eth\_free\_irq}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03259}03259 err\_setup\_int:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03260}03260         \mbox{\hyperlink{al__eth_8c_ac9a2bde486c476eb96293250eb207519}{al\_eth\_hw\_stop}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03261}03261 err\_hw\_init\_open:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03262}03262         \mbox{\hyperlink{al__eth_8c_a049732a0792444b060c0b6759a9c316c}{al\_eth\_function\_reset}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03263}03263 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03264}03264         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03265}03265 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03266}03266 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03267}03267 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03268}\mbox{\hyperlink{al__eth_8c_a2f8c46e11a6aec27b78fa0b422b27da4}{03268}} \mbox{\hyperlink{al__eth_8c_a2f8c46e11a6aec27b78fa0b422b27da4}{al\_shutdown}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03269}03269 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03270}03270         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = device\_get\_softc(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03271}03271 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03272}03272         \mbox{\hyperlink{al__eth_8c_a2511d605f21e0a4e99f5a432cebf324c}{al\_eth\_down}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03273}03273 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03274}03274         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03275}03275 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03276}03276 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03277}03277 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03278}\mbox{\hyperlink{al__eth_8c_a2511d605f21e0a4e99f5a432cebf324c}{03278}} \mbox{\hyperlink{al__eth_8c_a2511d605f21e0a4e99f5a432cebf324c}{al\_eth\_down}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03279}03279 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03280}03280 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03281}03281         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}al\_eth\_down: begin\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03282}03282 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03283}03283         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ac6c6cc2942cd87bfe2b75260962b4602}{up}} = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03284}03284 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03285}03285         mtx\_lock(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adaad12c5723c9d3509d549e7d7b8196c}{wd\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03286}03286         callout\_stop(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a44431cdbba74692b6cec56c19b780ef1}{wd\_callout}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03287}03287         mtx\_unlock(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_adaad12c5723c9d3509d549e7d7b8196c}{wd\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03288}03288 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03289}03289         \mbox{\hyperlink{al__eth_8c_a3f593239934c1006efd8483343311c99}{al\_eth\_disable\_int\_sync}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03290}03290 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03291}03291         mtx\_lock(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab60e8d48d54e894f61f3ea6b805f1991}{stats\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03292}03292         callout\_stop(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_acec4cc09d2cfe25a5ce42c28843aadbf}{stats\_callout}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03293}03293         mtx\_unlock(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ab60e8d48d54e894f61f3ea6b805f1991}{stats\_mtx}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03294}03294 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03295}03295         \mbox{\hyperlink{al__eth_8c_a8c5a6284fcc731ea9957c6371be0ff62}{al\_eth\_free\_irq}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03296}03296         \mbox{\hyperlink{al__eth_8c_ac9a2bde486c476eb96293250eb207519}{al\_eth\_hw\_stop}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03297}03297 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03298}03298         \mbox{\hyperlink{al__eth_8c_a9b45dc6dd204875884171a48a56c3201}{al\_eth\_free\_all\_tx\_resources}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03299}03299         \mbox{\hyperlink{al__eth_8c_a2f417956a9b9a75ead7be3ea8bef5614}{al\_eth\_free\_all\_rx\_resources}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03300}03300 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03301}03301 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03302}03302 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03303}\mbox{\hyperlink{al__eth_8c_a5db70fc47f61dbe4c6c920f6919f01d4}{03303}} \mbox{\hyperlink{al__eth_8c_a5db70fc47f61dbe4c6c920f6919f01d4}{al\_ioctl}}(\textcolor{keyword}{struct} ifnet *ifp, u\_long command, caddr\_t data)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03304}03304 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03305}03305         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}}     *adapter = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03306}03306         \textcolor{keyword}{struct }ifreq            *ifr = (\textcolor{keyword}{struct }ifreq *)data;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03307}03307         \textcolor{keywordtype}{int}                     error = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03308}03308 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03309}03309         \textcolor{keywordflow}{switch} (command) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03310}03310         \textcolor{keywordflow}{case} SIOCSIFMTU:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03311}03311         \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03312}03312                 error = \mbox{\hyperlink{al__eth_8c_a23e9cb6b44b3f91fe13fcf3e0666e3da}{al\_eth\_check\_mtu}}(adapter, ifr-\/>ifr\_mtu);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03313}03313                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03314}03314                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}ioctl wrong mtu \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03315}03315                             adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_mtu);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03316}03316                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03317}03317                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03318}03318 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03319}03319                 ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03320}03320                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_mtu = ifr-\/>ifr\_mtu;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03321}03321                 \mbox{\hyperlink{al__eth_8c_a72dd112b571e01ec89e41bfda049bbd2}{al\_init}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03322}03322                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03323}03323         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03324}03324         \textcolor{keywordflow}{case} SIOCSIFFLAGS:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03325}03325                 \textcolor{keywordflow}{if} ((ifp-\/>if\_flags \& IFF\_UP) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03326}03326                         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03327}03327                                 \textcolor{keywordflow}{if} (((ifp-\/>if\_flags \string^ adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3b2327ff4fc2556acbbb3f3818635af1}{if\_flags}}) \&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03328}03328                                     (IFF\_PROMISC | IFF\_ALLMULTI)) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03329}03329                                         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03330}03330                                             \textcolor{stringliteral}{"{}ioctl promisc/allmulti\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03331}03331                                         \mbox{\hyperlink{al__eth_8c_a5a8cd0abc4a9859825d50a34803a1af7}{al\_eth\_set\_rx\_mode}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03332}03332                                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03333}03333                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03334}03334                                 error = \mbox{\hyperlink{al__eth_8c_a4c16389147c0f1fd1d31a2cc17c65f48}{al\_eth\_up}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03335}03335                                 \textcolor{keywordflow}{if} (error == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03336}03336                                         ifp-\/>if\_drv\_flags |= IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03337}03337                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03338}03338                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03339}03339                         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03340}03340                                 \mbox{\hyperlink{al__eth_8c_a2511d605f21e0a4e99f5a432cebf324c}{al\_eth\_down}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03341}03341                                 ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03342}03342                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03343}03343                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03344}03344 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03345}03345                 adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a3b2327ff4fc2556acbbb3f3818635af1}{if\_flags}} = ifp-\/>if\_flags;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03346}03346                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03347}03347 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03348}03348         \textcolor{keywordflow}{case} SIOCADDMULTI:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03349}03349         \textcolor{keywordflow}{case} SIOCDELMULTI:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03350}03350                 \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03351}03351                         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03352}03352                             \textcolor{stringliteral}{"{}ioctl add/del multi before\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03353}03353                         \mbox{\hyperlink{al__eth_8c_a5a8cd0abc4a9859825d50a34803a1af7}{al\_eth\_set\_rx\_mode}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03354}03354 \textcolor{preprocessor}{\#ifdef DEVICE\_POLLING}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03355}03355                         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_POLLING) == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03356}03356 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03357}03357                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03358}03358                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03359}03359         \textcolor{keywordflow}{case} SIOCSIFMEDIA:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03360}03360         \textcolor{keywordflow}{case} SIOCGIFMEDIA:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03361}03361                 \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}} != NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03362}03362                         error = ifmedia\_ioctl(ifp, ifr,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03363}03363                             \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}}-\/>mii\_media, command);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03364}03364                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03365}03365                         error = ifmedia\_ioctl(ifp, ifr,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03366}03366                             \&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8c6afc17f22102e718f43968b4c9aa9d}{media}}, command);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03367}03367                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03368}03368         \textcolor{keywordflow}{case} SIOCSIFCAP:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03369}03369             \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03370}03370                 \textcolor{keywordtype}{int} mask, reinit;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03371}03371 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03372}03372                 reinit = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03373}03373                 mask = ifr-\/>ifr\_reqcap \string^ ifp-\/>if\_capenable;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03374}03374 \textcolor{preprocessor}{\#ifdef DEVICE\_POLLING}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03375}03375                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_POLLING) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03376}03376                         \textcolor{keywordflow}{if} ((ifr-\/>ifr\_reqcap \& IFCAP\_POLLING) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03377}03377                                 \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03378}03378                                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03379}03379                                 ifp-\/>if\_capenable |= IFCAP\_POLLING;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03380}03380                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03381}03381                                 error = ether\_poll\_deregister(ifp);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03382}03382                                 \textcolor{comment}{/* Enable interrupt even in error case */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03383}03383                                 ifp-\/>if\_capenable \&= \string~IFCAP\_POLLING;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03384}03384                         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03385}03385                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03386}03386 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03387}03387                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_HWCSUM) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03388}03388                         \textcolor{comment}{/* apply to both rx and tx */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03389}03389                         ifp-\/>if\_capenable \string^= IFCAP\_HWCSUM;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03390}03390                         reinit = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03391}03391                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03392}03392                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_HWCSUM\_IPV6) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03393}03393                         ifp-\/>if\_capenable \string^= IFCAP\_HWCSUM\_IPV6;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03394}03394                         reinit = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03395}03395                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03396}03396                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_TSO) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03397}03397                         ifp-\/>if\_capenable \string^= IFCAP\_TSO;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03398}03398                         reinit = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03399}03399                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03400}03400                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_LRO) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03401}03401                         ifp-\/>if\_capenable \string^= IFCAP\_LRO;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03402}03402                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03403}03403                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_VLAN\_HWTAGGING) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03404}03404                         ifp-\/>if\_capenable \string^= IFCAP\_VLAN\_HWTAGGING;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03405}03405                         reinit = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03406}03406                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03407}03407                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_VLAN\_HWFILTER) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03408}03408                         ifp-\/>if\_capenable \string^= IFCAP\_VLAN\_HWFILTER;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03409}03409                         reinit = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03410}03410                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03411}03411                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_VLAN\_HWTSO) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03412}03412                         ifp-\/>if\_capenable \string^= IFCAP\_VLAN\_HWTSO;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03413}03413                         reinit = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03414}03414                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03415}03415                 \textcolor{keywordflow}{if} ((reinit != 0) \&\&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03416}03416                     ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING)) != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03417}03417                 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03418}03418                         \mbox{\hyperlink{al__eth_8c_a72dd112b571e01ec89e41bfda049bbd2}{al\_init}}(adapter);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03419}03419                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03420}03420                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03421}03421             \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03422}03422 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03423}03423         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03424}03424                 error = ether\_ioctl(ifp, command, data);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03425}03425                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03426}03426         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03427}03427 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03428}03428         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03429}03429 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03430}03430 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03431}03431 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03432}\mbox{\hyperlink{al__eth_8c_a06a8ce939e45eeb8386ac8718459211f}{03432}} \mbox{\hyperlink{al__eth_8c_a06a8ce939e45eeb8386ac8718459211f}{al\_is\_device\_supported}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03433}03433 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03434}03434         uint16\_t pci\_vendor\_id = pci\_get\_vendor(dev);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03435}03435         uint16\_t pci\_device\_id = pci\_get\_device(dev);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03436}03436 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03437}03437         \textcolor{keywordflow}{return} (pci\_vendor\_id == \mbox{\hyperlink{al__eth_8c_a7fc3cab080bd6ff87b0ba5c9184d8f21}{PCI\_VENDOR\_ID\_ANNAPURNA\_LABS}} \&\&}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03438}03438             (pci\_device\_id == \mbox{\hyperlink{al__eth_8c_a0225a73623348bfb1dca9aed3e3c4fe4}{PCI\_DEVICE\_ID\_AL\_ETH}} ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03439}03439             pci\_device\_id == \mbox{\hyperlink{al__eth_8c_a26b965ee5fd8cfa1149c5ee411b6cc05}{PCI\_DEVICE\_ID\_AL\_ETH\_ADVANCED}} ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03440}03440             pci\_device\_id == \mbox{\hyperlink{al__eth_8c_a8f74b6ca6a4e90e7d7e829b0c8c9bc4b}{PCI\_DEVICE\_ID\_AL\_ETH\_NIC}} ||}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03441}03441             pci\_device\_id == \mbox{\hyperlink{al__eth_8c_a5ca588a7269ba6d4068696d4cb780121}{PCI\_DEVICE\_ID\_AL\_ETH\_FPGA\_NIC}}));}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03442}03442 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03443}03443 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03444}03444 \textcolor{comment}{/* Time in mSec to keep trying to read / write from MDIO in case of error */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03445}\mbox{\hyperlink{al__eth_8c_ac05f222255cbc02b8bf12d9ea3b92cbb}{03445}} \textcolor{preprocessor}{\#define MDIO\_TIMEOUT\_MSEC       100}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03446}\mbox{\hyperlink{al__eth_8c_aa910dc22f212d2aa2d81a4fc5b3a128e}{03446}} \textcolor{preprocessor}{\#define MDIO\_PAUSE\_MSEC         10}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03447}03447 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03448}03448 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03449}\mbox{\hyperlink{al__eth_8c_a1ca56909be3bdc082efd0a722fe9eea9}{03449}} \mbox{\hyperlink{al__eth_8c_a1ca56909be3bdc082efd0a722fe9eea9}{al\_miibus\_readreg}}(device\_t dev, \textcolor{keywordtype}{int} phy, \textcolor{keywordtype}{int} reg)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03450}03450 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03451}03451         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = device\_get\_softc(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03452}03452         uint16\_t value = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03453}03453         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03454}03454         \textcolor{keywordtype}{int} timeout = \mbox{\hyperlink{al__eth_8c_ac05f222255cbc02b8bf12d9ea3b92cbb}{MDIO\_TIMEOUT\_MSEC}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03455}03455 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03456}03456         \textcolor{keywordflow}{while} (timeout > 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03457}03457                 rc = al\_eth\_mdio\_read(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8576032ca22740731cc5153d0a6be21b}{phy\_addr}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03458}03458                     -\/1, reg, \&value);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03459}03459 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03460}03460                 \textcolor{keywordflow}{if} (rc == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03461}03461                         \textcolor{keywordflow}{return} (value);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03462}03462 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03463}03463                 \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03464}03464                     \textcolor{stringliteral}{"{}mdio read failed. try again in 10 msec\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03465}03465 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03466}03466                 timeout -\/= \mbox{\hyperlink{al__eth_8c_aa910dc22f212d2aa2d81a4fc5b3a128e}{MDIO\_PAUSE\_MSEC}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03467}03467                 pause(\textcolor{stringliteral}{"{}readred pause"{}}, \mbox{\hyperlink{al__eth_8c_aa910dc22f212d2aa2d81a4fc5b3a128e}{MDIO\_PAUSE\_MSEC}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03468}03468         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03469}03469 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03470}03470         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03471}03471                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}MDIO read failed on timeout\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03472}03472 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03473}03473         \textcolor{keywordflow}{return} (value);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03474}03474 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03475}03475 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03476}03476 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03477}\mbox{\hyperlink{al__eth_8c_ab9930624216f2f5667b2cadb702b80ba}{03477}} \mbox{\hyperlink{al__eth_8c_ab9930624216f2f5667b2cadb702b80ba}{al\_miibus\_writereg}}(device\_t \mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{keywordtype}{int} phy, \textcolor{keywordtype}{int} reg, \textcolor{keywordtype}{int} value)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03478}03478 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03479}03479         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = device\_get\_softc(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03480}03480         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03481}03481         \textcolor{keywordtype}{int} timeout = \mbox{\hyperlink{al__eth_8c_ac05f222255cbc02b8bf12d9ea3b92cbb}{MDIO\_TIMEOUT\_MSEC}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03482}03482 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03483}03483         \textcolor{keywordflow}{while} (timeout > 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03484}03484                 rc = al\_eth\_mdio\_write(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a8576032ca22740731cc5153d0a6be21b}{phy\_addr}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03485}03485                     -\/1, reg, value);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03486}03486 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03487}03487                 \textcolor{keywordflow}{if} (rc == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03488}03488                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03489}03489 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03490}03490                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03491}03491                     \textcolor{stringliteral}{"{}mdio write failed. try again in 10 msec\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03492}03492 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03493}03493                 timeout -\/= \mbox{\hyperlink{al__eth_8c_aa910dc22f212d2aa2d81a4fc5b3a128e}{MDIO\_PAUSE\_MSEC}};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03494}03494                 pause(\textcolor{stringliteral}{"{}miibus writereg"{}}, \mbox{\hyperlink{al__eth_8c_aa910dc22f212d2aa2d81a4fc5b3a128e}{MDIO\_PAUSE\_MSEC}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03495}03495         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03496}03496 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03497}03497         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03498}03498                 device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}MDIO write failed on timeout\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03499}03499 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03500}03500         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03501}03501 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03502}03502 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03503}03503 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03504}\mbox{\hyperlink{al__eth_8c_aebb53e2f81fe6ba9201825ef19f356c2}{03504}} \mbox{\hyperlink{al__eth_8c_aebb53e2f81fe6ba9201825ef19f356c2}{al\_miibus\_statchg}}(device\_t \mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03505}03505 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03506}03506         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = device\_get\_softc(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03507}03507 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03508}03508         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03509}03509             \textcolor{stringliteral}{"{}al\_miibus\_statchg: state has changed!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03510}03510         \mbox{\hyperlink{al__eth_8c_a7d98677babcd5655c5b2ae8924c309ef}{device\_printf\_dbg}}(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03511}03511             \textcolor{stringliteral}{"{}al\_miibus\_statchg: active = 0x\%x status = 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03512}03512             adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}}-\/>mii\_media\_active, adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}}-\/>mii\_media\_status);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03513}03513 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03514}03514         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ac6c6cc2942cd87bfe2b75260962b4602}{up}} == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03515}03515                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03516}03516 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03517}03517         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}}-\/>mii\_media\_status \& IFM\_AVALID) != 0) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03518}03518                 \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}}-\/>mii\_media\_status \& IFM\_ACTIVE) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03519}03519                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}link is UP\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03520}03520                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_link\_state = LINK\_STATE\_UP;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03521}03521                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03522}03522                         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}link is DOWN\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03523}03523                         adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_link\_state = LINK\_STATE\_DOWN;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03524}03524                 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03525}03525         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03526}03526 \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03527}03527 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03528}03528 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03529}\mbox{\hyperlink{al__eth_8c_ae0572b2dd663de09037a4dc4ae196b01}{03529}} \mbox{\hyperlink{al__eth_8c_ae0572b2dd663de09037a4dc4ae196b01}{al\_miibus\_linkchg}}(device\_t \mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}})}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03530}03530 \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03531}03531         \textcolor{keyword}{struct }\mbox{\hyperlink{structal__eth__adapter}{al\_eth\_adapter}} *adapter = device\_get\_softc(\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}});}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03532}03532         uint8\_t duplex = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03533}03533         uint8\_t speed = 0;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03534}03534 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03535}03535         \textcolor{keywordflow}{if} (adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}} == NULL)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03536}03536                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03537}03537 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03538}03538         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_aecddc8ef840106b69e939972ad37c510}{netdev}}-\/>if\_flags \& IFF\_UP) == 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03539}03539                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03540}03540 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03541}03541         \textcolor{comment}{/* Ignore link changes when link is not ready */}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03542}03542         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}}-\/>mii\_media\_status \& (IFM\_AVALID | IFM\_ACTIVE)) !=}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03543}03543             (IFM\_AVALID | IFM\_ACTIVE)) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03544}03544                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03545}03545         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03546}03546 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03547}03547         \textcolor{keywordflow}{if} ((adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}}-\/>mii\_media\_active \& IFM\_FDX) != 0)}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03548}03548                 duplex = 1;}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03549}03549 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03550}03550         speed = IFM\_SUBTYPE(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}}-\/>mii\_media\_active);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03551}03551 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03552}03552         \textcolor{keywordflow}{if} (speed == IFM\_10\_T) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03553}03553                 al\_eth\_mac\_link\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, 0, 1,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03554}03554                     \mbox{\hyperlink{al__eth_8c_a09eff3009462825ce2b1a07801d7852a}{AL\_10BASE\_T\_SPEED}}, duplex);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03555}03555                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03556}03556         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03557}03557 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03558}03558         \textcolor{keywordflow}{if} (speed == IFM\_100\_TX) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03559}03559                 al\_eth\_mac\_link\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, 0, 1,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03560}03560                     \mbox{\hyperlink{al__eth_8c_a618c2d8625bcb0fe42c40f195144f4e1}{AL\_100BASE\_TX\_SPEED}}, duplex);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03561}03561                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03562}03562         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03563}03563 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03564}03564         \textcolor{keywordflow}{if} (speed == IFM\_1000\_T) \{}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03565}03565                 al\_eth\_mac\_link\_config(\&adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a1f49acb851bebfeaa67980703423d153}{hal\_adapter}}, 0, 1,}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03566}03566                     \mbox{\hyperlink{al__eth_8c_a27525e5828f78bc4938d3cb3a30e86f5}{AL\_1000BASE\_T\_SPEED}}, duplex);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03567}03567                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03568}03568         \}}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03569}03569 }
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03570}03570         device\_printf(adapter-\/>\mbox{\hyperlink{structal__eth__adapter_a58cf8b60047992f8faded0d967bf0ee2}{dev}}, \textcolor{stringliteral}{"{}ERROR: unknown MII media active 0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03571}03571             adapter-\/>\mbox{\hyperlink{structal__eth__adapter_ad5f137141d8c214d88168d38533afb78}{mii}}-\/>mii\_media\_active);}
\DoxyCodeLine{\Hypertarget{al__eth_8c_source_l03572}03572 \}}

\end{DoxyCode}
