Style changes from avatar.

Submitted by:	avatar
This commit is contained in:
ambrisko 2008-01-18 16:34:18 +00:00
parent 22d76bf909
commit 5e9948e31a
2 changed files with 48 additions and 48 deletions

View File

@ -262,7 +262,7 @@ sysctl_an_dump(SYSCTL_HANDLER_ARGS)
} }
SYSCTL_PROC(_hw_an, OID_AUTO, an_dump, CTLTYPE_STRING | CTLFLAG_RW, SYSCTL_PROC(_hw_an, OID_AUTO, an_dump, CTLTYPE_STRING | CTLFLAG_RW,
0, sizeof(an_conf), sysctl_an_dump, "A", ""); 0, sizeof(an_conf), sysctl_an_dump, "A", "");
static int static int
sysctl_an_cache_mode(SYSCTL_HANDLER_ARGS) sysctl_an_cache_mode(SYSCTL_HANDLER_ARGS)
@ -300,7 +300,7 @@ sysctl_an_cache_mode(SYSCTL_HANDLER_ARGS)
} }
SYSCTL_PROC(_hw_an, OID_AUTO, an_cache_mode, CTLTYPE_STRING | CTLFLAG_RW, SYSCTL_PROC(_hw_an, OID_AUTO, an_cache_mode, CTLTYPE_STRING | CTLFLAG_RW,
0, sizeof(an_conf_cache), sysctl_an_cache_mode, "A", ""); 0, sizeof(an_conf_cache), sysctl_an_cache_mode, "A", "");
/* /*
* Setup the lock for PCI attachment since it skips the an_probe * Setup the lock for PCI attachment since it skips the an_probe
@ -311,7 +311,7 @@ SYSCTL_PROC(_hw_an, OID_AUTO, an_cache_mode, CTLTYPE_STRING | CTLFLAG_RW,
int int
an_pci_probe(device_t dev) an_pci_probe(device_t dev)
{ {
struct an_softc *sc = device_get_softc(dev); struct an_softc *sc = device_get_softc(dev);
mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE); MTX_DEF | MTX_RECURSE);
@ -328,7 +328,7 @@ an_pci_probe(device_t dev)
int int
an_probe(device_t dev) an_probe(device_t dev)
{ {
struct an_softc *sc = device_get_softc(dev); struct an_softc *sc = device_get_softc(dev);
struct an_ltv_ssidlist_new ssid; struct an_ltv_ssidlist_new ssid;
int error; int error;
@ -354,10 +354,10 @@ an_probe(device_t dev)
ssid.an_len = sizeof(ssid); ssid.an_len = sizeof(ssid);
ssid.an_type = AN_RID_SSIDLIST; ssid.an_type = AN_RID_SSIDLIST;
/* Make sure interrupts are disabled. */ /* Make sure interrupts are disabled. */
sc->mpi350 = 0; sc->mpi350 = 0;
CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), 0); CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), 0);
CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), 0xFFFF); CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), 0xFFFF);
mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE); MTX_DEF | MTX_RECURSE);
@ -493,7 +493,7 @@ an_dma_malloc(struct an_softc *sc, bus_size_t size, struct an_dma_alloc *dma,
goto fail_1; goto fail_1;
r = bus_dmamap_load(sc->an_dtag, dma->an_dma_map, dma->an_dma_vaddr, r = bus_dmamap_load(sc->an_dtag, dma->an_dma_map, dma->an_dma_vaddr,
size, size,
an_dma_malloc_cb, an_dma_malloc_cb,
&dma->an_dma_paddr, &dma->an_dma_paddr,
mapflags | BUS_DMA_NOWAIT); mapflags | BUS_DMA_NOWAIT);
@ -1726,8 +1726,8 @@ an_write_data(struct an_softc *sc, int id, int off, caddr_t buf, int len)
for (i = len; i > 1; i -= 2) for (i = len; i > 1; i -= 2)
CSR_WRITE_2(sc, AN_DATA0, *ptr++); CSR_WRITE_2(sc, AN_DATA0, *ptr++);
if (i) { if (i) {
ptr2 = (u_int8_t *)ptr; ptr2 = (u_int8_t *)ptr;
CSR_WRITE_1(sc, AN_DATA0, *ptr2); CSR_WRITE_1(sc, AN_DATA0, *ptr2);
} }
return(0); return(0);
@ -2016,7 +2016,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
an_setdef(sc, &sc->areq); an_setdef(sc, &sc->areq);
AN_UNLOCK(sc); AN_UNLOCK(sc);
break; break;
case SIOCGPRIVATE_0: /* used by Cisco client utility */ case SIOCGPRIVATE_0: /* used by Cisco client utility */
if ((error = priv_check(td, PRIV_DRIVER))) if ((error = priv_check(td, PRIV_DRIVER)))
goto out; goto out;
error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl)); error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl));
@ -2040,7 +2040,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = copyout(&l_ioctl, ifr->ifr_data, sizeof(l_ioctl)); error = copyout(&l_ioctl, ifr->ifr_data, sizeof(l_ioctl));
} }
break; break;
case SIOCGPRIVATE_1: /* used by Cisco client utility */ case SIOCGPRIVATE_1: /* used by Cisco client utility */
if ((error = priv_check(td, PRIV_DRIVER))) if ((error = priv_check(td, PRIV_DRIVER)))
goto out; goto out;
error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl)); error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl));
@ -2049,7 +2049,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
l_ioctl.command = 0; l_ioctl.command = 0;
error = AIROMAGIC; error = AIROMAGIC;
(void) copyout(&error, l_ioctl.data, sizeof(error)); (void) copyout(&error, l_ioctl.data, sizeof(error));
error = 0; error = 0;
break; break;
case SIOCG80211: case SIOCG80211:
sc->areq.an_len = sizeof(sc->areq); sc->areq.an_len = sizeof(sc->areq);
@ -2746,7 +2746,7 @@ an_start(struct ifnet *ifp)
struct an_txframe_802_3 tx_frame_802_3; struct an_txframe_802_3 tx_frame_802_3;
struct ether_header *eh; struct ether_header *eh;
int id, idx, i; int id, idx, i;
unsigned char txcontrol; unsigned char txcontrol;
struct an_card_tx_desc an_tx_desc; struct an_card_tx_desc an_tx_desc;
u_int8_t *buf; u_int8_t *buf;
@ -3060,9 +3060,9 @@ an_resume(device_t dev)
#ifdef documentation #ifdef documentation
int an_sigitems; /* number of cached entries */ int an_sigitems; /* number of cached entries */
struct an_sigcache an_sigcache[MAXANCACHE]; /* array of cache entries */ struct an_sigcache an_sigcache[MAXANCACHE]; /* array of cache entries */
int an_nextitem; /* index/# of entries */ int an_nextitem; /* index/# of entries */
#endif #endif
@ -3099,7 +3099,7 @@ an_cache_store(struct an_softc *sc, struct ether_header *eh, struct mbuf *m,
struct ip *ip = 0; struct ip *ip = 0;
int i; int i;
static int cache_slot = 0; /* use this cache entry */ static int cache_slot = 0; /* use this cache entry */
static int wrapindex = 0; /* next "free" cache entry */ static int wrapindex = 0; /* next "free" cache entry */
int type_ipv4 = 0; int type_ipv4 = 0;
/* filters: /* filters:
@ -3172,7 +3172,7 @@ an_cache_store(struct an_softc *sc, struct ether_header *eh, struct mbuf *m,
sc->an_nextitem++; sc->an_nextitem++;
sc->an_sigitems = sc->an_nextitem; sc->an_sigitems = sc->an_nextitem;
} }
/* no space found, so simply wrap anth wrap index /* no space found, so simply wrap anth wrap index
* and "zap" the next entry * and "zap" the next entry
*/ */
else { else {
@ -3404,7 +3404,7 @@ static int
writerids(struct ifnet *ifp, struct aironet_ioctl *l_ioctl) writerids(struct ifnet *ifp, struct aironet_ioctl *l_ioctl)
{ {
struct an_softc *sc; struct an_softc *sc;
int rid, command, error; int rid, command, error;
sc = ifp->if_softc; sc = ifp->if_softc;
AN_LOCK_ASSERT(sc); AN_LOCK_ASSERT(sc);
@ -3532,9 +3532,9 @@ unstickbusy(struct ifnet *ifp)
static int static int
WaitBusy(struct ifnet *ifp, int uSec) WaitBusy(struct ifnet *ifp, int uSec)
{ {
int statword = 0xffff; int statword = 0xffff;
int delay = 0; int delay = 0;
struct an_softc *sc = ifp->if_softc; struct an_softc *sc = ifp->if_softc;
while ((statword & AN_CMD_BUSY) && delay <= (1000 * 100)) { while ((statword & AN_CMD_BUSY) && delay <= (1000 * 100)) {
FLASH_DELAY(sc, 10); FLASH_DELAY(sc, 10);
@ -3556,8 +3556,8 @@ WaitBusy(struct ifnet *ifp, int uSec)
static int static int
cmdreset(struct ifnet *ifp) cmdreset(struct ifnet *ifp)
{ {
int status; int status;
struct an_softc *sc = ifp->if_softc; struct an_softc *sc = ifp->if_softc;
an_stop(sc); an_stop(sc);
@ -3592,8 +3592,8 @@ cmdreset(struct ifnet *ifp)
static int static int
setflashmode(struct ifnet *ifp) setflashmode(struct ifnet *ifp)
{ {
int status; int status;
struct an_softc *sc = ifp->if_softc; struct an_softc *sc = ifp->if_softc;
CSR_WRITE_2(sc, AN_SW0(sc->mpi350), FLASH_COMMAND); CSR_WRITE_2(sc, AN_SW0(sc->mpi350), FLASH_COMMAND);
CSR_WRITE_2(sc, AN_SW1(sc->mpi350), FLASH_COMMAND); CSR_WRITE_2(sc, AN_SW1(sc->mpi350), FLASH_COMMAND);
@ -3620,10 +3620,10 @@ setflashmode(struct ifnet *ifp)
static int static int
flashgchar(struct ifnet *ifp, int matchbyte, int dwelltime) flashgchar(struct ifnet *ifp, int matchbyte, int dwelltime)
{ {
int rchar; int rchar;
unsigned char rbyte = 0; unsigned char rbyte = 0;
int success = -1; int success = -1;
struct an_softc *sc = ifp->if_softc; struct an_softc *sc = ifp->if_softc;
do { do {
@ -3656,9 +3656,9 @@ flashgchar(struct ifnet *ifp, int matchbyte, int dwelltime)
static int static int
flashpchar(struct ifnet *ifp, int byte, int dwelltime) flashpchar(struct ifnet *ifp, int byte, int dwelltime)
{ {
int echo; int echo;
int pollbusy, waittime; int pollbusy, waittime;
struct an_softc *sc = ifp->if_softc; struct an_softc *sc = ifp->if_softc;
byte |= 0x8000; byte |= 0x8000;
@ -3714,8 +3714,8 @@ static int
flashputbuf(struct ifnet *ifp) flashputbuf(struct ifnet *ifp)
{ {
unsigned short *bufp; unsigned short *bufp;
int nwords; int nwords;
struct an_softc *sc = ifp->if_softc; struct an_softc *sc = ifp->if_softc;
/* Write stuff */ /* Write stuff */
@ -3747,8 +3747,8 @@ flashputbuf(struct ifnet *ifp)
static int static int
flashrestart(struct ifnet *ifp) flashrestart(struct ifnet *ifp)
{ {
int status = 0; int status = 0;
struct an_softc *sc = ifp->if_softc; struct an_softc *sc = ifp->if_softc;
FLASH_DELAY(sc, 1024); /* Added 12/7/00 */ FLASH_DELAY(sc, 1024); /* Added 12/7/00 */
@ -3767,7 +3767,7 @@ flashrestart(struct ifnet *ifp)
static int static int
flashcard(struct ifnet *ifp, struct aironet_ioctl *l_ioctl) flashcard(struct ifnet *ifp, struct aironet_ioctl *l_ioctl)
{ {
int z = 0, status; int z = 0, status;
struct an_softc *sc; struct an_softc *sc;
sc = ifp->if_softc; sc = ifp->if_softc;

View File

@ -118,7 +118,7 @@ static int
an_probe_pci(device_t dev) an_probe_pci(device_t dev)
{ {
struct an_type *t; struct an_type *t;
struct an_softc *sc = device_get_softc(dev); struct an_softc *sc = device_get_softc(dev);
bzero(sc, sizeof(struct an_softc)); bzero(sc, sizeof(struct an_softc));
t = an_devs; t = an_devs;
@ -231,7 +231,7 @@ an_attach_pci(dev)
error = an_alloc_irq(dev, 0, RF_SHAREABLE); error = an_alloc_irq(dev, 0, RF_SHAREABLE);
if (error) { if (error) {
goto fail; goto fail;
} }
sc->an_dev = dev; sc->an_dev = dev;
error = an_attach(sc, device_get_unit(dev), flags); error = an_attach(sc, device_get_unit(dev), flags);
@ -268,20 +268,20 @@ an_resume_pci(device_t dev)
} }
static device_method_t an_pci_methods[] = { static device_method_t an_pci_methods[] = {
/* Device interface */ /* Device interface */
DEVMETHOD(device_probe, an_probe_pci), DEVMETHOD(device_probe, an_probe_pci),
DEVMETHOD(device_attach, an_attach_pci), DEVMETHOD(device_attach, an_attach_pci),
DEVMETHOD(device_detach, an_detach), DEVMETHOD(device_detach, an_detach),
DEVMETHOD(device_shutdown, an_shutdown), DEVMETHOD(device_shutdown, an_shutdown),
DEVMETHOD(device_suspend, an_suspend_pci), DEVMETHOD(device_suspend, an_suspend_pci),
DEVMETHOD(device_resume, an_resume_pci), DEVMETHOD(device_resume, an_resume_pci),
{ 0, 0 } { 0, 0 }
}; };
static driver_t an_pci_driver = { static driver_t an_pci_driver = {
"an", "an",
an_pci_methods, an_pci_methods,
sizeof(struct an_softc), sizeof(struct an_softc),
}; };
static devclass_t an_devclass; static devclass_t an_devclass;