The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/pci/if_sisreg.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 1997, 1998, 1999
    3  *      Bill Paul <wpaul@ee.columbia.edu>.  All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  * 3. All advertising materials mentioning features or use of this software
   14  *    must display the following acknowledgement:
   15  *      This product includes software developed by Bill Paul.
   16  * 4. Neither the name of the author nor the names of any co-contributors
   17  *    may be used to endorse or promote products derived from this software
   18  *    without specific prior written permission.
   19  *
   20  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
   21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   23  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
   24  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
   30  * THE POSSIBILITY OF SUCH DAMAGE.
   31  *
   32  * $FreeBSD$
   33  */
   34 
   35 /*
   36  * Register definitions for the SiS 900 and SiS 7016 chipsets. The
   37  * 7016 is actually an older chip and some of its registers differ
   38  * from the 900, however the core operational registers are the same:
   39  * the differences lie in the OnNow/Wake on LAN stuff which we don't
   40  * use anyway. The 7016 needs an external MII compliant PHY while the
   41  * SiS 900 has one built in. All registers are 32-bits wide.
   42  */
   43 
   44 /* Registers common to SiS 900 and SiS 7016 */
   45 #define SIS_CSR                 0x00
   46 #define SIS_CFG                 0x04
   47 #define SIS_EECTL               0x08
   48 #define SIS_PCICTL              0x0C
   49 #define SIS_ISR                 0x10
   50 #define SIS_IMR                 0x14
   51 #define SIS_IER                 0x18
   52 #define SIS_PHYCTL              0x1C
   53 #define SIS_TX_LISTPTR          0x20
   54 #define SIS_TX_CFG              0x24
   55 #define SIS_RX_LISTPTR          0x30
   56 #define SIS_RX_CFG              0x34
   57 #define SIS_FLOWCTL             0x38
   58 #define SIS_RXFILT_CTL          0x48
   59 #define SIS_RXFILT_DATA         0x4C
   60 #define SIS_PWRMAN_CTL          0xB0
   61 #define SIS_PWERMAN_WKUP_EVENT  0xB4
   62 #define SIS_WKUP_FRAME_CRC      0xBC
   63 #define SIS_WKUP_FRAME_MASK0    0xC0
   64 #define SIS_WKUP_FRAME_MASKXX   0xEC
   65 
   66 /* SiS 7016 specific registers */
   67 #define SIS_SILICON_REV         0x5C
   68 #define SIS_MIB_CTL0            0x60
   69 #define SIS_MIB_CTL1            0x64
   70 #define SIS_MIB_CTL2            0x68
   71 #define SIS_MIB_CTL3            0x6C
   72 #define SIS_MIB                 0x80
   73 #define SIS_LINKSTS             0xA0
   74 #define SIS_TIMEUNIT            0xA4
   75 #define SIS_GPIO                0xB8
   76 
   77 #define SIS_CSR_TX_ENABLE       0x00000001
   78 #define SIS_CSR_TX_DISABLE      0x00000002
   79 #define SIS_CSR_RX_ENABLE       0x00000004
   80 #define SIS_CSR_RX_DISABLE      0x00000008
   81 #define SIS_CSR_TX_RESET        0x00000010
   82 #define SIS_CSR_RX_RESET        0x00000020
   83 #define SIS_CSR_SOFTINTR        0x00000080
   84 #define SIS_CSR_RESET           0x00000100
   85 
   86 #define SIS_CFG_BIGENDIAN       0x00000001
   87 #define SIS_CFG_PERR_DETECT     0x00000008
   88 #define SIS_CFG_DEFER_DISABLE   0x00000010
   89 #define SIS_CFG_OUTOFWIN_TIMER  0x00000020
   90 #define SIS_CFG_SINGLE_BACKOFF  0x00000040
   91 #define SIS_CFG_PCIREQ_ALG      0x00000080
   92 
   93 #define SIS_EECTL_DIN           0x00000001
   94 #define SIS_EECTL_DOUT          0x00000002
   95 #define SIS_EECTL_CLK           0x00000004
   96 #define SIS_EECTL_CSEL          0x00000008
   97 
   98 #define SIS_EECMD_WRITE         0x140
   99 #define SIS_EECMD_READ          0x180
  100 #define SIS_EECMD_ERASE         0x1c0
  101 
  102 #define SIS_EE_NODEADDR         0x8
  103 
  104 #define SIS_PCICTL_SRAMADDR     0x0000001F
  105 #define SIS_PCICTL_RAMTSTENB    0x00000020
  106 #define SIS_PCICTL_TXTSTENB     0x00000040
  107 #define SIS_PCICTL_RXTSTENB     0x00000080
  108 #define SIS_PCICTL_BMTSTENB     0x00000200
  109 #define SIS_PCICTL_RAMADDR      0x001F0000
  110 #define SIS_PCICTL_ROMTIME      0x0F000000
  111 #define SIS_PCICTL_DISCTEST     0x40000000
  112 
  113 #define SIS_ISR_RX_OK           0x00000001
  114 #define SIS_ISR_RX_DESC_OK      0x00000002
  115 #define SIS_ISR_RX_ERR          0x00000004
  116 #define SIS_ISR_RX_EARLY        0x00000008
  117 #define SIS_ISR_RX_IDLE         0x00000010
  118 #define SIS_ISR_RX_OFLOW        0x00000020
  119 #define SIS_ISR_TX_OK           0x00000040
  120 #define SIS_ISR_TX_DESC_OK      0x00000080
  121 #define SIS_ISR_TX_ERR          0x00000100
  122 #define SIS_ISR_TX_IDLE         0x00000200
  123 #define SIS_ISR_TX_UFLOW        0x00000400
  124 #define SIS_ISR_SOFTINTR        0x00000800
  125 #define SIS_ISR_HIBITS          0x00008000
  126 #define SIS_ISR_RX_FIFO_OFLOW   0x00010000
  127 #define SIS_ISR_TGT_ABRT        0x00100000
  128 #define SIS_ISR_BM_ABRT         0x00200000
  129 #define SIS_ISR_SYSERR          0x00400000
  130 #define SIS_ISR_PARITY_ERR      0x00800000
  131 #define SIS_ISR_RX_RESET_DONE   0x01000000
  132 #define SIS_ISR_TX_RESET_DONE   0x02000000
  133 #define SIS_ISR_TX_PAUSE_START  0x04000000
  134 #define SIS_ISR_TX_PAUSE_DONE   0x08000000
  135 #define SIS_ISR_WAKE_EVENT      0x10000000
  136 
  137 #define SIS_IMR_RX_OK           0x00000001
  138 #define SIS_IMR_RX_DESC_OK      0x00000002
  139 #define SIS_IMR_RX_ERR          0x00000004
  140 #define SIS_IMR_RX_EARLY        0x00000008
  141 #define SIS_IMR_RX_IDLE         0x00000010
  142 #define SIS_IMR_RX_OFLOW        0x00000020
  143 #define SIS_IMR_TX_OK           0x00000040
  144 #define SIS_IMR_TX_DESC_OK      0x00000080
  145 #define SIS_IMR_TX_ERR          0x00000100
  146 #define SIS_IMR_TX_IDLE         0x00000200
  147 #define SIS_IMR_TX_UFLOW        0x00000400
  148 #define SIS_IMR_SOFTINTR        0x00000800
  149 #define SIS_IMR_HIBITS          0x00008000
  150 #define SIS_IMR_RX_FIFO_OFLOW   0x00010000
  151 #define SIS_IMR_TGT_ABRT        0x00100000
  152 #define SIS_IMR_BM_ABRT         0x00200000
  153 #define SIS_IMR_SYSERR          0x00400000
  154 #define SIS_IMR_PARITY_ERR      0x00800000
  155 #define SIS_IMR_RX_RESET_DONE   0x01000000
  156 #define SIS_IMR_TX_RESET_DONE   0x02000000
  157 #define SIS_IMR_TX_PAUSE_START  0x04000000
  158 #define SIS_IMR_TX_PAUSE_DONE   0x08000000
  159 #define SIS_IMR_WAKE_EVENT      0x10000000
  160 
  161 #define SIS_INTRS       \
  162         (SIS_IMR_RX_OFLOW|SIS_IMR_TX_UFLOW|SIS_IMR_TX_OK|\
  163          SIS_IMR_TX_IDLE|SIS_IMR_RX_OK|SIS_IMR_RX_ERR|\
  164          SIS_IMR_SYSERR)
  165 
  166 #define SIS_IER_INTRENB         0x00000001
  167 
  168 #define SIS_PHYCTL_ACCESS       0x00000010
  169 #define SIS_PHYCTL_OP           0x00000020
  170 #define SIS_PHYCTL_REGADDR      0x000007C0
  171 #define SIS_PHYCTL_PHYADDR      0x0000F800
  172 #define SIS_PHYCTL_PHYDATA      0xFFFF0000
  173 
  174 #define SIS_PHYOP_READ          0x00000020
  175 #define SIS_PHYOP_WRITE         0x00000000
  176 
  177 #define SIS_TXCFG_DRAIN_THRESH  0x0000003F /* 32-byte units */
  178 #define SIS_TXCFG_FILL_THRESH   0x00003F00 /* 32-byte units */
  179 #define SIS_TXCFG_DMABURST      0x00700000
  180 #define SIS_TXCFG_AUTOPAD       0x10000000
  181 #define SIS_TXCFG_LOOPBK        0x20000000
  182 #define SIS_TXCFG_IGN_HBEAT     0x40000000
  183 #define SIS_TXCFG_IGN_CARR      0x80000000
  184 
  185 #define SIS_TXCFG_DRAIN(x)      (((x) >> 5) & SIS_TXCFG_DRAIN_THRESH)
  186 #define SIS_TXCFG_FILL(x)       ((((x) >> 5) << 8) & SIS_TXCFG_FILL_THRESH)
  187 
  188 #define SIS_TXDMA_512BYTES      0x00000000
  189 #define SIS_TXDMA_4BYTES        0x00100000
  190 #define SIS_TXDMA_8BYTES        0x00200000
  191 #define SIS_TXDMA_16BYTES       0x00300000
  192 #define SIS_TXDMA_32BYTES       0x00400000
  193 #define SIS_TXDMA_64BYTES       0x00500000
  194 #define SIS_TXDMA_128BYTES      0x00600000
  195 #define SIS_TXDMA_256BYTES      0x00700000
  196 
  197 #define SIS_TXCFG       \
  198         (SIS_TXDMA_64BYTES|SIS_TXCFG_AUTOPAD|\
  199          SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1500))
  200 
  201 #define SIS_RXCFG_DRAIN_THRESH  0x0000003E /* 8-byte units */
  202 #define SIS_RXCFG_DMABURST      0x00700000
  203 #define SIS_RXCFG_RX_JABBER     0x08000000
  204 #define SIS_RXCFG_RX_TXPKTS     0x10000000
  205 #define SIS_RXCFG_RX_RUNTS      0x40000000
  206 #define SIS_RXCFG_RX_GIANTS     0x80000000
  207 
  208 #define SIS_RXCFG_DRAIN(x)      ((((x) >> 3) << 1) & SIS_RXCFG_DRAIN_THRESH)
  209 
  210 #define SIS_RXDMA_512BYTES      0x00000000
  211 #define SIS_RXDMA_4BYTES        0x00100000
  212 #define SIS_RXDMA_8BYTES        0x00200000
  213 #define SIS_RXDMA_16BYTES       0x00300000
  214 #define SIS_RXDMA_32BYTES       0x00400000
  215 #define SIS_RXDMA_64BYTES       0x00500000
  216 #define SIS_RXDMA_128BYTES      0x00600000
  217 #define SIS_RXDMA_256BYTES      0x00700000
  218 
  219 #define SIS_RXCFG \
  220         (SIS_RXCFG_DRAIN(64)|SIS_RXDMA_256BYTES)
  221 
  222 #define SIS_RXFILTCTL_ADDR      0x000F0000
  223 #define SIS_RXFILTCTL_ALLPHYS   0x10000000
  224 #define SIS_RXFILTCTL_ALLMULTI  0x20000000
  225 #define SIS_RXFILTCTL_BROAD     0x40000000
  226 #define SIS_RXFILTCTL_ENABLE    0x80000000
  227 
  228 #define SIS_FILTADDR_PAR0       0x00000000
  229 #define SIS_FILTADDR_PAR1       0x00010000
  230 #define SIS_FILTADDR_PAR2       0x00020000
  231 #define SIS_FILTADDR_MAR0       0x00040000
  232 #define SIS_FILTADDR_MAR1       0x00050000
  233 #define SIS_FILTADDR_MAR2       0x00060000
  234 #define SIS_FILTADDR_MAR3       0x00070000
  235 #define SIS_FILTADDR_MAR4       0x00080000
  236 #define SIS_FILTADDR_MAR5       0x00090000
  237 #define SIS_FILTADDR_MAR6       0x000A0000
  238 #define SIS_FILTADDR_MAR7       0x000B0000
  239 
  240 /*
  241  * DMA descriptor structures. The first part of the descriptor
  242  * is the hardware descriptor format, which is just three longwords.
  243  * After this, we include some additional structure members for
  244  * use by the driver. Note that for this structure will be a different
  245  * size on the alpha, but that's okay as long as it's a multiple of 4
  246  * bytes in size.
  247  */
  248 struct sis_desc {
  249         /* SiS hardware descriptor section */
  250         u_int32_t               sis_next;
  251         u_int32_t               sis_cmdsts;
  252 #define sis_rxstat              sis_cmdsts
  253 #define sis_txstat              sis_cmdsts
  254 #define sis_ctl                 sis_cmdsts
  255         u_int32_t               sis_ptr;
  256         /* Driver software section */
  257         struct mbuf             *sis_mbuf;
  258         struct sis_desc         *sis_nextdesc;
  259 };
  260 
  261 #define SIS_CMDSTS_BUFLEN       0x00000FFF
  262 #define SIS_CMDSTS_PKT_OK       0x08000000
  263 #define SIS_CMDSTS_CRC          0x10000000
  264 #define SIS_CMDSTS_INTR         0x20000000
  265 #define SIS_CMDSTS_MORE         0x40000000
  266 #define SIS_CMDSTS_OWN          0x80000000
  267 
  268 #define SIS_LASTDESC(x)         (!((x)->sis_ctl & SIS_CMDSTS_MORE)))
  269 #define SIS_OWNDESC(x)          ((x)->sis_ctl & SIS_CMDSTS_OWN)
  270 #define SIS_INC(x, y)           (x) = (x + 1) % y
  271 #define SIS_RXBYTES(x)          ((x)->sis_ctl & SIS_CMDSTS_BUFLEN)
  272 
  273 #define SIS_RXSTAT_COLL         0x00010000
  274 #define SIS_RXSTAT_LOOPBK       0x00020000
  275 #define SIS_RXSTAT_ALIGNERR     0x00040000
  276 #define SIS_RXSTAT_CRCERR       0x00080000
  277 #define SIS_RXSTAT_SYMBOLERR    0x00100000
  278 #define SIS_RXSTAT_RUNT         0x00200000
  279 #define SIS_RXSTAT_GIANT        0x00400000
  280 #define SIS_RXSTAT_DSTCLASS     0x01800000
  281 #define SIS_RXSTAT_OVERRUN      0x02000000
  282 #define SIS_RXSTAT_RX_ABORT     0x04000000
  283 
  284 #define SIS_DSTCLASS_REJECT     0x00000000
  285 #define SIS_DSTCLASS_UNICAST    0x00800000
  286 #define SIS_DSTCLASS_MULTICAST  0x01000000
  287 #define SIS_DSTCLASS_BROADCAST  0x02000000
  288 
  289 #define SIS_TXSTAT_COLLCNT      0x000F0000
  290 #define SIS_TXSTAT_EXCESSCOLLS  0x00100000
  291 #define SIS_TXSTAT_OUTOFWINCOLL 0x00200000
  292 #define SIS_TXSTAT_EXCESS_DEFER 0x00400000
  293 #define SIS_TXSTAT_DEFERED      0x00800000
  294 #define SIS_TXSTAT_CARR_LOST    0x01000000
  295 #define SIS_TXSTAT_UNDERRUN     0x02000000
  296 #define SIS_TXSTAT_TX_ABORT     0x04000000
  297 
  298 #define SIS_RX_LIST_CNT         64
  299 #define SIS_TX_LIST_CNT         128
  300 
  301 struct sis_list_data {
  302         struct sis_desc         sis_rx_list[SIS_RX_LIST_CNT];
  303         struct sis_desc         sis_tx_list[SIS_TX_LIST_CNT];
  304 };
  305 
  306 struct sis_ring_data {
  307         int                     sis_rx_prod;
  308         int                     sis_tx_prod;
  309         int                     sis_tx_cons;
  310         int                     sis_tx_cnt;
  311 };
  312 
  313 
  314 /*
  315  * SiS PCI vendor ID.
  316  */
  317 #define SIS_VENDORID            0x1039
  318 
  319 /*
  320  * SiS PCI device IDs
  321  */
  322 #define SIS_DEVICEID_900        0x0900
  323 #define SIS_DEVICEID_7016       0x7016
  324 
  325 struct sis_type {
  326         u_int16_t               sis_vid;
  327         u_int16_t               sis_did;
  328         char                    *sis_name;
  329 };
  330 
  331 #define SIS_TYPE_900    1
  332 #define SIS_TYPE_7016   2
  333 
  334 struct sis_softc {
  335         struct arpcom           arpcom;         /* interface info */
  336         struct ifmedia          ifmedia;
  337         bus_space_handle_t      sis_bhandle;
  338         bus_space_tag_t         sis_btag;
  339         u_int8_t                sis_unit;
  340         u_int8_t                sis_type;
  341         int                     sis_phy_addr;
  342         struct sis_type         *sis_pinfo;
  343         u_int8_t                sis_autoneg;
  344         u_int8_t                sis_want_auto;
  345         u_int8_t                sis_tx_pend;
  346         struct sis_list_data    *sis_ldata;
  347         struct sis_ring_data    sis_cdata;
  348 };
  349 
  350 /*
  351  * register space access macros
  352  */
  353 #define CSR_WRITE_4(sc, reg, val)       \
  354         bus_space_write_4(sc->sis_btag, sc->sis_bhandle, reg, val)
  355 
  356 #define CSR_READ_4(sc, reg)             \
  357         bus_space_read_4(sc->sis_btag, sc->sis_bhandle, reg)
  358 
  359 #define SIS_TIMEOUT             1000
  360 #define ETHER_ALIGN             2
  361 #define SIS_RXLEN               1536
  362 #define SIS_MIN_FRAMELEN        60
  363 
  364 /*
  365  * PCI low memory base and low I/O base register, and
  366  * other PCI registers.
  367  */
  368 
  369 #define SIS_PCI_VENDOR_ID       0x00
  370 #define SIS_PCI_DEVICE_ID       0x02
  371 #define SIS_PCI_COMMAND         0x04
  372 #define SIS_PCI_STATUS          0x06
  373 #define SIS_PCI_REVID           0x08
  374 #define SIS_PCI_CLASSCODE       0x09
  375 #define SIS_PCI_CACHELEN        0x0C
  376 #define SIS_PCI_LATENCY_TIMER   0x0D
  377 #define SIS_PCI_HEADER_TYPE     0x0E
  378 #define SIS_PCI_LOIO            0x10
  379 #define SIS_PCI_LOMEM           0x14
  380 #define SIS_PCI_BIOSROM         0x30
  381 #define SIS_PCI_INTLINE         0x3C
  382 #define SIS_PCI_INTPIN          0x3D
  383 #define SIS_PCI_MINGNT          0x3E
  384 #define SIS_PCI_MINLAT          0x0F
  385 #define SIS_PCI_RESETOPT        0x48
  386 #define SIS_PCI_EEPROM_DATA     0x4C
  387 
  388 /* power management registers */
  389 #define SIS_PCI_CAPID           0x50 /* 8 bits */
  390 #define SIS_PCI_NEXTPTR         0x51 /* 8 bits */
  391 #define SIS_PCI_PWRMGMTCAP      0x52 /* 16 bits */
  392 #define SIS_PCI_PWRMGMTCTRL     0x54 /* 16 bits */
  393 
  394 #define SIS_PSTATE_MASK         0x0003
  395 #define SIS_PSTATE_D0           0x0000
  396 #define SIS_PSTATE_D1           0x0001
  397 #define SIS_PSTATE_D2           0x0002
  398 #define SIS_PSTATE_D3           0x0003
  399 #define SIS_PME_EN              0x0010
  400 #define SIS_PME_STATUS          0x8000
  401 
  402 #define SIS_FLAG_FORCEDELAY     1
  403 #define SIS_FLAG_SCHEDDELAY     2
  404 #define SIS_FLAG_DELAYTIMEO     3
  405 
  406 #define SIS_PHYADDR_MIN         0x00
  407 #define SIS_PHYADDR_MAX         0x1F
  408 
  409 #define PHY_UNKNOWN             6
  410 
  411 #define AL_PHYADDR_MIN          0x00
  412 #define AL_PHYADDR_MAL          0x1F
  413 
  414 #define PHY_BMCR                0x00
  415 #define PHY_BMSR                0x01
  416 #define PHY_VENID               0x02
  417 #define PHY_DEVID               0x03
  418 #define PHY_ANAR                0x04
  419 #define PHY_LPAR                0x05
  420 #define PHY_ANEXP               0x06
  421 
  422 #define PHY_ANAR_NEXTPAGE       0x8000
  423 #define PHY_ANAR_RSVD0          0x4000
  424 #define PHY_ANAR_TLRFLT         0x2000
  425 #define PHY_ANAR_RSVD1          0x1000
  426 #define PHY_ANAR_RSVD2          0x0800
  427 #define PHY_ANAR_RSVD3          0x0400
  428 #define PHY_ANAR_100BT4         0x0200
  429 #define PHY_ANAR_100BTXFULL     0x0100
  430 #define PHY_ANAR_100BTXHALF     0x0080
  431 #define PHY_ANAR_10BTFULL       0x0040
  432 #define PHY_ANAR_10BTHALF       0x0020
  433 #define PHY_ANAR_PROTO4         0x0010
  434 #define PHY_ANAR_PROTO3         0x0008
  435 #define PHY_ANAR_PROTO2         0x0004
  436 #define PHY_ANAR_PROTO1         0x0002
  437 #define PHY_ANAR_PROTO0         0x0001
  438 
  439 /*
  440  * These are the register definitions for the PHY (physical layer
  441  * interface chip).
  442  */
  443 /*
  444  * PHY BMCR Basic Mode Control Register
  445  */
  446 #define PHY_BMCR_RESET                  0x8000
  447 #define PHY_BMCR_LOOPBK                 0x4000
  448 #define PHY_BMCR_SPEEDSEL               0x2000
  449 #define PHY_BMCR_AUTONEGENBL            0x1000
  450 #define PHY_BMCR_RSVD0                  0x0800  /* write as zero */
  451 #define PHY_BMCR_ISOLATE                0x0400
  452 #define PHY_BMCR_AUTONEGRSTR            0x0200
  453 #define PHY_BMCR_DUPLEX                 0x0100
  454 #define PHY_BMCR_COLLTEST               0x0080
  455 #define PHY_BMCR_RSVD1                  0x0040  /* write as zero, don't care */
  456 #define PHY_BMCR_RSVD2                  0x0020  /* write as zero, don't care */
  457 #define PHY_BMCR_RSVD3                  0x0010  /* write as zero, don't care */
  458 #define PHY_BMCR_RSVD4                  0x0008  /* write as zero, don't care */
  459 #define PHY_BMCR_RSVD5                  0x0004  /* write as zero, don't care */
  460 #define PHY_BMCR_RSVD6                  0x0002  /* write as zero, don't care */
  461 #define PHY_BMCR_RSVD7                  0x0001  /* write as zero, don't care */
  462 /*
  463  * RESET: 1 == software reset, 0 == normal operation
  464  * Resets status and control registers to default values.
  465  * Relatches all hardware config values.
  466  *
  467  * LOOPBK: 1 == loopback operation enabled, 0 == normal operation
  468  *
  469  * SPEEDSEL: 1 == 100Mb/s, 0 == 10Mb/s
  470  * Link speed is selected byt his bit or if auto-negotiation if bit
  471  * 12 (AUTONEGENBL) is set (in which case the value of this register
  472  * is ignored).
  473  *
  474  * AUTONEGENBL: 1 == Autonegotiation enabled, 0 == Autonegotiation disabled
  475  * Bits 8 and 13 are ignored when autoneg is set, otherwise bits 8 and 13
  476  * determine speed and mode. Should be cleared and then set if PHY configured
  477  * for no autoneg on startup.
  478  *
  479  * ISOLATE: 1 == isolate PHY from MII, 0 == normal operation
  480  *
  481  * AUTONEGRSTR: 1 == restart autonegotiation, 0 = normal operation
  482  *
  483  * DUPLEX: 1 == full duplex mode, 0 == half duplex mode
  484  *
  485  * COLLTEST: 1 == collision test enabled, 0 == normal operation
  486  */
  487 
  488 /* 
  489  * PHY, BMSR Basic Mode Status Register 
  490  */   
  491 #define PHY_BMSR_100BT4                 0x8000
  492 #define PHY_BMSR_100BTXFULL             0x4000
  493 #define PHY_BMSR_100BTXHALF             0x2000
  494 #define PHY_BMSR_10BTFULL               0x1000
  495 #define PHY_BMSR_10BTHALF               0x0800
  496 #define PHY_BMSR_RSVD1                  0x0400  /* write as zero, don't care */
  497 #define PHY_BMSR_RSVD2                  0x0200  /* write as zero, don't care */
  498 #define PHY_BMSR_RSVD3                  0x0100  /* write as zero, don't care */
  499 #define PHY_BMSR_RSVD4                  0x0080  /* write as zero, don't care */
  500 #define PHY_BMSR_MFPRESUP               0x0040
  501 #define PHY_BMSR_AUTONEGCOMP            0x0020
  502 #define PHY_BMSR_REMFAULT               0x0010
  503 #define PHY_BMSR_CANAUTONEG             0x0008
  504 #define PHY_BMSR_LINKSTAT               0x0004
  505 #define PHY_BMSR_JABBER                 0x0002
  506 #define PHY_BMSR_EXTENDED               0x0001
  507 
  508 #ifdef __alpha__
  509 #undef vtophys
  510 #define vtophys(va)             (pmap_kextract(((vm_offset_t) (va))) \
  511                                         + 1*1024*1024*1024)
  512 #endif

Cache object: a3d068c9edbf6f7128cf8aa01c25433d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.