1 /*- 2 * Copyright (c) 2008 Benno Rice. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * 24 * $FreeBSD$ 25 * 26 */ 27 28 #ifndef _IF_SMCVAR_H_ 29 #define _IF_SMCVAR_H_ 30 31 struct smc_softc { 32 struct ifnet *smc_ifp; 33 device_t smc_dev; 34 struct mtx smc_mtx; 35 u_int smc_chip; 36 u_int smc_rev; 37 u_int smc_mask; 38 39 /* Resources */ 40 int smc_usemem; 41 int smc_reg_rid; 42 int smc_irq_rid; 43 struct resource *smc_reg; 44 struct resource *smc_irq; 45 void *smc_ih; 46 47 /* Tasks */ 48 struct taskqueue *smc_tq; 49 struct task smc_intr; 50 struct task smc_rx; 51 struct task smc_tx; 52 struct mbuf *smc_pending; 53 struct callout smc_watchdog; 54 55 /* MII support */ 56 device_t smc_miibus; 57 struct callout smc_mii_tick_ch; 58 void (*smc_mii_tick)(void *); 59 void (*smc_mii_mediachg)(struct smc_softc *); 60 int (*smc_mii_mediaioctl)(struct smc_softc *, 61 struct ifreq *, u_long); 62 63 /* DMA support */ 64 void (*smc_read_packet)(struct smc_softc *, 65 bus_addr_t, uint8_t *, bus_size_t); 66 void *smc_read_arg; 67 }; 68 69 int smc_probe(device_t); 70 int smc_attach(device_t); 71 int smc_detach(device_t); 72 73 int smc_miibus_readreg(device_t, int, int); 74 int smc_miibus_writereg(device_t, int, int, int); 75 void smc_miibus_statchg(device_t); 76 77 #endif /* _IF_SMCVAR_H_ */ 78