summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1996-04-23 18:36:56 +0000
committernate <nate@FreeBSD.org>1996-04-23 18:36:56 +0000
commitd41d7b99af67da8ee05185346116504a017e4540 (patch)
treecc5c5456155f3a3d5c07436057cc09e00a3eeec9 /sys/dev
parent04b29fb4bc12eea3fd9a68fa8036e5701d67de05 (diff)
downloadFreeBSD-src-d41d7b99af67da8ee05185346116504a017e4540.zip
FreeBSD-src-d41d7b99af67da8ee05185346116504a017e4540.tar.gz
Format the already applied PCCARD additions to use KNF form. No
functional changes.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ed/if_ed.c82
-rw-r--r--sys/dev/fe/if_fe.c148
-rw-r--r--sys/dev/sio/sio.c82
3 files changed, 150 insertions, 162 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index eceb525..e1784a2 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ed.c,v 1.95 1996/03/31 15:53:19 joerg Exp $
+ * $Id: if_ed.c,v 1.96 1996/04/08 01:25:22 davidg Exp $
*/
/*
@@ -170,6 +170,7 @@ static u_long ds_crc(u_char *ep);
#include <pccard/card.h>
#include <pccard/driver.h>
#include <pccard/slot.h>
+
/*
* PC-Card (PCMCIA) specific code.
*/
@@ -178,8 +179,7 @@ static void edunload(struct pccard_dev *); /* Disable driver */
static void edsuspend(struct pccard_dev *); /* Suspend driver */
static int edinit(struct pccard_dev *, int); /* init device */
-static struct pccard_drv ed_info =
- {
+static struct pccard_drv ed_info = {
"ed",
card_intr,
edunload,
@@ -187,64 +187,63 @@ static struct pccard_drv ed_info =
edinit,
0, /* Attributes - presently unused */
&net_imask /* Interrupt mask for device */
- /* This should also include net_imask?? */
- };
+ /* XXX - Should this also include net_imask? */
+};
+
/*
- * Called when a power down is wanted. Shuts down the
- * device and configures the device as unavailable (but
- * still loaded...). A resume is done by calling
- * edinit with first=0. This is called when the user suspends
- * the system, or the APM code suspends the system.
+ * Called when a power down is requested. Shuts down the
+ * device and configures the device as unavailable (but
+ * still loaded...). A resume is done by calling
+ * edinit with first=0. This is called when the user suspends
+ * the system, or the APM code suspends the system.
*/
static void
edsuspend(struct pccard_dev *dp)
{
printf("ed%d: suspending\n", dp->isahd.id_unit);
}
+
/*
* Initialize the device - called from Slot manager.
- * if first is set, then initially check for
- * the device's existence before initialising it.
- * Once initialised, the device table may be set up.
+ * If first is set, then check for the device's existence
+ * before initializing it. Once initialized, the device table may
+ * be set up.
*/
static int
edinit(struct pccard_dev *dp, int first)
{
struct ed_softc *sc = &ed_softc[dp->isahd.id_unit];
-/*
- * validate unit number.
- */
+
+ /* validate unit number. */
if (first) {
if (dp->isahd.id_unit >= NED)
return(ENODEV);
-/*
- * Probe the device. If a value is returned, the
- * device was found at the location.
- */
-
+ /*
+ * Probe the device. If a value is returned, the
+ * device was found at the location.
+ */
sc->gone = 0;
- if (ed_probe_pccard(&dp->isahd,dp->misc)==0) {
+ if (ed_probe_pccard(&dp->isahd,dp->misc)==0)
return(ENXIO);
- }
- if (ed_attach(&dp->isahd)==0) {
+ if (ed_attach(&dp->isahd)==0)
return(ENXIO);
- }
}
-/*
- * XXX TODO:
- * If it was already inited before, the device structure
- * should be already initialised. Here we should
- * reset (and possibly restart) the hardware, but
- * I am not sure of the best way to do this...
- */
+ /*
+ * XXX TODO:
+ * If it was initialized before, the device structure
+ * should also be initialized. We should
+ * reset (and possibly restart) the hardware, but
+ * I am not sure of the best way to do this...
+ */
return(0);
}
+
/*
* edunload - unload the driver and clear the table.
* XXX TODO:
- * This is called usually when the card is ejected, but
- * can be caused by the modunload of a controller driver.
- * The idea is reset the driver's view of the device
+ * This is usually called when the card is ejected, but
+ * can be caused by a modunload of a controller driver.
+ * The idea is to reset the driver's view of the device
* and ensure that any driver entry points such as
* read and write do not hang.
*/
@@ -354,13 +353,14 @@ ed_probe(isa_dev)
struct isa_device *isa_dev;
{
int nports;
+
#if NCRD > 0
-/*
- * If PC-Card probe required, then register driver with
- * slot manager.
- */
- pccard_add_driver(&ed_info);
-#endif /* NCRD > 0 */
+ /*
+ * If PC-Card probe required, then register driver with
+ * slot manager.
+ */
+ pccard_add_driver(&ed_info);
+#endif
#ifndef DEV_LKM
ed_registerdev(isa_dev, "Ethernet adapter");
diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c
index c6eb951..073379f 100644
--- a/sys/dev/fe/if_fe.c
+++ b/sys/dev/fe/if_fe.c
@@ -21,7 +21,7 @@
*/
/*
- * $Id: if_fe.c,v 1.12 1996/03/17 08:36:36 jkh Exp $
+ * $Id: if_fe.c,v 1.13 1996/04/07 17:50:09 bde Exp $
*
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
* To be used with FreeBSD 2.x
@@ -133,9 +133,7 @@
#include <pccard/card.h>
#include <pccard/slot.h>
#include <pccard/driver.h>
-
-#include <machine/laptops.h>
-#endif /* NCRD > 0 */
+#endif
#include <i386/isa/ic/mb86960.h>
#include <i386/isa/if_fereg.h>
@@ -355,28 +353,28 @@ static void feunload(struct pccard_dev *); /* Disable driver */
static void fesuspend(struct pccard_dev *); /* Suspend driver */
static int feinit(struct pccard_dev *, int); /* init device */
-static struct pccard_drv fe_info =
- {
- "fe",
- fe_card_intr,
- feunload,
- fesuspend,
- feinit,
- 0, /* Attributes - presently unused */
- &net_imask /* Interrupt mask for device */
- /* This should also include net_imask?? */
- };
+static struct pccard_drv fe_info = {
+ "fe",
+ fe_card_intr,
+ feunload,
+ fesuspend,
+ feinit,
+ 0, /* Attributes - presently unused */
+ &net_imask /* Interrupt mask for device */
+ /* XXX - Should this also include net_imask? */
+};
+
/*
- * Called when a power down is requested. Shuts down the
- * device and configures the device as unavailable (but
- * still loaded...). A resume is done by calling
- * feinit with first=0. This is called when the user suspends
- * the system, or the APM code suspends the system.
+ * Called when a power down is requested. Shuts down the
+ * device and configures the device as unavailable (but
+ * still loaded...). A resume is done by calling
+ * feinit with first=0. This is called when the user suspends
+ * the system, or the APM code suspends the system.
*/
static void
fesuspend(struct pccard_dev *dp)
{
- printf("fe%d: suspending\n", dp->isahd.id_unit);
+ printf("fe%d: suspending\n", dp->isahd.id_unit);
}
/*
@@ -388,65 +386,60 @@ fesuspend(struct pccard_dev *dp)
static int
feinit(struct pccard_dev *dp, int first)
{
-/*
- * validate unit number.
- */
- struct fe_softc *sc;
- if (first)
- {
- if (dp->isahd.id_unit >= NFE)
- return(ENODEV);
-/*
- * Probe the device. If a value is returned, the
- * device was found at the location.
- */
+ /* validate unit number. */
+ if (first) {
+ if (dp->isahd.id_unit >= NFE)
+ return (ENODEV);
+ /*
+ * Probe the device. If a value is returned,
+ * the device was found at the location.
+ */
#if FE_DEBUG >= 2
printf("Start Probe\n");
#endif
- if (fe_probe(&dp->isahd)==0)
- return(ENXIO);
+ if (fe_probe(&dp->isahd) == 0)
+ return (ENXIO);
#if FE_DEBUG >= 2
printf("Start attach\n");
#endif
- if (fe_attach(&dp->isahd)==0)
- return(ENXIO);
-
- }
-/*
- * XXX TODO:
- * If it was already init'ed before, the device structure
- * should be already initialized. Here we should
- * reset (and possibly restart) the hardware, but
- * I am not sure of the best way to do this...
- */
- return(0);
+ if (fe_attach(&dp->isahd) == 0)
+ return (ENXIO);
+ }
+ /*
+ * XXX TODO:
+ * If it was initialized before, the device structure
+ * should also be initialized. We should
+ * reset (and possibly restart) the hardware, but
+ * I am not sure of the best way to do this...
+ */
+ return (0);
}
/*
- * feunload - unload the driver and clear the table.
- * XXX TODO:
- * This is called usually when the card is ejected, but
- * can be caused by the modunload of a controller driver.
- * The idea is reset the driver's view of the device
- * and ensure that any driver entry points such as
- * read and write do not hang.
+ * feunload - unload the driver and clear the table.
+ * XXX TODO:
+ * This is usually called when the card is ejected, but
+ * can be caused by a modunload of a controller driver.
+ * The idea is to reset the driver's view of the device
+ * and ensure that any driver entry points such as
+ * read and write do not hang.
*/
static void
feunload(struct pccard_dev *dp)
{
- printf("fe%d: unload\n", dp->isahd.id_unit);
- fe_stop(dp->isahd.id_unit);
+ printf("fe%d: unload\n", dp->isahd.id_unit);
+ fe_stop(dp->isahd.id_unit);
}
/*
- * card_intr - Shared interrupt called from
- * front end of PC-Card handler.
+ * fe_card_intr - Shared interrupt called from
+ * front end of PC-Card handler.
*/
static int
fe_card_intr(struct pccard_dev *dp)
{
- feintr(dp->isahd.id_unit);
- return(1);
+ feintr(dp->isahd.id_unit);
+ return (1);
}
#endif /* NCRD > 0 */
@@ -501,7 +494,7 @@ fe_probe ( DEVICE * dev )
{
#if NCRD > 0
static int fe_already_init;
-#endif /* NCRD > 0 */
+#endif
struct fe_softc * sc;
int u;
int nports;
@@ -515,21 +508,19 @@ fe_probe ( DEVICE * dev )
#if NCRD == 0
#ifndef DEV_LKM
- fe_registerdev( sc, dev );
+ fe_registerdev(sc, dev);
#endif
#endif /* NCRD == 0 */
#if NCRD > 0
-/*
- * If PC-Card probe required, then register driver with
- * slot manager.
- */
- if (fe_already_init != 1)
- {
+ /*
+ * If PC-Card probe required, then register driver with
+ * slot manager.
+ */
+ if (fe_already_init != 1) {
fe_registerdev(sc,dev);
- pccard_add_driver(&fe_info);
- fe_already_init = 1;
-/* return ( 0 ); */
+ pccard_add_driver(&fe_info);
+ fe_already_init = 1;
}
#endif /* NCRD > 0 */
@@ -1317,7 +1308,7 @@ static int
fe_attach ( DEVICE * dev )
{
#if NCRD > 0
-static int alredy_ifatch[NFE];
+ static int already_ifattach[NFE];
#endif
struct fe_softc *sc = &fe_softc[dev->id_unit];
@@ -1383,17 +1374,16 @@ static int alredy_ifatch[NFE];
break;
}
- /* Attach and stop the interface. */
+ /* Attach and stop the interface. */
#if NCRD > 0
- if (alredy_ifatch[dev->id_unit] != 1)
- {
- if_attach( &sc->sc_if );
- alredy_ifatch[dev->id_unit] = 1;
+ if (already_ifattach[dev->id_unit] != 1) {
+ if_attach(&sc->sc_if);
+ already_ifattach[dev->id_unit] = 1;
}
#else
- if_attach( &sc->sc_if );
+ if_attach(&sc->sc_if);
#endif /* NCRD > 0 */
- fe_stop( sc->sc_unit ); /* This changes the state to IDLE. */
+ fe_stop(sc->sc_unit); /* This changes the state to IDLE. */
ether_ifattach(&sc->sc_if);
/* Print additional info when attached. */
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 08f3724..3d2fba5 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.139 1996/04/11 21:18:49 bde Exp $
+ * $Id: sio.c,v 1.140 1996/04/13 14:55:18 bde Exp $
*/
#include "opt_comconsole.h"
@@ -83,7 +83,7 @@
#include <pccard/card.h>
#include <pccard/driver.h>
#include <pccard/slot.h>
-#endif /* NCRD > 0 */
+#endif
#define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */
#define RB_I_HIGH_WATER (TTYHOG - 2 * RS_IBUFSIZE)
@@ -399,8 +399,7 @@ static void siounload(struct pccard_dev *); /* Disable driver */
static void siosuspend(struct pccard_dev *); /* Suspend driver */
static int sioinit(struct pccard_dev *, int); /* init device */
-static struct pccard_drv sio_info =
- {
+static struct pccard_drv sio_info = {
driver_name,
card_intr,
siounload,
@@ -408,65 +407,64 @@ static struct pccard_drv sio_info =
sioinit,
0, /* Attributes - presently unused */
&tty_imask /* Interrupt mask for device */
- /* This should also include net_imask?? */
- };
+ /* XXX - Should this also include net_imask? */
+};
+
/*
- * Called when a power down is wanted. Shuts down the
- * device and configures the device as unavailable (but
- * still loaded...). A resume is done by calling
- * sioinit with first=0. This is called when the user suspends
- * the system, or the APM code suspends the system.
+ * Called when a power down is requested. Shuts down the
+ * device and configures the device as unavailable (but
+ * still loaded...). A resume is done by calling
+ * sioinit with first=0. This is called when the user suspends
+ * the system, or the APM code suspends the system.
*/
static void
siosuspend(struct pccard_dev *dp)
{
printf("sio%d: suspending\n", dp->isahd.id_unit);
}
+
/*
* Initialize the device - called from Slot manager.
- * if first is set, then initially check for
- * the device's existence before initialising it.
- * Once initialised, the device table may be set up.
+ * If first is set, then check for the device's existence
+ * before initializing it. Once initialized, the device table may
+ * be set up.
*/
int
sioinit(struct pccard_dev *dp, int first)
{
-/*
- * validate unit number.
- */
- if (first)
- {
+
+ /* validate unit number. */
+ if (first) {
if (dp->isahd.id_unit >= NSIO)
return(ENODEV);
-/*
- * Make sure it isn't already probed.
- */
+ /* Make sure it isn't already probed. */
if (com_addr(dp->isahd.id_unit))
return(EBUSY);
-/*
- * Probe the device. If a value is returned, the
- * device was found at the location.
- */
+ /*
+ * Probe the device. If a value is returned, the
+ * device was found at the location.
+ */
if (sioprobe(&dp->isahd)==0)
return(ENXIO);
if (sioattach(&dp->isahd)==0)
return(ENXIO);
- }
-/*
- * XXX TODO:
- * If it was already inited before, the device structure
- * should be already initialised. Here we should
- * reset (and possibly restart) the hardware, but
- * I am not sure of the best way to do this...
- */
+ }
+ /*
+ * XXX TODO:
+ * If it was initialized before, the device structure
+ * should also be initialized. We should
+ * reset (and possibly restart) the hardware, but
+ * I am not sure of the best way to do this...
+ */
return(0);
}
+
/*
* siounload - unload the driver and clear the table.
* XXX TODO:
- * This is called usually when the card is ejected, but
- * can be caused by the modunload of a controller driver.
- * The idea is reset the driver's view of the device
+ * This is usually called when the card is ejected, but
+ * can be caused by a modunload of a controller driver.
+ * The idea is to reset the driver's view of the device
* and ensure that any driver entry points such as
* read and write do not hang.
*/
@@ -559,12 +557,12 @@ sioprobe(dev)
if (xdev->id_driver == &siodriver && xdev->id_enabled)
outb(xdev->id_iobase + com_mcr, 0);
#if NCRD > 0
-/*
- * If PC-Card probe required, then register driver with
- * slot manager.
- */
+ /*
+ * If PC-Card probe required, then register driver with
+ * slot manager.
+ */
pccard_add_driver(&sio_info);
-#endif /* NCRD > 0 */
+#endif
already_init = TRUE;
}
OpenPOWER on IntegriCloud