summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorfjoe <fjoe@FreeBSD.org>2002-08-05 17:20:17 +0000
committerfjoe <fjoe@FreeBSD.org>2002-08-05 17:20:17 +0000
commitd8fc8f49436ddb69f6f574a3495ebe3c2eb0e7d6 (patch)
tree8112be9bd19cb9a807a6f52e556e82c5a46bb8a9 /sys/dev
parent61e34cfa225b4660b4f79d4b6ced59747c57ceff (diff)
downloadFreeBSD-src-d8fc8f49436ddb69f6f574a3495ebe3c2eb0e7d6.zip
FreeBSD-src-d8fc8f49436ddb69f6f574a3495ebe3c2eb0e7d6.tar.gz
style fixes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sbni/if_sbni.c30
-rw-r--r--sys/dev/sbni/if_sbni_isa.c22
-rw-r--r--sys/dev/sbni/if_sbni_pci.c4
3 files changed, 30 insertions, 26 deletions
diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c
index 4be96a4..df46da6 100644
--- a/sys/dev/sbni/if_sbni.c
+++ b/sys/dev/sbni/if_sbni.c
@@ -329,8 +329,8 @@ sbni_intr(void *arg)
handle_channel(sc);
repeat = 1;
}
- if (sc->slave_sc /* second channel present */
- && (sbni_inb(sc->slave_sc, CSR0) & (RC_RDY | TR_RDY))) {
+ if (sc->slave_sc && /* second channel present */
+ (sbni_inb(sc->slave_sc, CSR0) & (RC_RDY | TR_RDY))) {
handle_channel(sc->slave_sc);
repeat = 1;
}
@@ -368,9 +368,10 @@ handle_channel(struct sbni_softc *sc)
/* if state & FL_NEED_RESEND != 0 then tx_frameno != 0 */
if (req_ans || sc->tx_frameno != 0)
send_frame(sc);
- else
+ else {
/* send the marker without any data */
sbni_outb(sc, CSR0, sbni_inb(sc, CSR0) & ~TR_REQ);
+ }
}
sbni_outb(sc, CSR0, sbni_inb(sc, CSR0) | EN_INT);
@@ -391,9 +392,9 @@ recv_frame(struct sbni_softc *sc)
crc = CRC32_INITIAL;
if (check_fhdr(sc, &framelen, &frameno, &ack, &is_first, &crc)) {
- frame_ok = framelen > 4
- ? upload_data(sc, framelen, frameno, is_first, crc)
- : skip_tail(sc, framelen, crc);
+ frame_ok = framelen > 4 ?
+ upload_data(sc, framelen, frameno, is_first, crc) :
+ skip_tail(sc, framelen, crc);
if (frame_ok)
interpret_ack(sc, ack);
} else
@@ -498,8 +499,9 @@ do_copy:
if (data_len -= slice)
data_p += slice;
else {
- do m = m->m_next;
- while (m != NULL && m->m_len == 0);
+ do {
+ m = m->m_next;
+ } while (m != NULL && m->m_len == 0);
if (m) {
data_len = m->m_len;
@@ -582,10 +584,10 @@ interpret_ack(struct sbni_softc *sc, u_int ack)
if (sc->state & FL_WAIT_ACK) {
sc->outpos += sc->framelen;
- if (--sc->tx_frameno)
- sc->framelen = min(sc->maxframe,
- sc->pktlen - sc->outpos);
- else {
+ if (--sc->tx_frameno) {
+ sc->framelen = min(
+ sc->maxframe, sc->pktlen - sc->outpos);
+ } else {
send_complete(sc);
prepare_to_send(sc);
}
@@ -1059,8 +1061,8 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
switch (command) {
case SIOCSIFADDR:
case SIOCGIFADDR:
- ether_ioctl(ifp, command, data);
- break;
+ ether_ioctl(ifp, command, data);
+ break;
case SIOCSIFFLAGS:
/*
diff --git a/sys/dev/sbni/if_sbni_isa.c b/sys/dev/sbni/if_sbni_isa.c
index ad12240..d8a76df 100644
--- a/sys/dev/sbni/if_sbni_isa.c
+++ b/sys/dev/sbni/if_sbni_isa.c
@@ -115,18 +115,19 @@ sbni_attach_isa(device_t dev)
sc = device_get_softc(dev);
printf("sbni%d: <Granch SBNI12/ISA adapter> port 0x%x",
- next_sbni_unit, sc->base_addr);
- sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid,
- 0ul, ~0ul, 1, RF_ACTIVE);
+ next_sbni_unit, rman_get_start(sc->io_res));
+ sc->irq_res = bus_alloc_resource(
+ dev, SYS_RES_IRQ, &sc->irq_rid, 0ul, ~0ul, 1, RF_ACTIVE);
if (sc->irq_res) {
printf(" irq %ld\n", rman_get_start(sc->irq_res));
- error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- sbni_intr, sc, &sc->irq_handle);
+ error = bus_setup_intr(
+ dev, sc->irq_res, INTR_TYPE_NET,
+ sbni_intr, sc, &sc->irq_handle);
if (error) {
printf("sbni%d: bus_setup_intr\n", next_sbni_unit);
- bus_release_resource(dev, SYS_RES_IOPORT,
- sc->io_rid, sc->io_res);
+ bus_release_resource(
+ dev, SYS_RES_IOPORT, sc->io_rid, sc->io_res);
return (error);
}
@@ -149,12 +150,13 @@ sbni_attach_isa(device_t dev)
if ((master = connect_to_master(sc)) == 0) {
printf("\nsbni%d: failed to alloc irq\n",
next_sbni_unit);
- bus_release_resource(dev, SYS_RES_IOPORT,
- sc->io_rid, sc->io_res);
+ bus_release_resource(
+ dev, SYS_RES_IOPORT, sc->io_rid, sc->io_res);
return (ENXIO);
- } else
+ } else {
printf(" shared irq with sbni%d\n",
master->arpcom.ac_if.if_unit);
+ }
}
#endif /* SBNI_DUAL_COMPOUND */
diff --git a/sys/dev/sbni/if_sbni_pci.c b/sys/dev/sbni/if_sbni_pci.c
index 5ca3ea8..60868d6 100644
--- a/sys/dev/sbni/if_sbni_pci.c
+++ b/sys/dev/sbni/if_sbni_pci.c
@@ -78,8 +78,8 @@ sbni_pci_probe(device_t dev)
u_int32_t ports;
ports = SBNI_PORTS;
- if (pci_get_vendor(dev) != SBNI_PCI_VENDOR
- || pci_get_device(dev) != SBNI_PCI_DEVICE)
+ if (pci_get_vendor(dev) != SBNI_PCI_VENDOR ||
+ pci_get_device(dev) != SBNI_PCI_DEVICE)
return (ENXIO);
sc = device_get_softc(dev);
OpenPOWER on IntegriCloud