style fixes

This commit is contained in:
Max Khon 2002-08-05 17:20:17 +00:00
parent 93c10c2246
commit cc99b6cf41
3 changed files with 30 additions and 26 deletions

View File

@ -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 @@ download_data(struct sbni_softc *sc, u_int32_t *crc_p)
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:
/*

View File

@ -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 */

View File

@ -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);