/* * Copyright (c) 1998,1999 Trans New Technology, Inc. and * Hiroki NAKANO * All rights reserved. * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that this notice is retained, * the conditions in the following notices are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by * Trans New Technology, Inc. (in Japan) * * * THIS SOFTWARE IS PROVIDED BY TRANS NEW TECHNOLOGY, INC. ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL TRANS NEW TECHNOLOGY, INC. BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ /* * ICOM UX-136 Wireless LAN Card * (AMD Am79C930 Firmware ver.2.0-Japan) * * glue module for FreeBSD PAO * */ /* * defines for the driver to touch the chip. * * pay attention about endian. */ #define _UX_MEM_ADDR(sc,off) \ (((struct ux_pcmcia_softc*)(sc))->ux_pcmcia_devi->isahd.id_maddr+(off)) #define UX_MEM_READ1(sc,off) (*(volatile u_int8_t *)_UX_MEM_ADDR(sc,off)) #define UX_MEM_READ2(sc,off) (*(volatile u_int16_t *)_UX_MEM_ADDR(sc,off)) #define UX_MEM_READ4(sc,off) (*(volatile u_int32_t *)_UX_MEM_ADDR(sc,off)) #define UX_MEM_WRITE1(sc,d,off) \ (*(volatile u_int8_t *)_UX_MEM_ADDR(sc,off) = (d)) #define UX_MEM_WRITE2(sc,d,off) \ (*(volatile u_int16_t *)_UX_MEM_ADDR(sc,off) = (d)) #define UX_MEM_WRITE4(sc,d,off) \ (*(volatile u_int32_t *)_UX_MEM_ADDR(sc,off) = (d)) #define UX_MEM_READM(sc,ptr,sz,off) \ bcopy(_UX_MEM_ADDR(sc,off), (ptr), (sz)) #define UX_MEM_WRITEM(sc,ptr,sz,off) \ bcopy((ptr), _UX_MEM_ADDR(sc,off), (sz)) #define _UX_IO_ADDR(sc,off) \ (((struct ux_pcmcia_softc*)(sc))->ux_pcmcia_devi->isahd.id_iobase+(off)) #define UX_IO_READ1(sc,off) inb(_UX_IO_ADDR((sc),(off))) #define UX_IO_READ2(sc,off) inw(_UX_IO_ADDR((sc),(off))) #define UX_IO_READ4(sc,off) inl(_UX_IO_ADDR((sc),(off))) #define UX_IO_WRITE1(sc,d,off) outb(_UX_IO_ADDR((sc),(off)),(d)) #define UX_IO_WRITE2(sc,d,off) outw(_UX_IO_ADDR((sc),(off)),(d)) #define UX_IO_WRITE4(sc,d,off) outl(_UX_IO_ADDR((sc),(off)),(d)) #define UX_OFFSETOF(stname,member,base) \ ((base) + (unsigned int)(&(((struct stname *)0)->member))) #define UX_SIZEOF(stname,member) sizeof(((struct stname *)0)->member) /* * softc */ struct ux_pcmcia_softc { struct ux_softc ux_pcmcia_sc; struct pccard_devinfo * ux_pcmcia_devi; }; /* * functions am79c930.c uses */ void ux_tap(struct ux_softc *sc, struct mbuf *m); /* EOF */