summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2016-07-11 11:31:49 +0000
committermsaitoh <msaitoh@NetBSD.org>2016-07-11 11:31:49 +0000
commit0e374985ea894755c520acaf984454138df95f31 (patch)
treea2cceaa07511ff3780ef8d867c0b244e4c8f22cc /sys/dev
parent38d22cab3950aa152b4a0a7ffc5610e4d0afc767 (diff)
KNF. No functional change.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/com_acpi.c8
-rw-r--r--sys/dev/acpi/ym_acpi.c10
-rw-r--r--sys/dev/cardbus/njs_cardbus.c10
-rw-r--r--sys/dev/dm/device-mapper.c48
-rw-r--r--sys/dev/eisa/ahb.c51
-rw-r--r--sys/dev/eisa/ahc_eisa.c8
-rw-r--r--sys/dev/eisa/eisa.c11
-rw-r--r--sys/dev/eisa/uha_eisa.c10
-rw-r--r--sys/dev/gpib/cs80bus.c10
-rw-r--r--sys/dev/gpib/ct.c20
-rw-r--r--sys/dev/gpib/gpib.c10
-rw-r--r--sys/dev/gpib/rd.c7
-rw-r--r--sys/dev/i2c/dbcool.c68
-rw-r--r--sys/dev/ic/aha.c35
-rw-r--r--sys/dev/ic/i82586.c80
-rw-r--r--sys/dev/ic/tulip.c76
-rw-r--r--sys/dev/ic/uha.c46
-rw-r--r--sys/dev/isa/addcom_isa.c7
-rw-r--r--sys/dev/isa/ast.c7
-rw-r--r--sys/dev/isa/boca.c7
-rw-r--r--sys/dev/isa/cec.c8
-rw-r--r--sys/dev/isa/gus.c74
-rw-r--r--sys/dev/isa/if_lc_isa.c14
-rw-r--r--sys/dev/isa/if_ntwoc_isa.c12
-rw-r--r--sys/dev/isa/if_tr_isa.c10
-rw-r--r--sys/dev/isa/moxa_isa.c7
-rw-r--r--sys/dev/isa/rtfps.c7
-rw-r--r--sys/dev/isa/sbdsp.c27
-rw-r--r--sys/dev/isa/soekrisgpio.c8
-rw-r--r--sys/dev/isa/tcom.c7
-rw-r--r--sys/dev/isa/wds.c43
-rw-r--r--sys/dev/isa/wt.c19
-rw-r--r--sys/dev/isapnp/if_an_isapnp.c7
-rw-r--r--sys/dev/mca/ed_mca.c8
-rw-r--r--sys/dev/mca/edc_mca.c26
-rw-r--r--sys/dev/mca/if_elmc_mca.c68
-rw-r--r--sys/dev/mca/if_ep_mca.c7
-rw-r--r--sys/dev/mca/if_tra_mca.c10
-rw-r--r--sys/dev/pci/gffb.c61
-rw-r--r--sys/dev/pci/gtp.c10
-rw-r--r--sys/dev/pci/iavc_pci.c42
-rw-r--r--sys/dev/pci/if_vte.c35
-rw-r--r--sys/dev/pci/machfb.c121
-rw-r--r--sys/dev/pci/njs_pci.c7
-rw-r--r--sys/dev/pci/piixpm.c24
-rw-r--r--sys/dev/pci/voodoofb.c275
-rw-r--r--sys/dev/pcmcia/if_tr_pcmcia.c10
-rw-r--r--sys/dev/pcmcia/isic_pcmcia.c25
-rw-r--r--sys/dev/usb/uark.c13
-rw-r--r--sys/dev/usb/uscanner.c36
-rw-r--r--sys/dev/usb/uthum.c23
51 files changed, 855 insertions, 718 deletions
diff --git a/sys/dev/acpi/com_acpi.c b/sys/dev/acpi/com_acpi.c
index 06511a3f10a..7d35cd84d52 100644
--- a/sys/dev/acpi/com_acpi.c
+++ b/sys/dev/acpi/com_acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com_acpi.c,v 1.32 2010/07/22 16:35:24 pgoyette Exp $ */
+/* $NetBSD: com_acpi.c,v 1.33 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 2002 Jared D. McNeill <jmcneill@invisible.ca>
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.32 2010/07/22 16:35:24 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.33 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -120,8 +120,8 @@ com_acpi_attach(device_t parent, device_t self, void *aux)
base = mem->ar_base;
size = mem->ar_length;
} else {
- aprint_error_dev(self,
- "unable to find i/o register and memory resource\n");
+ aprint_error_dev(self, "unable to find i/o register "
+ "and memory resource\n");
goto out;
}
}
diff --git a/sys/dev/acpi/ym_acpi.c b/sys/dev/acpi/ym_acpi.c
index 2d976f7c728..05044fcad46 100644
--- a/sys/dev/acpi/ym_acpi.c
+++ b/sys/dev/acpi/ym_acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ym_acpi.c,v 1.14 2011/06/02 14:12:25 tsutsui Exp $ */
+/* $NetBSD: ym_acpi.c,v 1.15 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 2006 Jasper Wallace <jasper@pointless.net>
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ym_acpi.c,v 1.14 2011/06/02 14:12:25 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ym_acpi.c,v 1.15 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -122,7 +122,8 @@ ym_acpi_attach(device_t parent, device_t self, void *aux)
mpu_io == NULL ||
#endif
control_io == NULL) {
- aprint_error_dev(self, "unable to find i/o registers resource\n");
+ aprint_error_dev(self,
+ "unable to find i/o registers resource\n");
goto out;
}
if (bus_space_map(sc->sc_iot, sb_io->ar_base, sb_io->ar_length,
@@ -149,7 +150,8 @@ ym_acpi_attach(device_t parent, device_t self, void *aux)
#endif
if (bus_space_map(sc->sc_iot, control_io->ar_base,
control_io->ar_length, 0, &sc->sc_controlioh) != 0) {
- aprint_error_dev(self, "unable to map i/o registers (control)\n");
+ aprint_error_dev(self,
+ "unable to map i/o registers (control)\n");
goto out;
}
diff --git a/sys/dev/cardbus/njs_cardbus.c b/sys/dev/cardbus/njs_cardbus.c
index 39c4130e034..b1a8515ac8a 100644
--- a/sys/dev/cardbus/njs_cardbus.c
+++ b/sys/dev/cardbus/njs_cardbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: njs_cardbus.c,v 1.17 2011/08/01 11:20:28 drochner Exp $ */
+/* $NetBSD: njs_cardbus.c,v 1.18 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: njs_cardbus.c,v 1.17 2011/08/01 11:20:28 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: njs_cardbus.c,v 1.18 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -174,7 +174,8 @@ njs_cardbus_attach(device_t parent, device_t self, void *aux)
csr |= PCI_COMMAND_IO_ENABLE;
sc->sc_flags = NJSC32_IO_MAPPED;
} else {
- aprint_error_dev(self, "unable to map device registers\n");
+ aprint_error_dev(self,
+ "unable to map device registers\n");
return;
}
}
@@ -203,8 +204,7 @@ njs_cardbus_attach(device_t parent, device_t self, void *aux)
*/
sc->sc_ih = Cardbus_intr_establish(ct, IPL_BIO, njsc32_intr, sc);
if (sc->sc_ih == NULL) {
- aprint_error_dev(self,
- "unable to establish interrupt\n");
+ aprint_error_dev(self, "unable to establish interrupt\n");
return;
}
diff --git a/sys/dev/dm/device-mapper.c b/sys/dev/dm/device-mapper.c
index 41a80ed7b05..6eea060412d 100644
--- a/sys/dev/dm/device-mapper.c
+++ b/sys/dev/dm/device-mapper.c
@@ -1,4 +1,4 @@
-/* $NetBSD: device-mapper.c,v 1.37 2015/08/20 14:40:17 christos Exp $ */
+/* $NetBSD: device-mapper.c,v 1.38 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@ extern uint32_t dm_dev_counter;
/*
* This array is used to translate cmd to function pointer.
*
- * Interface between libdevmapper and lvm2tools uses different
+ * Interface between libdevmapper and lvm2tools uses different
* names for one IOCTL call because libdevmapper do another thing
* then. When I run "info" or "mknodes" libdevmapper will send same
* ioctl to kernel but will do another things in userspace.
@@ -132,7 +132,7 @@ static const struct cmd_function cmd_fn[] = {
{ .cmd = "mknodes", .fn = dm_dev_status_ioctl, .allowed = 1 },
{ .cmd = "names", .fn = dm_dev_list_ioctl, .allowed = 1 },
{ .cmd = "suspend", .fn = dm_dev_suspend_ioctl, .allowed = 0 },
- { .cmd = "remove", .fn = dm_dev_remove_ioctl, .allowed = 0 },
+ { .cmd = "remove", .fn = dm_dev_remove_ioctl, .allowed = 0 },
{ .cmd = "rename", .fn = dm_dev_rename_ioctl, .allowed = 0 },
{ .cmd = "resume", .fn = dm_dev_resume_ioctl, .allowed = 0 },
{ .cmd = "clear", .fn = dm_table_clear_ioctl, .allowed = 0 },
@@ -140,7 +140,7 @@ static const struct cmd_function cmd_fn[] = {
{ .cmd = "reload", .fn = dm_table_load_ioctl, .allowed = 0 },
{ .cmd = "status", .fn = dm_table_status_ioctl, .allowed = 1 },
{ .cmd = "table", .fn = dm_table_status_ioctl, .allowed = 1 },
- { .cmd = NULL, .fn = NULL, .allowed = 0 }
+ { .cmd = NULL, .fn = NULL, .allowed = 0 }
};
#ifdef _MODULE
@@ -196,7 +196,7 @@ dm_modcmd(modcmd_t cmd, void *arg)
* defined in driver. This is probably too strong we need
* to disable auto-unload only if there is mounted dm device
* present.
- */
+ */
if (dm_dev_counter > 0)
return EBUSY;
@@ -228,8 +228,7 @@ dm_modcmd(modcmd_t cmd, void *arg)
* Autoconfiguration match function for pseudo-device glue.
*/
static int
-dm_match(device_t parent, cfdata_t match,
- void *aux)
+dm_match(device_t parent, cfdata_t match, void *aux)
{
/* Pseudo-device; always present. */
@@ -242,8 +241,7 @@ dm_match(device_t parent, cfdata_t match,
* Autoconfiguration attach function for pseudo-device glue.
*/
static void
-dm_attach(device_t parent, device_t self,
- void *aux)
+dm_attach(device_t parent, device_t self, void *aux)
{
return;
}
@@ -254,7 +252,7 @@ dm_attach(device_t parent, device_t self,
*
* Autoconfiguration detach function for pseudo-device glue.
* This routine is called by dm_ioctl::dm_dev_remove_ioctl and by autoconf to
- * remove devices created in device-mapper.
+ * remove devices created in device-mapper.
*/
static int
dm_detach(device_t self, int flags)
@@ -270,7 +268,7 @@ dm_detach(device_t self, int flags)
/* Destroy inactive table if exits, too. */
dm_table_destroy(&dmv->table_head, DM_TABLE_INACTIVE);
-
+
dm_table_head_destroy(&dmv->table_head);
/* Destroy disk device structure */
@@ -319,7 +317,7 @@ dmdestroy(void)
error = config_cfattach_detach(dm_cd.cd_name, &dm_ca);
if (error)
return error;
-
+
dm_dev_destroy();
dm_pdev_destroy();
dm_target_destroy();
@@ -355,7 +353,7 @@ dmioctl(dev_t dev, const u_long cmd, void *data, int flag, struct lwp *l)
aprint_debug("dmioctl called\n");
KASSERT(data != NULL);
-
+
if (( r = disk_ioctl_switch(dev, cmd, data)) == ENOTTY) {
struct plistref *pref = (struct plistref *) data;
@@ -364,7 +362,8 @@ dmioctl(dev_t dev, const u_long cmd, void *data, int flag, struct lwp *l)
if ((r = dm_ioctl_switch(cmd)) != 0)
return r;
- if((r = prop_dictionary_copyin_ioctl(pref, cmd, &dm_dict_in)) != 0)
+ if((r = prop_dictionary_copyin_ioctl(pref, cmd, &dm_dict_in))
+ != 0)
return r;
if ((r = dm_check_version(dm_dict_in)) != 0)
@@ -386,10 +385,11 @@ cleanup_exit:
* Translate command sent from libdevmapper to func.
*/
static int
-dm_cmd_to_fun(prop_dictionary_t dm_dict) {
+dm_cmd_to_fun(prop_dictionary_t dm_dict)
+ {
int i, r;
prop_string_t command;
-
+
r = 0;
if ((command = prop_dictionary_get(dm_dict, DM_IOCTL_COMMAND)) == NULL)
@@ -399,7 +399,7 @@ dm_cmd_to_fun(prop_dictionary_t dm_dict) {
if (prop_string_equals_cstring(command, cmd_fn[i].cmd))
break;
- if (!cmd_fn[i].allowed &&
+ if (!cmd_fn[i].allowed &&
(r = kauth_authorize_system(kauth_cred_get(),
KAUTH_SYSTEM_DEVMAPPER, 0, NULL, NULL, NULL)) != 0)
return r;
@@ -444,7 +444,7 @@ disk_ioctl_switch(dev_t dev, u_long cmd, void *data)
/* disk ioctls make sense only on block devices */
if (minor(dev) == 0)
return ENOTTY;
-
+
switch(cmd) {
case DIOCGWEDGEINFO:
{
@@ -490,7 +490,7 @@ disk_ioctl_switch(dev_t dev, u_long cmd, void *data)
{
dm_table_entry_t *table_en;
dm_table_t *tbl;
-
+
if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
return ENODEV;
@@ -509,8 +509,8 @@ disk_ioctl_switch(dev_t dev, u_long cmd, void *data)
dm_dev_unbusy(dmv);
break;
}
-
-
+
+
default:
aprint_debug("unknown disk_ioctl called\n");
return ENOTTY;
@@ -538,7 +538,7 @@ dmstrategy(struct buf *bp)
buf_start = bp->b_blkno * DEV_BSIZE;
buf_len = bp->b_bcount;
- tbl = NULL;
+ tbl = NULL;
table_end = 0;
issued_len = 0;
@@ -548,7 +548,7 @@ dmstrategy(struct buf *bp)
bp->b_resid = bp->b_bcount;
biodone(bp);
return;
- }
+ }
if (bounds_check_with_mediasize(bp, DEV_BSIZE,
dm_table_size(&dmv->table_head)) <= 0) {
@@ -658,7 +658,7 @@ dmsize(dev_t dev)
size = dm_table_size(&dmv->table_head);
dm_dev_unbusy(dmv);
-
+
return size;
}
diff --git a/sys/dev/eisa/ahb.c b/sys/dev/eisa/ahb.c
index 8b019354abe..3106c0f12be 100644
--- a/sys/dev/eisa/ahb.c
+++ b/sys/dev/eisa/ahb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ahb.c,v 1.62 2014/10/18 08:33:27 snj Exp $ */
+/* $NetBSD: ahb.c,v 1.63 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.62 2014/10/18 08:33:27 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.63 2016/07/11 11:31:50 msaitoh Exp $");
#include "opt_ddb.h"
@@ -164,8 +164,8 @@ ahbmatch(device_t parent, cfdata_t match,
return (0);
if (bus_space_map(iot,
- EISA_SLOT_ADDR(ea->ea_slot) + AHB_EISA_SLOT_OFFSET, AHB_EISA_IOSIZE,
- 0, &ioh))
+ EISA_SLOT_ADDR(ea->ea_slot) + AHB_EISA_SLOT_OFFSET,
+ AHB_EISA_IOSIZE, 0, &ioh))
return (0);
rv = !ahb_find(iot, ioh, NULL);
@@ -208,8 +208,8 @@ ahbattach(device_t parent, device_t self, void *aux)
printf(": %s\n", model);
if (bus_space_map(iot,
- EISA_SLOT_ADDR(ea->ea_slot) + AHB_EISA_SLOT_OFFSET, AHB_EISA_IOSIZE,
- 0, &ioh))
+ EISA_SLOT_ADDR(ea->ea_slot) + AHB_EISA_SLOT_OFFSET,
+ AHB_EISA_IOSIZE, 0, &ioh))
panic("ahbattach: could not map I/O addresses");
sc->sc_iot = iot;
@@ -263,8 +263,7 @@ ahbattach(device_t parent, device_t self, void *aux)
return;
}
if (intrstr != NULL)
- aprint_normal_dev(sc->sc_dev, "interrupting at %s\n",
- intrstr);
+ aprint_normal_dev(sc->sc_dev, "interrupting at %s\n", intrstr);
/*
* ask the adapter what subunits are present
@@ -380,8 +379,9 @@ ahbintr(void *arg)
case AHB_ECB_ERR:
ecb = ahb_ecb_phys_kv(sc, mboxval);
if (!ecb) {
- aprint_error_dev(sc->sc_dev, "BAD ECB RETURNED!\n");
- goto next; /* whatever it was, it'll timeout */
+ aprint_error_dev(sc->sc_dev,
+ "BAD ECB RETURNED!\n");
+ goto next; /* whatever it was, it'll timeout */
}
break;
@@ -397,8 +397,8 @@ ahbintr(void *arg)
break;
default:
- aprint_error_dev(sc->sc_dev, "unexpected interrupt %x\n",
- ahbstat);
+ aprint_error_dev(sc->sc_dev,
+ "unexpected interrupt %x\n", ahbstat);
goto next;
}
@@ -475,8 +475,8 @@ ahb_create_ecbs(struct ahb_softc *sc, struct ahb_ecb *ecbstore, int count)
for (i = 0; i < count; i++) {
ecb = &ecbstore[i];
if ((error = ahb_init_ecb(sc, ecb)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to initialize ecb, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to initialize ecb, error = %d\n", error);
goto out;
}
TAILQ_INSERT_TAIL(&sc->sc_free_ecb, ecb, chain);
@@ -605,7 +605,8 @@ done:
* Start the board, ready for normal operation
*/
static int
-ahb_find(bus_space_tag_t iot, bus_space_handle_t ioh, struct ahb_probe_data *sc)
+ahb_find(bus_space_tag_t iot, bus_space_handle_t ioh,
+ struct ahb_probe_data *sc)
{
u_char intdef;
int i, irq, busid;
@@ -712,8 +713,8 @@ ahb_init(struct ahb_softc *sc)
if ((error = bus_dmamem_map(sc->sc_dmat, &seg, rseg,
ECBSIZE, (void **)&sc->sc_ecbs,
BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to map ecbs, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to map ecbs, error = %d\n", error);
return (error);
}
@@ -722,14 +723,14 @@ ahb_init(struct ahb_softc *sc)
*/
if ((error = bus_dmamap_create(sc->sc_dmat, ECBSIZE,
1, ECBSIZE, 0, BUS_DMA_NOWAIT, &sc->sc_dmamap_ecb)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to create ecb DMA map, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to create ecb DMA map, error = %d\n", error);
return (error);
}
if ((error = bus_dmamap_load(sc->sc_dmat, sc->sc_dmamap_ecb,
sc->sc_ecbs, ECBSIZE, NULL, BUS_DMA_NOWAIT)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to load ecb DMA map, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to load ecb DMA map, error = %d\n", error);
return (error);
}
@@ -836,8 +837,8 @@ ahb_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
* Put all the arguments for the xfer in the ecb
*/
if (xs->cmdlen > sizeof(ecb->scsi_cmd)) {
- aprint_error_dev(sc->sc_dev, "cmdlen %d too large for ECB\n",
- xs->cmdlen);
+ aprint_error_dev(sc->sc_dev,
+ "cmdlen %d too large for ECB\n", xs->cmdlen);
xs->error = XS_DRIVER_STUFFUP;
goto out_bad;
}
@@ -882,8 +883,8 @@ ahb_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
default:
xs->error = XS_DRIVER_STUFFUP;
- aprint_error_dev(sc->sc_dev, "error %d loading DMA map\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "error %d loading DMA map\n", error);
out_bad:
ahb_free_ecb(sc, ecb);
scsipi_done(xs);
diff --git a/sys/dev/eisa/ahc_eisa.c b/sys/dev/eisa/ahc_eisa.c
index 776fa613c81..1edc921fe6b 100644
--- a/sys/dev/eisa/ahc_eisa.c
+++ b/sys/dev/eisa/ahc_eisa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ahc_eisa.c,v 1.40 2014/10/18 08:33:27 snj Exp $ */
+/* $NetBSD: ahc_eisa.c,v 1.41 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Product specific probe and attach routines for:
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahc_eisa.c,v 1.40 2014/10/18 08:33:27 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahc_eisa.c,v 1.41 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -170,8 +170,8 @@ ahc_eisa_attach(device_t parent, device_t self, void *aux)
ahc->ih = eisa_intr_establish(ec, ih,
intrtype, IPL_BIO, ahc_intr, ahc);
if (ahc->ih == NULL) {
- aprint_error_dev(ahc->sc_dev, "couldn't establish %s interrupt",
- intrtypestr);
+ aprint_error_dev(ahc->sc_dev,
+ "couldn't establish %s interrupt", intrtypestr);
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
diff --git a/sys/dev/eisa/eisa.c b/sys/dev/eisa/eisa.c
index 9e3dc1fbf7c..5a41e7dbb81 100644
--- a/sys/dev/eisa/eisa.c
+++ b/sys/dev/eisa/eisa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: eisa.c,v 1.45 2008/04/06 08:54:43 cegger Exp $ */
+/* $NetBSD: eisa.c,v 1.46 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: eisa.c,v 1.45 2008/04/06 08:54:43 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eisa.c,v 1.46 2016/07/11 11:31:50 msaitoh Exp $");
#include "opt_eisaverbose.h"
@@ -131,8 +131,8 @@ eisaattach(device_t parent, device_t self, void *aux)
* about it.
*/
if (bus_space_map(iot, slotaddr, EISA_SLOT_SIZE, 0, &slotioh)) {
- aprint_error_dev(self, "can't map I/O space for slot %d\n",
- slot);
+ aprint_error_dev(self,
+ "can't map I/O space for slot %d\n", slot);
continue;
}
@@ -146,8 +146,7 @@ eisaattach(device_t parent, device_t self, void *aux)
#if 0
printf("no device at %s slot %d\n", device_xname(self),
slot);
- printf("\t(0x%x, 0x%x)\n", ea.ea_vid[0],
- ea.ea_vid[1]);
+ printf("\t(0x%x, 0x%x)\n", ea.ea_vid[0], ea.ea_vid[1]);
#endif
bus_space_unmap(iot, slotioh, EISA_SLOT_SIZE);
continue;
diff --git a/sys/dev/eisa/uha_eisa.c b/sys/dev/eisa/uha_eisa.c
index 8bd484308b9..ffd9b9e2810 100644
--- a/sys/dev/eisa/uha_eisa.c
+++ b/sys/dev/eisa/uha_eisa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uha_eisa.c,v 1.37 2014/10/18 08:33:27 snj Exp $ */
+/* $NetBSD: uha_eisa.c,v 1.38 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uha_eisa.c,v 1.37 2014/10/18 08:33:27 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uha_eisa.c,v 1.38 2016/07/11 11:31:50 msaitoh Exp $");
#include "opt_ddb.h"
@@ -164,7 +164,8 @@ uha_eisa_attach(device_t parent, device_t self, void *aux)
}
static int
-u24_find(bus_space_tag_t iot, bus_space_handle_t ioh, struct uha_probe_data *sc)
+u24_find(bus_space_tag_t iot, bus_space_handle_t ioh,
+ struct uha_probe_data *sc)
{
u_int8_t config0, config1, config2;
int irq, drq;
@@ -233,7 +234,8 @@ u24_start_mbox(struct uha_softc *sc, struct uha_mscp *mscp)
delay(100);
}
if (!spincount) {
- aprint_error_dev(sc->sc_dev, "uha_start_mbox, board not responding\n");
+ aprint_error_dev(sc->sc_dev,
+ "uha_start_mbox, board not responding\n");
Debugger();
}
diff --git a/sys/dev/gpib/cs80bus.c b/sys/dev/gpib/cs80bus.c
index e7964849ac0..b076866debb 100644
--- a/sys/dev/gpib/cs80bus.c
+++ b/sys/dev/gpib/cs80bus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cs80bus.c,v 1.16 2012/10/27 17:18:16 chs Exp $ */
+/* $NetBSD: cs80bus.c,v 1.17 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs80bus.c,v 1.16 2012/10/27 17:18:16 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs80bus.c,v 1.17 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -115,7 +115,8 @@ cs80busattach(device_t parent, device_t self, void *aux)
for (slave = 0; slave < 8; slave++) {
- if (gpib_isalloc(device_private(device_parent(sc->sc_dev)), slave))
+ if (gpib_isalloc(device_private(device_parent(sc->sc_dev)),
+ slave))
continue;
if (gpibrecv(sc->sc_ic, GPIB_BROADCAST_ADDR,
@@ -133,7 +134,8 @@ cs80busattach(device_t parent, device_t self, void *aux)
ca.ca_slave = slave;
ca.ca_id = id;
- (void)config_search_ia(cs80bussearch, sc->sc_dev, "cs80bus", &ca);
+ (void)config_search_ia(cs80bussearch, sc->sc_dev, "cs80bus",
+ &ca);
}
}
diff --git a/sys/dev/gpib/ct.c b/sys/dev/gpib/ct.c
index d9f21202c71..187eeea8985 100644
--- a/sys/dev/gpib/ct.c
+++ b/sys/dev/gpib/ct.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ct.c,v 1.27 2014/07/25 08:10:36 dholland Exp $ */
+/* $NetBSD: ct.c,v 1.28 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.27 2014/07/25 08:10:36 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.28 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -275,7 +275,8 @@ ctattach(device_t parent, device_t self, void *aux)
if (cs80describe(parent, sc->sc_slave, sc->sc_punit, &csd)) {
aprint_normal("\n");
- aprint_error_dev(sc->sc_dev, "didn't respond to describe command\n");
+ aprint_error_dev(sc->sc_dev,
+ "didn't respond to describe command\n");
return;
}
memset(name, 0, sizeof(name));
@@ -620,14 +621,14 @@ cteof(struct ct_softc *sc, struct buf *bp)
* we really read and update b_resid.
*/
blks = sc->sc_stat.c_blk - sc->sc_blkno - 1;
- DPRINTF(CDB_FILES, ("cteof: bc %d oblk %d nblk %d read %ld, resid %ld\n",
+ DPRINTF(CDB_FILES,
+ ("cteof: bc %d oblk %d nblk %d read %ld, resid %ld\n",
bp->b_bcount, sc->sc_blkno, sc->sc_stat.c_blk,
blks, bp->b_bcount - CTKTOB(blks)));
if (blks == -1) { /* 9145 on EOF does not change sc_stat.c_blk */
blks = 0;
sc->sc_blkno++;
- }
- else {
+ } else {
sc->sc_blkno = sc->sc_stat.c_blk;
}
bp->b_resid = bp->b_bcount - CTKTOB(blks);
@@ -729,9 +730,10 @@ ctintr(struct ct_softc *sc)
(void) gpibrecv(sc->sc_ic, slave, CS80CMD_EXEC, &sc->sc_stat,
sizeof(sc->sc_stat));
(void) gpibrecv(sc->sc_ic, slave, CS80CMD_QSTAT, &stat, 1);
- DPRINTF(CDB_FILES, ("ctintr: return stat 0x%x, A%x F%x blk %d\n",
- stat, sc->sc_stat.c_aef,
- sc->sc_stat.c_fef, sc->sc_stat.c_blk));
+ DPRINTF(CDB_FILES,
+ ("ctintr: return stat 0x%x, A%x F%x blk %d\n",
+ stat, sc->sc_stat.c_aef,
+ sc->sc_stat.c_fef, sc->sc_stat.c_blk));
if (stat == 0) {
if (sc->sc_stat.c_aef & (AEF_EOF | AEF_EOV)) {
cteof(sc, bp);
diff --git a/sys/dev/gpib/gpib.c b/sys/dev/gpib/gpib.c
index 2bc9bdd9722..0f32bcab6d0 100644
--- a/sys/dev/gpib/gpib.c
+++ b/sys/dev/gpib/gpib.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gpib.c,v 1.22 2014/07/25 08:10:36 dholland Exp $ */
+/* $NetBSD: gpib.c,v 1.23 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gpib.c,v 1.22 2014/07/25 08:10:36 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpib.c,v 1.23 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -140,7 +140,8 @@ gpibattach(device_t parent, device_t self, void *aux)
for (address=0; address<GPIB_NDEVS; address++) {
ga.ga_ic = sc->sc_ic;
ga.ga_address = address;
- (void) config_search_ia(gpibsubmatch1, sc->sc_dev, "gpib", &ga);
+ (void) config_search_ia(gpibsubmatch1, sc->sc_dev, "gpib",
+ &ga);
}
/* attach the wild-carded devices - probably protocol busses */
@@ -224,7 +225,8 @@ gpibintr(void *v)
* Create a callback handle.
*/
int
-_gpibregister(struct gpib_softc *sc, int slave, gpib_callback_t callback, void *arg, gpib_handle_t *hdl)
+_gpibregister(struct gpib_softc *sc, int slave, gpib_callback_t callback,
+ void *arg, gpib_handle_t *hdl)
{
*hdl = malloc(sizeof(struct gpibqueue), M_DEVBUF, M_NOWAIT);
diff --git a/sys/dev/gpib/rd.c b/sys/dev/gpib/rd.c
index de4486d6b16..54b0dff0641 100644
--- a/sys/dev/gpib/rd.c
+++ b/sys/dev/gpib/rd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rd.c,v 1.40 2015/04/13 16:33:24 riastradh Exp $ */
+/* $NetBSD: rd.c,v 1.41 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.40 2015/04/13 16:33:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.41 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -331,7 +331,8 @@ rdattach(device_t parent, device_t self, void *aux)
if (cs80describe(parent, sc->sc_slave, sc->sc_punit, &csd)) {
aprint_normal("\n");
- aprint_error_dev(sc->sc_dev, "didn't respond to describe command\n");
+ aprint_error_dev(sc->sc_dev,
+ "didn't respond to describe command\n");
return;
}
memset(name, 0, sizeof(name));
diff --git a/sys/dev/i2c/dbcool.c b/sys/dev/i2c/dbcool.c
index 6170a9a4396..130f5520cc3 100644
--- a/sys/dev/i2c/dbcool.c
+++ b/sys/dev/i2c/dbcool.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dbcool.c,v 1.44 2015/12/16 08:05:38 jdc Exp $ */
+/* $NetBSD: dbcool.c,v 1.45 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/*
+/*
* a driver for the dbCool(tm) family of environmental controllers
*
* Data sheets for the various supported chips are available at
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.44 2015/12/16 08:05:38 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.45 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -65,7 +65,7 @@ __KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.44 2015/12/16 08:05:38 jdc Exp $");
/* Config interface */
static int dbcool_match(device_t, cfdata_t, void *);
-static void dbcool_attach(device_t, device_t, void *);
+static int dbcool_attach(device_t, device_t, void *);
static int dbcool_detach(device_t, int);
/* Device attributes */
@@ -131,7 +131,7 @@ struct dbc_sysctl_info {
static struct dbc_sysctl_info dbc_sysctl_table[] = {
/*
- * The first several entries must remain in the same order as the
+ * The first several entries must remain in the same order as the
* corresponding entries in enum dbc_pwm_params
*/
{ "behavior", "operating behavior and temp selector",
@@ -407,7 +407,7 @@ struct dbcool_power_control ADT7475_power_table[] = {
{ { DBCOOL_PWM2_CTL, DBCOOL_PWM2_MINDUTY,
DBCOOL_PWM2_MAXDUTY, DBCOOL_PWM2_CURDUTY },
"fan_control_2" },
- { { DBCOOL_PWM3_CTL, DBCOOL_PWM3_MINDUTY,
+ { { DBCOOL_PWM3_CTL, DBCOOL_PWM3_MINDUTY,
DBCOOL_PWM3_MAXDUTY, DBCOOL_PWM3_CURDUTY },
"fan_control_3" },
{ { 0, 0, 0, 0 }, NULL }
@@ -539,7 +539,7 @@ struct dbcool_sensor ADM1030_sensor_table[] = {
{ DBC_EOF, {0, 0, 0 }, 0, 0, 0 }
};
-struct dbcool_power_control ADM1030_power_table[] = {
+struct dbcool_power_control ADM1030_power_table[] = {
{ { DBCOOL_ADM1030_CFG1, DBCOOL_NO_REG, DBCOOL_NO_REG,
DBCOOL_ADM1030_FAN_SPEED_CFG },
"fan_control_1" },
@@ -592,7 +592,7 @@ struct dbcool_sensor ADM1031_sensor_table[] = {
{ DBC_EOF, {0, 0, 0 }, 0, 0, 0 }
};
-struct dbcool_power_control ADM1031_power_table[] = {
+struct dbcool_power_control ADM1031_power_table[] = {
{ { DBCOOL_ADM1030_CFG1, DBCOOL_NO_REG, DBCOOL_NO_REG,
DBCOOL_ADM1030_FAN_SPEED_CFG },
"fan_control_1" },
@@ -785,12 +785,12 @@ dbcool_attach(device_t parent, device_t self, void *aux)
if (sc->sc_dc.dc_chip->company == SMSC_COMPANYID)
{
aprint_normal_dev(self, "SMSC %s Controller "
- "(rev 0x%02x, stepping 0x%02x)\n", sc->sc_dc.dc_chip->name,
- ver >> 4, ver & 0x0f);
+ "(rev 0x%02x, stepping 0x%02x)\n",
+ sc->sc_dc.dc_chip->name, ver >> 4, ver & 0x0f);
} else {
aprint_normal_dev(self, "%s dBCool(tm) Controller "
- "(rev 0x%02x, stepping 0x%02x)\n", sc->sc_dc.dc_chip->name,
- ver >> 4, ver & 0x0f);
+ "(rev 0x%02x, stepping 0x%02x)\n",
+ sc->sc_dc.dc_chip->name, ver >> 4, ver & 0x0f);
}
else
aprint_normal_dev(self, "%s dBCool(tm) Controller "
@@ -831,7 +831,7 @@ bool dbcool_pmf_suspend(device_t dev, const pmf_qual_t *qual)
if ((sc->sc_dc.dc_chip->flags & DBCFLAG_HAS_SHDN) == 0)
return true;
-
+
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466) {
reg = DBCOOL_ADT7466_CONFIG2;
bit = DBCOOL_ADT7466_CFG2_SHDN;
@@ -856,7 +856,7 @@ bool dbcool_pmf_resume(device_t dev, const pmf_qual_t *qual)
if ((sc->sc_dc.dc_chip->flags & DBCFLAG_HAS_SHDN) == 0)
return true;
-
+
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466) {
reg = DBCOOL_ADT7466_CONFIG2;
} else {
@@ -892,12 +892,12 @@ bad:
return data;
}
-void
+void
dbcool_writereg(struct dbcool_chipset *dc, uint8_t reg, uint8_t val)
{
if (iic_acquire_bus(dc->dc_tag, 0) != 0)
return;
-
+
(void)iic_smbus_write_byte(dc->dc_tag, dc->dc_addr, reg, val, 0);
iic_release_bus(dc->dc_tag, 0);
@@ -1109,7 +1109,7 @@ dbcool_read_volt(struct dbcool_softc *sc, uint8_t reg, int nom_idx, bool extres)
ext &= 0x03;
}
- /*
+ /*
* Scale the nominal value by the 10-bit fraction
*
* Returned value is in microvolts.
@@ -1147,7 +1147,7 @@ sysctl_dbcool_temp(SYSCTLFN_ARGS)
if (error || newp == NULL)
return error;
- /* We were asked to update the value - sanity check before writing */
+ /* We were asked to update the value - sanity check before writing */
if (*(int *)node.sysctl_data < -64 ||
*(int *)node.sysctl_data > 127 + sc->sc_temp_offset)
return EINVAL;
@@ -1179,7 +1179,7 @@ sysctl_adm1030_temp(SYSCTLFN_ARGS)
if (error || newp == NULL)
return error;
- /* We were asked to update the value - sanity check before writing */
+ /* We were asked to update the value - sanity check before writing */
if (*(int *)node.sysctl_data < 0 || *(int *)node.sysctl_data > 127)
return EINVAL;
@@ -1212,7 +1212,7 @@ sysctl_adm1030_trange(SYSCTLFN_ARGS)
if (error || newp == NULL)
return error;
- /* We were asked to update the value - sanity check before writing */
+ /* We were asked to update the value - sanity check before writing */
newval = *(int *)node.sysctl_data;
if (newval == 5)
@@ -1257,7 +1257,7 @@ sysctl_dbcool_duty(SYSCTLFN_ARGS)
if (error || newp == NULL)
return error;
- /* We were asked to update the value - sanity check before writing */
+ /* We were asked to update the value - sanity check before writing */
if (*(int *)node.sysctl_data < 0 || *(int *)node.sysctl_data > 100)
return EINVAL;
@@ -1281,7 +1281,7 @@ sysctl_dbcool_behavior(SYSCTLFN_ARGS)
node = *rnode;
sc = (struct dbcool_softc *)node.sysctl_data;
chipreg = node.sysctl_num & 0xff;
-
+
oldreg = sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030) {
@@ -1355,7 +1355,7 @@ sysctl_dbcool_slope(SYSCTLFN_ARGS)
node = *rnode;
sc = (struct dbcool_softc *)node.sysctl_data;
chipreg = node.sysctl_num & 0xff;
-
+
reg = (sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg) >> 4) & 0x0f;
node.sysctl_data = &reg;
error = sysctl_lookup(SYSCTLFN_CALL(&node));
@@ -1363,7 +1363,7 @@ sysctl_dbcool_slope(SYSCTLFN_ARGS)
if (error || newp == NULL)
return error;
- /* We were asked to update the value - sanity check before writing */
+ /* We were asked to update the value - sanity check before writing */
if (*(int *)node.sysctl_data < 0 || *(int *)node.sysctl_data > 0x0f)
return EINVAL;
@@ -1400,7 +1400,7 @@ sysctl_dbcool_thyst(SYSCTLFN_ARGS)
if (error || newp == NULL)
return error;
- /* We were asked to update the value - sanity check before writing */
+ /* We were asked to update the value - sanity check before writing */
newhyst = *(int *)node.sysctl_data;
if (newhyst > 0x0f)
return EINVAL;
@@ -1438,7 +1438,7 @@ sysctl_dbcool_reg_select(SYSCTLFN_ARGS)
node = *rnode;
sc = (struct dbcool_softc *)node.sysctl_data;
-
+
reg = sc->sc_user_reg;
node.sysctl_data = &reg;
error = sysctl_lookup(SYSCTLFN_CALL(&node));
@@ -1462,7 +1462,7 @@ sysctl_dbcool_reg_access(SYSCTLFN_ARGS)
node = *rnode;
sc = (struct dbcool_softc *)node.sysctl_data;
chipreg = sc->sc_user_reg;
-
+
reg = sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
node.sysctl_data = &reg;
error = sysctl_lookup(SYSCTLFN_CALL(&node));
@@ -1590,7 +1590,7 @@ dbcool_setup(device_t self)
"unable to register with sysmon (%d)\n", error);
goto out;
}
-
+
return;
out:
@@ -1786,7 +1786,7 @@ dbcool_setup_controllers(struct dbcool_softc *sc)
name,
SYSCTL_DESCR(dbc_sysctl_table[j].desc),
dbc_sysctl_table[j].helper,
- 0, sc,
+ 0, sc,
( j == DBC_PWM_BEHAVIOR)?
sizeof(dbcool_cur_behav): sizeof(int),
CTL_HW, sc->sc_root_sysctl_num, me2->sysctl_num,
@@ -1801,10 +1801,10 @@ dbcool_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
struct dbcool_softc *sc=sme->sme_cookie;
int i, nom_volt_idx, cur;
struct reg_list *reg;
-
+
i = edata->sensor;
reg = sc->sc_regs[i];
-
+
edata->state = ENVSYS_SVALID;
switch (edata->units)
{
@@ -1870,7 +1870,7 @@ dbcool_chip_ident(struct dbcool_chipset *dc)
d_id = dc->dc_readreg(dc, DBCOOL_DEVICEID_REG);
r_id = dc->dc_readreg(dc, DBCOOL_REVISION_REG);
}
-
+
for (i = 0; chip_table[i].company != 0; i++)
if ((c_id == chip_table[i].company) &&
(d_id == chip_table[i].device ||
@@ -1886,7 +1886,7 @@ dbcool_chip_ident(struct dbcool_chipset *dc)
r_id);
return -1;
-}
+}
/*
* Retrieve sensor limits from the chip registers
@@ -1918,7 +1918,7 @@ dbcool_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
/* If both limits provided, make sure they're sane */
if ((*props & PROP_CRITMIN) &&
(*props & PROP_CRITMAX) &&
- (limits->sel_critmin >= limits->sel_critmax))
+ (limits->sel_critmin >= limits->sel_critmax))
*props &= ~(PROP_CRITMIN | PROP_CRITMAX);
/*
diff --git a/sys/dev/ic/aha.c b/sys/dev/ic/aha.c
index 6a26d6728a4..c43b84a0356 100644
--- a/sys/dev/ic/aha.c
+++ b/sys/dev/ic/aha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aha.c,v 1.61 2010/11/13 13:52:00 uebayasi Exp $ */
+/* $NetBSD: aha.c,v 1.62 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aha.c,v 1.61 2010/11/13 13:52:00 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aha.c,v 1.62 2016/07/11 11:31:50 msaitoh Exp $");
#include "opt_ddb.h"
@@ -169,7 +169,8 @@ aha_cmd(bus_space_tag_t iot, bus_space_handle_t ioh, struct aha_softc *sc,
* queue feeding to us.
*/
if (ocnt) {
- while ((bus_space_read_1(iot, ioh, AHA_STAT_PORT)) & AHA_STAT_DF)
+ while ((bus_space_read_1(iot, ioh, AHA_STAT_PORT))
+ & AHA_STAT_DF)
bus_space_read_1(iot, ioh, AHA_DATA_PORT);
}
/*
@@ -185,8 +186,10 @@ aha_cmd(bus_space_tag_t iot, bus_space_handle_t ioh, struct aha_softc *sc,
}
if (!i) {
if (opcode != AHA_INQUIRE_REVISION)
- printf("%s: aha_cmd, cmd/data port full\n", name);
- bus_space_write_1(iot, ioh, AHA_CTRL_PORT, AHA_CTRL_SRST);
+ printf("%s: aha_cmd, cmd/data port full\n",
+ name);
+ bus_space_write_1(iot, ioh, AHA_CTRL_PORT,
+ AHA_CTRL_SRST);
return (1);
}
bus_space_write_1(iot, ioh, AHA_CMD_PORT, *ibuf++);
@@ -206,7 +209,8 @@ aha_cmd(bus_space_tag_t iot, bus_space_handle_t ioh, struct aha_softc *sc,
if (opcode != AHA_INQUIRE_REVISION)
printf("%s: aha_cmd, cmd/data port empty %d\n",
name, ocnt);
- bus_space_write_1(iot, ioh, AHA_CTRL_PORT, AHA_CTRL_SRST);
+ bus_space_write_1(iot, ioh, AHA_CTRL_PORT,
+ AHA_CTRL_SRST);
return (1);
}
*obuf++ = bus_space_read_1(iot, ioh, AHA_DATA_PORT);
@@ -705,7 +709,8 @@ aha_done(struct aha_softc *sc, struct aha_ccb *ccb)
} else if (ccb->target_stat != SCSI_OK) {
switch (ccb->target_stat) {
case SCSI_CHECK:
- s1 = (struct scsi_sense_data *) (((char *) (&ccb->scsi_cmd)) +
+ s1 = (struct scsi_sense_data *)
+ (((char *)(&ccb->scsi_cmd)) +
ccb->scsi_cmd_length);
s2 = &xs->sense.scsi_sense;
*s2 = *s1;
@@ -731,7 +736,8 @@ aha_done(struct aha_softc *sc, struct aha_ccb *ccb)
* Find the board and find its irq/drq
*/
int
-aha_find(bus_space_tag_t iot, bus_space_handle_t ioh, struct aha_probe_data *sc)
+aha_find(bus_space_tag_t iot, bus_space_handle_t ioh,
+ struct aha_probe_data *sc)
{
int i;
u_char sts;
@@ -756,7 +762,8 @@ aha_find(bus_space_tag_t iot, bus_space_handle_t ioh, struct aha_probe_data *sc)
* that it's not there.. good for the probe
*/
- bus_space_write_1(iot, ioh, AHA_CTRL_PORT, AHA_CTRL_HRST | AHA_CTRL_SRST);
+ bus_space_write_1(iot, ioh, AHA_CTRL_PORT,
+ AHA_CTRL_HRST | AHA_CTRL_SRST);
delay(100);
for (i = AHA_RESET_TIMEOUT; i; i--) {
@@ -924,11 +931,12 @@ aha_init(struct aha_softc *sc)
for (i = 0; i < 8; i++) {
if (!setup.reply.sync[i].valid ||
- (!setup.reply.sync[i].offset && !setup.reply.sync[i].period))
+ (!setup.reply.sync[i].offset
+ && !setup.reply.sync[i].period))
continue;
printf("%s targ %d: sync, offset %d, period %dnsec\n",
- device_xname(sc->sc_dev), i,
- setup.reply.sync[i].offset, setup.reply.sync[i].period * 50 + 200);
+ device_xname(sc->sc_dev), i, setup.reply.sync[i].offset,
+ setup.reply.sync[i].period * 50 + 200);
}
/*
@@ -1314,7 +1322,8 @@ aha_poll(struct aha_softc *sc, struct scsipi_xfer *xs, int count)
* If we had interrupts enabled, would we
* have got an interrupt?
*/
- if (bus_space_read_1(iot, ioh, AHA_INTR_PORT) & AHA_INTR_ANYINTR)
+ if (bus_space_read_1(iot, ioh, AHA_INTR_PORT)
+ & AHA_INTR_ANYINTR)
aha_intr(sc);
if (xs->xs_status & XS_STS_DONE)
return (0);
diff --git a/sys/dev/ic/i82586.c b/sys/dev/ic/i82586.c
index 49e14210f9f..3e952fed57b 100644
--- a/sys/dev/ic/i82586.c
+++ b/sys/dev/ic/i82586.c
@@ -1,4 +1,4 @@
-/* $NetBSD: i82586.c,v 1.72 2016/06/10 13:27:13 ozaki-r Exp $ */
+/* $NetBSD: i82586.c,v 1.73 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -137,7 +137,7 @@ Mode of operation:
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.72 2016/06/10 13:27:13 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.73 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
@@ -231,7 +231,8 @@ static char* padbuf = NULL;
*
*/
void
-i82586_attach(struct ie_softc *sc, const char *name, u_int8_t *etheraddr, int *media, int nmedia, int defmedia)
+i82586_attach(struct ie_softc *sc, const char *name, u_int8_t *etheraddr,
+ int *media, int nmedia, int defmedia)
{
int i;
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
@@ -262,7 +263,8 @@ i82586_attach(struct ie_softc *sc, const char *name, u_int8_t *etheraddr, int *m
padbuf = malloc(ETHER_MIN_LEN - ETHER_CRC_LEN, M_DEVBUF,
M_ZERO | M_NOWAIT);
if (padbuf == NULL) {
- aprint_error_dev(sc->sc_dev, "can't allocate pad buffer\n");
+ aprint_error_dev(sc->sc_dev,
+ "can't allocate pad buffer\n");
return;
}
}
@@ -327,7 +329,8 @@ i82586_cmd_wait(struct ie_softc *sc)
* We may have to wait for the command's acceptance later though.
*/
static int
-i82586_start_cmd(struct ie_softc *sc, int cmd, int iecmdbuf, int mask, int async)
+i82586_start_cmd(struct ie_softc *sc, int cmd, int iecmdbuf, int mask,
+ int async)
{
int i;
int off;
@@ -425,7 +428,6 @@ i82586_rx_errors(struct ie_softc *sc, int fn, int status)
snprintb(bits, sizeof(bits), IE_FD_STATUSBITS, status);
log(LOG_ERR, "%s: rx error (frame# %d): %s\n",
device_xname(sc->sc_dev), fn, bits);
-
}
/*
@@ -472,7 +474,8 @@ loop:
#if I82586_DEBUG
if ((status & IE_ST_CNA) && (sc->sc_debug & IED_CNA))
- printf("%s: cna; status=0x%x\n", device_xname(sc->sc_dev), status);
+ printf("%s: cna; status=0x%x\n", device_xname(sc->sc_dev),
+ status);
#endif
if (sc->intrhook)
(sc->intrhook)(sc, INTR_LOOP);
@@ -616,7 +619,8 @@ static int timesthru = 1024;
scbstatus);
if (i82586_start_cmd(sc, IE_RUC_RESUME, 0, 0, 0) == 0)
return (0);
- aprint_error_dev(sc->sc_dev, "RU RESUME command timed out\n");
+ aprint_error_dev(sc->sc_dev,
+ "RU RESUME command timed out\n");
return (1); /* Ask for a reset */
}
@@ -740,7 +744,8 @@ i82586_tint(struct ie_softc *sc, int scbstatus)
* Get a range of receive buffer descriptors that represent one packet.
*/
static int
-i82586_get_rbd_list(struct ie_softc *sc, u_int16_t *start, u_int16_t *end, int *pktlen)
+i82586_get_rbd_list(struct ie_softc *sc, u_int16_t *start, u_int16_t *end,
+ int *pktlen)
{
int off, rbbase = sc->rbds;
int rbindex, count = 0;
@@ -1090,7 +1095,8 @@ iexmit(struct ie_softc *sc)
* Gate preceding NOP to this XMIT command
*/
prev = (cur + NTXBUF - 1) % NTXBUF;
- sc->ie_bus_write16(sc, IE_CMD_NOP_STATUS(sc->nop_cmds, prev), 0);
+ sc->ie_bus_write16(sc, IE_CMD_NOP_STATUS(sc->nop_cmds, prev),
+ 0);
sc->ie_bus_write16(sc, IE_CMD_NOP_LINK(sc->nop_cmds, prev),
IE_CMD_XMIT_ADDR(sc->xmit_cmds, cur));
@@ -1108,11 +1114,13 @@ iexmit(struct ie_softc *sc)
IE_CMD_XMIT | IE_CMD_INTR | IE_CMD_LAST);
off = IE_SCB_CMDLST(sc->scb);
- sc->ie_bus_write16(sc, off, IE_CMD_XMIT_ADDR(sc->xmit_cmds, cur));
+ sc->ie_bus_write16(sc, off, IE_CMD_XMIT_ADDR(sc->xmit_cmds,
+ cur));
IE_BUS_BARRIER(sc, off, 2, BUS_SPACE_BARRIER_READ);
if (i82586_start_cmd(sc, IE_CUC_START, 0, 0, 1))
- aprint_error_dev(sc->sc_dev, "iexmit: start xmit command timed out\n");
+ aprint_error_dev(sc->sc_dev,
+ "iexmit: start xmit command timed out\n");
}
sc->sc_ethercom.ec_if.if_timer = 5;
@@ -1318,14 +1326,14 @@ ie_run_tdr(struct ie_softc *sc, int cmd)
else if (result & IE_TDR_XCVR)
aprint_error_dev(sc->sc_dev, "transceiver problem\n");
else if (result & IE_TDR_OPEN)
- aprint_error_dev(sc->sc_dev, "TDR detected incorrect termination %d clocks away\n",
- result & IE_TDR_TIME);
+ aprint_error_dev(sc->sc_dev, "TDR detected incorrect "
+ "termination %d clocks away\n", result & IE_TDR_TIME);
else if (result & IE_TDR_SHORT)
- aprint_error_dev(sc->sc_dev, "TDR detected a short circuit %d clocks away\n",
- result & IE_TDR_TIME);
+ aprint_error_dev(sc->sc_dev, "TDR detected a short circuit "
+ "%d clocks away\n", result & IE_TDR_TIME);
else
- aprint_error_dev(sc->sc_dev, "TDR returned unknown status 0x%x\n",
- result);
+ aprint_error_dev(sc->sc_dev,
+ "TDR returned unknown status 0x%x\n", result);
}
@@ -1401,8 +1409,8 @@ i82586_setup_bufs(struct ie_softc *sc)
ptr += sc->nrxbuf * IE_RBUF_SIZE;
#if I82586_DEBUG
- printf("%s: %d frames %d bufs\n", device_xname(sc->sc_dev), sc->nframes,
- sc->nrxbuf);
+ printf("%s: %d frames %d bufs\n", device_xname(sc->sc_dev),
+ sc->nframes, sc->nrxbuf);
#endif
/*
@@ -1518,11 +1526,13 @@ ie_cfg_setup(struct ie_softc *sc, int cmd, int promiscuous, int manchester)
cmdresult = i82586_start_cmd(sc, IE_CUC_START, cmd, IE_STAT_COMPL, 0);
status = sc->ie_bus_read16(sc, IE_CMD_COMMON_STATUS(cmd));
if (cmdresult != 0) {
- aprint_error_dev(sc->sc_dev, "configure command timed out; status %x\n", status);
+ aprint_error_dev(sc->sc_dev,
+ "configure command timed out; status %x\n", status);
return (0);
}
if ((status & IE_STAT_OK) == 0) {
- aprint_error_dev(sc->sc_dev, "configure command failed; status %x\n", status);
+ aprint_error_dev(sc->sc_dev,
+ "configure command failed; status %x\n", status);
return (0);
}
@@ -1545,11 +1555,14 @@ ie_ia_setup(struct ie_softc *sc, int cmdbuf)
cmdresult = i82586_start_cmd(sc, IE_CUC_START, cmdbuf, IE_STAT_COMPL, 0);
status = sc->ie_bus_read16(sc, IE_CMD_COMMON_STATUS(cmdbuf));
if (cmdresult != 0) {
- aprint_error_dev(sc->sc_dev, "individual address command timed out; status %x\n", status);
+ aprint_error_dev(sc->sc_dev,
+ "individual address command timed out; status %x\n",
+ status);
return (0);
}
if ((status & IE_STAT_OK) == 0) {
- aprint_error_dev(sc->sc_dev, "individual address command failed; status %x\n", status);
+ aprint_error_dev(sc->sc_dev,
+ "individual address command failed; status %x\n", status);
return (0);
}
@@ -1580,15 +1593,17 @@ ie_mc_setup(struct ie_softc *sc, int cmdbuf)
sc->mcast_count * ETHER_ADDR_LEN);
/* Start the command */
- cmdresult = i82586_start_cmd(sc, IE_CUC_START, cmdbuf, IE_STAT_COMPL, 0);
+ cmdresult = i82586_start_cmd(sc, IE_CUC_START, cmdbuf, IE_STAT_COMPL,
+ 0);
status = sc->ie_bus_read16(sc, IE_CMD_COMMON_STATUS(cmdbuf));
if (cmdresult != 0) {
- aprint_error_dev(sc->sc_dev, "multicast setup command timed out; status %x\n", status);
+ aprint_error_dev(sc->sc_dev,
+ "multicast setup command timed out; status %x\n", status);
return (0);
}
if ((status & IE_STAT_OK) == 0) {
- aprint_error_dev(sc->sc_dev, "multicast setup command failed; status %x\n",
- status);
+ aprint_error_dev(sc->sc_dev,
+ "multicast setup command failed; status %x\n", status);
return (0);
}
@@ -1680,7 +1695,8 @@ i82586_start_transceiver(struct ie_softc *sc)
if (sc->do_xmitnopchain) {
/* Stop transmit command chain */
if (i82586_start_cmd(sc, IE_CUC_SUSPEND|IE_RUC_SUSPEND, 0, 0, 0))
- aprint_error_dev(sc->sc_dev, "CU/RU stop command timed out\n");
+ aprint_error_dev(sc->sc_dev,
+ "CU/RU stop command timed out\n");
/* Start the receiver & transmitter chain */
/* sc->scb->ie_command_list =
@@ -1691,7 +1707,8 @@ i82586_start_transceiver(struct ie_softc *sc)
(sc->xctail + NTXBUF - 1) % NTXBUF));
if (i82586_start_cmd(sc, IE_CUC_START|IE_RUC_START, 0, 0, 0))
- aprint_error_dev(sc->sc_dev, "CU/RU command timed out\n");
+ aprint_error_dev(sc->sc_dev,
+ "CU/RU command timed out\n");
} else {
if (i82586_start_cmd(sc, IE_RUC_START, 0, 0, 0))
aprint_error_dev(sc->sc_dev, "RU command timed out\n");
@@ -1706,7 +1723,8 @@ i82586_stop(
struct ie_softc *sc = ifp->if_softc;
if (i82586_start_cmd(sc, IE_RUC_SUSPEND | IE_CUC_SUSPEND, 0, 0, 0))
- aprint_error_dev(sc->sc_dev, "iestop: disable commands timed out\n");
+ aprint_error_dev(sc->sc_dev,
+ "iestop: disable commands timed out\n");
}
int
diff --git a/sys/dev/ic/tulip.c b/sys/dev/ic/tulip.c
index 97db3209a43..ed3bfabfefb 100644
--- a/sys/dev/ic/tulip.c
+++ b/sys/dev/ic/tulip.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tulip.c,v 1.187 2016/06/10 13:27:14 ozaki-r Exp $ */
+/* $NetBSD: tulip.c,v 1.188 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.187 2016/06/10 13:27:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.188 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
@@ -391,16 +391,16 @@ tlp_attach(struct tulip_softc *sc, const uint8_t *enaddr)
if ((error = bus_dmamem_alloc(sc->sc_dmat,
sizeof(struct tulip_control_data), PAGE_SIZE, 0, &sc->sc_cdseg,
1, &sc->sc_cdnseg, 0)) != 0) {
- aprint_error_dev(self, "unable to allocate control data, error = %d\n",
- error);
+ aprint_error_dev(self,
+ "unable to allocate control data, error = %d\n", error);
goto fail_0;
}
if ((error = bus_dmamem_map(sc->sc_dmat, &sc->sc_cdseg, sc->sc_cdnseg,
sizeof(struct tulip_control_data), (void **)&sc->sc_control_data,
BUS_DMA_COHERENT)) != 0) {
- aprint_error_dev(self, "unable to map control data, error = %d\n",
- error);
+ aprint_error_dev(self,
+ "unable to map control data, error = %d\n", error);
goto fail_1;
}
@@ -408,15 +408,17 @@ tlp_attach(struct tulip_softc *sc, const uint8_t *enaddr)
sizeof(struct tulip_control_data), 1,
sizeof(struct tulip_control_data), 0, 0, &sc->sc_cddmamap)) != 0) {
sc->sc_cddmamap = NULL;
- aprint_error_dev(self, "unable to create control data DMA map, "
- "error = %d\n", error);
+ aprint_error_dev(self,
+ "unable to create control data DMA map, error = %d\n",
+ error);
goto fail_2;
}
if ((error = bus_dmamap_load(sc->sc_dmat, sc->sc_cddmamap,
sc->sc_control_data, sizeof(struct tulip_control_data), NULL,
0)) != 0) {
- aprint_error_dev(self, "unable to load control data DMA map, error = %d\n",
+ aprint_error_dev(self,
+ "unable to load control data DMA map, error = %d\n",
error);
goto fail_3;
}
@@ -449,8 +451,9 @@ tlp_attach(struct tulip_softc *sc, const uint8_t *enaddr)
sc->sc_ntxsegs, MCLBYTES, 0, 0,
&sc->sc_txsoft[i].txs_dmamap)) != 0) {
sc->sc_txsoft[i].txs_dmamap = NULL;
- aprint_error_dev(self, "unable to create tx DMA map %d, "
- "error = %d\n", i, error);
+ aprint_error_dev(self,
+ "unable to create tx DMA map %d, error = %d\n", i,
+ error);
goto fail_4;
}
}
@@ -462,8 +465,9 @@ tlp_attach(struct tulip_softc *sc, const uint8_t *enaddr)
if ((error = bus_dmamap_create(sc->sc_dmat, MCLBYTES, 1,
MCLBYTES, 0, 0, &sc->sc_rxsoft[i].rxs_dmamap)) != 0) {
sc->sc_rxsoft[i].rxs_dmamap = NULL;
- aprint_error_dev(self, "unable to create rx DMA map %d, "
- "error = %d\n", i, error);
+ aprint_error_dev(self,
+ "unable to create rx DMA map %d, error = %d\n", i,
+ error);
goto fail_5;
}
sc->sc_rxsoft[i].rxs_mbuf = NULL;
@@ -933,7 +937,8 @@ tlp_watchdog(struct ifnet *ifp)
doing_transmit = (! SIMPLEQ_EMPTY(&sc->sc_txdirtyq));
if (doing_setup && doing_transmit) {
- printf("%s: filter setup and transmit timeout\n", device_xname(sc->sc_dev));
+ printf("%s: filter setup and transmit timeout\n",
+ device_xname(sc->sc_dev));
ifp->if_oerrors++;
} else if (doing_transmit) {
printf("%s: transmit timeout\n", device_xname(sc->sc_dev));
@@ -941,7 +946,8 @@ tlp_watchdog(struct ifnet *ifp)
} else if (doing_setup)
printf("%s: filter setup timeout\n", device_xname(sc->sc_dev));
else
- printf("%s: spurious watchdog timeout\n", device_xname(sc->sc_dev));
+ printf("%s: spurious watchdog timeout\n",
+ device_xname(sc->sc_dev));
(void) tlp_init(ifp);
@@ -1158,8 +1164,8 @@ tlp_intr(void *arg)
str = "unknown error";
break;
}
- aprint_error_dev(sc->sc_dev, "fatal system error: %s\n",
- str);
+ aprint_error_dev(sc->sc_dev,
+ "fatal system error: %s\n", str);
(void) tlp_init(ifp);
break;
}
@@ -1275,8 +1281,8 @@ tlp_rxintr(struct tulip_softc *sc)
rxstat &= errors;
#define PRINTERR(bit, str) \
if (rxstat & (bit)) \
- aprint_error_dev(sc->sc_dev, "receive error: %s\n", \
- str)
+ aprint_error_dev(sc->sc_dev, \
+ "receive error: %s\n", str)
ifp->if_ierrors++;
PRINTERR(TDSTAT_Rx_DE, "descriptor error");
PRINTERR(TDSTAT_Rx_RF, "runt frame");
@@ -1813,9 +1819,9 @@ tlp_init(struct ifnet *ifp)
rxs = &sc->sc_rxsoft[i];
if (rxs->rxs_mbuf == NULL) {
if ((error = tlp_add_rxbuf(sc, i)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to allocate or map rx "
- "buffer %d, error = %d\n",
- i, error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to allocate or map rx "
+ "buffer %d, error = %d\n", i, error);
/*
* XXX Should attempt to run with fewer receive
* XXX buffers instead of just failing.
@@ -2174,8 +2180,8 @@ tlp_srom_size(struct tulip_softc *sc)
SROM_EMIT(sc, 0);
if (x < 4 || x > 12) {
- aprint_debug_dev(sc->sc_dev, "broken MicroWire interface detected; "
- "setting SROM size to 1Kb\n");
+ aprint_debug_dev(sc->sc_dev, "broken MicroWire interface "
+ "detected; setting SROM size to 1Kb\n");
return (6);
} else {
if (tlp_srom_debug)
@@ -2310,8 +2316,8 @@ tlp_add_rxbuf(struct tulip_softc *sc, int idx)
m->m_ext.ext_buf, m->m_ext.ext_size, NULL,
BUS_DMA_READ|BUS_DMA_NOWAIT);
if (error) {
- aprint_error_dev(sc->sc_dev, "can't load rx DMA map %d, error = %d\n",
- idx, error);
+ aprint_error_dev(sc->sc_dev,
+ "can't load rx DMA map %d, error = %d\n", idx, error);
panic("tlp_add_rxbuf"); /* XXX */
}
@@ -2813,7 +2819,8 @@ tlp_filter_setup(struct tulip_softc *sc)
/* Set up a watchdog timer in case the chip flakes out. */
ifp->if_timer = 5;
- DPRINTF(sc, ("%s: tlp_filter_setup: returning\n", device_xname(sc->sc_dev)));
+ DPRINTF(sc, ("%s: tlp_filter_setup: returning\n",
+ device_xname(sc->sc_dev)));
}
/*
@@ -4629,7 +4636,8 @@ tlp_2114x_isv_tmsw_init(struct tulip_softc *sc)
}
if (i == devcnt) {
- aprint_error_dev(sc->sc_dev, "unable to locate info leaf in SROM\n");
+ aprint_error_dev(sc->sc_dev,
+ "unable to locate info leaf in SROM\n");
return;
}
@@ -4819,7 +4827,8 @@ tlp_2114x_isv_tmsw_init(struct tulip_softc *sc)
break;
}
if (phy == NULL) {
- aprint_error_dev(sc->sc_dev, "unable to configure MII\n");
+ aprint_error_dev(sc->sc_dev,
+ "unable to configure MII\n");
break;
}
@@ -4974,7 +4983,8 @@ tlp_2114x_isv_tmsw_init(struct tulip_softc *sc)
break;
}
if (phy == NULL) {
- aprint_error_dev(sc->sc_dev, "unable to configure MII\n");
+ aprint_error_dev(sc->sc_dev,
+ "unable to configure MII\n");
break;
}
@@ -5724,7 +5734,8 @@ tlp_pnic_nway_auto(struct tulip_softc *sc, int waitfor)
}
#if 0
if ((reg & PNIC_NWAY_LPAR_MASK) == 0)
- aprint_error_dev(sc->sc_dev, "autonegotiation failed to complete\n");
+ aprint_error_dev(sc->sc_dev,
+ "autonegotiation failed to complete\n");
#endif
/*
@@ -5761,7 +5772,8 @@ tlp_pnic_nway_auto_timeout(void *arg)
TULIP_READ(sc, CSR_PNIC_NWAY);
#if 0
if ((reg & PNIC_NWAY_LPAR_MASK) == 0)
- aprint_error_dev(sc->sc_dev, "autonegotiation failed to complete\n");
+ aprint_error_dev(sc->sc_dev,
+ "autonegotiation failed to complete\n");
#endif
tlp_pnic_nway_acomp(sc);
diff --git a/sys/dev/ic/uha.c b/sys/dev/ic/uha.c
index ea4d13c2b77..ea6be7fbef1 100644
--- a/sys/dev/ic/uha.c
+++ b/sys/dev/ic/uha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uha.c,v 1.46 2012/10/27 17:18:23 chs Exp $ */
+/* $NetBSD: uha.c,v 1.47 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uha.c,v 1.46 2012/10/27 17:18:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uha.c,v 1.47 2016/07/11 11:31:50 msaitoh Exp $");
#undef UHADEBUG
#ifdef DDB
@@ -142,15 +142,15 @@ uha_attach(struct uha_softc *sc, struct uha_probe_data *upd)
*/
if ((error = bus_dmamem_alloc(sc->sc_dmat, MSCPSIZE,
PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to allocate mscps, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to allocate mscps, error = %d\n", error);
return;
}
if ((error = bus_dmamem_map(sc->sc_dmat, &seg, rseg,
MSCPSIZE, (void **)&sc->sc_mscps,
BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to map mscps, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to map mscps, error = %d\n", error);
return;
}
@@ -160,14 +160,14 @@ uha_attach(struct uha_softc *sc, struct uha_probe_data *upd)
if ((error = bus_dmamap_create(sc->sc_dmat, MSCPSIZE,
1, MSCPSIZE, 0, BUS_DMA_NOWAIT | sc->sc_dmaflags,
&sc->sc_dmamap_mscp)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to create mscp DMA map, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to create mscp DMA map, error = %d\n", error);
return;
}
if ((error = bus_dmamap_load(sc->sc_dmat, sc->sc_dmamap_mscp,
sc->sc_mscps, MSCPSIZE, NULL, BUS_DMA_NOWAIT)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to load mscp DMA map, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to load mscp DMA map, error = %d\n", error);
return;
}
@@ -181,8 +181,8 @@ uha_attach(struct uha_softc *sc, struct uha_probe_data *upd)
aprint_error_dev(sc->sc_dev, "unable to create mscps\n");
return;
} else if (i != UHA_MSCP_MAX) {
- aprint_error_dev(sc->sc_dev, "WARNING: only %d of %d mscps created\n",
- i, UHA_MSCP_MAX);
+ aprint_error_dev(sc->sc_dev,
+ "WARNING: only %d of %d mscps created\n", i, UHA_MSCP_MAX);
}
adapt->adapt_openings = i;
@@ -228,8 +228,8 @@ uha_init_mscp(struct uha_softc *sc, struct uha_mscp *mscp)
0, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW | sc->sc_dmaflags,
&mscp->dmamap_xfer);
if (error) {
- aprint_error_dev(sc->sc_dev, "can't create mscp DMA map, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "can't create mscp DMA map, error = %d\n", error);
return (error);
}
@@ -259,8 +259,8 @@ uha_create_mscps(struct uha_softc *sc, struct uha_mscp *mscpstore, int count)
for (i = 0; i < count; i++) {
mscp = &mscpstore[i];
if ((error = uha_init_mscp(sc, mscp)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to initialize mscp, error = %d\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to initialize mscp, error = %d\n", error);
goto out;
}
TAILQ_INSERT_TAIL(&sc->sc_free_mscp, mscp, chain);
@@ -369,8 +369,8 @@ uha_done(struct uha_softc *sc, struct uha_mscp *mscp)
xs->error = XS_BUSY;
break;
default:
- aprint_error_dev(sc->sc_dev, "target_stat %x\n",
- mscp->target_stat);
+ aprint_error_dev(sc->sc_dev,
+ "target_stat %x\n", mscp->target_stat);
xs->error = XS_DRIVER_STUFFUP;
}
} else
@@ -395,7 +395,8 @@ uhaminphys(struct buf *bp)
*/
void
-uha_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *arg)
+uha_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
+ void *arg)
{
struct scsipi_xfer *xs;
struct scsipi_periph *periph;
@@ -438,7 +439,8 @@ uha_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *
mscp->ca = 0x01;
} else {
if (xs->cmdlen > sizeof(mscp->scsi_cmd)) {
- aprint_error_dev(sc->sc_dev, "cmdlen %d too large for MSCP\n",
+ aprint_error_dev(sc->sc_dev,
+ "cmdlen %d too large for MSCP\n",
xs->cmdlen);
xs->error = XS_DRIVER_STUFFUP;
goto out_bad;
@@ -493,8 +495,8 @@ uha_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *
default:
xs->error = XS_DRIVER_STUFFUP;
- aprint_error_dev(sc->sc_dev, "error %d loading DMA map\n",
- error);
+ aprint_error_dev(sc->sc_dev,
+ "error %d loading DMA map\n", error);
out_bad:
uha_free_mscp(sc, mscp);
scsipi_done(xs);
diff --git a/sys/dev/isa/addcom_isa.c b/sys/dev/isa/addcom_isa.c
index 252e429a750..83b675141f1 100644
--- a/sys/dev/isa/addcom_isa.c
+++ b/sys/dev/isa/addcom_isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: addcom_isa.c,v 1.20 2012/10/27 17:18:23 chs Exp $ */
+/* $NetBSD: addcom_isa.c,v 1.21 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 2000 Michael Graff. All rights reserved.
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: addcom_isa.c,v 1.20 2012/10/27 17:18:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: addcom_isa.c,v 1.21 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -209,7 +209,8 @@ addcomattach(device_t parent, device_t self, void *aux)
if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) &&
bus_space_map(iot, iobase, COM_NPORTS, 0,
&sc->sc_slaveioh[i])) {
- aprint_error_dev(self, "can't map i/o space for slave %d\n", i);
+ aprint_error_dev(self,
+ "can't map i/o space for slave %d\n", i);
return;
}
}
diff --git a/sys/dev/isa/ast.c b/sys/dev/isa/ast.c
index a4821c2956f..c20e3aa0f28 100644
--- a/sys/dev/isa/ast.c
+++ b/sys/dev/isa/ast.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ast.c,v 1.65 2012/10/27 17:18:23 chs Exp $ */
+/* $NetBSD: ast.c,v 1.66 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.65 2012/10/27 17:18:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.66 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -160,7 +160,8 @@ astattach(device_t parent, device_t self, void *aux)
if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) &&
bus_space_map(iot, iobase, COM_NPORTS, 0,
&sc->sc_slaveioh[i])) {
- aprint_error_dev(self, "can't map i/o space for slave %d\n", i);
+ aprint_error_dev(self,
+ "can't map i/o space for slave %d\n", i);
return;
}
}
diff --git a/sys/dev/isa/boca.c b/sys/dev/isa/boca.c
index 73bdc70d053..b878e3ad168 100644
--- a/sys/dev/isa/boca.c
+++ b/sys/dev/isa/boca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: boca.c,v 1.54 2012/10/27 17:18:24 chs Exp $ */
+/* $NetBSD: boca.c,v 1.55 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: boca.c,v 1.54 2012/10/27 17:18:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: boca.c,v 1.55 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -166,7 +166,8 @@ bocaattach(device_t parent, device_t self, void *aux)
if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) &&
bus_space_map(iot, iobase, COM_NPORTS, 0,
&sc->sc_slaveioh[i])) {
- aprint_error_dev(sc->sc_dev, "can't map i/o space for slave %d\n", i);
+ aprint_error_dev(sc->sc_dev,
+ "can't map i/o space for slave %d\n", i);
return;
}
}
diff --git a/sys/dev/isa/cec.c b/sys/dev/isa/cec.c
index 6fa74f7f6f6..4f0e930a9c0 100644
--- a/sys/dev/isa/cec.c
+++ b/sys/dev/isa/cec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cec.c,v 1.13 2012/10/27 17:18:24 chs Exp $ */
+/* $NetBSD: cec.c,v 1.14 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cec.c,v 1.13 2012/10/27 17:18:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cec.c,v 1.14 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -207,8 +207,8 @@ cecattach(device_t parent, device_t self, void *aux)
maxsize = isa_dmamaxsize(sc->sc_ic, sc->sc_drq);
if (isa_dmamap_create(sc->sc_ic, sc->sc_drq,
maxsize, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW)) {
- aprint_error_dev(sc->sc_dev, "unable to create map for drq %d\n",
- sc->sc_drq);
+ aprint_error_dev(sc->sc_dev,
+ "unable to create map for drq %d\n", sc->sc_drq);
sc->sc_flags &= ~CECF_USEDMA;
}
}
diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c
index f598dbe8e00..da62015ed50 100644
--- a/sys/dev/isa/gus.c
+++ b/sys/dev/isa/gus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gus.c,v 1.109 2012/10/27 17:18:24 chs Exp $ */
+/* $NetBSD: gus.c,v 1.110 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1996, 1999, 2008 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.109 2012/10/27 17:18:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.110 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -693,8 +693,8 @@ gusprobe(device_t parent, cfdata_t match, void *aux)
if (recdrq != ISA_UNKNOWN_DRQ) {
if (recdrq > 7 || gus_drq_map[recdrq] == -1) {
- printf("gus: invalid second DMA channel (%d), card not "
- "probed\n", recdrq);
+ printf("gus: invalid second DMA channel (%d), card "
+ "not probed\n", recdrq);
return 0;
}
} else
@@ -944,8 +944,8 @@ gusattach(device_t parent, device_t self, void *aux)
}
if (isa_dmamap_create(sc->sc_ic, sc->sc_playdrq,
sc->sc_play_maxsize, BUS_DMA_WAITOK|BUS_DMA_ALLOCNOW)) {
- aprint_error_dev(sc->sc_dev, "can't create map for drq %d\n",
- sc->sc_playdrq);
+ aprint_error_dev(sc->sc_dev,
+ "can't create map for drq %d\n", sc->sc_playdrq);
ad1848_destroy_locks(&sc->sc_codec.sc_ad1848);
return;
}
@@ -961,8 +961,8 @@ gusattach(device_t parent, device_t self, void *aux)
}
if (isa_dmamap_create(sc->sc_ic, sc->sc_recdrq,
sc->sc_req_maxsize, BUS_DMA_WAITOK|BUS_DMA_ALLOCNOW)) {
- aprint_error_dev(sc->sc_dev, "can't create map for drq %d\n",
- sc->sc_recdrq);
+ aprint_error_dev(sc->sc_dev,
+ "can't create map for drq %d\n", sc->sc_recdrq);
ad1848_destroy_locks(&sc->sc_codec.sc_ad1848);
return;
}
@@ -1057,11 +1057,13 @@ gusattach(device_t parent, device_t self, void *aux)
* full right.
* For mono playback, we set up both voices playing the same buffer.
*/
- bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT, (unsigned char) GUS_VOICE_LEFT);
+ bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT,
+ (unsigned char)GUS_VOICE_LEFT);
SELECT_GUS_REG(iot, ioh2, GUSREG_PAN_POS);
bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, GUS_PAN_FULL_LEFT);
- bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT, (unsigned char) GUS_VOICE_RIGHT);
+ bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT,
+ (unsigned char)GUS_VOICE_RIGHT);
SELECT_GUS_REG(iot, ioh2, GUSREG_PAN_POS);
bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, GUS_PAN_FULL_RIGHT);
@@ -1144,7 +1146,8 @@ gus_deinterleave(struct gus_softc *sc, void *tbuf, int size)
printf("gus: deinterleave %d > %d\n", size, sc->sc_blocksize);
return;
} else if (size < sc->sc_blocksize) {
- DPRINTF(("gus: deinterleave %d < %d\n", size, sc->sc_blocksize));
+ DPRINTF(("gus: deinterleave %d < %d\n", size,
+ sc->sc_blocksize));
}
/*
@@ -1403,7 +1406,8 @@ gusintr(void *arg)
if (HAS_CODEC(sc))
retval = ad1848_isa_intr(&sc->sc_codec);
- if ((intr = bus_space_read_1(iot, ioh1, GUS_IRQ_STATUS)) & GUSMASK_IRQ_DMATC) {
+ if ((intr = bus_space_read_1(iot, ioh1, GUS_IRQ_STATUS))
+ & GUSMASK_IRQ_DMATC) {
DMAPRINTF(("gusintr DMA flags=%x\n", sc->sc_flags));
#ifdef DIAGNOSTIC
gusdmaintrcnt++;
@@ -1727,8 +1731,9 @@ gus_voice_intr(struct gus_softc *sc)
status = bus_space_read_1(iot, ioh2, GUS_DATA_HIGH);
if (status & GUSMASK_VOICE_STOPPED) {
if (voice != GUS_VOICE_LEFT) {
- DMAPRINTF(("%s: spurious voice %d stop?\n",
- device_xname(sc->sc_dev), voice));
+ DMAPRINTF(("%s: spurious voice %d "
+ "stop?\n",
+ device_xname(sc->sc_dev), voice));
gus_stop_voice(sc, voice, 0);
continue;
}
@@ -1743,15 +1748,18 @@ gus_voice_intr(struct gus_softc *sc)
* just trying to get the next buffer
* in place. Start the voice again.
*/
- printf("%s: stopped voice not drained? (%x)\n",
- device_xname(sc->sc_dev), sc->sc_bufcnt);
+ printf("%s: stopped voice not drained?"
+ " (%x)\n",
+ device_xname(sc->sc_dev),
+ sc->sc_bufcnt);
gus_falsestops++;
- sc->sc_playbuf = (sc->sc_playbuf + 1) % sc->sc_nbufs;
+ sc->sc_playbuf = (sc->sc_playbuf + 1)
+ % sc->sc_nbufs;
gus_start_playing(sc, sc->sc_playbuf);
} else if (sc->sc_bufcnt < 0) {
- panic("%s: negative bufcnt in stopped voice",
- device_xname(sc->sc_dev));
+ panic("%s: negative bufcnt in stopped "
+ "voice", device_xname(sc->sc_dev));
} else {
sc->sc_playbuf = -1; /* none are active */
gus_stops++;
@@ -2240,10 +2248,12 @@ gus_set_volume(struct gus_softc *sc, int voice, int volume)
bus_space_write_1(iot, ioh2, GUS_VOICE_SELECT, (unsigned char) voice);
SELECT_GUS_REG(iot, ioh2, GUSREG_START_VOLUME);
- bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, (unsigned char) (gusvol >> 4));
+ bus_space_write_1(iot, ioh2, GUS_DATA_HIGH,
+ (unsigned char)(gusvol >> 4));
SELECT_GUS_REG(iot, ioh2, GUSREG_END_VOLUME);
- bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, (unsigned char) (gusvol >> 4));
+ bus_space_write_1(iot, ioh2, GUS_DATA_HIGH,
+ (unsigned char)(gusvol >> 4));
SELECT_GUS_REG(iot, ioh2, GUSREG_CUR_VOLUME);
bus_space_write_2(iot, ioh2, GUS_DATA_LOW, gusvol << 4);
@@ -2773,9 +2783,11 @@ guspoke(bus_space_tag_t iot, bus_space_handle_t ioh2,
*/
SELECT_GUS_REG(iot, ioh2, GUSREG_DRAM_ADDR_LOW);
- bus_space_write_2(iot, ioh2, GUS_DATA_LOW, (unsigned int) (address & 0xffff));
+ bus_space_write_2(iot, ioh2, GUS_DATA_LOW,
+ (unsigned int)(address & 0xffff));
SELECT_GUS_REG(iot, ioh2, GUSREG_DRAM_ADDR_HIGH);
- bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, (unsigned char) ((address >> 16) & 0xff));
+ bus_space_write_1(iot, ioh2, GUS_DATA_HIGH,
+ (unsigned char)((address >> 16) & 0xff));
/*
* Actually write the data
@@ -2796,9 +2808,11 @@ guspeek(bus_space_tag_t iot, bus_space_handle_t ioh2, u_long address)
*/
SELECT_GUS_REG(iot, ioh2, GUSREG_DRAM_ADDR_LOW);
- bus_space_write_2(iot, ioh2, GUS_DATA_LOW, (unsigned int) (address & 0xffff));
+ bus_space_write_2(iot, ioh2, GUS_DATA_LOW,
+ (unsigned int)(address & 0xffff));
SELECT_GUS_REG(iot, ioh2, GUSREG_DRAM_ADDR_HIGH);
- bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, (unsigned char) ((address >> 16) & 0xff));
+ bus_space_write_1(iot, ioh2, GUS_DATA_HIGH,
+ (unsigned char)((address >> 16) & 0xff));
/*
* Read in the data from the board
@@ -2936,8 +2950,8 @@ gusreset(struct gus_softc *sc, int voices)
bus_space_read_1(iot, ioh2, GUS_DATA_HIGH);
SELECT_GUS_REG(iot, ioh2, GUSREG_RESET);
- bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, GUSMASK_MASTER_RESET | GUSMASK_DAC_ENABLE |
- GUSMASK_IRQ_ENABLE);
+ bus_space_write_1(iot, ioh2, GUS_DATA_HIGH,
+ GUSMASK_MASTER_RESET | GUSMASK_DAC_ENABLE | GUSMASK_IRQ_ENABLE);
}
@@ -2982,7 +2996,8 @@ gus_init_cs4231(struct gus_softc *sc)
will do the real mixing for them. */
sc->sc_mixcontrol &= ~GUSMASK_LINE_IN; /* 0 enables. */
sc->sc_mixcontrol |= GUSMASK_MIC_IN; /* 1 enables. */
- bus_space_write_1(iot, ioh1, GUS_MIX_CONTROL, sc->sc_mixcontrol);
+ bus_space_write_1(iot, ioh1, GUS_MIX_CONTROL,
+ sc->sc_mixcontrol);
ad1848_isa_attach(&sc->sc_codec);
/* turn on pre-MUX microphone gain. */
@@ -3112,7 +3127,8 @@ gus_dmain_intr(struct gus_softc *sc)
sc->sc_inarg = 0;
sc->sc_flags &= ~GUS_DMAIN_ACTIVE;
- DMAPRINTF(("calling dmain_intr callback %p(%p)\n", callback, arg));
+ DMAPRINTF(("calling dmain_intr callback %p(%p)\n", callback,
+ arg));
(*callback)(arg);
return 1;
} else {
diff --git a/sys/dev/isa/if_lc_isa.c b/sys/dev/isa/if_lc_isa.c
index 80128c5bc7a..7028d9095be 100644
--- a/sys/dev/isa/if_lc_isa.c
+++ b/sys/dev/isa/if_lc_isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_lc_isa.c,v 1.34 2012/10/27 17:18:24 chs Exp $ */
+/* $NetBSD: if_lc_isa.c,v 1.35 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1994, 1995, 1997 Matt Thomas <matt@3am-software.com>
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_lc_isa.c,v 1.34 2012/10/27 17:18:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lc_isa.c,v 1.35 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -62,7 +62,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_lc_isa.c,v 1.34 2012/10/27 17:18:24 chs Exp $");
extern struct cfdriver lc_cd;
-static int lemac_isa_find(lemac_softc_t *, const char *, struct isa_attach_args *, int);
+static int lemac_isa_find(lemac_softc_t *, const char *,
+ struct isa_attach_args *, int);
static int lemac_isa_probe(device_t, cfdata_t, void *);
static void lemac_isa_attach(device_t, device_t, void *);
@@ -70,7 +71,8 @@ CFATTACH_DECL_NEW(lc_isa, sizeof(lemac_softc_t),
lemac_isa_probe, lemac_isa_attach, NULL, NULL);
static int
-lemac_isa_find(lemac_softc_t *sc, const char *xname, struct isa_attach_args *ia, int attach)
+lemac_isa_find(lemac_softc_t *sc, const char *xname,
+ struct isa_attach_args *ia, int attach)
{
bus_addr_t maddr;
bus_size_t msiz;
@@ -149,7 +151,9 @@ lemac_isa_find(lemac_softc_t *sc, const char *xname, struct isa_attach_args *ia,
sc->sc_ats = shutdownhook_establish(lemac_shutdown, sc);
if (sc->sc_ats == NULL) {
aprint_normal("\n");
- aprint_error("%s: warning: can't establish shutdown hook\n", xname);
+ aprint_error(
+ "%s: warning: can't establish shutdown hook\n",
+ xname);
}
lemac_ifattach(sc);
diff --git a/sys/dev/isa/if_ntwoc_isa.c b/sys/dev/isa/if_ntwoc_isa.c
index 14dd106a4a6..4304bb251a4 100644
--- a/sys/dev/isa/if_ntwoc_isa.c
+++ b/sys/dev/isa/if_ntwoc_isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ntwoc_isa.c,v 1.25 2014/03/23 02:45:02 christos Exp $ */
+/* $NetBSD: if_ntwoc_isa.c,v 1.26 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 1999 Christian E. Hopps
* Copyright (c) 1996 John Hay.
@@ -29,11 +29,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ntwoc_isa.c,v 1.25 2014/03/23 02:45:02 christos Exp $
+ * $Id: if_ntwoc_isa.c,v 1.26 2016/07/11 11:31:50 msaitoh Exp $
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ntwoc_isa.c,v 1.25 2014/03/23 02:45:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ntwoc_isa.c,v 1.26 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -419,8 +419,7 @@ ntwoc_isa_attach(device_t parent, device_t self, void *aux)
if ((rv = bus_space_map(ia->ia_iot, ia->ia_io[0].ir_addr,
NTWOC_SRC_IOPORT_SIZE, 0, &sca->sc_ioh))) {
aprint_error_dev(sc->sc_dev, "can't map io 0x%x sz %d, %d\n",
- ia->ia_io[0].ir_addr,
- NTWOC_SRC_IOPORT_SIZE, rv);
+ ia->ia_io[0].ir_addr, NTWOC_SRC_IOPORT_SIZE, rv);
return;
}
@@ -430,7 +429,8 @@ ntwoc_isa_attach(device_t parent, device_t self, void *aux)
/* map the isa io addresses */
if ((tmp = bus_space_map(ia->ia_iot, ioport, 16, 0,
&sca->scu_sca_ioh[i]))) {
- aprint_error_dev(sc->sc_dev, "mapping sca 0x%x sz %d failed: %d\n",
+ aprint_error_dev(sc->sc_dev,
+ "mapping sca 0x%x sz %d failed: %d\n",
ioport, 16, tmp);
return;
}
diff --git a/sys/dev/isa/if_tr_isa.c b/sys/dev/isa/if_tr_isa.c
index 637b18f5af2..cb84b2e1cea 100644
--- a/sys/dev/isa/if_tr_isa.c
+++ b/sys/dev/isa/if_tr_isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tr_isa.c,v 1.24 2012/10/27 17:18:24 chs Exp $ */
+/* $NetBSD: if_tr_isa.c,v 1.25 2016/07/11 11:31:50 msaitoh Exp $ */
/* XXXJRT changes isa_attach_args too early!! */
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tr_isa.c,v 1.24 2012/10/27 17:18:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tr_isa.c,v 1.25 2016/07/11 11:31:50 msaitoh Exp $");
#undef TRISADEBUG
@@ -82,7 +82,8 @@ CFATTACH_DECL_NEW(tr_isa, sizeof(struct tr_softc),
tr_isa_probe, tr_isa_attach, NULL, NULL);
int
-tr_isa_map_io(struct isa_attach_args *ia, bus_space_handle_t *pioh, bus_space_handle_t *mmioh)
+tr_isa_map_io(struct isa_attach_args *ia, bus_space_handle_t *pioh,
+ bus_space_handle_t *mmioh)
{
bus_size_t mmio;
u_int8_t s;
@@ -113,7 +114,8 @@ tr_isa_map_io(struct isa_attach_args *ia, bus_space_handle_t *pioh, bus_space_ha
}
void
-tr_isa_unmap_io(struct isa_attach_args *ia, bus_space_handle_t pioh, bus_space_handle_t mmioh)
+tr_isa_unmap_io(struct isa_attach_args *ia, bus_space_handle_t pioh,
+ bus_space_handle_t mmioh)
{
bus_space_unmap(ia->ia_memt, mmioh, TR_MMIO_SIZE);
bus_space_unmap(ia->ia_iot, pioh, ia->ia_io[0].ir_size);
diff --git a/sys/dev/isa/moxa_isa.c b/sys/dev/isa/moxa_isa.c
index 7b26d303be8..b59f9303848 100644
--- a/sys/dev/isa/moxa_isa.c
+++ b/sys/dev/isa/moxa_isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: moxa_isa.c,v 1.20 2012/10/27 17:18:25 chs Exp $ */
+/* $NetBSD: moxa_isa.c,v 1.21 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: moxa_isa.c,v 1.20 2012/10/27 17:18:25 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: moxa_isa.c,v 1.21 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -158,7 +158,8 @@ moxa_isaattach(device_t parent, device_t self, void *aux)
if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) &&
bus_space_map(iot, iobase, COM_NPORTS, 0,
&sc->sc_slaveioh[i])) {
- aprint_error_dev(self, "can't map i/o space for slave %d\n", i);
+ aprint_error_dev(self,
+ "can't map i/o space for slave %d\n", i);
return;
}
}
diff --git a/sys/dev/isa/rtfps.c b/sys/dev/isa/rtfps.c
index ce2d2999ca6..7c8bb789eeb 100644
--- a/sys/dev/isa/rtfps.c
+++ b/sys/dev/isa/rtfps.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rtfps.c,v 1.58 2012/10/27 17:18:25 chs Exp $ */
+/* $NetBSD: rtfps.c,v 1.59 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtfps.c,v 1.58 2012/10/27 17:18:25 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtfps.c,v 1.59 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -168,7 +168,8 @@ rtfpsattach(device_t parent, device_t self, void *aux)
if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) &&
bus_space_map(iot, iobase, COM_NPORTS, 0,
&sc->sc_slaveioh[i])) {
- aprint_error_dev(self, "can't map i/o space for slave %d\n", i);
+ aprint_error_dev(self,
+ "can't map i/o space for slave %d\n", i);
return;
}
}
diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c
index 0bd65a838df..19a33cdd5ad 100644
--- a/sys/dev/isa/sbdsp.c
+++ b/sys/dev/isa/sbdsp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbdsp.c,v 1.135 2011/11/23 23:07:32 jmcneill Exp $ */
+/* $NetBSD: sbdsp.c,v 1.136 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1999, 2008 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.135 2011/11/23 23:07:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.136 2016/07/11 11:31:50 msaitoh Exp $");
#include "midi.h"
#include "mpu.h"
@@ -442,7 +442,8 @@ sbdsp_attach(struct sbdsp_softc *sc)
}
if (!pmf_device_register(sc->sc_dev, NULL, sbdsp_resume))
- aprint_error_dev(sc->sc_dev, "couldn't establish power handler\n");
+ aprint_error_dev(sc->sc_dev,
+ "couldn't establish power handler\n");
}
static bool
@@ -1213,7 +1214,8 @@ int
sbdsp16_set_rate(struct sbdsp_softc *sc, int cmd, int rate)
{
- DPRINTF(("sbdsp16_set_rate: sc=%p cmd=0x%02x rate=%d\n", sc, cmd, rate));
+ DPRINTF(("sbdsp16_set_rate: sc=%p cmd=0x%02x rate=%d\n", sc, cmd,
+ rate));
if (sbdsp_wdsp(sc, cmd) < 0 ||
sbdsp_wdsp(sc, rate >> 8) < 0 ||
sbdsp_wdsp(sc, rate) < 0)
@@ -1555,7 +1557,8 @@ sbdsp_intr(void *arg)
mutex_spin_enter(&sc->sc_intr_lock);
if (ISSB16CLASS(sc)) {
irq = sbdsp_mix_read(sc, SBP_IRQ_STATUS);
- if ((irq & (SBP_IRQ_DMA8 | SBP_IRQ_DMA16 | SBP_IRQ_MPU401)) == 0) {
+ if ((irq & (SBP_IRQ_DMA8 | SBP_IRQ_DMA16 | SBP_IRQ_MPU401))
+ == 0) {
mutex_spin_exit(&sc->sc_intr_lock);
DPRINTF(("sbdsp_intr: Spurious interrupt 0x%x\n", irq));
return 0;
@@ -1695,13 +1698,15 @@ sbdsp_set_mixer_gain(struct sbdsp_softc *sc, int port)
src = SB16P_BASS_L;
break;
case SB_PCSPEAKER:
- sbdsp_mix_write(sc, SB16P_PCSPEAKER, sc->gain[port][SB_LEFT]);
+ sbdsp_mix_write(sc, SB16P_PCSPEAKER,
+ sc->gain[port][SB_LEFT]);
return;
default:
return;
}
sbdsp_mix_write(sc, src, sc->gain[port][SB_LEFT]);
- sbdsp_mix_write(sc, SB16P_L_TO_R(src), sc->gain[port][SB_RIGHT]);
+ sbdsp_mix_write(sc, SB16P_L_TO_R(src),
+ sc->gain[port][SB_RIGHT]);
break;
}
}
@@ -1743,11 +1748,13 @@ sbdsp_mixer_set_port(void *addr, mixer_ctrl_t *cp)
}
switch (cp->dev) {
case SB_TREBLE:
- sbdsp_set_ifilter(addr, cp->un.ord ? SB_TREBLE : 0);
+ sbdsp_set_ifilter(addr,
+ cp->un.ord ? SB_TREBLE : 0);
mutex_spin_exit(&sc->sc_intr_lock);
return 0;
case SB_BASS:
- sbdsp_set_ifilter(addr, cp->un.ord ? SB_BASS : 0);
+ sbdsp_set_ifilter(addr,
+ cp->un.ord ? SB_BASS : 0);
mutex_spin_exit(&sc->sc_intr_lock);
return 0;
}
@@ -1949,7 +1956,7 @@ sbdsp_mixer_get_port(void *addr, mixer_ctrl_t *cp)
return EINVAL;
mutex_spin_enter(&sc->sc_intr_lock);
-
+
switch (cp->dev) {
case SB_TREBLE:
case SB_BASS:
diff --git a/sys/dev/isa/soekrisgpio.c b/sys/dev/isa/soekrisgpio.c
index d249783bcb3..1d1b788d347 100644
--- a/sys/dev/isa/soekrisgpio.c
+++ b/sys/dev/isa/soekrisgpio.c
@@ -20,11 +20,11 @@
*/
/*
- * Soekris net6501 GPIO and LEDs as implemented by the onboard Xilinx FPGA
+ * Soekris net6501 GPIO and LEDs as implemented by the onboard Xilinx FPGA
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: soekrisgpio.c,v 1.2 2013/06/10 07:14:02 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: soekrisgpio.c,v 1.3 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -128,8 +128,8 @@ soekris_attach(device_t parent, device_t self, void *aux)
u_int data;
int i;
- if (bus_space_map(ia->ia_iot, ia->ia_io[0].ir_addr, ia->ia_io[0].ir_size, 0,
- &sc->sc_ioh) != 0) {
+ if (bus_space_map(ia->ia_iot, ia->ia_io[0].ir_addr,
+ ia->ia_io[0].ir_size, 0, &sc->sc_ioh) != 0) {
aprint_normal(": can't map i/o space\n");
return;
}
diff --git a/sys/dev/isa/tcom.c b/sys/dev/isa/tcom.c
index 941e9be6480..ab84ed175d9 100644
--- a/sys/dev/isa/tcom.c
+++ b/sys/dev/isa/tcom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tcom.c,v 1.19 2009/05/12 09:10:16 cegger Exp $ */
+/* $NetBSD: tcom.c,v 1.20 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcom.c,v 1.19 2009/05/12 09:10:16 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcom.c,v 1.20 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -200,7 +200,8 @@ tcomattach(device_t parent, device_t self, void *aux)
if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) &&
bus_space_map(iot, iobase, COM_NPORTS, 0,
&sc->sc_slaveioh[i])) {
- aprint_error_dev(sc->sc_dev, "can't map i/o space for slave %d\n", i);
+ aprint_error_dev(sc->sc_dev,
+ "can't map i/o space for slave %d\n", i);
return;
}
}
diff --git a/sys/dev/isa/wds.c b/sys/dev/isa/wds.c
index ada9d468e8e..e79fc17fe97 100644
--- a/sys/dev/isa/wds.c
+++ b/sys/dev/isa/wds.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wds.c,v 1.76 2012/10/27 17:18:25 chs Exp $ */
+/* $NetBSD: wds.c,v 1.77 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* XXX
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wds.c,v 1.76 2012/10/27 17:18:25 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wds.c,v 1.77 2016/07/11 11:31:50 msaitoh Exp $");
#include "opt_ddb.h"
@@ -209,7 +209,8 @@ int wds_debug = 0;
#define WDS_ABORT_TIMEOUT 2000 /* time to wait for abort (mSec) */
integrate void
-wds_wait(bus_space_tag_t iot, bus_space_handle_t ioh, int port, int mask, int val)
+wds_wait(bus_space_tag_t iot, bus_space_handle_t ioh, int port, int mask,
+ int val)
{
while ((bus_space_read_1(iot, ioh, port) & mask) != val)
@@ -336,7 +337,8 @@ wdsattach(device_t parent, device_t self, void *aux)
#ifdef notyet
if (wpd.sc_drq != -1) {
if ((error = isa_dmacascade(ic, wpd.sc_drq)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to cascade DRQ, error = %d\n", error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to cascade DRQ, error = %d\n", error);
return;
}
}
@@ -345,7 +347,8 @@ wdsattach(device_t parent, device_t self, void *aux)
wdsintr, sc);
#else
if ((error = isa_dmacascade(ic, ia->ia_drq[0].ir_drq)) != 0) {
- aprint_error_dev(sc->sc_dev, "unable to cascade DRQ, error = %d\n", error);
+ aprint_error_dev(sc->sc_dev,
+ "unable to cascade DRQ, error = %d\n", error);
return;
}
@@ -490,7 +493,8 @@ wdsintr(void *arg)
break;
default:
- aprint_error_dev(sc->sc_dev, "unrecognized interrupt type %02x", c);
+ aprint_error_dev(sc->sc_dev,
+ "unrecognized interrupt type %02x", c);
break;
}
@@ -593,7 +597,8 @@ wds_create_scbs(struct wds_softc *sc, void *mem, size_t size)
error = bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0, &seg,
1, &rseg, BUS_DMA_NOWAIT);
if (error) {
- aprint_error_dev(sc->sc_dev, "can't allocate memory for scbs\n");
+ aprint_error_dev(sc->sc_dev,
+ "can't allocate memory for scbs\n");
return (error);
}
@@ -795,15 +800,15 @@ wds_done(struct wds_softc *sc, struct wds_scb *scb, u_char stat)
*/
switch (scb->cmd.venderr) {
case 0x00:
- aprint_error_dev(sc->sc_dev, "Is this "
- "an error?\n");
+ aprint_error_dev(sc->sc_dev,
+ "Is this an error?\n");
/* Experiment. */
xs->error = XS_DRIVER_STUFFUP;
break;
case 0x01:
#if 0
- aprint_error_dev(sc->sc_dev, "OK, see SCSI "
- "error field.\n");
+ aprint_error_dev(sc->sc_dev,
+ "OK, see SCSI error field.\n");
#endif
if (scb->cmd.stat == SCSI_CHECK ||
scb->cmd.stat == SCSI_BUSY) {
@@ -864,7 +869,8 @@ wds_done(struct wds_softc *sc, struct wds_scb *scb, u_char stat)
}
int
-wds_find(bus_space_tag_t iot, bus_space_handle_t ioh, struct wds_probe_data *sc)
+wds_find(bus_space_tag_t iot, bus_space_handle_t ioh,
+ struct wds_probe_data *sc)
{
int i;
@@ -1059,7 +1065,8 @@ wdsminphys(struct buf *bp)
* Send a SCSI command.
*/
void
-wds_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *arg)
+wds_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
+ void *arg)
{
struct scsipi_xfer *xs;
struct scsipi_periph *periph;
@@ -1087,7 +1094,8 @@ wds_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *
* Let's not worry about UIO. There isn't any code
* for the non-SG boards anyway!
*/
- aprint_error_dev(sc->sc_dev, "UIO is untested and disabled!\n");
+ aprint_error_dev(sc->sc_dev,
+ "UIO is untested and disabled!\n");
xs->error = XS_DRIVER_STUFFUP;
scsipi_done(xs);
return;
@@ -1114,8 +1122,8 @@ wds_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *
/* Zero out the command structure. */
if (xs->cmdlen > sizeof(scb->cmd.scb)) {
- aprint_error_dev(sc->sc_dev, "cmdlen %d too large for SCB\n",
- xs->cmdlen);
+ aprint_error_dev(sc->sc_dev,
+ "cmdlen %d too large for SCB\n", xs->cmdlen);
xs->error = XS_DRIVER_STUFFUP;
goto out_bad;
}
@@ -1164,7 +1172,8 @@ wds_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *
default:
xs->error = XS_DRIVER_STUFFUP;
- aprint_error_dev(sc->sc_dev, "error %d loading DMA map\n", error);
+ aprint_error_dev(sc->sc_dev,
+ "error %d loading DMA map\n", error);
out_bad:
wds_free_scb(sc, scb);
scsipi_done(xs);
diff --git a/sys/dev/isa/wt.c b/sys/dev/isa/wt.c
index faafce5ab02..ab0b16430dc 100644
--- a/sys/dev/isa/wt.c
+++ b/sys/dev/isa/wt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wt.c,v 1.86 2014/07/25 08:10:37 dholland Exp $ */
+/* $NetBSD: wt.c,v 1.87 2016/07/11 11:31:50 msaitoh Exp $ */
/*
* Streamer tape driver.
@@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wt.c,v 1.86 2014/07/25 08:10:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wt.c,v 1.87 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -325,7 +325,8 @@ ok:
sc->chan = ia->ia_drq[0].ir_drq;
if ((maxsize = isa_dmamaxsize(sc->sc_ic, sc->chan)) < MAXPHYS) {
- aprint_error_dev(sc->sc_dev, "max DMA size %lu is less than required %d\n",
+ aprint_error_dev(sc->sc_dev,
+ "max DMA size %lu is less than required %d\n",
(u_long)maxsize, MAXPHYS);
return;
}
@@ -347,8 +348,7 @@ ok:
}
static int
-wtdump(dev_t dev, daddr_t blkno, void *va,
- size_t size)
+wtdump(dev_t dev, daddr_t blkno, void *va, size_t size)
{
/* Not implemented. */
@@ -426,7 +426,8 @@ wtopen(dev_t dev, int flag, int mode, struct lwp *l)
/* Check the status of the controller. */
if (sc->error & TP_ILL) {
- aprint_error_dev(sc->sc_dev, "invalid tape density\n");
+ aprint_error_dev(sc->sc_dev,
+ "invalid tape density\n");
return ENODEV;
}
}
@@ -451,8 +452,7 @@ wtopen(dev_t dev, int flag, int mode, struct lwp *l)
* Close routine, called on last device close.
*/
static int
-wtclose(dev_t dev, int flags, int mode,
- struct lwp *l)
+wtclose(dev_t dev, int flags, int mode, struct lwp *l)
{
struct wt_softc *sc;
@@ -503,8 +503,7 @@ done:
* ioctl(int fd, WTQICMD, int qicop) -- do QIC op
*/
static int
-wtioctl(dev_t dev, unsigned long cmd, void *addr, int flag,
- struct lwp *l)
+wtioctl(dev_t dev, unsigned long cmd, void *addr, int flag, struct lwp *l)
{
struct wt_softc *sc;
int error, count, op;
diff --git a/sys/dev/isapnp/if_an_isapnp.c b/sys/dev/isapnp/if_an_isapnp.c
index 6af60d1f3b5..afa14d9bd46 100644
--- a/sys/dev/isapnp/if_an_isapnp.c
+++ b/sys/dev/isapnp/if_an_isapnp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_an_isapnp.c,v 1.22 2009/05/12 10:16:35 cegger Exp $ */
+/* $NetBSD: if_an_isapnp.c,v 1.23 2016/07/11 11:31:50 msaitoh Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_an_isapnp.c,v 1.22 2009/05/12 10:16:35 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_an_isapnp.c,v 1.23 2016/07/11 11:31:50 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -121,7 +121,8 @@ an_isapnp_attach(device_t parent, device_t self, void *aux)
isc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num,
ipa->ipa_irq[0].type, IPL_NET, an_intr, sc);
if (isc->sc_ih == NULL) {
- aprint_error_dev(self, "couldn't establish interrupt handler\n");
+ aprint_error_dev(self,
+ "couldn't establish interrupt handler\n");
return;
}
diff --git a/sys/dev/mca/ed_mca.c b/sys/dev/mca/ed_mca.c
index ad87f848996..90669b6a56f 100644
--- a/sys/dev/mca/ed_mca.c
+++ b/sys/dev/mca/ed_mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ed_mca.c,v 1.64 2015/04/26 15:15:20 mlelstv Exp $ */
+/* $NetBSD: ed_mca.c,v 1.65 2016/07/11 11:31:51 msaitoh Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.64 2015/04/26 15:15:20 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.65 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -74,8 +74,8 @@ __KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.64 2015/04/26 15:15:20 mlelstv Exp $");
#define EDLABELDEV(dev) (MAKEDISKDEV(major(dev), DISKUNIT(dev), RAW_PART))
-static int ed_mca_probe (device_t, cfdata_t, void *);
-static void ed_mca_attach (device_t, device_t, void *);
+static int ed_mca_probe (device_t, cfdata_t, void *);
+static void ed_mca_attach (device_t, device_t, void *);
CFATTACH_DECL_NEW(ed_mca, sizeof(struct ed_softc),
ed_mca_probe, ed_mca_attach, NULL, NULL);
diff --git a/sys/dev/mca/edc_mca.c b/sys/dev/mca/edc_mca.c
index f2ff5bebade..9723f5a25ff 100644
--- a/sys/dev/mca/edc_mca.c
+++ b/sys/dev/mca/edc_mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: edc_mca.c,v 1.50 2015/04/13 16:33:24 riastradh Exp $ */
+/* $NetBSD: edc_mca.c,v 1.51 2016/07/11 11:31:51 msaitoh Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.50 2015/04/13 16:33:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.51 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -209,7 +209,8 @@ edc_mca_attach(device_t parent, device_t self, void *aux)
* utility uses only valid addresses.
*/
if (drq == 2 || drq >= 8) {
- aprint_error_dev(sc->sc_dev, "invalid DMA Arbitration Level %d\n", drq);
+ aprint_error_dev(sc->sc_dev,
+ "invalid DMA Arbitration Level %d\n", drq);
return;
}
#endif
@@ -238,7 +239,8 @@ edc_mca_attach(device_t parent, device_t self, void *aux)
sc->sc_ih = mca_intr_establish(ma->ma_mc, irq, IPL_BIO, edc_intr, sc);
if (sc->sc_ih == NULL) {
- aprint_error_dev(sc->sc_dev, "couldn't establish interrupt handler\n");
+ aprint_error_dev(sc->sc_dev,
+ "couldn't establish interrupt handler\n");
return;
}
@@ -247,7 +249,8 @@ edc_mca_attach(device_t parent, device_t self, void *aux)
if ((error = mca_dmamap_create(sc->sc_dmat, MAXPHYS,
BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW | MCABUS_DMA_16BIT,
&sc->sc_dmamap_xfer, drq)) != 0){
- aprint_error_dev(sc->sc_dev, "couldn't create DMA map - error %d\n", error);
+ aprint_error_dev(sc->sc_dev,
+ "couldn't create DMA map - error %d\n", error);
return;
}
@@ -332,7 +335,8 @@ edc_mca_attach(device_t parent, device_t self, void *aux)
config_pending_incr(self);
if ((error = kthread_create(PRI_NONE, 0, NULL, edcworker, sc, NULL,
"%s", device_xname(sc->sc_dev)))) {
- aprint_error_dev(sc->sc_dev, "cannot spawn worker thread: errno=%d\n", error);
+ aprint_error_dev(sc->sc_dev,
+ "cannot spawn worker thread: errno=%d\n", error);
panic("edc_mca_attach");
}
}
@@ -349,7 +353,7 @@ edc_intr(void *arg)
struct edc_mca_softc *sc = arg;
u_int8_t isr, intr_id;
u_int16_t sifr;
- int cmd=-1, devno;
+ int cmd = -1, devno;
/*
* Check if the interrupt was for us.
@@ -516,8 +520,9 @@ edc_do_attn(struct edc_mca_softc *sc, int attn_type, int devno, int intr_id)
}
if (tries == EDC_ATTN_MAXTRIES) {
- printf("%s: edc_do_attn: timeout waiting for attachment to become available\n",
- device_xname(sc->sc_ed[devno]->sc_dev));
+ printf("%s: edc_do_attn: timeout waiting for "
+ "attachment to become available\n",
+ device_xname(sc->sc_ed[devno]->sc_dev));
return (EIO);
}
}
@@ -619,7 +624,8 @@ edc_run_cmd(struct edc_mca_softc *sc, int cmd, int devno,
if (tries == 10000
&& bus_space_read_1(sc->sc_iot, sc->sc_ioh, BSR)
& BSR_CIFR_FULL) {
- aprint_error_dev(sc->sc_dev, "device too slow to accept command %d\n", cmd);
+ aprint_error_dev(sc->sc_dev,
+ "device too slow to accept command %d\n", cmd);
return (EIO);
}
}
diff --git a/sys/dev/mca/if_elmc_mca.c b/sys/dev/mca/if_elmc_mca.c
index a842df6ff37..17545e0b567 100644
--- a/sys/dev/mca/if_elmc_mca.c
+++ b/sys/dev/mca/if_elmc_mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_elmc_mca.c,v 1.30 2011/06/03 16:28:40 tsutsui Exp $ */
+/* $NetBSD: if_elmc_mca.c,v 1.31 2016/07/11 11:31:51 msaitoh Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_elmc_mca.c,v 1.30 2011/06/03 16:28:40 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_elmc_mca.c,v 1.31 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -164,7 +164,8 @@ elmc_mca_attach(device_t parent, device_t self, void *aux)
if (bus_space_map(ma->ma_memt, pbram_addr, ELMC_MADDR_SIZE, 0, &memh)) {
aprint_error_dev(self, "unable to map memory space\n");
if (pbram_addr == 0xc0000) {
- aprint_error_dev(self, "memory space 0xc0000 may conflict with vga\n");
+ aprint_error_dev(self,
+ "memory space 0xc0000 may conflict with vga\n");
}
bus_space_unmap(ma->ma_iot, ioh, ELMC_IOADDR_SIZE);
@@ -229,7 +230,8 @@ elmc_mca_attach(device_t parent, device_t self, void *aux)
/* set up pointers to key structures */
elmc_mca_write_24(sc, IE_SCP_ISCP((u_long)sc->scp), (u_long) sc->iscp);
elmc_mca_write_16(sc, IE_ISCP_SCB((u_long)sc->iscp), (u_long) sc->scb);
- elmc_mca_write_24(sc, IE_ISCP_BASE((u_long)sc->iscp), (u_long) sc->iscp);
+ elmc_mca_write_24(sc, IE_ISCP_BASE((u_long)sc->iscp),
+ (u_long) sc->iscp);
/* flush setup of pointers, check if chip answers */
bus_space_barrier(sc->bt, sc->bh, 0, sc->sc_msize,
@@ -267,7 +269,8 @@ elmc_mca_attach(device_t parent, device_t self, void *aux)
asc->sc_ih = mca_intr_establish(ma->ma_mc, irq, IPL_NET, i82586_intr,
sc);
if (asc->sc_ih == NULL) {
- aprint_error_dev(self, "couldn't establish interrupt handler\n");
+ aprint_error_dev(self,
+ "couldn't establish interrupt handler\n");
return;
}
}
@@ -298,7 +301,8 @@ elmc_mca_copyin (struct ie_softc *sc, void *dst, int offset, size_t size)
}
static void
-elmc_mca_copyout (struct ie_softc *sc, const void *src, int offset, size_t size)
+elmc_mca_copyout (struct ie_softc *sc, const void *src, int offset,
+ size_t size)
{
int dribble;
int osize = size;
@@ -341,7 +345,7 @@ static void
elmc_mca_write_24 (struct ie_softc *sc, int offset, int addr)
{
bus_space_write_4(sc->bt, sc->bh, offset, addr +
- (u_long) sc->sc_maddr - (u_long) sc->sc_iobase);
+ (u_long) sc->sc_maddr - (u_long) sc->sc_iobase);
bus_space_barrier(sc->bt, sc->bh, offset, 4, BUS_SPACE_BARRIER_WRITE);
}
@@ -351,23 +355,23 @@ elmc_mca_write_24 (struct ie_softc *sc, int offset, int addr)
static void
elmc_mca_attn(struct ie_softc *sc, int why)
{
- struct elmc_mca_softc* asc = (struct elmc_mca_softc *) sc;
- int intr = 0;
-
- switch (why) {
- case CHIP_PROBE:
- intr = 0;
- break;
- case CARD_RESET:
- intr = ELMC_CTRL_INT;
- break;
- }
-
- bus_space_write_1(asc->sc_regt, asc->sc_regh, ELMC_CTRL,
- ELMC_CTRL_RST | ELMC_CTRL_BS3 | ELMC_CTRL_CHA | intr);
- delay(1); /* should be > 500 ns */
- bus_space_write_1(asc->sc_regt, asc->sc_regh, ELMC_CTRL,
- ELMC_CTRL_RST | ELMC_CTRL_BS3 | intr);
+ struct elmc_mca_softc* asc = (struct elmc_mca_softc *) sc;
+ int intr = 0;
+
+ switch (why) {
+ case CHIP_PROBE:
+ intr = 0;
+ break;
+ case CARD_RESET:
+ intr = ELMC_CTRL_INT;
+ break;
+ }
+
+ bus_space_write_1(asc->sc_regt, asc->sc_regh, ELMC_CTRL,
+ ELMC_CTRL_RST | ELMC_CTRL_BS3 | ELMC_CTRL_CHA | intr);
+ delay(1); /* should be > 500 ns */
+ bus_space_write_1(asc->sc_regt, asc->sc_regh, ELMC_CTRL,
+ ELMC_CTRL_RST | ELMC_CTRL_BS3 | intr);
}
/*
@@ -376,16 +380,16 @@ elmc_mca_attn(struct ie_softc *sc, int why)
static void
elmc_mca_hwreset(struct ie_softc *sc, int why)
{
- struct elmc_mca_softc* asc = (struct elmc_mca_softc *) sc;
+ struct elmc_mca_softc* asc = (struct elmc_mca_softc *) sc;
- /* toggle the RST bit low then high */
- bus_space_write_1(asc->sc_regt, asc->sc_regh, ELMC_CTRL,
- ELMC_CTRL_BS3 | ELMC_CTRL_LOOP);
- delay(1); /* should be > 500 ns */
- bus_space_write_1(asc->sc_regt, asc->sc_regh, ELMC_CTRL,
- ELMC_CTRL_BS3 | ELMC_CTRL_LOOP | ELMC_CTRL_RST);
+ /* toggle the RST bit low then high */
+ bus_space_write_1(asc->sc_regt, asc->sc_regh, ELMC_CTRL,
+ ELMC_CTRL_BS3 | ELMC_CTRL_LOOP);
+ delay(1); /* should be > 500 ns */
+ bus_space_write_1(asc->sc_regt, asc->sc_regh, ELMC_CTRL,
+ ELMC_CTRL_BS3 | ELMC_CTRL_LOOP | ELMC_CTRL_RST);
- elmc_mca_attn(sc, why);
+ elmc_mca_attn(sc, why);
}
/*
diff --git a/sys/dev/mca/if_ep_mca.c b/sys/dev/mca/if_ep_mca.c
index 6d7a3a570ed..edf02a43fec 100644
--- a/sys/dev/mca/if_ep_mca.c
+++ b/sys/dev/mca/if_ep_mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ep_mca.c,v 1.22 2009/03/14 15:36:18 dsl Exp $ */
+/* $NetBSD: if_ep_mca.c,v 1.23 2016/07/11 11:31:51 msaitoh Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ep_mca.c,v 1.22 2009/03/14 15:36:18 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ep_mca.c,v 1.23 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -217,7 +217,8 @@ ep_mca_attach(device_t parent, device_t self, void *aux)
/* Map and establish the interrupt. */
sc->sc_ih = mca_intr_establish(ma->ma_mc, irq, IPL_NET, epintr, sc);
if (sc->sc_ih == NULL) {
- aprint_error_dev(sc->sc_dev, "couldn't establish interrupt handler\n");
+ aprint_error_dev(sc->sc_dev,
+ "couldn't establish interrupt handler\n");
return;
}
diff --git a/sys/dev/mca/if_tra_mca.c b/sys/dev/mca/if_tra_mca.c
index 6d2a1db21ae..64edcd19d1c 100644
--- a/sys/dev/mca/if_tra_mca.c
+++ b/sys/dev/mca/if_tra_mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tra_mca.c,v 1.17 2015/04/13 16:33:24 riastradh Exp $ */
+/* $NetBSD: if_tra_mca.c,v 1.18 2016/07/11 11:31:51 msaitoh Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tra_mca.c,v 1.17 2015/04/13 16:33:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tra_mca.c,v 1.18 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -208,7 +208,8 @@ tiara_mca_attach(device_t parent, device_t self, void *aux)
}
#endif
- printf(" slot %d ports %#x-%#x irq %d: %s\n", ma->ma_slot + 1,iobase, iobase + TIARA_NPORTS, irq, tra_p->tra_name);
+ printf(" slot %d ports %#x-%#x irq %d: %s\n", ma->ma_slot + 1,iobase,
+ iobase + TIARA_NPORTS, irq, tra_p->tra_name);
/* Map i/o space. */
if (bus_space_map(iot, iobase, TIARA_NPORTS, 0, &ioh)) {
@@ -240,7 +241,8 @@ tiara_mca_attach(device_t parent, device_t self, void *aux)
isc->sc_ih = mca_intr_establish(ma->ma_mc, irq, IPL_NET,
mb86950_intr, sc);
if (isc->sc_ih == NULL) {
- aprint_error_dev(self, "couldn't establish interrupt handler\n");
+ aprint_error_dev(self,
+ "couldn't establish interrupt handler\n");
return;
}
}
diff --git a/sys/dev/pci/gffb.c b/sys/dev/pci/gffb.c
index 3b305debc5f..004e7f26fe1 100644
--- a/sys/dev/pci/gffb.c
+++ b/sys/dev/pci/gffb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gffb.c,v 1.10 2015/09/16 16:52:54 macallan Exp $ */
+/* $NetBSD: gffb.c,v 1.11 2016/07/11 11:31:51 msaitoh Exp $ */
/*
* Copyright (c) 2013 Michael Lorenz
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gffb.c,v 1.10 2015/09/16 16:52:54 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gffb.c,v 1.11 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -112,8 +112,7 @@ static void gffb_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(gffb, sizeof(struct gffb_softc),
gffb_match, gffb_attach, NULL, NULL);
-static int gffb_ioctl(void *, void *, u_long, void *, int,
- struct lwp *);
+static int gffb_ioctl(void *, void *, u_long, void *, int, struct lwp *);
static paddr_t gffb_mmap(void *, void *, off_t, int);
static void gffb_init_screen(void *, struct vcons_screen *, int, long *);
@@ -130,8 +129,7 @@ static void gffb_sync(struct gffb_softc *);
static void gffb_rectfill(struct gffb_softc *, int, int, int, int,
uint32_t);
-static void gffb_bitblt(void *, int, int, int, int, int,
- int, int);
+static void gffb_bitblt(void *, int, int, int, int, int, int, int);
static void gffb_rop(struct gffb_softc *, int);
static void gffb_cursor(void *, int, int, int);
@@ -276,7 +274,7 @@ gffb_attach(device_t parent, device_t self, void *aux)
*/
mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
- /* init engine here */
+ /* init engine here */
gffb_init(sc);
vcons_init(&sc->vd, sc, &sc->sc_defaultscreen_descr,
@@ -297,19 +295,19 @@ gffb_attach(device_t parent, device_t self, void *aux)
gffb_rectfill(sc, 0, 0, sc->sc_width, sc->sc_height,
ri->ri_devcmap[(defattr >> 16) & 0xf]);
-
+
sc->sc_defaultscreen_descr.textops = &ri->ri_ops;
sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
-
+
glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
(0x800000 / sc->sc_stride) - sc->sc_height - 5,
sc->sc_width,
ri->ri_font->fontwidth,
ri->ri_font->fontheight,
defattr);
-
+
wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
defattr);
vcons_replay_msgbuf(&sc->sc_console_screen);
@@ -324,7 +322,7 @@ gffb_attach(device_t parent, device_t self, void *aux)
&defattr);
} else
(*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
-
+
glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
(0x800000 / sc->sc_stride) - sc->sc_height - 5,
sc->sc_width,
@@ -360,7 +358,7 @@ gffb_attach(device_t parent, device_t self, void *aux)
(i + j ) & 1 ? 0xe0e0e0e0 : 0x03030303);
}
}
-
+
gffb_rectfill(sc, 0, 800, 1280, 224, 0x92929292);
gffb_bitblt(sc, 0, 10, 10, 810, 200, 20, 0xcc);
gffb_bitblt(sc, 0, 10, 10, 840, 300, 20, 0xcc);
@@ -378,8 +376,7 @@ gffb_attach(device_t parent, device_t self, void *aux)
}
static int
-gffb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
- struct lwp *l)
+gffb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l)
{
struct vcons_data *vd = v;
struct gffb_softc *sc = vd->cookie;
@@ -398,7 +395,7 @@ gffb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
cmd, data, flag, l);
case WSDISPLAYIO_GET_BUSID:
- return wsdisplayio_busid_pci(sc->sc_dev, sc->sc_pc,
+ return wsdisplayio_busid_pci(sc->sc_dev, sc->sc_pc,
sc->sc_pcitag, data);
case WSDISPLAYIO_GINFO:
@@ -439,7 +436,7 @@ gffb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
}
}
return 0;
-
+
case WSDISPLAYIO_GET_EDID: {
struct wsdisplayio_edid_info *d = data;
return wsdisplayio_get_edid(sc->sc_dev, d);
@@ -485,7 +482,7 @@ gffb_mmap(void *v, void *vs, off_t offset, int prot)
return pa;
}
- if ((offset >= sc->sc_reg) &&
+ if ((offset >= sc->sc_reg) &&
(offset < (sc->sc_reg + sc->sc_regsize))) {
pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
BUS_SPACE_MAP_LINEAR);
@@ -636,7 +633,7 @@ gffb_putpalreg(struct gffb_softc *sc, uint8_t idx, uint8_t r, uint8_t g,
GFFB_PDIO1 + GFFB_PEL_D, g);
bus_space_write_1(sc->sc_memt, sc->sc_regh,
GFFB_PDIO1 + GFFB_PEL_D, b);
-
+
return 0;
}
@@ -680,7 +677,7 @@ gffb_dmastart(struct gffb_softc *sc, uint32_t tag, int size)
#define SKIPS 8
-static void
+static void
gffb_make_room(struct gffb_softc *sc, int size)
{
uint32_t get;
@@ -759,7 +756,7 @@ gffb_init(struct gffb_softc *sc)
GFFB_WRITE_4(GFFB_CRTC1 + GFFB_DISPLAYSTART, 0x2000);
GFFB_WRITE_4(GFFB_PDIO0 + GFFB_PEL_MASK, 0xff);
GFFB_WRITE_4(GFFB_PDIO1 + GFFB_PEL_MASK, 0xff);
-
+
/* DMA stuff. A whole lot of magic number voodoo from xf86-video-nv */
GFFB_WRITE_4(GFFB_PMC + 0x140, 0);
GFFB_WRITE_4(GFFB_PMC + 0x200, 0xffff00ff);
@@ -931,7 +928,7 @@ gffb_init(struct gffb_softc *sc)
for(i = 0; i < SKIPS; i++)
gffb_dmanext(sc, 0);
-
+
gffb_dmanext(sc, 0x00040000);
gffb_dmanext(sc, 0x80000010);
gffb_dmanext(sc, 0x00042000);
@@ -967,7 +964,7 @@ gffb_init(struct gffb_softc *sc)
gffb_dmanext(sc, 0xffffffff);
gffb_dmanext(sc, 0xffffffff);
gffb_dmanext(sc, 0xffffffff);
-
+
gffb_dmastart(sc, ROP_SET, 1);
gffb_dmanext(sc, 0xcc);
sc->sc_rop = 0xcc;
@@ -975,7 +972,7 @@ gffb_init(struct gffb_softc *sc)
gffb_dma_kickoff(sc);
gffb_sync(sc);
DPRINTF("put %x current %x\n", sc->sc_put, sc->sc_current);
-
+
}
static void
@@ -986,7 +983,7 @@ gffb_rop(struct gffb_softc *sc, int rop)
sc->sc_rop = rop;
gffb_dmastart(sc, ROP_SET, 1);
gffb_dmanext(sc, rop);
-}
+}
static void
gffb_rectfill(struct gffb_softc *sc, int x, int y, int wi, int he,
@@ -1030,10 +1027,10 @@ gffb_cursor(void *cookie, int on, int row, int col)
struct vcons_screen *scr = ri->ri_hw;
struct gffb_softc *sc = scr->scr_cookie;
int x, y, wi, he;
-
+
wi = ri->ri_font->fontwidth;
he = ri->ri_font->fontheight;
-
+
if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
x = ri->ri_ccol * wi + ri->ri_xorigin;
y = ri->ri_crow * he + ri->ri_yorigin;
@@ -1067,7 +1064,7 @@ gffb_putchar(void *cookie, int row, int col, u_int c, long attr)
int x, y, wi, he, rv = GC_NOPE;
uint32_t bg;
- if (sc->sc_mode != WSDISPLAYIO_MODE_EMUL)
+ if (sc->sc_mode != WSDISPLAYIO_MODE_EMUL)
return;
if (!CHAR_IN_FONT(c, font))
@@ -1075,11 +1072,11 @@ gffb_putchar(void *cookie, int row, int col, u_int c, long attr)
wi = font->fontwidth;
he = font->fontheight;
-
+
x = ri->ri_xorigin + col * wi;
y = ri->ri_yorigin + row * he;
bg = ri->ri_devcmap[(attr >> 16) & 0xf];
-
+
if (c == 0x20) {
gffb_rectfill(sc, x, y, wi, he, bg);
return;
@@ -1106,7 +1103,7 @@ gffb_copycols(void *cookie, int row, int srccol, int dstcol, int ncols)
struct vcons_screen *scr = ri->ri_hw;
struct gffb_softc *sc = scr->scr_cookie;
int32_t xs, xd, y, width, height;
-
+
if ((sc->sc_locked == 0) && (sc->sc_mode == WSDISPLAYIO_MODE_EMUL)) {
xs = ri->ri_xorigin + ri->ri_font->fontwidth * srccol;
xd = ri->ri_xorigin + ri->ri_font->fontwidth * dstcol;
@@ -1124,7 +1121,7 @@ gffb_erasecols(void *cookie, int row, int startcol, int ncols, long fillattr)
struct vcons_screen *scr = ri->ri_hw;
struct gffb_softc *sc = scr->scr_cookie;
int32_t x, y, width, height, fg, bg, ul;
-
+
if ((sc->sc_locked == 0) && (sc->sc_mode == WSDISPLAYIO_MODE_EMUL)) {
x = ri->ri_xorigin + ri->ri_font->fontwidth * startcol;
y = ri->ri_yorigin + ri->ri_font->fontheight * row;
@@ -1161,7 +1158,7 @@ gffb_eraserows(void *cookie, int row, int nrows, long fillattr)
struct vcons_screen *scr = ri->ri_hw;
struct gffb_softc *sc = scr->scr_cookie;
int32_t x, y, width, height, fg, bg, ul;
-
+
if ((sc->sc_locked == 0) && (sc->sc_mode == WSDISPLAYIO_MODE_EMUL)) {
x = ri->ri_xorigin;
y = ri->ri_yorigin + ri->ri_font->fontheight * row;
diff --git a/sys/dev/pci/gtp.c b/sys/dev/pci/gtp.c
index dfc49357ea2..77716876f37 100644
--- a/sys/dev/pci/gtp.c
+++ b/sys/dev/pci/gtp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gtp.c,v 1.19 2012/10/27 17:18:32 chs Exp $ */
+/* $NetBSD: gtp.c,v 1.20 2016/07/11 11:31:51 msaitoh Exp $ */
/* $OpenBSD: gtp.c,v 1.1 2002/06/03 16:13:21 mickey Exp $ */
/*
@@ -29,7 +29,7 @@
/* Gemtek PCI Radio Card Device Driver */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtp.c,v 1.19 2012/10/27 17:18:32 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtp.c,v 1.20 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -53,9 +53,9 @@ __KERNEL_RCSID(0, "$NetBSD: gtp.c,v 1.19 2012/10/27 17:18:32 chs Exp $");
static int gtp_match(device_t, cfdata_t, void *);
static void gtp_attach(device_t, device_t, void *);
-static int gtp_get_info(void *, struct radio_info *);
-static int gtp_set_info(void *, struct radio_info *);
-static int gtp_search(void *, int);
+static int gtp_get_info(void *, struct radio_info *);
+static int gtp_set_info(void *, struct radio_info *);
+static int gtp_search(void *, int);
#define GEMTEK_PCI_CAPS RADIO_CAPS_DETECT_SIGNAL | \
RADIO_CAPS_DETECT_STEREO | \
diff --git a/sys/dev/pci/iavc_pci.c b/sys/dev/pci/iavc_pci.c
index 95772db726d..f2fcd4947e5 100644
--- a/sys/dev/pci/iavc_pci.c
+++ b/sys/dev/pci/iavc_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: iavc_pci.c,v 1.16 2014/03/29 19:28:24 christos Exp $ */
+/* $NetBSD: iavc_pci.c,v 1.17 2016/07/11 11:31:51 msaitoh Exp $ */
/*
char intrbuf[PCI_INTRSTR_LEN];
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iavc_pci.c,v 1.16 2014/03/29 19:28:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iavc_pci.c,v 1.17 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -157,7 +157,7 @@ iavc_pci_attach(device_t parent, device_t self, void *aux)
iavc_b1dma_reset(sc);
if (pp->npp_product == PCI_PRODUCT_AVM_T1) {
- aprint_error_dev(sc->sc_dev, "sorry, PRI not yet supported\n");
+ aprint_error_dev(self, "sorry, PRI not yet supported\n");
return;
#if 0
@@ -166,9 +166,9 @@ iavc_pci_attach(device_t parent, device_t self, void *aux)
ret = iavc_t1_detect(sc);
if (ret) {
if (ret < 6) {
- aprint_error_dev(sc->sc_dev, "no card detected?\n");
+ aprint_error_dev(self, "no card detected?\n");
} else {
- aprint_error_dev(sc->sc_dev, "black box not on\n");
+ aprint_error_dev(self, "black box not on\n");
}
return;
} else {
@@ -184,7 +184,7 @@ iavc_pci_attach(device_t parent, device_t self, void *aux)
if (ret) {
ret = iavc_b1_detect(sc);
if (ret) {
- aprint_error_dev(sc->sc_dev, "no card detected?\n");
+ aprint_error_dev(self, "no card detected?\n");
return;
}
} else {
@@ -205,21 +205,21 @@ iavc_pci_attach(device_t parent, device_t self, void *aux)
#endif
if (pci_intr_map(pa, &ih)) {
- aprint_error_dev(sc->sc_dev, "couldn't map interrupt\n");
+ aprint_error_dev(self, "couldn't map interrupt\n");
return;
}
intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf));
psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, iavc_pci_intr, psc);
if (psc->sc_ih == NULL) {
- aprint_error_dev(sc->sc_dev, "couldn't establish interrupt");
+ aprint_error_dev(self, "couldn't establish interrupt");
if (intrstr != NULL)
aprint_error(" at %s", intrstr);
aprint_error("\n");
return;
}
psc->sc_pc = pc;
- aprint_normal("%s: interrupting at %s\n", device_xname(sc->sc_dev), intrstr);
+ aprint_normal_dev(self, "interrupting at %s\n", intrstr);
memset(&sc->sc_txq, 0, sizeof(struct ifqueue));
sc->sc_txq.ifq_maxlen = sc->sc_capi.sc_nbch * 4;
@@ -238,14 +238,14 @@ iavc_pci_attach(device_t parent, device_t self, void *aux)
/* lock & load DMA for TX */
if ((ret = bus_dmamem_alloc(sc->dmat, IAVC_DMA_SIZE, PAGE_SIZE, 0,
&sc->txseg, 1, &sc->ntxsegs, BUS_DMA_ALLOCNOW)) != 0) {
- aprint_error_dev(sc->sc_dev, "can't allocate tx DMA memory, error = %d\n",
- ret);
+ aprint_error_dev(self,
+ "can't allocate tx DMA memory, error = %d\n", ret);
goto fail1;
}
if ((ret = bus_dmamem_map(sc->dmat, &sc->txseg, sc->ntxsegs,
IAVC_DMA_SIZE, &sc->sc_sendbuf, BUS_DMA_NOWAIT)) != 0) {
- aprint_error_dev(sc->sc_dev, "can't map tx DMA memory, error = %d\n",
+ aprint_error_dev(self, "can't map tx DMA memory, error = %d\n",
ret);
goto fail2;
}
@@ -253,14 +253,14 @@ iavc_pci_attach(device_t parent, device_t self, void *aux)
if ((ret = bus_dmamap_create(sc->dmat, IAVC_DMA_SIZE, 1,
IAVC_DMA_SIZE, 0, BUS_DMA_ALLOCNOW | BUS_DMA_NOWAIT,
&sc->tx_map)) != 0) {
- aprint_error_dev(sc->sc_dev, "can't create tx DMA map, error = %d\n",
+ aprint_error_dev(self, "can't create tx DMA map, error = %d\n",
ret);
goto fail3;
}
if ((ret = bus_dmamap_load(sc->dmat, sc->tx_map, sc->sc_sendbuf,
IAVC_DMA_SIZE, NULL, BUS_DMA_WRITE | BUS_DMA_NOWAIT)) != 0) {
- aprint_error_dev(sc->sc_dev, "can't load tx DMA map, error = %d\n",
+ aprint_error_dev(self, "can't load tx DMA map, error = %d\n",
ret);
goto fail4;
}
@@ -268,34 +268,34 @@ iavc_pci_attach(device_t parent, device_t self, void *aux)
/* do the same for RX */
if ((ret = bus_dmamem_alloc(sc->dmat, IAVC_DMA_SIZE, PAGE_SIZE, 0,
&sc->rxseg, 1, &sc->nrxsegs, BUS_DMA_ALLOCNOW)) != 0) {
- aprint_error_dev(sc->sc_dev, "can't allocate rx DMA memory, error = %d\n",
- ret);
+ aprint_error_dev(self,
+ "can't allocate rx DMA memory, error = %d\n", ret);
goto fail5;
}
if ((ret = bus_dmamem_map(sc->dmat, &sc->rxseg, sc->nrxsegs,
IAVC_DMA_SIZE, &sc->sc_recvbuf, BUS_DMA_NOWAIT)) != 0) {
- aprint_error_dev(sc->sc_dev, "can't map rx DMA memory, error = %d\n",
- ret);
+ aprint_error_dev(self,
+ "can't map rx DMA memory, error = %d\n", ret);
goto fail6;
}
if ((ret = bus_dmamap_create(sc->dmat, IAVC_DMA_SIZE, 1, IAVC_DMA_SIZE,
0, BUS_DMA_ALLOCNOW | BUS_DMA_NOWAIT, &sc->rx_map)) != 0) {
- aprint_error_dev(sc->sc_dev, "can't create rx DMA map, error = %d\n",
+ aprint_error_dev(self, "can't create rx DMA map, error = %d\n",
ret);
goto fail7;
}
if ((ret = bus_dmamap_load(sc->dmat, sc->rx_map, sc->sc_recvbuf,
IAVC_DMA_SIZE, NULL, BUS_DMA_READ | BUS_DMA_NOWAIT)) != 0) {
- aprint_error_dev(sc->sc_dev, "can't load rx DMA map, error = %d\n",
+ aprint_error_dev(self, "can't load rx DMA map, error = %d\n",
ret);
goto fail8;
}
if (capi_ll_attach(&sc->sc_capi, device_xname(sc->sc_dev), pp->name)) {
- aprint_error_dev(sc->sc_dev, "capi attach failed\n");
+ aprint_error_dev(self, "capi attach failed\n");
goto fail9;
}
return;
diff --git a/sys/dev/pci/if_vte.c b/sys/dev/pci/if_vte.c
index 8bb3668af93..f483fba1c76 100644
--- a/sys/dev/pci/if_vte.c
+++ b/sys/dev/pci/if_vte.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vte.c,v 1.14 2016/06/10 13:27:14 ozaki-r Exp $ */
+/* $NetBSD: if_vte.c,v 1.15 2016/07/11 11:31:51 msaitoh Exp $ */
/*
* Copyright (c) 2011 Manuel Bouyer. All rights reserved.
@@ -55,7 +55,7 @@
/* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.14 2016/06/10 13:27:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.15 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -222,10 +222,11 @@ vte_attach(device_t parent, device_t self, void *aux)
/* Map and establish interrupts */
if (pci_intr_map(pa, &intrhandle)) {
- aprint_error_dev(self, "couldn't map interrupt\n");
- return;
+ aprint_error_dev(self, "couldn't map interrupt\n");
+ return;
}
- intrstr = pci_intr_string(pa->pa_pc, intrhandle, intrbuf, sizeof(intrbuf));
+ intrstr = pci_intr_string(pa->pa_pc, intrhandle, intrbuf,
+ sizeof(intrbuf));
sc->vte_ih = pci_intr_establish(pa->pa_pc, intrhandle, IPL_NET,
vte_intr, sc);
if (sc->vte_ih == NULL) {
@@ -260,13 +261,13 @@ vte_attach(device_t parent, device_t self, void *aux)
strlcpy(ifp->if_xname, device_xname(self), IFNAMSIZ);
ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_NOTRAILERS|IFF_MULTICAST;
- ifp->if_ioctl = vte_ifioctl;
- ifp->if_start = vte_ifstart;
+ ifp->if_ioctl = vte_ifioctl;
+ ifp->if_start = vte_ifstart;
ifp->if_watchdog = vte_ifwatchdog;
- ifp->if_init = vte_init;
- ifp->if_stop = vte_stop;
+ ifp->if_init = vte_init;
+ ifp->if_stop = vte_stop;
ifp->if_timer = 0;
- IFQ_SET_READY(&ifp->if_snd);
+ IFQ_SET_READY(&ifp->if_snd);
if_attach(ifp);
ether_ifattach(&(sc)->vte_if, (sc)->vte_eaddr);
@@ -1077,7 +1078,9 @@ vte_newbuf(struct vte_softc *sc, struct vte_rxdesc *rxd)
htole32(rxd->rx_dmamap->dm_segs[0].ds_addr);
rxd->rx_desc->drlen = htole16(
VTE_RX_LEN(rxd->rx_dmamap->dm_segs[0].ds_len));
- DPRINTF(("rx data %p mbuf %p buf 0x%x/0x%x\n", rxd, m, (u_int)rxd->rx_dmamap->dm_segs[0].ds_addr, rxd->rx_dmamap->dm_segs[0].ds_len));
+ DPRINTF(("rx data %p mbuf %p buf 0x%x/0x%x\n", rxd, m,
+ (u_int)rxd->rx_dmamap->dm_segs[0].ds_addr,
+ rxd->rx_dmamap->dm_segs[0].ds_len));
rxd->rx_desc->drst = htole16(VTE_DRST_RX_OWN);
return (0);
@@ -1103,7 +1106,9 @@ vte_rxeof(struct vte_softc *sc)
VTE_DESC_INC(cons, VTE_RX_RING_CNT)) {
rxd = &sc->vte_cdata.vte_rxdesc[cons];
status = le16toh(rxd->rx_desc->drst);
- DPRINTF(("vte_rxoef rxd %d/%p mbuf %p status 0x%x len %d\n", cons, rxd, rxd->rx_m, status, VTE_RX_LEN(le16toh(rxd->rx_desc->drlen))));
+ DPRINTF(("vte_rxoef rxd %d/%p mbuf %p status 0x%x len %d\n",
+ cons, rxd, rxd->rx_m, status,
+ VTE_RX_LEN(le16toh(rxd->rx_desc->drlen))));
if ((status & VTE_DRST_RX_OWN) != 0)
break;
total_len = VTE_RX_LEN(le16toh(rxd->rx_desc->drlen));
@@ -1335,7 +1340,8 @@ vte_init(struct ifnet *ifp)
/* Acknowledge all pending interrupts and clear it. */
CSR_WRITE_2(sc, VTE_MIER, VTE_INTRS);
CSR_WRITE_2(sc, VTE_MISR, 0);
- DPRINTF(("before ipend 0x%x 0x%x\n", CSR_READ_2(sc, VTE_MIER), CSR_READ_2(sc, VTE_MISR)));
+ DPRINTF(("before ipend 0x%x 0x%x\n", CSR_READ_2(sc, VTE_MIER),
+ CSR_READ_2(sc, VTE_MISR)));
sc->vte_flags &= ~VTE_FLAG_LINK;
ifp->if_flags |= IFF_RUNNING;
@@ -1352,7 +1358,8 @@ vte_init(struct ifnet *ifp)
callout_reset(&sc->vte_tick_ch, hz, vte_tick, sc);
- DPRINTF(("ipend 0x%x 0x%x\n", CSR_READ_2(sc, VTE_MIER), CSR_READ_2(sc, VTE_MISR)));
+ DPRINTF(("ipend 0x%x 0x%x\n", CSR_READ_2(sc, VTE_MIER),
+ CSR_READ_2(sc, VTE_MISR)));
splx(s);
return 0;
}
diff --git a/sys/dev/pci/machfb.c b/sys/dev/pci/machfb.c
index 18f27b475f0..88fc6eb8b3c 100644
--- a/sys/dev/pci/machfb.c
+++ b/sys/dev/pci/machfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machfb.c,v 1.91 2013/12/18 11:53:17 macallan Exp $ */
+/* $NetBSD: machfb.c,v 1.92 2016/07/11 11:31:51 msaitoh Exp $ */
/*
* Copyright (c) 2002 Bang Jun-Young
@@ -33,8 +33,8 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0,
- "$NetBSD: machfb.c,v 1.91 2013/12/18 11:53:17 macallan Exp $");
+__KERNEL_RCSID(0,
+ "$NetBSD: machfb.c,v 1.92 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -228,8 +228,8 @@ extern const u_char rasops_cmap[768];
static int mach64_match(device_t, cfdata_t, void *);
static void mach64_attach(device_t, device_t, void *);
-CFATTACH_DECL_NEW(machfb, sizeof(struct mach64_softc), mach64_match, mach64_attach,
- NULL, NULL);
+CFATTACH_DECL_NEW(machfb, sizeof(struct mach64_softc), mach64_match,
+ mach64_attach, NULL, NULL);
static void mach64_init(struct mach64_softc *);
static int mach64_get_memsize(struct mach64_softc *);
@@ -393,7 +393,7 @@ static inline void
regw(struct mach64_softc *sc, uint32_t index, uint32_t data)
{
bus_space_write_4(sc->sc_regt, sc->sc_regh, index + 0x400, data);
- bus_space_barrier(sc->sc_regt, sc->sc_regh, index, 4,
+ bus_space_barrier(sc->sc_regt, sc->sc_regh, index, 4,
BUS_SPACE_BARRIER_WRITE);
}
@@ -401,7 +401,7 @@ static inline void
regws(struct mach64_softc *sc, uint32_t index, uint32_t data)
{
bus_space_write_stream_4(sc->sc_regt, sc->sc_regh, index + 0x400, data);
- bus_space_barrier(sc->sc_regt, sc->sc_regh, index + 0x400, 4,
+ bus_space_barrier(sc->sc_regt, sc->sc_regh, index + 0x400, 4,
BUS_SPACE_BARRIER_WRITE);
}
@@ -409,7 +409,7 @@ static inline void
regwb(struct mach64_softc *sc, uint32_t index, uint8_t data)
{
bus_space_write_1(sc->sc_regt, sc->sc_regh, index + 0x400, data);
- bus_space_barrier(sc->sc_regt, sc->sc_regh, index + 0x400, 1,
+ bus_space_barrier(sc->sc_regt, sc->sc_regh, index + 0x400, 1,
BUS_SPACE_BARRIER_WRITE);
}
@@ -511,7 +511,7 @@ mach64_attach(device_t parent, device_t self, void *aux)
#ifdef MACHFB_DEBUG
printf(prop_dictionary_externalize(device_properties(self)));
#endif
-
+
/* enable memory access */
screg = pci_conf_read(sc->sc_pc, sc->sc_pcitag, PCI_COMMAND_STATUS_REG);
if ((screg & enables) != enables) {
@@ -530,7 +530,7 @@ mach64_attach(device_t parent, device_t self, void *aux)
aprint_debug_dev(sc->sc_dev, "aperture size %08x\n",
(uint32_t)sc->sc_apersize);
- sc->sc_rom.vb_type = PCI_MAPREG_TYPE_ROM;
+ sc->sc_rom.vb_type = PCI_MAPREG_TYPE_ROM;
pci_mapreg_info(sc->sc_pc, sc->sc_pcitag, PCI_MAPREG_ROM,
sc->sc_rom.vb_type, &sc->sc_rom.vb_base,
&sc->sc_rom.vb_size, &sc->sc_rom.vb_flags);
@@ -538,8 +538,8 @@ mach64_attach(device_t parent, device_t self, void *aux)
/* use MMIO register aperture if available */
if ((sc->sc_regbase != 0) && (sc->sc_regbase != 0xffffffff)) {
- if (pci_mapreg_map(pa, MACH64_BAR_MMIO, PCI_MAPREG_TYPE_MEM, 0,
- &sc->sc_regt, &sc->sc_regh, &sc->sc_regbase,
+ if (pci_mapreg_map(pa, MACH64_BAR_MMIO, PCI_MAPREG_TYPE_MEM,
+ 0, &sc->sc_regt, &sc->sc_regh, &sc->sc_regbase,
&sc->sc_regsize) == 0) {
/*
@@ -551,10 +551,10 @@ mach64_attach(device_t parent, device_t self, void *aux)
aprint_normal_dev(sc->sc_dev, "using MMIO aperture\n");
use_mmio = TRUE;
}
- }
+ }
if (!use_mmio) {
- if (bus_space_map(sc->sc_memt, sc->sc_aperbase, sc->sc_apersize,
- BUS_SPACE_MAP_LINEAR, &sc->sc_memh)) {
+ if (bus_space_map(sc->sc_memt, sc->sc_aperbase,
+ sc->sc_apersize, BUS_SPACE_MAP_LINEAR, &sc->sc_memh)) {
panic("%s: failed to map aperture",
device_xname(sc->sc_dev));
}
@@ -690,7 +690,7 @@ mach64_attach(device_t parent, device_t self, void *aux)
/* fill in default_mode if it's empty */
mach64_get_mode(sc, &default_mode);
if (default_mode.dot_clock == 0) {
- memcpy(&default_mode, &mach64_modes[4],
+ memcpy(&default_mode, &mach64_modes[4],
sizeof(default_mode));
}
sc->sc_my_mode = &default_mode;
@@ -698,7 +698,7 @@ mach64_attach(device_t parent, device_t self, void *aux)
}
#else
if (default_mode.dot_clock == 0) {
- memcpy(&default_mode, &mach64_modes[0],
+ memcpy(&default_mode, &mach64_modes[0],
sizeof(default_mode));
}
sc->sc_my_mode = &mach64_modes[0];
@@ -725,7 +725,7 @@ mach64_attach(device_t parent, device_t self, void *aux)
sc->bits_per_pixel);
wsfont_init();
-
+
vcons_init(&sc->vd, sc, &mach64_defaultscreen, &sc->sc_accessops);
sc->vd.init_screen = mach64_init_screen;
@@ -751,7 +751,7 @@ mach64_attach(device_t parent, device_t self, void *aux)
ri->ri_font->fontwidth,
ri->ri_font->fontheight,
defattr);
- wsdisplay_cnattach(&mach64_defaultscreen, ri, 0, 0, defattr);
+ wsdisplay_cnattach(&mach64_defaultscreen, ri, 0, 0, defattr);
} else {
/*
* since we're not the console we can postpone the rest
@@ -782,7 +782,7 @@ mach64_attach(device_t parent, device_t self, void *aux)
vcons_replay_msgbuf(&mach64_console_screen);
machfb_blank(sc, 0); /* unblank the screen */
-
+
aa.console = sc->sc_console;
aa.scrdata = &mach64_screenlist;
aa.accessops = &sc->sc_accessops;
@@ -795,10 +795,10 @@ mach64_attach(device_t parent, device_t self, void *aux)
* so we need to turn them off only when mapping vram in
* WSDISPLAYIO_MODE_DUMB would overlap ( unlikely but far from
* impossible )
- */
+ */
if (use_mmio) {
/*
- * Now that we took over, turn off the aperture registers if we
+ * Now that we took over, turn off the aperture registers if we
* don't use them. Can't do this earlier since on some hardware
* we use firmware calls as early console output which may in
* turn try to access these registers.
@@ -848,12 +848,12 @@ mach64_init_screen(void *cookie, struct vcons_screen *scr, int existing,
device_xname(sc->sc_dev));
}
}
-
+
rasops_init(ri, 0, 0);
ri->ri_caps = WSSCREEN_WSCOLORS;
rasops_reconfig(ri, sc->sc_my_mode->vdisplay / ri->ri_font->fontheight,
sc->sc_my_mode->hdisplay / ri->ri_font->fontwidth);
-
+
/* enable acceleration */
ri->ri_hw = scr;
ri->ri_ops.copyrows = mach64_copyrows;
@@ -1033,7 +1033,7 @@ mach64_modeswitch(struct mach64_softc *sc, struct videomode *mode)
return 1;
aprint_debug("crtc dot clock: %d\n", crtc.dot_clock);
if (crtc.dot_clock == 0) {
- aprint_error("%s: preposterous dot clock (%d)\n",
+ aprint_error("%s: preposterous dot clock (%d)\n",
device_xname(sc->sc_dev), crtc.dot_clock);
return 1;
}
@@ -1287,7 +1287,7 @@ mach64_set_pll(struct mach64_softc *sc, int clock)
aprint_debug("vclk_ctl: %02x\n", vclk_ctl);
vclk_ctl |= PLL_VCLK_RESET;
regwb_pll(sc, PLL_VCLK_CNTL, vclk_ctl);
-
+
regwb_pll(sc, MCLK_FB_DIV, sc->mclk_fb_div);
reg = regrb_pll(sc, VCLK_POST_DIV);
reg &= ~(3 << clockshift);
@@ -1320,16 +1320,16 @@ mach64_init_lut(struct mach64_softc *sc)
}
static int
-mach64_putpalreg(struct mach64_softc *sc, uint8_t index, uint8_t r, uint8_t g,
+mach64_putpalreg(struct mach64_softc *sc, uint8_t index, uint8_t r, uint8_t g,
uint8_t b)
{
sc->sc_cmap_red[index] = r;
sc->sc_cmap_green[index] = g;
sc->sc_cmap_blue[index] = b;
- /*
+ /*
* writing the dac index takes a while, in theory we can poll some
* register to see when it's ready - but we better avoid writing it
- * unnecessarily
+ * unnecessarily
*/
if (index != sc->sc_dacw) {
regwb(sc, DAC_MASK, 0xff);
@@ -1437,10 +1437,10 @@ mach64_cursor(void *cookie, int on, int row, int col)
struct vcons_screen *scr = ri->ri_hw;
struct mach64_softc *sc = scr->scr_cookie;
int x, y, wi, he;
-
+
wi = ri->ri_font->fontwidth;
he = ri->ri_font->fontheight;
-
+
if ((!sc->sc_locked) && (sc->sc_mode == WSDISPLAYIO_MODE_EMUL)) {
x = ri->ri_ccol * wi + ri->ri_xorigin;
y = ri->ri_crow * he + ri->ri_yorigin;
@@ -1478,7 +1478,7 @@ mach64_putchar_mono(void *cookie, int row, int col, u_int c, long attr)
struct wsdisplay_font *font = PICK_FONT(ri, c);
struct vcons_screen *scr = ri->ri_hw;
struct mach64_softc *sc = scr->scr_cookie;
-
+
if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
int fg, bg, uc;
uint8_t *data;
@@ -1496,7 +1496,7 @@ mach64_putchar_mono(void *cookie, int row, int col, u_int c, long attr)
mach64_rectfill(sc, x, y, wi, he, bg);
} else {
uc = c - font->firstchar;
- data = (uint8_t *)font->data + uc *
+ data = (uint8_t *)font->data + uc *
ri->ri_fontscale;
mach64_setup_mono(sc, x, y, wi, he, fg, bg);
@@ -1518,7 +1518,7 @@ mach64_putchar_aa8(void *cookie, int row, int col, u_int c, long attr)
uint8_t *data8;
int rv = 0, cnt = 0;
- if (sc->sc_mode != WSDISPLAYIO_MODE_EMUL)
+ if (sc->sc_mode != WSDISPLAYIO_MODE_EMUL)
return;
if (!CHAR_IN_FONT(c, font))
@@ -1591,8 +1591,8 @@ mach64_putchar_aa8(void *cookie, int row, int col, u_int c, long attr)
if ((i & 3) == 3) {
regws(sc, HOST_DATA0, latch);
/*
- * not strictly necessary, old data should be shifted
- * out
+ * not strictly necessary, old data should be shifted
+ * out
*/
latch = 0;
cnt++;
@@ -1605,7 +1605,7 @@ mach64_putchar_aa8(void *cookie, int row, int col, u_int c, long attr)
}
/* if we have pixels left in latch write them out */
if ((i & 3) != 0) {
- latch = latch << ((4 - (i & 3)) << 3);
+ latch = latch << ((4 - (i & 3)) << 3);
regws(sc, HOST_DATA0, latch);
}
@@ -1621,7 +1621,7 @@ mach64_copycols(void *cookie, int row, int srccol, int dstcol, int ncols)
struct vcons_screen *scr = ri->ri_hw;
struct mach64_softc *sc = scr->scr_cookie;
int32_t xs, xd, y, width, height;
-
+
if ((sc->sc_locked == 0) && (sc->sc_mode == WSDISPLAYIO_MODE_EMUL)) {
xs = ri->ri_xorigin + ri->ri_font->fontwidth * srccol;
xd = ri->ri_xorigin + ri->ri_font->fontwidth * dstcol;
@@ -1639,7 +1639,7 @@ mach64_erasecols(void *cookie, int row, int startcol, int ncols, long fillattr)
struct vcons_screen *scr = ri->ri_hw;
struct mach64_softc *sc = scr->scr_cookie;
int32_t x, y, width, height, fg, bg, ul;
-
+
if ((sc->sc_locked == 0) && (sc->sc_mode == WSDISPLAYIO_MODE_EMUL)) {
x = ri->ri_xorigin + ri->ri_font->fontwidth * startcol;
y = ri->ri_yorigin + ri->ri_font->fontheight * row;
@@ -1676,10 +1676,10 @@ mach64_eraserows(void *cookie, int row, int nrows, long fillattr)
struct vcons_screen *scr = ri->ri_hw;
struct mach64_softc *sc = scr->scr_cookie;
int32_t x, y, width, height, fg, bg, ul;
-
+
if ((sc->sc_locked == 0) && (sc->sc_mode == WSDISPLAYIO_MODE_EMUL)) {
if ((row == 0) && (nrows == ri->ri_rows)) {
- /* clear full screen */
+ /* clear full screen */
x = 0;
y = 0;
width = sc->virt_x;
@@ -1697,11 +1697,12 @@ mach64_eraserows(void *cookie, int row, int nrows, long fillattr)
}
static void
-mach64_bitblt(void *cookie, int xs, int ys, int xd, int yd, int width, int height, int rop)
+mach64_bitblt(void *cookie, int xs, int ys, int xd, int yd, int width,
+ int height, int rop)
{
struct mach64_softc *sc = cookie;
uint32_t dest_ctl = 0;
-
+
wait_for_fifo(sc, 10);
regw(sc, DP_PIX_WIDTH, DST_8BPP | SRC_8BPP | HOST_8BPP);
regw(sc, DP_SRC, FRGD_SRC_BLIT);
@@ -1732,7 +1733,7 @@ mach64_bitblt(void *cookie, int xs, int ys, int xd, int yd, int width, int heigh
}
static void
-mach64_setup_mono(struct mach64_softc *sc, int xd, int yd, int width,
+mach64_setup_mono(struct mach64_softc *sc, int xd, int yd, int width,
int height, uint32_t fg, uint32_t bg)
{
wait_for_idle(sc);
@@ -1760,7 +1761,7 @@ mach64_feed_bytes(struct mach64_softc *sc, int count, uint8_t *data)
uint32_t latch = 0, bork;
int shift = 0;
int reg = 0;
-
+
for (i = 0; i < count; i++) {
bork = data[i];
latch |= (bork << shift);
@@ -1778,7 +1779,7 @@ mach64_feed_bytes(struct mach64_softc *sc, int count, uint8_t *data)
static void
-mach64_rectfill(struct mach64_softc *sc, int x, int y, int width, int height,
+mach64_rectfill(struct mach64_softc *sc, int x, int y, int width, int height,
int colour)
{
wait_for_fifo(sc, 11);
@@ -1828,10 +1829,10 @@ mach64_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
struct mach64_softc *sc = vd->cookie;
struct wsdisplay_fbinfo *wdf;
struct vcons_screen *ms = vd->active;
-
+
switch (cmd) {
case WSDISPLAYIO_GTYPE:
- *(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
+ *(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
return 0;
case WSDISPLAYIO_LINEBYTES:
@@ -1845,15 +1846,15 @@ mach64_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
wdf->depth = sc->bits_per_pixel;
wdf->cmsize = 256;
return 0;
-
+
case WSDISPLAYIO_GETCMAP:
- return mach64_getcmap(sc,
+ return mach64_getcmap(sc,
(struct wsdisplay_cmap *)data);
case WSDISPLAYIO_PUTCMAP:
- return mach64_putcmap(sc,
+ return mach64_putcmap(sc,
(struct wsdisplay_cmap *)data);
-
+
/* PCI config read/write passthrough. */
case PCI_IOC_CFGREAD:
case PCI_IOC_CFGWRITE:
@@ -1904,8 +1905,8 @@ mach64_mmap(void *v, void *vs, off_t offset, int prot)
paddr_t pa;
if (sc->sc_mode == WSDISPLAYIO_MODE_DUMBFB) {
- /*
- *'regular' framebuffer mmap()ing
+ /*
+ *'regular' framebuffer mmap()ing
*/
if (offset < (sc->memsize * 1024)) {
pa = bus_space_mmap(sc->sc_memt, sc->sc_aperbase,
@@ -1922,23 +1923,23 @@ mach64_mmap(void *v, void *vs, off_t offset, int prot)
NULL, NULL, NULL, NULL) != 0) {
return -1;
}
- if ((offset >= sc->sc_aperbase) &&
+ if ((offset >= sc->sc_aperbase) &&
(offset < (sc->sc_aperbase + sc->sc_apersize))) {
- pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
+ pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
BUS_SPACE_MAP_LINEAR);
return pa;
}
- if ((offset >= sc->sc_regbase) &&
+ if ((offset >= sc->sc_regbase) &&
(offset < (sc->sc_regbase + sc->sc_regsize))) {
- pa = bus_space_mmap(sc->sc_regt, offset, 0, prot,
+ pa = bus_space_mmap(sc->sc_regt, offset, 0, prot,
BUS_SPACE_MAP_LINEAR);
return pa;
}
- if ((offset >= sc->sc_rom.vb_base) &&
+ if ((offset >= sc->sc_rom.vb_base) &&
(offset < (sc->sc_rom.vb_base + sc->sc_rom.vb_size))) {
- pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
+ pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
BUS_SPACE_MAP_LINEAR);
return pa;
}
diff --git a/sys/dev/pci/njs_pci.c b/sys/dev/pci/njs_pci.c
index 8f71a0e2419..d7bc6fc0eb2 100644
--- a/sys/dev/pci/njs_pci.c
+++ b/sys/dev/pci/njs_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: njs_pci.c,v 1.10 2014/03/29 19:28:25 christos Exp $ */
+/* $NetBSD: njs_pci.c,v 1.11 2016/07/11 11:31:51 msaitoh Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: njs_pci.c,v 1.10 2014/03/29 19:28:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: njs_pci.c,v 1.11 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -172,7 +172,8 @@ njs_pci_attach(device_t parent, device_t self, void *aux)
#endif
sc->sc_flags = NJSC32_IO_MAPPED;
} else {
- aprint_error_dev(self, "unable to map device registers\n");
+ aprint_error_dev(self,
+ "unable to map device registers\n");
return;
}
}
diff --git a/sys/dev/pci/piixpm.c b/sys/dev/pci/piixpm.c
index 5020f038feb..52dd27137d7 100644
--- a/sys/dev/pci/piixpm.c
+++ b/sys/dev/pci/piixpm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.48 2016/07/10 04:44:47 pgoyette Exp $ */
+/* $NetBSD: piixpm.c,v 1.49 2016/07/11 11:31:51 msaitoh Exp $ */
/* $OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $ */
/*
@@ -22,7 +22,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.48 2016/07/10 04:44:47 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.49 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -195,7 +195,8 @@ piixpm_attach(device_t parent, device_t self, void *aux)
base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_PM_BASE);
if (bus_space_map(sc->sc_pm_iot, PCI_MAPREG_IO_ADDR(base),
PIIX_PM_SIZE, 0, &sc->sc_pm_ioh)) {
- aprint_error_dev(self, "can't map power management I/O space\n");
+ aprint_error_dev(self,
+ "can't map power management I/O space\n");
goto nopowermanagement;
}
@@ -251,9 +252,10 @@ nopowermanagement:
} else if ((conf & PIIX_SMB_HOSTC_INTMASK) == PIIX_SMB_HOSTC_IRQ) {
/* Install interrupt handler */
if (pci_intr_map(pa, &ih) == 0) {
- intrstr = pci_intr_string(pa->pa_pc, ih, intrbuf, sizeof(intrbuf));
- sc->sc_smb_ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO,
- piixpm_intr, sc);
+ intrstr = pci_intr_string(pa->pa_pc, ih, intrbuf,
+ sizeof(intrbuf));
+ sc->sc_smb_ih = pci_intr_establish(pa->pa_pc, ih,
+ IPL_BIO, piixpm_intr, sc);
if (sc->sc_smb_ih != NULL) {
aprint_normal("interrupting at %s", intrstr);
sc->sc_poll = 0;
@@ -380,7 +382,8 @@ piixpm_sb800_init(struct piixpm_softc *sc)
aprint_debug_dev(sc->sc_dev, "SMBus @ 0x%04x\n", base_addr);
- bus_space_write_1(iot, ioh, PIIXPM_INDIRECTIO_INDEX, SB800_PM_SMBUS0SELEN);
+ bus_space_write_1(iot, ioh, PIIXPM_INDIRECTIO_INDEX,
+ SB800_PM_SMBUS0SELEN);
bus_space_write_1(iot, ioh, PIIXPM_INDIRECTIO_DATA, 1); /* SMBUS0SEL */
if (bus_space_map(iot, PCI_MAPREG_IO_ADDR(base_addr),
@@ -471,8 +474,8 @@ piixpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
device_xname(sc->sc_dev), op, addr, cmdlen, len, flags));
/* Clear status bits */
- bus_space_write_1(sc->sc_smb_iot, sc->sc_smb_ioh, PIIX_SMB_HS,
- PIIX_SMB_HS_INTR | PIIX_SMB_HS_DEVERR |
+ bus_space_write_1(sc->sc_smb_iot, sc->sc_smb_ioh, PIIX_SMB_HS,
+ PIIX_SMB_HS_INTR | PIIX_SMB_HS_DEVERR |
PIIX_SMB_HS_BUSERR | PIIX_SMB_HS_FAILED);
bus_space_barrier(sc->sc_smb_iot, sc->sc_smb_ioh, PIIX_SMB_HS, 1,
BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
@@ -583,7 +586,8 @@ timeout:
DELAY(PIIXPM_DELAY);
st = bus_space_read_1(sc->sc_smb_iot, sc->sc_smb_ioh, PIIX_SMB_HS);
if ((st & PIIX_SMB_HS_FAILED) == 0)
- aprint_error_dev(sc->sc_dev, "transaction abort failed, status 0x%x\n", st);
+ aprint_error_dev(sc->sc_dev,
+ "transaction abort failed, status 0x%x\n", st);
bus_space_write_1(sc->sc_smb_iot, sc->sc_smb_ioh, PIIX_SMB_HS, st);
/*
* CSB5 needs hard reset to unlock the smbus after timeout.
diff --git a/sys/dev/pci/voodoofb.c b/sys/dev/pci/voodoofb.c
index 699493475bc..2473feae5fc 100644
--- a/sys/dev/pci/voodoofb.c
+++ b/sys/dev/pci/voodoofb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: voodoofb.c,v 1.50 2015/09/16 16:52:54 macallan Exp $ */
+/* $NetBSD: voodoofb.c,v 1.51 2016/07/11 11:31:51 msaitoh Exp $ */
/*
* Copyright (c) 2005, 2006, 2012 Michael Lorenz
@@ -25,14 +25,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * A console driver for 3Dfx Voodoo3 graphics boards
- * Thanks to Andreas Drewke (andreas_dr@gmx.de) for his Voodoo3 driver for BeOS
+/*
+ * A console driver for 3Dfx Voodoo3 graphics boards
+ * Thanks to Andreas Drewke (andreas_dr@gmx.de) for his Voodoo3 driver for BeOS
* which I used as reference / documentation
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.50 2015/09/16 16:52:54 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.51 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -72,12 +72,12 @@ struct voodoofb_softc {
bus_space_tag_t sc_memt;
bus_space_tag_t sc_iot;
- bus_space_handle_t sc_memh;
+ bus_space_handle_t sc_memh;
bus_space_tag_t sc_regt;
bus_space_tag_t sc_ioregt;
bus_space_handle_t sc_regh;
- bus_space_handle_t sc_ioregh;
+ bus_space_handle_t sc_ioregh;
bus_addr_t sc_regs, sc_fb, sc_ioreg;
bus_size_t sc_regsize, sc_fbsize, sc_ioregsize;
@@ -87,7 +87,7 @@ struct voodoofb_softc {
#define MAX_CLOCK_V3 300000 /* Voodoo3 */
#define MAX_CLOCK_V45 350000 /* Voodoo4/5 (not yet) */
uint32_t sc_max_clock;
-
+
size_t sc_memsize;
int sc_memtype;
@@ -113,10 +113,10 @@ struct voodoofb_softc {
int sc_mode;
uint32_t sc_bg;
-
+
u_char sc_cmap_red[256];
u_char sc_cmap_green[256];
- u_char sc_cmap_blue[256];
+ u_char sc_cmap_blue[256];
int sc_dacw;
struct vcons_data vd;
@@ -128,7 +128,7 @@ struct voodoo_regs {
uint8_t vr_attr[21];
uint8_t vr_seq[5];
};
-
+
static struct vcons_screen voodoofb_console_screen;
static int voodoofb_match(device_t, cfdata_t, void *);
@@ -138,11 +138,11 @@ static int voodoofb_drm_print(void *, const char *);
static int voodoofb_drm_unmap(struct voodoofb_softc *);
static int voodoofb_drm_map(struct voodoofb_softc *);
-CFATTACH_DECL_NEW(voodoofb, sizeof(struct voodoofb_softc), voodoofb_match,
+CFATTACH_DECL_NEW(voodoofb, sizeof(struct voodoofb_softc), voodoofb_match,
voodoofb_attach, NULL, NULL);
static bool voodoofb_is_console(struct voodoofb_softc *);
-static void voodoofb_init(struct voodoofb_softc *);
+static void voodoofb_init(struct voodoofb_softc *);
static void voodoofb_cursor(void *, int, int, int);
static void voodoofb_putchar(void *, int, int, u_int, long);
@@ -169,9 +169,9 @@ static void voodoofb_bitblt(struct voodoofb_softc *, int, int, int, int,
static void voodoofb_rectfill(struct voodoofb_softc *, int, int, int, int,
int);
static void voodoofb_rectinvert(struct voodoofb_softc *, int, int, int,
- int);
+ int);
static void voodoofb_setup_mono(struct voodoofb_softc *, int, int, int,
- int, uint32_t, uint32_t);
+ int, uint32_t, uint32_t);
static void voodoofb_feed_line(struct voodoofb_softc *, int, uint8_t *);
static void voodoofb_wait_idle(struct voodoofb_softc *);
@@ -268,7 +268,7 @@ voodoo3_write32s(struct voodoofb_softc *sc, uint32_t reg, uint32_t val)
bus_space_write_stream_4(sc->sc_regt, sc->sc_regh, reg, val);
}
static inline uint32_t
-voodoo3_read32(struct voodoofb_softc *sc, uint32_t reg)
+voodoo3_read32(struct voodoofb_softc *sc, uint32_t reg)
{
return bus_space_read_4(sc->sc_regt, sc->sc_regh, reg);
}
@@ -298,7 +298,7 @@ static inline void
voodoo3_write_attr(struct voodoofb_softc *sc, uint8_t reg, uint8_t val)
{
uint8_t index;
-
+
(void)bus_space_read_1(sc->sc_ioregt, sc->sc_ioregh, IS1_R - 0x300);
index = bus_space_read_1(sc->sc_ioregt, sc->sc_ioregh, ATT_IW - 0x300);
bus_space_write_1(sc->sc_ioregt, sc->sc_ioregh, ATT_IW - 0x300, reg);
@@ -308,13 +308,13 @@ voodoo3_write_attr(struct voodoofb_softc *sc, uint8_t reg, uint8_t val)
static inline void
vga_outb(struct voodoofb_softc *sc, uint32_t reg, uint8_t val)
-{
- bus_space_write_1(sc->sc_ioregt, sc->sc_ioregh, reg - 0x300, val);
+{
+ bus_space_write_1(sc->sc_ioregt, sc->sc_ioregh, reg - 0x300, val);
}
/* wait until there's room for len bytes in the FIFO */
static inline void
-voodoo3_make_room(struct voodoofb_softc *sc, int len)
+voodoo3_make_room(struct voodoofb_softc *sc, int len)
{
while ((voodoo3_read32(sc, STATUS) & 0x1f) < len);
}
@@ -341,11 +341,11 @@ voodoofb_match(device_t parent, cfdata_t match, void *aux)
if (PCI_CLASS(pa->pa_class) != PCI_CLASS_DISPLAY ||
PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_DISPLAY_VGA)
return 0;
- if ((PCI_VENDOR(pa->pa_id)==PCI_VENDOR_3DFX) &&
+ if ((PCI_VENDOR(pa->pa_id)==PCI_VENDOR_3DFX) &&
(PCI_PRODUCT(pa->pa_id)>=PCI_PRODUCT_3DFX_VOODOO3))
return 100;
- if ((PCI_VENDOR(pa->pa_id)==PCI_VENDOR_3DFX) &&
+ if ((PCI_VENDOR(pa->pa_id)==PCI_VENDOR_3DFX) &&
(PCI_PRODUCT(pa->pa_id)>=PCI_PRODUCT_3DFX_BANSHEE))
return 100;
return 0;
@@ -354,7 +354,7 @@ voodoofb_match(device_t parent, cfdata_t match, void *aux)
static void
voodoofb_attach(device_t parent, device_t self, void *aux)
{
- struct voodoofb_softc *sc = device_private(self);
+ struct voodoofb_softc *sc = device_private(self);
struct pci_attach_args *pa = aux;
struct wsemuldisplaydev_attach_args aa;
struct rasops_info *ri;
@@ -386,8 +386,8 @@ voodoofb_attach(device_t parent, device_t self, void *aux)
sc->sc_max_clock = MAX_CLOCK_V3;
/* the framebuffer */
- if (pci_mapreg_info(sc->sc_pc, sc->sc_pcitag, 0x14, PCI_MAPREG_TYPE_MEM,
- &sc->sc_fb, &sc->sc_fbsize, &flags)) {
+ if (pci_mapreg_info(sc->sc_pc, sc->sc_pcitag, 0x14,
+ PCI_MAPREG_TYPE_MEM, &sc->sc_fb, &sc->sc_fbsize, &flags)) {
aprint_error_dev(self, "failed to map the frame buffer.\n");
}
sc->sc_memsize = sc->sc_fbsize >> 1; /* VRAM aperture is 2x VRAM */
@@ -395,7 +395,8 @@ voodoofb_attach(device_t parent, device_t self, void *aux)
/* memory-mapped registers */
if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_regt, &sc->sc_regh, &sc->sc_regs, &sc->sc_regsize)) {
- aprint_error_dev(self, "failed to map memory-mapped registers.\n");
+ aprint_error_dev(self,
+ "failed to map memory-mapped registers.\n");
}
/* IO-mapped registers */
@@ -406,10 +407,10 @@ voodoofb_attach(device_t parent, device_t self, void *aux)
}
sc->sc_is_mapped = TRUE;
voodoofb_init(sc);
-
+
/* we should read these from the chip instead of depending on OF */
width = height = -1;
-
+
dict = device_properties(self);
if (!prop_dictionary_get_uint32(dict, "width", &width)) {
aprint_error_dev(self, "no width property\n");
@@ -474,12 +475,12 @@ voodoofb_attach(device_t parent, device_t self, void *aux)
printf("%s: %d MB aperture at 0x%08x, %d MB registers at 0x%08x\n",
device_xname(self), (u_int)(sc->sc_fbsize >> 20),
- (u_int)sc->sc_fb, (u_int)(sc->sc_regsize >> 20),
+ (u_int)sc->sc_fb, (u_int)(sc->sc_regsize >> 20),
(u_int)sc->sc_regs);
#ifdef VOODOOFB_DEBUG
printf("fb: %08lx\n", (ulong)ri->ri_bits);
#endif
-
+
if (sc->sc_bits_per_pixel == 8) {
uint8_t tmp;
for (i = 0; i < 256; i++) {
@@ -524,7 +525,7 @@ voodoofb_attach(device_t parent, device_t self, void *aux)
}
intrstr = pci_intr_string(sc->sc_pc, ih, intrbuf, sizeof(intrbuf));
- sc->sc_ih = pci_intr_establish(sc->sc_pc, ih, IPL_NET, voodoofb_intr,
+ sc->sc_ih = pci_intr_establish(sc->sc_pc, ih, IPL_NET, voodoofb_intr,
sc);
if (sc->sc_ih == NULL) {
aprint_error_dev(self, "failed to establish interrupt");
@@ -573,7 +574,7 @@ voodoofb_drm_unmap(struct voodoofb_softc *sc)
bus_space_unmap(sc->sc_regt, sc->sc_regh, sc->sc_regsize);
sc->sc_is_mapped = FALSE;
-
+
return 0;
}
@@ -609,11 +610,11 @@ voodoofb_drm_map(struct voodoofb_softc *sc)
}
static int
-voodoofb_putpalreg(struct voodoofb_softc *sc, uint8_t index, uint8_t r,
+voodoofb_putpalreg(struct voodoofb_softc *sc, uint8_t index, uint8_t r,
uint8_t g, uint8_t b)
{
uint32_t color;
-
+
sc->sc_cmap_red[index] = r;
sc->sc_cmap_green[index] = g;
sc->sc_cmap_blue[index] = b;
@@ -637,7 +638,7 @@ voodoofb_putcmap(struct voodoofb_softc *sc, struct wsdisplay_cmap *cm)
#ifdef VOODOOFB_DEBUG
printf("putcmap: %d %d\n",index, count);
-#endif
+#endif
if (cm->index >= 256 || cm->count > 256 ||
(cm->index + cm->count) > 256)
return EINVAL;
@@ -658,7 +659,7 @@ voodoofb_putcmap(struct voodoofb_softc *sc, struct wsdisplay_cmap *cm)
r = &sc->sc_cmap_red[index];
g = &sc->sc_cmap_green[index];
b = &sc->sc_cmap_blue[index];
-
+
for (i = 0; i < count; i++) {
voodoofb_putpalreg(sc, index, *r, *g, *b);
index++;
@@ -676,7 +677,7 @@ voodoofb_getcmap(struct voodoofb_softc *sc, struct wsdisplay_cmap *cm)
if (index >= 255 || count > 256 || index + count > 256)
return EINVAL;
-
+
error = copyout(&sc->sc_cmap_red[index], cm->red, count);
if (error)
return error;
@@ -718,10 +719,10 @@ voodoofb_cursor(void *cookie, int on, int row, int col)
struct vcons_screen *scr = ri->ri_hw;
struct voodoofb_softc *sc = scr->scr_cookie;
int x, y, wi, he;
-
+
wi = ri->ri_font->fontwidth;
he = ri->ri_font->fontheight;
-
+
if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
x = ri->ri_ccol * wi + ri->ri_xorigin;
y = ri->ri_crow * he + ri->ri_yorigin;
@@ -779,9 +780,9 @@ voodoofb_putchar(void *cookie, int row, int col, u_int c, long attr)
voodoofb_rectfill(sc, x, y, wi, he, bg);
} else {
uc = c - font->firstchar;
- data = (uint8_t *)font->data + uc *
+ data = (uint8_t *)font->data + uc *
ri->ri_fontscale;
- voodoofb_setup_mono(sc, x, y, wi, he, fg, bg);
+ voodoofb_setup_mono(sc, x, y, wi, he, fg, bg);
for (i = 0; i < he; i++) {
voodoofb_feed_line(sc, font->stride, data);
data += font->stride;
@@ -827,12 +828,13 @@ voodoofb_putchar_aa(void *cookie, int row, int col, u_int c, long attr)
voodoo3_write32(sc, SRCBASE, offset);
voodoo3_write32(sc, DSTBASE, 0);
voodoo3_write32(sc, SRCFORMAT, sc->sc_fmt);
- voodoo3_write32(sc, DSTFORMAT, sc->sc_linebytes | FMT_8BIT);
+ voodoo3_write32(sc, DSTFORMAT,
+ sc->sc_linebytes | FMT_8BIT);
voodoo3_write32(sc, DSTSIZE, wi | (he << 16));
voodoo3_write32(sc, DSTXY, x | (y << 16));
voodoo3_write32(sc, SRCXY, 0);
- voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_S2S_BITBLT |
- (ROP_COPY << 24) | SST_2D_GO);
+ voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_S2S_BITBLT
+ | (ROP_COPY << 24) | SST_2D_GO);
return;
} else {
int slot = sc->sc_usedglyphs;
@@ -850,7 +852,7 @@ voodoofb_putchar_aa(void *cookie, int row, int col, u_int c, long attr)
voodoo3_write32(sc, DSTSIZE, wi | (he << 16));
voodoo3_write32(sc, DSTXY, x | (y << 16));
voodoo3_write32(sc, SRCXY, 0);
- voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_H2S_BITBLT |
+ voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_H2S_BITBLT |
(ROP_COPY << 24) | SST_2D_GO);
/*
@@ -889,8 +891,8 @@ voodoofb_putchar_aa(void *cookie, int row, int col, u_int c, long attr)
if ((i & 3) == 3) {
voodoo3_write32s(sc, LAUNCH_2D, latch);
/*
- * not strictly necessary, old data should be shifted
- * out
+ * not strictly necessary, old data should be shifted
+ * out
*/
latch = 0;
/*
@@ -909,7 +911,7 @@ voodoofb_putchar_aa(void *cookie, int row, int col, u_int c, long attr)
}
/* if we have pixels left in latch write them out */
if ((i & 3) != 0) {
- latch = latch << ((4 - (i & 3)) << 3);
+ latch = latch << ((4 - (i & 3)) << 3);
voodoo3_write32s(sc, LAUNCH_2D, latch);
}
if (save_offset != 0) {
@@ -922,7 +924,7 @@ voodoofb_putchar_aa(void *cookie, int row, int col, u_int c, long attr)
voodoo3_write32(sc, DSTSIZE, wi | (he << 16));
voodoo3_write32(sc, DSTXY, 0);
voodoo3_write32(sc, SRCXY, x | (y << 16));
- voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_S2S_BITBLT |
+ voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_S2S_BITBLT |
(ROP_COPY << 24) | SST_2D_GO);
}
}
@@ -934,33 +936,33 @@ voodoofb_copycols(void *cookie, int row, int srccol, int dstcol, int ncols)
struct vcons_screen *scr = ri->ri_hw;
struct voodoofb_softc *sc = scr->scr_cookie;
int32_t xs, xd, y, width, height;
-
+
if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
xs = ri->ri_xorigin + ri->ri_font->fontwidth * srccol;
xd = ri->ri_xorigin + ri->ri_font->fontwidth * dstcol;
y = ri->ri_yorigin + ri->ri_font->fontheight * row;
width = ri->ri_font->fontwidth * ncols;
- height = ri->ri_font->fontheight;
+ height = ri->ri_font->fontheight;
voodoofb_bitblt(sc, xs, y, xd, y, width, height);
}
}
static void
-voodoofb_erasecols(void *cookie, int row, int startcol, int ncols,
+voodoofb_erasecols(void *cookie, int row, int startcol, int ncols,
long fillattr)
{
struct rasops_info *ri = cookie;
struct vcons_screen *scr = ri->ri_hw;
struct voodoofb_softc *sc = scr->scr_cookie;
int32_t x, y, width, height, fg, bg, ul;
-
+
if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
x = ri->ri_xorigin + ri->ri_font->fontwidth * startcol;
y = ri->ri_yorigin + ri->ri_font->fontheight * row;
width = ri->ri_font->fontwidth * ncols;
- height = ri->ri_font->fontheight;
+ height = ri->ri_font->fontheight;
rasops_unpack_attr(fillattr, &fg, &bg, &ul);
-
+
voodoofb_rectfill(sc, x, y, width, height, ri->ri_devcmap[bg]);
}
}
@@ -978,7 +980,7 @@ voodoofb_copyrows(void *cookie, int srcrow, int dstrow, int nrows)
ys = ri->ri_yorigin + ri->ri_font->fontheight * srcrow;
yd = ri->ri_yorigin + ri->ri_font->fontheight * dstrow;
width = ri->ri_emuwidth;
- height = ri->ri_font->fontheight * nrows;
+ height = ri->ri_font->fontheight * nrows;
voodoofb_bitblt(sc, x, ys, x, yd, width, height);
}
}
@@ -1001,7 +1003,7 @@ voodoofb_eraserows(void *cookie, int row, int nrows, long fillattr)
x = ri->ri_xorigin;
y = ri->ri_yorigin + ri->ri_font->fontheight * row;
width = ri->ri_emuwidth;
- height = ri->ri_font->fontheight * nrows;
+ height = ri->ri_font->fontheight * nrows;
voodoofb_rectfill(sc, x, y, width, height,
ri->ri_devcmap[bg]);
}
@@ -1009,18 +1011,19 @@ voodoofb_eraserows(void *cookie, int row, int nrows, long fillattr)
}
static void
-voodoofb_bitblt(struct voodoofb_softc *sc, int xs, int ys, int xd, int yd, int width, int height)
+voodoofb_bitblt(struct voodoofb_softc *sc, int xs, int ys, int xd, int yd,
+ int width, int height)
{
uint32_t fmt, blitcmd;
-
- fmt = sc->sc_linebytes | ((sc->sc_bits_per_pixel +
+
+ fmt = sc->sc_linebytes | ((sc->sc_bits_per_pixel +
((sc->sc_bits_per_pixel == 8) ? 0 : 8)) << 13);
blitcmd = COMMAND_2D_S2S_BITBLT | (ROP_COPY << 24);
if (xs <= xd) {
blitcmd |= BIT(14);
- xs += (width - 1);
- xd += (width - 1);
+ xs += (width - 1);
+ xd += (width - 1);
}
if (ys <= yd) {
blitcmd |= BIT(15);
@@ -1028,24 +1031,24 @@ voodoofb_bitblt(struct voodoofb_softc *sc, int xs, int ys, int xd, int yd, int w
yd += (height - 1);
}
voodoo3_make_room(sc, 8);
-
+
voodoo3_write32(sc, SRCBASE, 0);
voodoo3_write32(sc, DSTBASE, 0);
voodoo3_write32(sc, SRCFORMAT, fmt);
voodoo3_write32(sc, DSTFORMAT, fmt);
voodoo3_write32(sc, DSTSIZE, width | (height << 16));
voodoo3_write32(sc, DSTXY, xd | (yd << 16));
- voodoo3_write32(sc, SRCXY, xs | (ys << 16));
- voodoo3_write32(sc, COMMAND_2D, blitcmd | SST_2D_GO);
+ voodoo3_write32(sc, SRCXY, xs | (ys << 16));
+ voodoo3_write32(sc, COMMAND_2D, blitcmd | SST_2D_GO);
}
-
+
static void
-voodoofb_rectfill(struct voodoofb_softc *sc, int x, int y, int width,
- int height, int colour)
+voodoofb_rectfill(struct voodoofb_softc *sc, int x, int y, int width,
+ int height, int colour)
{
uint32_t fmt;
-
- fmt = sc->sc_linebytes | ((sc->sc_bits_per_pixel +
+
+ fmt = sc->sc_linebytes | ((sc->sc_bits_per_pixel +
((sc->sc_bits_per_pixel == 8) ? 0 : 8)) << 13);
voodoo3_make_room(sc, 7);
@@ -1059,32 +1062,32 @@ voodoofb_rectfill(struct voodoofb_softc *sc, int x, int y, int width,
}
static void
-voodoofb_rectinvert(struct voodoofb_softc *sc, int x, int y, int width,
- int height)
+voodoofb_rectinvert(struct voodoofb_softc *sc, int x, int y, int width,
+ int height)
{
uint32_t fmt;
-
- fmt = sc->sc_linebytes | ((sc->sc_bits_per_pixel +
+
+ fmt = sc->sc_linebytes | ((sc->sc_bits_per_pixel +
((sc->sc_bits_per_pixel == 8) ? 0 : 8)) << 13);
voodoo3_make_room(sc, 8);
voodoo3_write32(sc, SRCBASE, 0);
voodoo3_write32(sc, DSTBASE, 0);
voodoo3_write32(sc, DSTFORMAT, fmt);
- voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_FILLRECT |
+ voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_FILLRECT |
(ROP_INVERT << 24));
voodoo3_write32(sc, DSTSIZE, width | (height << 16));
voodoo3_write32(sc, DSTXY, x | (y << 16));
voodoo3_write32(sc, LAUNCH_2D, x | (y << 16));
}
-static void
-voodoofb_setup_mono(struct voodoofb_softc *sc, int xd, int yd, int width, int height, uint32_t fg,
- uint32_t bg)
+static void
+voodoofb_setup_mono(struct voodoofb_softc *sc, int xd, int yd, int width,
+ int height, uint32_t fg, uint32_t bg)
{
uint32_t dfmt, sfmt = sc->sc_linebytes;
-
- dfmt = sc->sc_linebytes | ((sc->sc_bits_per_pixel +
+
+ dfmt = sc->sc_linebytes | ((sc->sc_bits_per_pixel +
((sc->sc_bits_per_pixel == 8) ? 0 : 8)) << 13);
voodoo3_make_room(sc, 10);
@@ -1096,19 +1099,19 @@ voodoofb_setup_mono(struct voodoofb_softc *sc, int xd, int yd, int width, int he
voodoo3_write32(sc, DSTSIZE, width | (height << 16));
voodoo3_write32(sc, DSTXY, xd | (yd << 16));
voodoo3_write32(sc, SRCXY, 0);
- voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_H2S_BITBLT |
+ voodoo3_write32(sc, COMMAND_2D, COMMAND_2D_H2S_BITBLT |
(ROP_COPY << 24) | SST_2D_GO);
-
+
/* now feed the data into the chip */
}
-static void
+static void
voodoofb_feed_line(struct voodoofb_softc *sc, int count, uint8_t *data)
{
int i;
uint32_t latch = 0, bork;
int shift = 0;
-
+
voodoo3_make_room(sc, count);
for (i = 0; i < count; i++) {
bork = data[i];
@@ -1122,7 +1125,7 @@ voodoofb_feed_line(struct voodoofb_softc *sc, int count, uint8_t *data)
}
if (shift != 24)
voodoo3_write32(sc, LAUNCH_2D, latch);
-}
+}
#if 0
static int
@@ -1158,7 +1161,7 @@ voodoofb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
wdf->depth = ms->scr_ri.ri_depth;
wdf->cmsize = 256;
return 0;
-
+
case WSDISPLAYIO_GETCMAP:
return voodoofb_getcmap(sc,
(struct wsdisplay_cmap *)data);
@@ -1184,12 +1187,12 @@ voodoofb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
if (new_mode == WSDISPLAYIO_MODE_EMUL) {
voodoofb_drm_map(sc);
int i;
-
+
/* restore the palette */
for (i = 0; i < 256; i++) {
- voodoofb_putpalreg(sc,
- i,
- sc->sc_cmap_red[i],
+ voodoofb_putpalreg(sc,
+ i,
+ sc->sc_cmap_red[i],
sc->sc_cmap_green[i],
sc->sc_cmap_blue[i]);
}
@@ -1225,13 +1228,13 @@ voodoofb_mmap(void *v, void *vs, off_t offset, int prot)
struct vcons_data *vd = v;
struct voodoofb_softc *sc = vd->cookie;
paddr_t pa;
-
+
/* 'regular' framebuffer mmap()ing */
if (sc->sc_mode == WSDISPLAYIO_MODE_DUMBFB) {
if (offset < sc->sc_fbsize) {
pa = bus_space_mmap(sc->sc_memt, sc->sc_fb, offset,
- prot,
- BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE);
+ prot,
+ BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE);
return pa;
}
} else if (sc->sc_mode == WSDISPLAYIO_MODE_MAPPED) {
@@ -1246,21 +1249,21 @@ voodoofb_mmap(void *v, void *vs, off_t offset, int prot)
(offset < 0xb0000)) {
pa = bus_space_mmap(sc->sc_memt,
sc->sc_fb, offset - 0xa0000,
- prot, BUS_SPACE_MAP_LINEAR);
+ prot, BUS_SPACE_MAP_LINEAR);
return pa;
}
if ((offset >= sc->sc_fb) &&
(offset < (sc->sc_fb + sc->sc_fbsize))) {
- pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
- BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE);
+ pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
+ BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE);
return pa;
}
- if ((offset >= sc->sc_regs) && (offset < (sc->sc_regs +
+ if ((offset >= sc->sc_regs) && (offset < (sc->sc_regs +
sc->sc_regsize))) {
- pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
- BUS_SPACE_MAP_LINEAR);
+ pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
+ BUS_SPACE_MAP_LINEAR);
return pa;
}
@@ -1271,15 +1274,15 @@ voodoofb_mmap(void *v, void *vs, off_t offset, int prot)
pa = bus_space_mmap(sc->sc_iot,
offset - PCI_MAGIC_IO_RANGE, 0, prot, 0);
return pa;
- }
+ }
#endif
#ifdef OFB_ALLOW_OTHERS
if (offset >= 0x80000000) {
- pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
- BUS_SPACE_MAP_LINEAR);
+ pa = bus_space_mmap(sc->sc_memt, offset, 0, prot,
+ BUS_SPACE_MAP_LINEAR);
return pa;
- }
+ }
#endif
}
return -1;
@@ -1291,13 +1294,13 @@ voodoofb_init_screen(void *cookie, struct vcons_screen *scr,
{
struct voodoofb_softc *sc = cookie;
struct rasops_info *ri = &scr->scr_ri;
-
+
ri->ri_depth = sc->sc_bits_per_pixel;
ri->ri_width = sc->sc_width;
ri->ri_height = sc->sc_height;
ri->ri_stride = sc->sc_linebytes;
ri->ri_flg = RI_CENTER | RI_8BIT_IS_RGB | RI_ENABLE_ALPHA;
-
+
rasops_init(ri, 0, 0);
ri->ri_caps = WSSCREEN_WSCOLORS;
@@ -1361,7 +1364,7 @@ voodoofb_calc_pll(int freq, int *f_out, int isBanshee)
maxm = 24;
} else {
minm = 1;
- maxm = 57;
+ maxm = 57;
/* This used to be 64, alas it seems the last 8 (funny that ?)
* values cause jittering at lower resolutions. I've not done
* any calculations to what the adjustment affects clock ranges,
@@ -1406,11 +1409,11 @@ voodoofb_setup_monitor(struct voodoofb_softc *sc, const struct videomode *vm)
uint32_t horizontal_display_end, horizontal_sync_start,
horizontal_sync_end, horizontal_total,
horizontal_blanking_start, horizontal_blanking_end;
-
+
uint32_t vertical_display_enable_end, vertical_sync_start,
vertical_sync_end, vertical_total, vertical_blanking_start,
vertical_blanking_end;
-
+
uint32_t wd; // CRTC offset
int i;
@@ -1418,9 +1421,9 @@ voodoofb_setup_monitor(struct voodoofb_softc *sc, const struct videomode *vm)
uint8_t misc;
memset(&mod, 0, sizeof(mod));
-
+
mode = &mod;
-
+
wd = (vm->hdisplay >> 3) - 1;
horizontal_display_end = (vm->hdisplay >> 3) - 1;
horizontal_sync_start = (vm->hsync_start >> 3) - 1;
@@ -1435,7 +1438,7 @@ voodoofb_setup_monitor(struct voodoofb_softc *sc, const struct videomode *vm)
vertical_total = vm->vtotal - 2;
vertical_blanking_start = vertical_display_enable_end;
vertical_blanking_end = vertical_total;
-
+
#if 0
misc = 0x0f |
(vm->hdisplay < 400 ? 0xa0 :
@@ -1450,20 +1453,20 @@ voodoofb_setup_monitor(struct voodoofb_softc *sc, const struct videomode *vm)
#ifdef VOODOOFB_DEBUG
printf("misc: %02x\n", misc);
#endif
-#endif
+#endif
mode->vr_seq[0] = 3;
mode->vr_seq[1] = 1;
mode->vr_seq[2] = 8;
mode->vr_seq[3] = 0;
mode->vr_seq[4] = 6;
-
+
/* crtc regs start */
mode->vr_crtc[0] = horizontal_total - 4;
mode->vr_crtc[1] = horizontal_display_end;
mode->vr_crtc[2] = horizontal_blanking_start;
mode->vr_crtc[3] = 0x80 | (horizontal_blanking_end & 0x1f);
mode->vr_crtc[4] = horizontal_sync_start;
-
+
mode->vr_crtc[5] = ((horizontal_blanking_end & 0x20) << 2) |
(horizontal_sync_end & 0x1f);
mode->vr_crtc[6] = vertical_total;
@@ -1475,18 +1478,18 @@ voodoofb_setup_monitor(struct voodoofb_softc *sc, const struct videomode *vm)
((vertical_sync_start & 0x100) >> 6) |
((vertical_display_enable_end & 0x100) >> 7) |
((vertical_total & 0x100) >> 8);
-
+
mode->vr_crtc[8] = 0;
mode->vr_crtc[9] = 0x40 |
((vertical_blanking_start & 0x200) >> 4);
-
+
mode->vr_crtc[10] = 0;
mode->vr_crtc[11] = 0;
mode->vr_crtc[12] = 0;
mode->vr_crtc[13] = 0;
mode->vr_crtc[14] = 0;
mode->vr_crtc[15] = 0;
-
+
mode->vr_crtc[16] = vertical_sync_start;
mode->vr_crtc[17] = (vertical_sync_end & 0x0f) | 0x20;
mode->vr_crtc[18] = vertical_display_enable_end;
@@ -1500,18 +1503,18 @@ voodoofb_setup_monitor(struct voodoofb_softc *sc, const struct videomode *vm)
/* overflow registers */
mode->vr_crtc[CRTC_HDISP_EXT] =
(horizontal_total&0x100) >> 8 |
- (horizontal_display_end & 0x100) >> 6 |
+ (horizontal_display_end & 0x100) >> 6 |
(horizontal_blanking_start & 0x100) >> 4 |
(horizontal_blanking_end & 0x40) >> 1 |
(horizontal_sync_start & 0x100) >> 2 |
(horizontal_sync_end & 0x20) << 2;
-
+
mode->vr_crtc[CRTC_VDISP_EXT] =
(vertical_total & 0x400) >> 10 |
(vertical_display_enable_end & 0x400) >> 8 | /* the manual is contradictory here */
(vertical_blanking_start & 0x400) >> 6 |
(vertical_blanking_end & 0x400) >> 4;
-
+
/* attr regs start */
mode->vr_attr[0] = 0;
mode->vr_attr[1] = 0;
@@ -1547,7 +1550,7 @@ voodoofb_setup_monitor(struct voodoofb_softc *sc, const struct videomode *vm)
mode->vr_graph[8] = 0;
vga_outb(sc, MISC_W, misc | 0x01);
-
+
for(i = 0; i < 5; i++)
voodoo3_write_seq(sc, i, mode->vr_seq[i]);
for (i = 0; i < CRTC_PCI_READBACK; i ++)
@@ -1559,7 +1562,7 @@ voodoofb_setup_monitor(struct voodoofb_softc *sc, const struct videomode *vm)
}
static void
-voodoofb_set_videomode(struct voodoofb_softc *sc,
+voodoofb_set_videomode(struct voodoofb_softc *sc,
const struct videomode *vm)
{
uint32_t miscinit0 = 0;
@@ -1572,13 +1575,13 @@ voodoofb_set_videomode(struct voodoofb_softc *sc,
sc->sc_width = vm->hdisplay;
sc->sc_height = vm->vdisplay;
sc->sc_linebytes = bytes_per_row;
-
+
voodoofb_setup_monitor(sc, vm);
-
+
vidproc &= ~(0x1c0000); /* clear bits 18 to 20, bpp in vidproccfg */
/* enable bits 18 to 20 to the required bpp */
vidproc |= ((bpp - 1) << VIDCFG_PIXFMT_SHIFT);
-
+
vidpll = voodoofb_calc_pll(vm->dot_clock, &fout, 0);
#ifdef VOODOOFB_DEBUG
@@ -1588,7 +1591,7 @@ voodoofb_set_videomode(struct voodoofb_softc *sc,
printf("pll: %08x %d\n", vidpll, fout);
#endif
/* bit 10 of vidproccfg, is enabled or disabled as needed */
- switch (bpp) {
+ switch (bpp) {
case 1:
/*
* bit 10 off for palettized modes only, off means
@@ -1607,7 +1610,7 @@ voodoofb_set_videomode(struct voodoofb_softc *sc,
case 4:
#if __POWERPC__
miscinit0 = 0x40000000;
- #endif
+ #endif
vidproc |= (1 << 10); /* Same for 32bit modes */
break;
#endif
@@ -1615,9 +1618,9 @@ voodoofb_set_videomode(struct voodoofb_softc *sc,
printf("We support only 8 bit for now\n");
return;
}
-
+
voodoofb_wait_idle(sc);
-
+
voodoo3_write32(sc, MISCINIT1, voodoo3_read32(sc, MISCINIT1) | 0x01);
voodoo3_make_room(sc, 4);
@@ -1625,7 +1628,7 @@ voodoofb_set_videomode(struct voodoofb_softc *sc,
voodoo3_write32(sc, DACMODE, 0);
voodoo3_write32(sc, VIDDESKSTRIDE, bytes_per_row);
voodoo3_write32(sc, PLLCTRL0, vidpll);
-
+
voodoo3_make_room(sc, 5);
voodoo3_write32(sc, VIDSCREENSIZE, sc->sc_width |
(sc->sc_height << 12));
@@ -1662,8 +1665,8 @@ voodoofb_init(struct voodoofb_softc *sc)
uint32_t vidcfg = 0;
#ifdef VOODOOFB_DEBUG
- printf("initializing engine...");
-#endif
+ printf("initializing engine...");
+#endif
vgainit0 = voodoo3_read32(sc, VGAINIT0);
#ifdef VOODOOFB_DEBUG
printf("vga: %08x", vgainit0);
@@ -1674,7 +1677,7 @@ voodoofb_init(struct voodoofb_softc *sc)
VGAINIT0_WAKEUP_3C3 |
VGAINIT0_ALT_READBACK |
VGAINIT0_EXTSHIFTOUT;
-
+
vidcfg = voodoo3_read32(sc, VIDPROCCFG);
#ifdef VOODOOFB_DEBUG
printf(" vidcfg: %08x\n", vidcfg);
@@ -1683,7 +1686,7 @@ voodoofb_init(struct voodoofb_softc *sc)
VIDCFG_VIDPROC_ENABLE |
VIDCFG_DESK_ENABLE;
vidcfg &= ~VIDCFG_HWCURSOR_ENABLE;
-
+
voodoo3_make_room(sc, 2);
voodoo3_write32(sc, VGAINIT0, vgainit0);
@@ -1778,7 +1781,7 @@ voodoofb_setup_i2c(struct voodoofb_softc *sc)
sc->sc_edid_info.edid_nmodes);
while ((sc->sc_videomode == NULL) &&
(n < sc->sc_edid_info.edid_nmodes)) {
- if (MODE_IS_VALID(&m[n],
+ if (MODE_IS_VALID(&m[n],
sc->sc_max_clock)) {
sc->sc_videomode = &m[n];
}
@@ -1846,7 +1849,7 @@ static int
voodoofb_i2c_initiate_xfer(void *cookie, i2c_addr_t addr, int flags)
{
- return (i2c_bitbang_initiate_xfer(cookie, addr, flags,
+ return (i2c_bitbang_initiate_xfer(cookie, addr, flags,
&voodoofb_i2cbb_ops));
}
diff --git a/sys/dev/pcmcia/if_tr_pcmcia.c b/sys/dev/pcmcia/if_tr_pcmcia.c
index 4afa74dd92f..5be1e03af45 100644
--- a/sys/dev/pcmcia/if_tr_pcmcia.c
+++ b/sys/dev/pcmcia/if_tr_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tr_pcmcia.c,v 1.25 2012/10/27 17:18:37 chs Exp $ */
+/* $NetBSD: if_tr_pcmcia.c,v 1.26 2016/07/11 11:31:51 msaitoh Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tr_pcmcia.c,v 1.25 2012/10/27 17:18:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tr_pcmcia.c,v 1.26 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -134,7 +134,8 @@ tr_pcmcia_attach(device_t parent, device_t self, void *aux)
}
if (pcmcia_io_alloc(pa->pf, cfe->iospace[0].start,
- cfe->iospace[0].length, cfe->iospace[0].length, &psc->sc_pioh) != 0) {
+ cfe->iospace[0].length, cfe->iospace[0].length, &psc->sc_pioh)
+ != 0) {
aprint_error_dev(self, "can't allocate pio space\n");
goto fail1;
}
@@ -212,7 +213,8 @@ tr_pcmcia_enable(struct tr_softc *sc)
sc->sc_ih = pcmcia_intr_establish(psc->sc_pf, IPL_NET, tr_intr, psc);
if (sc->sc_ih == NULL) {
- aprint_error_dev(psc->sc_tr.sc_dev, "couldn't establish interrupt\n");
+ aprint_error_dev(psc->sc_tr.sc_dev,
+ "couldn't establish interrupt\n");
return 1;
}
diff --git a/sys/dev/pcmcia/isic_pcmcia.c b/sys/dev/pcmcia/isic_pcmcia.c
index b8a29e16552..febe74e1229 100644
--- a/sys/dev/pcmcia/isic_pcmcia.c
+++ b/sys/dev/pcmcia/isic_pcmcia.c
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia.c,v 1.41 2012/10/27 17:18:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia.c,v 1.42 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -78,7 +78,8 @@ extern const struct isdn_layer1_isdnif_driver isic_std_driver;
static int isic_pcmcia_match(device_t, cfdata_t, void *);
static void isic_pcmcia_attach(device_t, device_t, void *);
-static const struct isic_pcmcia_card_entry * find_matching_card(struct pcmcia_attach_args *pa);
+static const struct isic_pcmcia_card_entry * find_matching_card(
+ struct pcmcia_attach_args *pa);
static int isic_pcmcia_isdn_attach(struct isic_softc *sc, const char*);
static int isic_pcmcia_detach(device_t self, int flags);
static int isic_pcmcia_activate(device_t self, enum devact act);
@@ -144,10 +145,12 @@ find_matching_card(struct pcmcia_attach_args *pa)
int i, j;
for (i = 0; i < NUM_MATCH_ENTRIES; i++) {
- if (card_list[i].vendor != PCMCIA_VENDOR_INVALID && pa->card->manufacturer != card_list[i].vendor)
+ if (card_list[i].vendor != PCMCIA_VENDOR_INVALID
+ && pa->card->manufacturer != card_list[i].vendor)
+ continue;
+ if (card_list[i].product != PCMCIA_PRODUCT_INVALID
+ && pa->card->product != card_list[i].product)
continue;
- if (card_list[i].product != PCMCIA_PRODUCT_INVALID && pa->card->product != card_list[i].product)
- continue;
if (pa->pf->function != card_list[i].function)
continue;
for (j = 0; j < 4; j++) {
@@ -155,7 +158,8 @@ find_matching_card(struct pcmcia_attach_args *pa)
continue; /* wildcard */
if (pa->card->cis1_info[j] == NULL)
break; /* not available */
- if (strcmp(pa->card->cis1_info[j], card_list[i].cis1_info[j]) != 0)
+ if (strcmp(pa->card->cis1_info[j],
+ card_list[i].cis1_info[j]) != 0)
break; /* mismatch */
}
if (j >= 4)
@@ -201,7 +205,8 @@ isic_pcmcia_attach(device_t parent, device_t self, void *aux)
/* Which card is it? */
cde = find_matching_card(pa);
if (cde == NULL) {
- aprint_error_dev(self, "attach failed, couldn't find matching card\n");
+ aprint_error_dev(self,
+ "attach failed, couldn't find matching card\n");
return;
}
printf("%s: %s\n", cde->name, device_xname(self));
@@ -212,14 +217,16 @@ isic_pcmcia_attach(device_t parent, device_t self, void *aux)
pcmcia_function_enable(pa->pf);
if (!cde->attach(psc, cfe, pa)) {
- aprint_error_dev(self, "attach failed, card-specific attach unsuccesful\n");
+ aprint_error_dev(self,
+ "attach failed, card-specific attach unsuccesful\n");
goto fail;
}
/* MI initilization */
sc->sc_cardtyp = cde->card_type;
if (isic_pcmcia_isdn_attach(sc, cde->name)) {
- aprint_error_dev(self, "attach failed, generic attach unsuccesful\n");
+ aprint_error_dev(self,
+ "attach failed, generic attach unsuccesful\n");
goto fail;
}
diff --git a/sys/dev/usb/uark.c b/sys/dev/usb/uark.c
index 3b30692971e..3561e06881f 100644
--- a/sys/dev/usb/uark.c
+++ b/sys/dev/usb/uark.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uark.c,v 1.8 2016/07/07 06:55:42 msaitoh Exp $ */
+/* $NetBSD: uark.c,v 1.9 2016/07/11 11:31:51 msaitoh Exp $ */
/* $OpenBSD: uark.c,v 1.13 2009/10/13 19:33:17 pirofti Exp $ */
/*
@@ -97,15 +97,16 @@ void uark_attach(device_t, device_t, void *);
int uark_detach(device_t, int);
int uark_activate(device_t, enum devact);
extern struct cfdriver uark_cd;
-CFATTACH_DECL_NEW(uark, sizeof(struct uark_softc), uark_match, uark_attach, uark_detach, uark_activate);
+CFATTACH_DECL_NEW(uark, sizeof(struct uark_softc), uark_match, uark_attach,
+ uark_detach, uark_activate);
int
uark_match(device_t parent, cfdata_t match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- return (usb_lookup(uark_devs, uaa->uaa_vendor, uaa->uaa_product) != NULL) ?
- UMATCH_VENDOR_PRODUCT : UMATCH_NONE;
+ return (usb_lookup(uark_devs, uaa->uaa_vendor, uaa->uaa_product)
+ != NULL) ? UMATCH_VENDOR_PRODUCT : UMATCH_NONE;
}
void
@@ -153,8 +154,8 @@ uark_attach(device_t parent, device_t self, void *aux)
for (i = 0; i < id->bNumEndpoints; i++) {
ed = usbd_interface2endpoint_descriptor(sc->sc_iface, i);
if (ed == NULL) {
- aprint_error_dev(self, "no endpoint descriptor found for %d\n",
- i);
+ aprint_error_dev(self,
+ "no endpoint descriptor found for %d\n", i);
sc->sc_dying = 1;
return;
}
diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c
index ee9eba31646..475fc96f2d5 100644
--- a/sys/dev/usb/uscanner.c
+++ b/sys/dev/usb/uscanner.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uscanner.c,v 1.77 2016/07/07 06:55:42 msaitoh Exp $ */
+/* $NetBSD: uscanner.c,v 1.78 2016/07/11 11:31:51 msaitoh Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uscanner.c,v 1.77 2016/07/07 06:55:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uscanner.c,v 1.78 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -261,12 +261,13 @@ Static void uscanner_do_close(struct uscanner_softc *);
#define USCANNERUNIT(n) (minor(n))
-int uscanner_match(device_t, cfdata_t, void *);
-void uscanner_attach(device_t, device_t, void *);
-int uscanner_detach(device_t, int);
-int uscanner_activate(device_t, enum devact);
+int uscanner_match(device_t, cfdata_t, void *);
+void uscanner_attach(device_t, device_t, void *);
+int uscanner_detach(device_t, int);
+int uscanner_activate(device_t, enum devact);
extern struct cfdriver uscanner_cd;
-CFATTACH_DECL_NEW(uscanner, sizeof(struct uscanner_softc), uscanner_match, uscanner_attach, uscanner_detach, uscanner_activate);
+CFATTACH_DECL_NEW(uscanner, sizeof(struct uscanner_softc), uscanner_match,
+ uscanner_attach, uscanner_detach, uscanner_activate);
int
uscanner_match(device_t parent, cfdata_t match, void *aux)
@@ -297,14 +298,15 @@ uscanner_attach(device_t parent, device_t self, void *aux)
aprint_normal_dev(self, "%s\n", devinfop);
usbd_devinfo_free(devinfop);
- sc->sc_dev_flags = uscanner_lookup(uaa->uaa_vendor, uaa->uaa_product)->flags;
+ sc->sc_dev_flags = uscanner_lookup(uaa->uaa_vendor,
+ uaa->uaa_product)->flags;
sc->sc_udev = uaa->uaa_device;
err = usbd_set_config_no(uaa->uaa_device, 1, 1); /* XXX */
if (err) {
- aprint_error_dev(self, "failed to set configuration"
- ", err=%s\n", usbd_errstr(err));
+ aprint_error_dev(self, "failed to set configuration, err=%s\n",
+ usbd_errstr(err));
sc->sc_dying = 1;
return;
}
@@ -361,8 +363,7 @@ uscanner_attach(device_t parent, device_t self, void *aux)
}
int
-uscanneropen(dev_t dev, int flag, int mode,
- struct lwp *l)
+uscanneropen(dev_t dev, int flag, int mode, struct lwp *l)
{
struct uscanner_softc *sc;
int unit = USCANNERUNIT(dev);
@@ -428,8 +429,7 @@ uscanneropen(dev_t dev, int flag, int mode,
}
int
-uscannerclose(dev_t dev, int flag, int mode,
- struct lwp *l)
+uscannerclose(dev_t dev, int flag, int mode, struct lwp *l)
{
struct uscanner_softc *sc;
@@ -506,8 +506,9 @@ uscanner_do_read(struct uscanner_softc *sc, struct uio *uio, int flag)
DPRINTFN(1, ("uscannerread: start transfer %d bytes\n",n));
tn = n;
- err = usbd_bulk_transfer(sc->sc_bulkin_xfer, sc->sc_bulkin_pipe,
- USBD_SHORT_XFER_OK, USBD_NO_TIMEOUT, sc->sc_bulkin_buffer, &tn);
+ err = usbd_bulk_transfer(sc->sc_bulkin_xfer,
+ sc->sc_bulkin_pipe, USBD_SHORT_XFER_OK, USBD_NO_TIMEOUT,
+ sc->sc_bulkin_buffer, &tn);
if (err) {
if (err == USBD_INTERRUPTED)
error = EINTR;
@@ -709,8 +710,7 @@ uscannerkqfilter(dev_t dev, struct knote *kn)
}
int
-uscannerioctl(dev_t dev, u_long cmd, void *addr,
- int flag, struct lwp *l)
+uscannerioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l)
{
return EINVAL;
}
diff --git a/sys/dev/usb/uthum.c b/sys/dev/usb/uthum.c
index 7ebdb7bd299..77d8627f85e 100644
--- a/sys/dev/usb/uthum.c
+++ b/sys/dev/usb/uthum.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uthum.c,v 1.11 2016/04/23 10:15:32 skrll Exp $ */
+/* $NetBSD: uthum.c,v 1.12 2016/07/11 11:31:51 msaitoh Exp $ */
/* $OpenBSD: uthum.c,v 1.6 2010/01/03 18:43:02 deraadt Exp $ */
/*
@@ -22,7 +22,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uthum.c,v 1.11 2016/04/23 10:15:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uthum.c,v 1.12 2016/07/11 11:31:51 msaitoh Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -119,8 +119,8 @@ uthum_match(device_t parent, cfdata_t match, void *aux)
{
struct uhidev_attach_arg *uha = aux;
- return uthum_lookup(uha->uiaa->uiaa_vendor, uha->uiaa->uiaa_product) != NULL ?
- UMATCH_VENDOR_PRODUCT : UMATCH_NONE;
+ return uthum_lookup(uha->uiaa->uiaa_vendor, uha->uiaa->uiaa_product)
+ != NULL ? UMATCH_VENDOR_PRODUCT : UMATCH_NONE;
}
void
@@ -176,8 +176,10 @@ uthum_attach(device_t parent, device_t self, void *aux)
sc->sc_sensor[UTHUM_HUMIDITY].value_cur = 0;
sc->sc_sensor[UTHUM_HUMIDITY].state = ENVSYS_SINVALID;
- sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor[UTHUM_TEMP]);
- sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor[UTHUM_HUMIDITY]);
+ sysmon_envsys_sensor_attach(sc->sc_sme,
+ &sc->sc_sensor[UTHUM_TEMP]);
+ sysmon_envsys_sensor_attach(sc->sc_sme,
+ &sc->sc_sensor[UTHUM_HUMIDITY]);
sc->sc_num_sensors = 2;
DPRINTF(("sensor type: SHT1x\n"));
break;
@@ -187,7 +189,8 @@ uthum_attach(device_t parent, device_t self, void *aux)
sc->sc_sensor[UTHUM_TEMP].units = ENVSYS_STEMP;
sc->sc_sensor[UTHUM_TEMP].state = ENVSYS_SINVALID;
- sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor[UTHUM_TEMP]);
+ sysmon_envsys_sensor_attach(sc->sc_sme,
+ &sc->sc_sensor[UTHUM_TEMP]);
sc->sc_num_sensors = 1;
DPRINTF(("sensor type: TEMPer\n"));
break;
@@ -202,7 +205,8 @@ uthum_attach(device_t parent, device_t self, void *aux)
sc->sc_sme->sme_refresh = uthum_refresh;
if (sysmon_envsys_register(sc->sc_sme)) {
- aprint_error_dev(self, "unable to register with sysmon\n");
+ aprint_error_dev(self,
+ "unable to register with sysmon\n");
sysmon_envsys_destroy(sc->sc_sme);
}
} else {
@@ -345,7 +349,8 @@ uthum_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
switch (sc->sc_sensortype) {
case UTHUM_TYPE_SHT1x:
- if (uthum_read_data(sc, CMD_GETDATA, buf, sizeof(buf), 1000) != 0) {
+ if (uthum_read_data(sc, CMD_GETDATA, buf, sizeof(buf), 1000)
+ != 0) {
DPRINTF(("uthum: data read fail\n"));
sc->sc_sensor[UTHUM_TEMP].state = ENVSYS_SINVALID;
sc->sc_sensor[UTHUM_HUMIDITY].state = ENVSYS_SINVALID;