1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2e689cf4aSJeff Kirsher /* $Id: sunhme.h,v 1.33 2001/08/03 06:23:04 davem Exp $ 3e689cf4aSJeff Kirsher * sunhme.h: Definitions for Sparc HME/BigMac 10/100baseT ethernet driver. 4e689cf4aSJeff Kirsher * Also known as the "Happy Meal". 5e689cf4aSJeff Kirsher * 6e689cf4aSJeff Kirsher * Copyright (C) 1996, 1999 David S. Miller (davem@redhat.com) 7e689cf4aSJeff Kirsher */ 8e689cf4aSJeff Kirsher 9e689cf4aSJeff Kirsher #ifndef _SUNHME_H 10e689cf4aSJeff Kirsher #define _SUNHME_H 11e689cf4aSJeff Kirsher 12e689cf4aSJeff Kirsher #include <linux/pci.h> 13e689cf4aSJeff Kirsher 14e689cf4aSJeff Kirsher /* Happy Meal global registers. */ 15e689cf4aSJeff Kirsher #define GREG_SWRESET 0x000UL /* Software Reset */ 16e689cf4aSJeff Kirsher #define GREG_CFG 0x004UL /* Config Register */ 1796a734baSMark Cave-Ayland #define GREG_STAT 0x100UL /* Status */ 1896a734baSMark Cave-Ayland #define GREG_IMASK 0x104UL /* Interrupt Mask */ 1996a734baSMark Cave-Ayland #define GREG_REG_SIZE 0x108UL 20e689cf4aSJeff Kirsher 21e689cf4aSJeff Kirsher /* Global reset register. */ 22e689cf4aSJeff Kirsher #define GREG_RESET_ETX 0x01 23e689cf4aSJeff Kirsher #define GREG_RESET_ERX 0x02 24e689cf4aSJeff Kirsher #define GREG_RESET_ALL 0x03 25e689cf4aSJeff Kirsher 26e689cf4aSJeff Kirsher /* Global config register. */ 27e689cf4aSJeff Kirsher #define GREG_CFG_BURSTMSK 0x03 28e689cf4aSJeff Kirsher #define GREG_CFG_BURST16 0x00 29e689cf4aSJeff Kirsher #define GREG_CFG_BURST32 0x01 30e689cf4aSJeff Kirsher #define GREG_CFG_BURST64 0x02 31e689cf4aSJeff Kirsher #define GREG_CFG_64BIT 0x04 32e689cf4aSJeff Kirsher #define GREG_CFG_PARITY 0x08 33e689cf4aSJeff Kirsher #define GREG_CFG_RESV 0x10 34e689cf4aSJeff Kirsher 35e689cf4aSJeff Kirsher /* Global status register. */ 36e689cf4aSJeff Kirsher #define GREG_STAT_GOTFRAME 0x00000001 /* Received a frame */ 37e689cf4aSJeff Kirsher #define GREG_STAT_RCNTEXP 0x00000002 /* Receive frame counter expired */ 38e689cf4aSJeff Kirsher #define GREG_STAT_ACNTEXP 0x00000004 /* Align-error counter expired */ 39e689cf4aSJeff Kirsher #define GREG_STAT_CCNTEXP 0x00000008 /* CRC-error counter expired */ 40e689cf4aSJeff Kirsher #define GREG_STAT_LCNTEXP 0x00000010 /* Length-error counter expired */ 41e689cf4aSJeff Kirsher #define GREG_STAT_RFIFOVF 0x00000020 /* Receive FIFO overflow */ 42e689cf4aSJeff Kirsher #define GREG_STAT_CVCNTEXP 0x00000040 /* Code-violation counter expired */ 43e689cf4aSJeff Kirsher #define GREG_STAT_STSTERR 0x00000080 /* Test error in XIF for SQE */ 44e689cf4aSJeff Kirsher #define GREG_STAT_SENTFRAME 0x00000100 /* Transmitted a frame */ 45e689cf4aSJeff Kirsher #define GREG_STAT_TFIFO_UND 0x00000200 /* Transmit FIFO underrun */ 46e689cf4aSJeff Kirsher #define GREG_STAT_MAXPKTERR 0x00000400 /* Max-packet size error */ 47e689cf4aSJeff Kirsher #define GREG_STAT_NCNTEXP 0x00000800 /* Normal-collision counter expired */ 48e689cf4aSJeff Kirsher #define GREG_STAT_ECNTEXP 0x00001000 /* Excess-collision counter expired */ 49e689cf4aSJeff Kirsher #define GREG_STAT_LCCNTEXP 0x00002000 /* Late-collision counter expired */ 50e689cf4aSJeff Kirsher #define GREG_STAT_FCNTEXP 0x00004000 /* First-collision counter expired */ 51e689cf4aSJeff Kirsher #define GREG_STAT_DTIMEXP 0x00008000 /* Defer-timer expired */ 52e689cf4aSJeff Kirsher #define GREG_STAT_RXTOHOST 0x00010000 /* Moved from receive-FIFO to host memory */ 53e689cf4aSJeff Kirsher #define GREG_STAT_NORXD 0x00020000 /* No more receive descriptors */ 54e689cf4aSJeff Kirsher #define GREG_STAT_RXERR 0x00040000 /* Error during receive dma */ 55e689cf4aSJeff Kirsher #define GREG_STAT_RXLATERR 0x00080000 /* Late error during receive dma */ 56e689cf4aSJeff Kirsher #define GREG_STAT_RXPERR 0x00100000 /* Parity error during receive dma */ 57e689cf4aSJeff Kirsher #define GREG_STAT_RXTERR 0x00200000 /* Tag error during receive dma */ 58e689cf4aSJeff Kirsher #define GREG_STAT_EOPERR 0x00400000 /* Transmit descriptor did not have EOP set */ 59e689cf4aSJeff Kirsher #define GREG_STAT_MIFIRQ 0x00800000 /* MIF is signaling an interrupt condition */ 60e689cf4aSJeff Kirsher #define GREG_STAT_HOSTTOTX 0x01000000 /* Moved from host memory to transmit-FIFO */ 61e689cf4aSJeff Kirsher #define GREG_STAT_TXALL 0x02000000 /* Transmitted all packets in the tx-fifo */ 62e689cf4aSJeff Kirsher #define GREG_STAT_TXEACK 0x04000000 /* Error during transmit dma */ 63e689cf4aSJeff Kirsher #define GREG_STAT_TXLERR 0x08000000 /* Late error during transmit dma */ 64e689cf4aSJeff Kirsher #define GREG_STAT_TXPERR 0x10000000 /* Parity error during transmit dma */ 65e689cf4aSJeff Kirsher #define GREG_STAT_TXTERR 0x20000000 /* Tag error during transmit dma */ 66e689cf4aSJeff Kirsher #define GREG_STAT_SLVERR 0x40000000 /* PIO access got an error */ 67e689cf4aSJeff Kirsher #define GREG_STAT_SLVPERR 0x80000000 /* PIO access got a parity error */ 68e689cf4aSJeff Kirsher 69e689cf4aSJeff Kirsher /* All interesting error conditions. */ 70e689cf4aSJeff Kirsher #define GREG_STAT_ERRORS 0xfc7efefc 71e689cf4aSJeff Kirsher 72e689cf4aSJeff Kirsher /* Global interrupt mask register. */ 73e689cf4aSJeff Kirsher #define GREG_IMASK_GOTFRAME 0x00000001 /* Received a frame */ 74e689cf4aSJeff Kirsher #define GREG_IMASK_RCNTEXP 0x00000002 /* Receive frame counter expired */ 75e689cf4aSJeff Kirsher #define GREG_IMASK_ACNTEXP 0x00000004 /* Align-error counter expired */ 76e689cf4aSJeff Kirsher #define GREG_IMASK_CCNTEXP 0x00000008 /* CRC-error counter expired */ 77e689cf4aSJeff Kirsher #define GREG_IMASK_LCNTEXP 0x00000010 /* Length-error counter expired */ 78e689cf4aSJeff Kirsher #define GREG_IMASK_RFIFOVF 0x00000020 /* Receive FIFO overflow */ 79e689cf4aSJeff Kirsher #define GREG_IMASK_CVCNTEXP 0x00000040 /* Code-violation counter expired */ 80e689cf4aSJeff Kirsher #define GREG_IMASK_STSTERR 0x00000080 /* Test error in XIF for SQE */ 81e689cf4aSJeff Kirsher #define GREG_IMASK_SENTFRAME 0x00000100 /* Transmitted a frame */ 82e689cf4aSJeff Kirsher #define GREG_IMASK_TFIFO_UND 0x00000200 /* Transmit FIFO underrun */ 83e689cf4aSJeff Kirsher #define GREG_IMASK_MAXPKTERR 0x00000400 /* Max-packet size error */ 84e689cf4aSJeff Kirsher #define GREG_IMASK_NCNTEXP 0x00000800 /* Normal-collision counter expired */ 85e689cf4aSJeff Kirsher #define GREG_IMASK_ECNTEXP 0x00001000 /* Excess-collision counter expired */ 86e689cf4aSJeff Kirsher #define GREG_IMASK_LCCNTEXP 0x00002000 /* Late-collision counter expired */ 87e689cf4aSJeff Kirsher #define GREG_IMASK_FCNTEXP 0x00004000 /* First-collision counter expired */ 88e689cf4aSJeff Kirsher #define GREG_IMASK_DTIMEXP 0x00008000 /* Defer-timer expired */ 89e689cf4aSJeff Kirsher #define GREG_IMASK_RXTOHOST 0x00010000 /* Moved from receive-FIFO to host memory */ 90e689cf4aSJeff Kirsher #define GREG_IMASK_NORXD 0x00020000 /* No more receive descriptors */ 91e689cf4aSJeff Kirsher #define GREG_IMASK_RXERR 0x00040000 /* Error during receive dma */ 92e689cf4aSJeff Kirsher #define GREG_IMASK_RXLATERR 0x00080000 /* Late error during receive dma */ 93e689cf4aSJeff Kirsher #define GREG_IMASK_RXPERR 0x00100000 /* Parity error during receive dma */ 94e689cf4aSJeff Kirsher #define GREG_IMASK_RXTERR 0x00200000 /* Tag error during receive dma */ 95e689cf4aSJeff Kirsher #define GREG_IMASK_EOPERR 0x00400000 /* Transmit descriptor did not have EOP set */ 96e689cf4aSJeff Kirsher #define GREG_IMASK_MIFIRQ 0x00800000 /* MIF is signaling an interrupt condition */ 97e689cf4aSJeff Kirsher #define GREG_IMASK_HOSTTOTX 0x01000000 /* Moved from host memory to transmit-FIFO */ 98e689cf4aSJeff Kirsher #define GREG_IMASK_TXALL 0x02000000 /* Transmitted all packets in the tx-fifo */ 99e689cf4aSJeff Kirsher #define GREG_IMASK_TXEACK 0x04000000 /* Error during transmit dma */ 100e689cf4aSJeff Kirsher #define GREG_IMASK_TXLERR 0x08000000 /* Late error during transmit dma */ 101e689cf4aSJeff Kirsher #define GREG_IMASK_TXPERR 0x10000000 /* Parity error during transmit dma */ 102e689cf4aSJeff Kirsher #define GREG_IMASK_TXTERR 0x20000000 /* Tag error during transmit dma */ 103e689cf4aSJeff Kirsher #define GREG_IMASK_SLVERR 0x40000000 /* PIO access got an error */ 104e689cf4aSJeff Kirsher #define GREG_IMASK_SLVPERR 0x80000000 /* PIO access got a parity error */ 105e689cf4aSJeff Kirsher 106e689cf4aSJeff Kirsher /* Happy Meal external transmitter registers. */ 107e689cf4aSJeff Kirsher #define ETX_PENDING 0x00UL /* Transmit pending/wakeup register */ 108e689cf4aSJeff Kirsher #define ETX_CFG 0x04UL /* Transmit config register */ 109e689cf4aSJeff Kirsher #define ETX_RING 0x08UL /* Transmit ring pointer */ 110e689cf4aSJeff Kirsher #define ETX_BBASE 0x0cUL /* Transmit buffer base */ 111e689cf4aSJeff Kirsher #define ETX_BDISP 0x10UL /* Transmit buffer displacement */ 112e689cf4aSJeff Kirsher #define ETX_FIFOWPTR 0x14UL /* FIFO write ptr */ 113e689cf4aSJeff Kirsher #define ETX_FIFOSWPTR 0x18UL /* FIFO write ptr (shadow register) */ 114e689cf4aSJeff Kirsher #define ETX_FIFORPTR 0x1cUL /* FIFO read ptr */ 115e689cf4aSJeff Kirsher #define ETX_FIFOSRPTR 0x20UL /* FIFO read ptr (shadow register) */ 116e689cf4aSJeff Kirsher #define ETX_FIFOPCNT 0x24UL /* FIFO packet counter */ 117e689cf4aSJeff Kirsher #define ETX_SMACHINE 0x28UL /* Transmitter state machine */ 118e689cf4aSJeff Kirsher #define ETX_RSIZE 0x2cUL /* Ring descriptor size */ 119e689cf4aSJeff Kirsher #define ETX_BPTR 0x30UL /* Transmit data buffer ptr */ 120e689cf4aSJeff Kirsher #define ETX_REG_SIZE 0x34UL 121e689cf4aSJeff Kirsher 122e689cf4aSJeff Kirsher /* ETX transmit pending register. */ 123e689cf4aSJeff Kirsher #define ETX_TP_DMAWAKEUP 0x00000001 /* Restart transmit dma */ 124e689cf4aSJeff Kirsher 125e689cf4aSJeff Kirsher /* ETX config register. */ 126e689cf4aSJeff Kirsher #define ETX_CFG_DMAENABLE 0x00000001 /* Enable transmit dma */ 127e689cf4aSJeff Kirsher #define ETX_CFG_FIFOTHRESH 0x000003fe /* Transmit FIFO threshold */ 128e689cf4aSJeff Kirsher #define ETX_CFG_IRQDAFTER 0x00000400 /* Interrupt after TX-FIFO drained */ 129e689cf4aSJeff Kirsher #define ETX_CFG_IRQDBEFORE 0x00000000 /* Interrupt before TX-FIFO drained */ 130e689cf4aSJeff Kirsher 131e689cf4aSJeff Kirsher #define ETX_RSIZE_SHIFT 4 132e689cf4aSJeff Kirsher 133e689cf4aSJeff Kirsher /* Happy Meal external receiver registers. */ 134e689cf4aSJeff Kirsher #define ERX_CFG 0x00UL /* Receiver config register */ 135e689cf4aSJeff Kirsher #define ERX_RING 0x04UL /* Receiver ring ptr */ 136e689cf4aSJeff Kirsher #define ERX_BPTR 0x08UL /* Receiver buffer ptr */ 137e689cf4aSJeff Kirsher #define ERX_FIFOWPTR 0x0cUL /* FIFO write ptr */ 138e689cf4aSJeff Kirsher #define ERX_FIFOSWPTR 0x10UL /* FIFO write ptr (shadow register) */ 139e689cf4aSJeff Kirsher #define ERX_FIFORPTR 0x14UL /* FIFO read ptr */ 140e689cf4aSJeff Kirsher #define ERX_FIFOSRPTR 0x18UL /* FIFO read ptr (shadow register) */ 141e689cf4aSJeff Kirsher #define ERX_SMACHINE 0x1cUL /* Receiver state machine */ 142e689cf4aSJeff Kirsher #define ERX_REG_SIZE 0x20UL 143e689cf4aSJeff Kirsher 144e689cf4aSJeff Kirsher /* ERX config register. */ 145e689cf4aSJeff Kirsher #define ERX_CFG_DMAENABLE 0x00000001 /* Enable receive DMA */ 146e689cf4aSJeff Kirsher #define ERX_CFG_RESV1 0x00000006 /* Unused... */ 147e689cf4aSJeff Kirsher #define ERX_CFG_BYTEOFFSET 0x00000038 /* Receive first byte offset */ 148e689cf4aSJeff Kirsher #define ERX_CFG_RESV2 0x000001c0 /* Unused... */ 149e689cf4aSJeff Kirsher #define ERX_CFG_SIZE32 0x00000000 /* Receive ring size == 32 */ 150e689cf4aSJeff Kirsher #define ERX_CFG_SIZE64 0x00000200 /* Receive ring size == 64 */ 151e689cf4aSJeff Kirsher #define ERX_CFG_SIZE128 0x00000400 /* Receive ring size == 128 */ 152e689cf4aSJeff Kirsher #define ERX_CFG_SIZE256 0x00000600 /* Receive ring size == 256 */ 153e689cf4aSJeff Kirsher #define ERX_CFG_RESV3 0x0000f800 /* Unused... */ 154e689cf4aSJeff Kirsher #define ERX_CFG_CSUMSTART 0x007f0000 /* Offset of checksum start, 155e689cf4aSJeff Kirsher * in halfwords. */ 156e689cf4aSJeff Kirsher 157e689cf4aSJeff Kirsher /* I'd like a Big Mac, small fries, small coke, and SparcLinux please. */ 158e689cf4aSJeff Kirsher #define BMAC_XIFCFG 0x0000UL /* XIF config register */ 159e689cf4aSJeff Kirsher /* 0x4-->0x204, reserved */ 160e689cf4aSJeff Kirsher #define BMAC_TXSWRESET 0x208UL /* Transmitter software reset */ 161e689cf4aSJeff Kirsher #define BMAC_TXCFG 0x20cUL /* Transmitter config register */ 162e689cf4aSJeff Kirsher #define BMAC_IGAP1 0x210UL /* Inter-packet gap 1 */ 163e689cf4aSJeff Kirsher #define BMAC_IGAP2 0x214UL /* Inter-packet gap 2 */ 164e689cf4aSJeff Kirsher #define BMAC_ALIMIT 0x218UL /* Transmit attempt limit */ 165e689cf4aSJeff Kirsher #define BMAC_STIME 0x21cUL /* Transmit slot time */ 166e689cf4aSJeff Kirsher #define BMAC_PLEN 0x220UL /* Size of transmit preamble */ 167e689cf4aSJeff Kirsher #define BMAC_PPAT 0x224UL /* Pattern for transmit preamble */ 168e689cf4aSJeff Kirsher #define BMAC_TXSDELIM 0x228UL /* Transmit delimiter */ 169e689cf4aSJeff Kirsher #define BMAC_JSIZE 0x22cUL /* Jam size */ 170e689cf4aSJeff Kirsher #define BMAC_TXMAX 0x230UL /* Transmit max pkt size */ 171e689cf4aSJeff Kirsher #define BMAC_TXMIN 0x234UL /* Transmit min pkt size */ 172e689cf4aSJeff Kirsher #define BMAC_PATTEMPT 0x238UL /* Count of transmit peak attempts */ 173e689cf4aSJeff Kirsher #define BMAC_DTCTR 0x23cUL /* Transmit defer timer */ 174e689cf4aSJeff Kirsher #define BMAC_NCCTR 0x240UL /* Transmit normal-collision counter */ 175e689cf4aSJeff Kirsher #define BMAC_FCCTR 0x244UL /* Transmit first-collision counter */ 176e689cf4aSJeff Kirsher #define BMAC_EXCTR 0x248UL /* Transmit excess-collision counter */ 177e689cf4aSJeff Kirsher #define BMAC_LTCTR 0x24cUL /* Transmit late-collision counter */ 178e689cf4aSJeff Kirsher #define BMAC_RSEED 0x250UL /* Transmit random number seed */ 179e689cf4aSJeff Kirsher #define BMAC_TXSMACHINE 0x254UL /* Transmit state machine */ 180e689cf4aSJeff Kirsher /* 0x258-->0x304, reserved */ 181e689cf4aSJeff Kirsher #define BMAC_RXSWRESET 0x308UL /* Receiver software reset */ 182e689cf4aSJeff Kirsher #define BMAC_RXCFG 0x30cUL /* Receiver config register */ 183e689cf4aSJeff Kirsher #define BMAC_RXMAX 0x310UL /* Receive max pkt size */ 184e689cf4aSJeff Kirsher #define BMAC_RXMIN 0x314UL /* Receive min pkt size */ 185e689cf4aSJeff Kirsher #define BMAC_MACADDR2 0x318UL /* Ether address register 2 */ 186e689cf4aSJeff Kirsher #define BMAC_MACADDR1 0x31cUL /* Ether address register 1 */ 187e689cf4aSJeff Kirsher #define BMAC_MACADDR0 0x320UL /* Ether address register 0 */ 188e689cf4aSJeff Kirsher #define BMAC_FRCTR 0x324UL /* Receive frame receive counter */ 189e689cf4aSJeff Kirsher #define BMAC_GLECTR 0x328UL /* Receive giant-length error counter */ 190e689cf4aSJeff Kirsher #define BMAC_UNALECTR 0x32cUL /* Receive unaligned error counter */ 191e689cf4aSJeff Kirsher #define BMAC_RCRCECTR 0x330UL /* Receive CRC error counter */ 192e689cf4aSJeff Kirsher #define BMAC_RXSMACHINE 0x334UL /* Receiver state machine */ 193e689cf4aSJeff Kirsher #define BMAC_RXCVALID 0x338UL /* Receiver code violation */ 194e689cf4aSJeff Kirsher /* 0x33c, reserved */ 195e689cf4aSJeff Kirsher #define BMAC_HTABLE3 0x340UL /* Hash table 3 */ 196e689cf4aSJeff Kirsher #define BMAC_HTABLE2 0x344UL /* Hash table 2 */ 197e689cf4aSJeff Kirsher #define BMAC_HTABLE1 0x348UL /* Hash table 1 */ 198e689cf4aSJeff Kirsher #define BMAC_HTABLE0 0x34cUL /* Hash table 0 */ 199e689cf4aSJeff Kirsher #define BMAC_AFILTER2 0x350UL /* Address filter 2 */ 200e689cf4aSJeff Kirsher #define BMAC_AFILTER1 0x354UL /* Address filter 1 */ 201e689cf4aSJeff Kirsher #define BMAC_AFILTER0 0x358UL /* Address filter 0 */ 202e689cf4aSJeff Kirsher #define BMAC_AFMASK 0x35cUL /* Address filter mask */ 203e689cf4aSJeff Kirsher #define BMAC_REG_SIZE 0x360UL 204e689cf4aSJeff Kirsher 205e689cf4aSJeff Kirsher /* BigMac XIF config register. */ 206e689cf4aSJeff Kirsher #define BIGMAC_XCFG_ODENABLE 0x00000001 /* Output driver enable */ 207e689cf4aSJeff Kirsher #define BIGMAC_XCFG_XLBACK 0x00000002 /* Loopback-mode XIF enable */ 208e689cf4aSJeff Kirsher #define BIGMAC_XCFG_MLBACK 0x00000004 /* Loopback-mode MII enable */ 209e689cf4aSJeff Kirsher #define BIGMAC_XCFG_MIIDISAB 0x00000008 /* MII receive buffer disable */ 210e689cf4aSJeff Kirsher #define BIGMAC_XCFG_SQENABLE 0x00000010 /* SQE test enable */ 211e689cf4aSJeff Kirsher #define BIGMAC_XCFG_SQETWIN 0x000003e0 /* SQE time window */ 212e689cf4aSJeff Kirsher #define BIGMAC_XCFG_LANCE 0x00000010 /* Lance mode enable */ 213e689cf4aSJeff Kirsher #define BIGMAC_XCFG_LIPG0 0x000003e0 /* Lance mode IPG0 */ 214e689cf4aSJeff Kirsher 215e689cf4aSJeff Kirsher /* BigMac transmit config register. */ 216e689cf4aSJeff Kirsher #define BIGMAC_TXCFG_ENABLE 0x00000001 /* Enable the transmitter */ 217e689cf4aSJeff Kirsher #define BIGMAC_TXCFG_SMODE 0x00000020 /* Enable slow transmit mode */ 218e689cf4aSJeff Kirsher #define BIGMAC_TXCFG_CIGN 0x00000040 /* Ignore transmit collisions */ 219e689cf4aSJeff Kirsher #define BIGMAC_TXCFG_FCSOFF 0x00000080 /* Do not emit FCS */ 220e689cf4aSJeff Kirsher #define BIGMAC_TXCFG_DBACKOFF 0x00000100 /* Disable backoff */ 221e689cf4aSJeff Kirsher #define BIGMAC_TXCFG_FULLDPLX 0x00000200 /* Enable full-duplex */ 222e689cf4aSJeff Kirsher #define BIGMAC_TXCFG_DGIVEUP 0x00000400 /* Don't give up on transmits */ 223e689cf4aSJeff Kirsher 224e689cf4aSJeff Kirsher /* BigMac receive config register. */ 225e689cf4aSJeff Kirsher #define BIGMAC_RXCFG_ENABLE 0x00000001 /* Enable the receiver */ 226e689cf4aSJeff Kirsher #define BIGMAC_RXCFG_PSTRIP 0x00000020 /* Pad byte strip enable */ 227e689cf4aSJeff Kirsher #define BIGMAC_RXCFG_PMISC 0x00000040 /* Enable promiscuous mode */ 228e689cf4aSJeff Kirsher #define BIGMAC_RXCFG_DERR 0x00000080 /* Disable error checking */ 229e689cf4aSJeff Kirsher #define BIGMAC_RXCFG_DCRCS 0x00000100 /* Disable CRC stripping */ 230e689cf4aSJeff Kirsher #define BIGMAC_RXCFG_REJME 0x00000200 /* Reject packets addressed to me */ 231e689cf4aSJeff Kirsher #define BIGMAC_RXCFG_PGRP 0x00000400 /* Enable promisc group mode */ 232e689cf4aSJeff Kirsher #define BIGMAC_RXCFG_HENABLE 0x00000800 /* Enable the hash filter */ 233e689cf4aSJeff Kirsher #define BIGMAC_RXCFG_AENABLE 0x00001000 /* Enable the address filter */ 234e689cf4aSJeff Kirsher 235e689cf4aSJeff Kirsher /* These are the "Management Interface" (ie. MIF) registers of the transceiver. */ 236e689cf4aSJeff Kirsher #define TCVR_BBCLOCK 0x00UL /* Bit bang clock register */ 237e689cf4aSJeff Kirsher #define TCVR_BBDATA 0x04UL /* Bit bang data register */ 238e689cf4aSJeff Kirsher #define TCVR_BBOENAB 0x08UL /* Bit bang output enable */ 239e689cf4aSJeff Kirsher #define TCVR_FRAME 0x0cUL /* Frame control/data register */ 240e689cf4aSJeff Kirsher #define TCVR_CFG 0x10UL /* MIF config register */ 241e689cf4aSJeff Kirsher #define TCVR_IMASK 0x14UL /* MIF interrupt mask */ 242e689cf4aSJeff Kirsher #define TCVR_STATUS 0x18UL /* MIF status */ 243e689cf4aSJeff Kirsher #define TCVR_SMACHINE 0x1cUL /* MIF state machine */ 244e689cf4aSJeff Kirsher #define TCVR_REG_SIZE 0x20UL 245e689cf4aSJeff Kirsher 246e689cf4aSJeff Kirsher /* Frame commands. */ 247e689cf4aSJeff Kirsher #define FRAME_WRITE 0x50020000 248e689cf4aSJeff Kirsher #define FRAME_READ 0x60020000 249e689cf4aSJeff Kirsher 250e689cf4aSJeff Kirsher /* Transceiver config register */ 251e689cf4aSJeff Kirsher #define TCV_CFG_PSELECT 0x00000001 /* Select PHY */ 252e689cf4aSJeff Kirsher #define TCV_CFG_PENABLE 0x00000002 /* Enable MIF polling */ 253e689cf4aSJeff Kirsher #define TCV_CFG_BENABLE 0x00000004 /* Enable the "bit banger" oh baby */ 254e689cf4aSJeff Kirsher #define TCV_CFG_PREGADDR 0x000000f8 /* Address of poll register */ 255e689cf4aSJeff Kirsher #define TCV_CFG_MDIO0 0x00000100 /* MDIO zero, data/attached */ 256e689cf4aSJeff Kirsher #define TCV_CFG_MDIO1 0x00000200 /* MDIO one, data/attached */ 257e689cf4aSJeff Kirsher #define TCV_CFG_PDADDR 0x00007c00 /* Device PHY address polling */ 258e689cf4aSJeff Kirsher 259e689cf4aSJeff Kirsher /* Here are some PHY addresses. */ 260e689cf4aSJeff Kirsher #define TCV_PADDR_ETX 0 /* Internal transceiver */ 261e689cf4aSJeff Kirsher #define TCV_PADDR_ITX 1 /* External transceiver */ 262e689cf4aSJeff Kirsher 263e689cf4aSJeff Kirsher /* Transceiver status register */ 264e689cf4aSJeff Kirsher #define TCV_STAT_BASIC 0xffff0000 /* The "basic" part */ 265e689cf4aSJeff Kirsher #define TCV_STAT_NORMAL 0x0000ffff /* The "non-basic" part */ 266e689cf4aSJeff Kirsher 267e689cf4aSJeff Kirsher /* Inside the Happy Meal transceiver is the physical layer, they use an 268e689cf4aSJeff Kirsher * implementations for National Semiconductor, part number DP83840VCE. 269e689cf4aSJeff Kirsher * You can retrieve the data sheets and programming docs for this beast 270e689cf4aSJeff Kirsher * from http://www.national.com/ 271e689cf4aSJeff Kirsher * 272e689cf4aSJeff Kirsher * The DP83840 is capable of both 10 and 100Mbps ethernet, in both 273e689cf4aSJeff Kirsher * half and full duplex mode. It also supports auto negotiation. 274e689cf4aSJeff Kirsher * 275e689cf4aSJeff Kirsher * But.... THIS THING IS A PAIN IN THE ASS TO PROGRAM! 276e689cf4aSJeff Kirsher * Debugging eeprom burnt code is more fun than programming this chip! 277e689cf4aSJeff Kirsher */ 278e689cf4aSJeff Kirsher 279e689cf4aSJeff Kirsher /* Generic MII registers defined in linux/mii.h, these below 280e689cf4aSJeff Kirsher * are DP83840 specific. 281e689cf4aSJeff Kirsher */ 282e689cf4aSJeff Kirsher #define DP83840_CSCONFIG 0x17 /* CS configuration */ 283e689cf4aSJeff Kirsher 284e689cf4aSJeff Kirsher /* The Carrier Sense config register. */ 285e689cf4aSJeff Kirsher #define CSCONFIG_RESV1 0x0001 /* Unused... */ 286e689cf4aSJeff Kirsher #define CSCONFIG_LED4 0x0002 /* Pin for full-dplx LED4 */ 287e689cf4aSJeff Kirsher #define CSCONFIG_LED1 0x0004 /* Pin for conn-status LED1 */ 288e689cf4aSJeff Kirsher #define CSCONFIG_RESV2 0x0008 /* Unused... */ 289e689cf4aSJeff Kirsher #define CSCONFIG_TCVDISAB 0x0010 /* Turns off the transceiver */ 290e689cf4aSJeff Kirsher #define CSCONFIG_DFBYPASS 0x0020 /* Bypass disconnect function */ 291e689cf4aSJeff Kirsher #define CSCONFIG_GLFORCE 0x0040 /* Good link force for 100mbps */ 292e689cf4aSJeff Kirsher #define CSCONFIG_CLKTRISTATE 0x0080 /* Tristate 25m clock */ 293e689cf4aSJeff Kirsher #define CSCONFIG_RESV3 0x0700 /* Unused... */ 294e689cf4aSJeff Kirsher #define CSCONFIG_ENCODE 0x0800 /* 1=MLT-3, 0=binary */ 295e689cf4aSJeff Kirsher #define CSCONFIG_RENABLE 0x1000 /* Repeater mode enable */ 296e689cf4aSJeff Kirsher #define CSCONFIG_TCDISABLE 0x2000 /* Disable timeout counter */ 297e689cf4aSJeff Kirsher #define CSCONFIG_RESV4 0x4000 /* Unused... */ 298e689cf4aSJeff Kirsher #define CSCONFIG_NDISABLE 0x8000 /* Disable NRZI */ 299e689cf4aSJeff Kirsher 300e689cf4aSJeff Kirsher /* Happy Meal descriptor rings and such. 301e689cf4aSJeff Kirsher * All descriptor rings must be aligned on a 2K boundary. 302e689cf4aSJeff Kirsher * All receive buffers must be 64 byte aligned. 303e689cf4aSJeff Kirsher * Always write the address first before setting the ownership 304e689cf4aSJeff Kirsher * bits to avoid races with the hardware scanning the ring. 305e689cf4aSJeff Kirsher */ 3069efeccacSMichael S. Tsirkin typedef u32 __bitwise hme32; 307e689cf4aSJeff Kirsher 308e689cf4aSJeff Kirsher struct happy_meal_rxd { 309e689cf4aSJeff Kirsher hme32 rx_flags; 310e689cf4aSJeff Kirsher hme32 rx_addr; 311e689cf4aSJeff Kirsher }; 312e689cf4aSJeff Kirsher 313e689cf4aSJeff Kirsher #define RXFLAG_OWN 0x80000000 /* 1 = hardware, 0 = software */ 314e689cf4aSJeff Kirsher #define RXFLAG_OVERFLOW 0x40000000 /* 1 = buffer overflow */ 315e689cf4aSJeff Kirsher #define RXFLAG_SIZE 0x3fff0000 /* Size of the buffer */ 316e689cf4aSJeff Kirsher #define RXFLAG_CSUM 0x0000ffff /* HW computed checksum */ 317e689cf4aSJeff Kirsher 318e689cf4aSJeff Kirsher struct happy_meal_txd { 319e689cf4aSJeff Kirsher hme32 tx_flags; 320e689cf4aSJeff Kirsher hme32 tx_addr; 321e689cf4aSJeff Kirsher }; 322e689cf4aSJeff Kirsher 323e689cf4aSJeff Kirsher #define TXFLAG_OWN 0x80000000 /* 1 = hardware, 0 = software */ 324e689cf4aSJeff Kirsher #define TXFLAG_SOP 0x40000000 /* 1 = start of packet */ 325e689cf4aSJeff Kirsher #define TXFLAG_EOP 0x20000000 /* 1 = end of packet */ 326e689cf4aSJeff Kirsher #define TXFLAG_CSENABLE 0x10000000 /* 1 = enable hw-checksums */ 327e689cf4aSJeff Kirsher #define TXFLAG_CSLOCATION 0x0ff00000 /* Where to stick the csum */ 328e689cf4aSJeff Kirsher #define TXFLAG_CSBUFBEGIN 0x000fc000 /* Where to begin checksum */ 329e689cf4aSJeff Kirsher #define TXFLAG_SIZE 0x00003fff /* Size of the packet */ 330e689cf4aSJeff Kirsher 331e689cf4aSJeff Kirsher #define TX_RING_SIZE 32 /* Must be >16 and <255, multiple of 16 */ 332e689cf4aSJeff Kirsher #define RX_RING_SIZE 32 /* see ERX_CFG_SIZE* for possible values */ 333e689cf4aSJeff Kirsher 334e689cf4aSJeff Kirsher #if (TX_RING_SIZE < 16 || TX_RING_SIZE > 256 || (TX_RING_SIZE % 16) != 0) 335e689cf4aSJeff Kirsher #error TX_RING_SIZE holds illegal value 336e689cf4aSJeff Kirsher #endif 337e689cf4aSJeff Kirsher 338e689cf4aSJeff Kirsher #define TX_RING_MAXSIZE 256 339e689cf4aSJeff Kirsher #define RX_RING_MAXSIZE 256 340e689cf4aSJeff Kirsher 341e689cf4aSJeff Kirsher /* We use a 14 byte offset for checksum computation. */ 342e689cf4aSJeff Kirsher #if (RX_RING_SIZE == 32) 343e689cf4aSJeff Kirsher #define ERX_CFG_DEFAULT(off) (ERX_CFG_DMAENABLE|((off)<<3)|ERX_CFG_SIZE32|((14/2)<<16)) 344e689cf4aSJeff Kirsher #else 345e689cf4aSJeff Kirsher #if (RX_RING_SIZE == 64) 346e689cf4aSJeff Kirsher #define ERX_CFG_DEFAULT(off) (ERX_CFG_DMAENABLE|((off)<<3)|ERX_CFG_SIZE64|((14/2)<<16)) 347e689cf4aSJeff Kirsher #else 348e689cf4aSJeff Kirsher #if (RX_RING_SIZE == 128) 349e689cf4aSJeff Kirsher #define ERX_CFG_DEFAULT(off) (ERX_CFG_DMAENABLE|((off)<<3)|ERX_CFG_SIZE128|((14/2)<<16)) 350e689cf4aSJeff Kirsher #else 351e689cf4aSJeff Kirsher #if (RX_RING_SIZE == 256) 352e689cf4aSJeff Kirsher #define ERX_CFG_DEFAULT(off) (ERX_CFG_DMAENABLE|((off)<<3)|ERX_CFG_SIZE256|((14/2)<<16)) 353e689cf4aSJeff Kirsher #else 354e689cf4aSJeff Kirsher #error RX_RING_SIZE holds illegal value 355e689cf4aSJeff Kirsher #endif 356e689cf4aSJeff Kirsher #endif 357e689cf4aSJeff Kirsher #endif 358e689cf4aSJeff Kirsher #endif 359e689cf4aSJeff Kirsher 360e689cf4aSJeff Kirsher #define NEXT_RX(num) (((num) + 1) & (RX_RING_SIZE - 1)) 361e689cf4aSJeff Kirsher #define NEXT_TX(num) (((num) + 1) & (TX_RING_SIZE - 1)) 362e689cf4aSJeff Kirsher #define PREV_RX(num) (((num) - 1) & (RX_RING_SIZE - 1)) 363e689cf4aSJeff Kirsher #define PREV_TX(num) (((num) - 1) & (TX_RING_SIZE - 1)) 364e689cf4aSJeff Kirsher 365e689cf4aSJeff Kirsher #define TX_BUFFS_AVAIL(hp) \ 366e689cf4aSJeff Kirsher (((hp)->tx_old <= (hp)->tx_new) ? \ 367e689cf4aSJeff Kirsher (hp)->tx_old + (TX_RING_SIZE - 1) - (hp)->tx_new : \ 368e689cf4aSJeff Kirsher (hp)->tx_old - (hp)->tx_new - 1) 369e689cf4aSJeff Kirsher 370e689cf4aSJeff Kirsher #define RX_OFFSET 2 371e689cf4aSJeff Kirsher #define RX_BUF_ALLOC_SIZE (1546 + RX_OFFSET + 64) 372e689cf4aSJeff Kirsher 373e689cf4aSJeff Kirsher #define RX_COPY_THRESHOLD 256 374e689cf4aSJeff Kirsher 375e689cf4aSJeff Kirsher struct hmeal_init_block { 376e689cf4aSJeff Kirsher struct happy_meal_rxd happy_meal_rxd[RX_RING_MAXSIZE]; 377e689cf4aSJeff Kirsher struct happy_meal_txd happy_meal_txd[TX_RING_MAXSIZE]; 378e689cf4aSJeff Kirsher }; 379e689cf4aSJeff Kirsher 380e689cf4aSJeff Kirsher #define hblock_offset(mem, elem) \ 381e689cf4aSJeff Kirsher ((__u32)((unsigned long)(&(((struct hmeal_init_block *)0)->mem[elem])))) 382e689cf4aSJeff Kirsher 383e689cf4aSJeff Kirsher /* Now software state stuff. */ 384e689cf4aSJeff Kirsher enum happy_transceiver { 385e689cf4aSJeff Kirsher external = 0, 386e689cf4aSJeff Kirsher internal = 1, 387e689cf4aSJeff Kirsher none = 2, 388e689cf4aSJeff Kirsher }; 389e689cf4aSJeff Kirsher 390e689cf4aSJeff Kirsher /* Timer state engine. */ 391e689cf4aSJeff Kirsher enum happy_timer_state { 392e689cf4aSJeff Kirsher arbwait = 0, /* Waiting for auto negotiation to complete. */ 393e689cf4aSJeff Kirsher lupwait = 1, /* Auto-neg complete, awaiting link-up status. */ 394e689cf4aSJeff Kirsher ltrywait = 2, /* Forcing try of all modes, from fastest to slowest. */ 395e689cf4aSJeff Kirsher asleep = 3, /* Time inactive. */ 396e689cf4aSJeff Kirsher }; 397e689cf4aSJeff Kirsher 398e689cf4aSJeff Kirsher struct quattro; 399e689cf4aSJeff Kirsher 400e689cf4aSJeff Kirsher /* Happy happy, joy joy! */ 401e689cf4aSJeff Kirsher struct happy_meal { 402e689cf4aSJeff Kirsher void __iomem *gregs; /* Happy meal global registers */ 403e689cf4aSJeff Kirsher struct hmeal_init_block *happy_block; /* RX and TX descriptors (CPU addr) */ 404e689cf4aSJeff Kirsher 405e689cf4aSJeff Kirsher #if defined(CONFIG_SBUS) && defined(CONFIG_PCI) 406e689cf4aSJeff Kirsher u32 (*read_desc32)(hme32 *); 407e689cf4aSJeff Kirsher void (*write_txd)(struct happy_meal_txd *, u32, u32); 408e689cf4aSJeff Kirsher void (*write_rxd)(struct happy_meal_rxd *, u32, u32); 409e689cf4aSJeff Kirsher #endif 410e689cf4aSJeff Kirsher 411e689cf4aSJeff Kirsher /* This is either an platform_device or a pci_dev. */ 412e689cf4aSJeff Kirsher void *happy_dev; 413e689cf4aSJeff Kirsher struct device *dma_dev; 414e689cf4aSJeff Kirsher 415e689cf4aSJeff Kirsher spinlock_t happy_lock; 416e689cf4aSJeff Kirsher 417e689cf4aSJeff Kirsher struct sk_buff *rx_skbs[RX_RING_SIZE]; 418e689cf4aSJeff Kirsher struct sk_buff *tx_skbs[TX_RING_SIZE]; 419e689cf4aSJeff Kirsher 420e689cf4aSJeff Kirsher int rx_new, tx_new, rx_old, tx_old; 421e689cf4aSJeff Kirsher 422e689cf4aSJeff Kirsher #if defined(CONFIG_SBUS) && defined(CONFIG_PCI) 423e689cf4aSJeff Kirsher u32 (*read32)(void __iomem *); 424e689cf4aSJeff Kirsher void (*write32)(void __iomem *, u32); 425e689cf4aSJeff Kirsher #endif 426e689cf4aSJeff Kirsher 427e689cf4aSJeff Kirsher void __iomem *etxregs; /* External transmitter regs */ 428e689cf4aSJeff Kirsher void __iomem *erxregs; /* External receiver regs */ 429e689cf4aSJeff Kirsher void __iomem *bigmacregs; /* BIGMAC core regs */ 430e689cf4aSJeff Kirsher void __iomem *tcvregs; /* MIF transceiver regs */ 431e689cf4aSJeff Kirsher 432e689cf4aSJeff Kirsher dma_addr_t hblock_dvma; /* DVMA visible address happy block */ 433e689cf4aSJeff Kirsher unsigned int happy_flags; /* Driver state flags */ 4347deb1182SFrancois Romieu int irq; 435e689cf4aSJeff Kirsher enum happy_transceiver tcvr_type; /* Kind of transceiver in use */ 436e689cf4aSJeff Kirsher unsigned int happy_bursts; /* Get your mind out of the gutter */ 437e689cf4aSJeff Kirsher unsigned int paddr; /* PHY address for transceiver */ 438e689cf4aSJeff Kirsher unsigned short hm_revision; /* Happy meal revision */ 439e689cf4aSJeff Kirsher unsigned short sw_bmcr; /* SW copy of BMCR */ 440e689cf4aSJeff Kirsher unsigned short sw_bmsr; /* SW copy of BMSR */ 441e689cf4aSJeff Kirsher unsigned short sw_physid1; /* SW copy of PHYSID1 */ 442e689cf4aSJeff Kirsher unsigned short sw_physid2; /* SW copy of PHYSID2 */ 443e689cf4aSJeff Kirsher unsigned short sw_advertise; /* SW copy of ADVERTISE */ 444e689cf4aSJeff Kirsher unsigned short sw_lpa; /* SW copy of LPA */ 445e689cf4aSJeff Kirsher unsigned short sw_expansion; /* SW copy of EXPANSION */ 446e689cf4aSJeff Kirsher unsigned short sw_csconfig; /* SW copy of CSCONFIG */ 447e689cf4aSJeff Kirsher unsigned int auto_speed; /* Auto-nego link speed */ 448e689cf4aSJeff Kirsher unsigned int forced_speed; /* Force mode link speed */ 449e689cf4aSJeff Kirsher unsigned int poll_data; /* MIF poll data */ 450e689cf4aSJeff Kirsher unsigned int poll_flag; /* MIF poll flag */ 451e689cf4aSJeff Kirsher unsigned int linkcheck; /* Have we checked the link yet? */ 452e689cf4aSJeff Kirsher unsigned int lnkup; /* Is the link up as far as we know? */ 453e689cf4aSJeff Kirsher unsigned int lnkdown; /* Trying to force the link down? */ 454e689cf4aSJeff Kirsher unsigned int lnkcnt; /* Counter for link-up attempts. */ 455e689cf4aSJeff Kirsher struct timer_list happy_timer; /* To watch the link when coming up. */ 456e689cf4aSJeff Kirsher enum happy_timer_state timer_state; /* State of the auto-neg timer. */ 457e689cf4aSJeff Kirsher unsigned int timer_ticks; /* Number of clicks at each state. */ 458e689cf4aSJeff Kirsher 459e689cf4aSJeff Kirsher struct net_device *dev; /* Backpointer */ 460e689cf4aSJeff Kirsher struct quattro *qfe_parent; /* For Quattro cards */ 461e689cf4aSJeff Kirsher int qfe_ent; /* Which instance on quattro */ 462e689cf4aSJeff Kirsher }; 463e689cf4aSJeff Kirsher 464e689cf4aSJeff Kirsher /* Here are the happy flags. */ 465e689cf4aSJeff Kirsher #define HFLAG_FENABLE 0x00000002 /* The MII frame is enabled */ 466e689cf4aSJeff Kirsher #define HFLAG_LANCE 0x00000004 /* We are using lance-mode */ 467e689cf4aSJeff Kirsher #define HFLAG_RXENABLE 0x00000008 /* Receiver is enabled */ 468e689cf4aSJeff Kirsher #define HFLAG_AUTO 0x00000010 /* Using auto-negotiation, 0 = force */ 469e689cf4aSJeff Kirsher #define HFLAG_FULL 0x00000020 /* Full duplex enable */ 470e689cf4aSJeff Kirsher #define HFLAG_MACFULL 0x00000040 /* Using full duplex in the MAC */ 471e689cf4aSJeff Kirsher #define HFLAG_RXCV 0x00000100 /* XXX RXCV ENABLE */ 472e689cf4aSJeff Kirsher #define HFLAG_INIT 0x00000200 /* Init called at least once */ 473e689cf4aSJeff Kirsher #define HFLAG_LINKUP 0x00000400 /* 1 = Link is up */ 474e689cf4aSJeff Kirsher #define HFLAG_PCI 0x00000800 /* PCI based Happy Meal */ 475e689cf4aSJeff Kirsher #define HFLAG_QUATTRO 0x00001000 /* On QFE/Quattro card */ 476e689cf4aSJeff Kirsher 477*3427372dSSean Anderson #define HFLAG_20_21 HFLAG_FENABLE 478*3427372dSSean Anderson #define HFLAG_NOT_A0 (HFLAG_FENABLE | HFLAG_LANCE | HFLAG_RXCV) 479e689cf4aSJeff Kirsher 480e689cf4aSJeff Kirsher /* Support for QFE/Quattro cards. */ 481e689cf4aSJeff Kirsher struct quattro { 482e689cf4aSJeff Kirsher struct net_device *happy_meals[4]; 483e689cf4aSJeff Kirsher 484e689cf4aSJeff Kirsher /* This is either a sbus_dev or a pci_dev. */ 485e689cf4aSJeff Kirsher void *quattro_dev; 486e689cf4aSJeff Kirsher 487e689cf4aSJeff Kirsher struct quattro *next; 488e689cf4aSJeff Kirsher 489e689cf4aSJeff Kirsher /* PROM ranges, if any. */ 490e689cf4aSJeff Kirsher #ifdef CONFIG_SBUS 491e689cf4aSJeff Kirsher struct linux_prom_ranges ranges[8]; 492e689cf4aSJeff Kirsher #endif 493e689cf4aSJeff Kirsher int nranges; 494e689cf4aSJeff Kirsher }; 495e689cf4aSJeff Kirsher 496e689cf4aSJeff Kirsher /* We use this to acquire receive skb's that we can DMA directly into. */ 497e689cf4aSJeff Kirsher #define ALIGNED_RX_SKB_ADDR(addr) \ 498e689cf4aSJeff Kirsher ((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr)) 499e689cf4aSJeff Kirsher #define happy_meal_alloc_skb(__length, __gfp_flags) \ 500e689cf4aSJeff Kirsher ({ struct sk_buff *__skb; \ 501e689cf4aSJeff Kirsher __skb = alloc_skb((__length) + 64, (__gfp_flags)); \ 502e689cf4aSJeff Kirsher if(__skb) { \ 503e689cf4aSJeff Kirsher int __offset = (int) ALIGNED_RX_SKB_ADDR(__skb->data); \ 504e689cf4aSJeff Kirsher if(__offset) \ 505e689cf4aSJeff Kirsher skb_reserve(__skb, __offset); \ 506e689cf4aSJeff Kirsher } \ 507e689cf4aSJeff Kirsher __skb; \ 508e689cf4aSJeff Kirsher }) 509e689cf4aSJeff Kirsher 510e689cf4aSJeff Kirsher #endif /* !(_SUNHME_H) */ 511