1179592Sbenno/*- 2179718Sbenno * Copyright (c) 2008 Benno Rice. All rights reserved. 3179592Sbenno * 4179592Sbenno * Redistribution and use in source and binary forms, with or without 5179592Sbenno * modification, are permitted provided that the following conditions 6179592Sbenno * are met: 7179592Sbenno * 1. Redistributions of source code must retain the above copyright 8179592Sbenno * notice, this list of conditions and the following disclaimer. 9179592Sbenno * 2. Redistributions in binary form must reproduce the above copyright 10179592Sbenno * notice, this list of conditions and the following disclaimer in the 11179592Sbenno * documentation and/or other materials provided with the distribution. 12179592Sbenno * 13179592Sbenno * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14179592Sbenno * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15179592Sbenno * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16179592Sbenno * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17179592Sbenno * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18179592Sbenno * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19179592Sbenno * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20179592Sbenno * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21179592Sbenno * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22179592Sbenno * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23179592Sbenno * 24179592Sbenno * $FreeBSD: releng/10.3/sys/dev/smc/if_smcvar.h 194024 2009-06-11 17:14:54Z avg $ 25179592Sbenno * 26179592Sbenno */ 27179592Sbenno 28179592Sbenno#ifndef _IF_SMCVAR_H_ 29179592Sbenno#define _IF_SMCVAR_H_ 30179592Sbenno 31179592Sbennostruct smc_softc { 32179592Sbenno struct ifnet *smc_ifp; 33179592Sbenno device_t smc_dev; 34179592Sbenno struct mtx smc_mtx; 35179592Sbenno u_int smc_chip; 36179592Sbenno u_int smc_rev; 37179592Sbenno u_int smc_mask; 38179592Sbenno 39179592Sbenno /* Resources */ 40179592Sbenno int smc_usemem; 41179592Sbenno int smc_reg_rid; 42179592Sbenno int smc_irq_rid; 43179592Sbenno struct resource *smc_reg; 44179592Sbenno struct resource *smc_irq; 45179592Sbenno void *smc_ih; 46179592Sbenno 47179592Sbenno /* Tasks */ 48179592Sbenno struct taskqueue *smc_tq; 49179719Sbenno struct task smc_intr; 50179592Sbenno struct task smc_rx; 51179592Sbenno struct task smc_tx; 52179592Sbenno struct mbuf *smc_pending; 53179592Sbenno struct callout smc_watchdog; 54179592Sbenno 55179592Sbenno /* MII support */ 56179592Sbenno device_t smc_miibus; 57179592Sbenno struct callout smc_mii_tick_ch; 58179592Sbenno void (*smc_mii_tick)(void *); 59179592Sbenno void (*smc_mii_mediachg)(struct smc_softc *); 60179592Sbenno int (*smc_mii_mediaioctl)(struct smc_softc *, 61179592Sbenno struct ifreq *, u_long); 62179592Sbenno 63179592Sbenno /* DMA support */ 64179592Sbenno void (*smc_read_packet)(struct smc_softc *, 65179592Sbenno bus_addr_t, uint8_t *, bus_size_t); 66179592Sbenno void *smc_read_arg; 67179592Sbenno}; 68179592Sbenno 69179592Sbennoint smc_probe(device_t); 70179592Sbennoint smc_attach(device_t); 71179592Sbennoint smc_detach(device_t); 72179592Sbenno 73179592Sbennoint smc_miibus_readreg(device_t, int, int); 74194024Savgint smc_miibus_writereg(device_t, int, int, int); 75179592Sbennovoid smc_miibus_statchg(device_t); 76179592Sbenno 77179592Sbenno#endif /* _IF_SMCVAR_H_ */ 78