Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/bktr Use bktr_softc.bktr_dev.dv_xname instead of...
details: https://anonhg.NetBSD.org/src/rev/b8b8260a096e
branches: trunk
changeset: 486412:b8b8260a096e
user: wiz <wiz%NetBSD.org@localhost>
date: Sun May 21 15:43:56 2000 +0000
description:
Use bktr_softc.bktr_dev.dv_xname instead of "bktr0" when printf'ing as
requested by Klaus Klein in kern/10166.
Also add device instance name to all printf's that didn't have it.
diffstat:
sys/dev/pci/bktr/bktr_audio.c | 26 ++++++++----
sys/dev/pci/bktr/bktr_card.c | 56 ++++++++++++++-----------
sys/dev/pci/bktr/bktr_core.c | 91 ++++++++++++++++++++++++++----------------
sys/dev/pci/bktr/bktr_core.h | 5 +-
sys/dev/pci/bktr/bktr_os.c | 30 ++++++-------
sys/dev/pci/bktr/bktr_tuner.c | 19 ++++----
6 files changed, 133 insertions(+), 94 deletions(-)
diffs (truncated from 671 to 300 lines):
diff -r 52e765755662 -r b8b8260a096e sys/dev/pci/bktr/bktr_audio.c
--- a/sys/dev/pci/bktr/bktr_audio.c Sun May 21 14:36:15 2000 +0000
+++ b/sys/dev/pci/bktr/bktr_audio.c Sun May 21 15:43:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bktr_audio.c,v 1.4 2000/05/07 14:43:31 veego Exp $ */
+/* $NetBSD: bktr_audio.c,v 1.5 2000/05/21 15:43:56 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_audio.c,v 1.2 1999/10/28 13:58:14 roger Exp */
/*
@@ -159,7 +159,8 @@
bktr->audio_mute_state = FALSE; /* clear mute */
break;
default:
- printf("bktr: audio cmd error %02x\n", cmd);
+ printf("%s: audio cmd error %02x\n", bktr_name(bktr),
+ cmd);
return( -1 );
}
@@ -202,7 +203,8 @@
temp = INL(bktr, BKTR_GPIO_DATA) & ~bktr->card.gpio_mux_bits;
#if defined( AUDIOMUX_DISCOVER )
OUTL(bktr, BKTR_GPIO_DATA, temp | (cmd & 0xff));
- printf("cmd: %d audio mux %x temp %x \n", cmd,bktr->card.audiomuxs[ idx ], temp );
+ printf("%s: cmd: %d audio mux %x temp %x \n", bktr_name(bktr),
+ cmd, bktr->card.audiomuxs[ idx ], temp );
#else
OUTL(bktr, BKTR_GPIO_DATA, temp | bktr->card.audiomuxs[ idx ]);
#endif /* AUDIOMUX_DISCOVER */
@@ -469,7 +471,8 @@
auto_detect = msp_dpl_read(bktr, bktr->msp_addr, 0x10, 0x007e);
loops++;
} while (auto_detect > 0xff && loops < 50);
- if (bootverbose)printf ("Result of autodetect after %dms: %d\n", loops*10, auto_detect);
+ if (bootverbose)printf ("%s: Result of autodetect after %dms: %d\n",
+ bktr_name(bktr), loops*10, auto_detect);
/* Now set the audio baseband processing */
switch (auto_detect) {
@@ -481,13 +484,16 @@
/* Read the stereo detection value from DSP reg 0x0018 */
DELAY(20000);
stereo = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x0018);
- if (bootverbose)printf ("Stereo reg 0x18 a: %d\n", stereo);
+ if (bootverbose)printf ("%s: Stereo reg 0x18 a: %d\n",
+ bktr_name(bktr), stereo);
DELAY(20000);
stereo = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x0018);
- if (bootverbose)printf ("Stereo reg 0x18 b: %d\n", stereo);
+ if (bootverbose)printf ("%s: Stereo reg 0x18 b: %d\n",
+ bktr_name(bktr), stereo);
DELAY(20000);
stereo = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x0018);
- if (bootverbose)printf ("Stereo reg 0x18 c: %d\n", stereo);
+ if (bootverbose)printf ("%s: Stereo reg 0x18 c: %d\n",
+ bktr_name(bktr), stereo);
if (stereo > 0x0100 && stereo < 0x8000) { /* Seems to be stereo */
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0020);/* Loudspeaker set stereo*/
/*
@@ -496,7 +502,8 @@
*/
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0005,0x3f28);
} else if (stereo > 0x8000) { /* bilingual mode */
- if (bootverbose) printf ("Bilingual mode detected\n");
+ if (bootverbose) printf ("%s: Bilingual mode detected\n",
+ bktr_name(bktr));
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0008,0x0000);/* Loudspeaker */
msp_dpl_write(bktr, bktr->msp_addr, 0x12, 0x0005,0x0000);/* all spatial effects off */
} else { /* must be mono */
@@ -527,7 +534,8 @@
case 10: /* i-FM NICAM */
break;
default:
- if (bootverbose) printf ("Unkown autodetection result value: %d\n", auto_detect);
+ if (bootverbose) printf ("%s: Unknown autodetection result value: %d\n",
+ bktr_name(bktr), auto_detect);
}
}
diff -r 52e765755662 -r b8b8260a096e sys/dev/pci/bktr/bktr_card.c
--- a/sys/dev/pci/bktr/bktr_card.c Sun May 21 14:36:15 2000 +0000
+++ b/sys/dev/pci/bktr/bktr_card.c Sun May 21 15:43:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bktr_card.c,v 1.4 2000/05/20 16:16:15 augustss Exp $ */
+/* $NetBSD: bktr_card.c,v 1.5 2000/05/21 15:43:57 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_card.c,v 1.9 2000/02/12 08:49:21 peter Exp */
@@ -543,7 +543,8 @@
/* Select all GPIO bits as inputs */
OUTL(bktr, BKTR_GPIO_OUT_EN, 0);
if (bootverbose)
- printf("bktr: GPIO is 0x%08x\n", INL(bktr, BKTR_GPIO_DATA));
+ printf("%s: GPIO is 0x%08x\n", bktr_name(bktr),
+ INL(bktr, BKTR_GPIO_DATA));
#ifdef HAUPPAUGE_MSP_RESET
/* Reset the MSP34xx audio chip. This resolves bootup card
@@ -607,7 +608,7 @@
subsystem_vendor_id = (byte_254 << 8) | byte_255;
if ( bootverbose )
- printf("subsystem 0x%04x 0x%04x\n",
+ printf("%s: subsystem 0x%04x 0x%04x\n", bktr_name(bktr),
subsystem_vendor_id, subsystem_id);
if (subsystem_vendor_id == VENDOR_AVER_MEDIA) {
@@ -654,11 +655,13 @@
/* Vendor is unknown. We will use the standard probe code */
/* which may not give best results */
- printf("Warning - card vendor 0x%04x (model 0x%04x) unknown.\n",subsystem_vendor_id,subsystem_id);
+ printf("%s: Warning - card vendor 0x%04x (model 0x%04x) unknown.\n",
+ bktr_name(bktr), subsystem_vendor_id, subsystem_id);
}
else
{
- printf("Card has no configuration EEPROM. Cannot determine card make.\n");
+ printf("%s: Card has no configuration EEPROM. Cannot determine card make.\n",
+ bktr_name(bktr));
}
} /* end of bt878/bt879 card detection code */
@@ -707,8 +710,10 @@
bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
goto checkTuner;
}
- printf("Warning: Unknown card type. EEPROM data not recognised\n");
- printf("%x %x %x %x\n",eeprom[0],eeprom[1],eeprom[2],eeprom[3]);
+ printf("%s: Warning: Unknown card type. EEPROM data not recognised\n",
+ bktr_name(bktr));
+ printf("%s: %x %x %x %x\n", bktr_name(bktr),
+ eeprom[0],eeprom[1],eeprom[2],eeprom[3]);
}
/* look for an STB card */
@@ -724,7 +729,7 @@
signCard( bktr, 1, 128, (u_char *) &probe_signature );
if (bootverbose) {
- printf("card signature \n");
+ printf("%s: card signature: ", bktr_name(bktr));
for (j = 0; j < Bt848_MAX_SIGN; j++) {
printf(" %02x ", probe_signature[j]);
}
@@ -872,13 +877,13 @@
model = (eeprom[12] << 8 | eeprom[11]);
revision = (eeprom[15] << 16 | eeprom[14] << 8 | eeprom[13]);
if (verbose)
- printf("bktr%d: Hauppauge Model %d %c%c%c%c\n",
- unit,
- model,
- ((revision >> 18) & 0x3f) + 32,
- ((revision >> 12) & 0x3f) + 32,
- ((revision >> 6) & 0x3f) + 32,
- ((revision >> 0) & 0x3f) + 32 );
+ printf("%s: Hauppauge Model %d %c%c%c%c\n",
+ bktr_name(bktr),
+ model,
+ ((revision >> 18) & 0x3f) + 32,
+ ((revision >> 12) & 0x3f) + 32,
+ ((revision >> 6) & 0x3f) + 32,
+ ((revision >> 0) & 0x3f) + 32 );
/* Determine the tuner type from the eeprom */
tuner_code = eeprom[9];
@@ -929,7 +934,8 @@
goto checkDBX;
default :
- printf("Warning - Unknown Hauppauge Tuner 0x%x\n",tuner_code);
+ printf("%s: Warning - Unknown Hauppauge Tuner 0x%x\n",
+ bktr_name(bktr), tuner_code);
}
}
break;
@@ -996,8 +1002,8 @@
goto checkDBX;
}
- printf("Warning - Unknown AVerMedia Tuner Make %d Format %d\n",
- tuner_make, tuner_format);
+ printf("%s: Warning - Unknown AVerMedia Tuner Make %d Format %d\n",
+ bktr_name(bktr), tuner_make, tuner_format);
}
break;
@@ -1094,9 +1100,9 @@
if (bktr->card.msp3400c) {
bktr->msp_addr = MSP3400C_WADDR;
msp_read_id( bktr );
- printf("bktr%d: Detected a MSP%s at 0x%x\n", unit,
- bktr->msp_version_string,
- bktr->msp_addr);
+ printf("%s: Detected a MSP%s at 0x%x\n", bktr_name(bktr),
+ bktr->msp_version_string,
+ bktr->msp_addr);
}
@@ -1108,9 +1114,9 @@
if (bktr->card.dpl3518a) {
bktr->dpl_addr = DPL3518A_WADDR;
dpl_read_id( bktr );
- printf("bktr%d: Detected a DPL%s at 0x%x\n", unit,
- bktr->dpl_version_string,
- bktr->dpl_addr);
+ printf("%s: Detected a DPL%s at 0x%x\n", bktr_name(bktr),
+ bktr->dpl_version_string,
+ bktr->dpl_addr);
}
/* Start of Check Remote */
@@ -1172,7 +1178,7 @@
bktr->card.tuner_pllAddr = tuner_i2c_address;
if ( verbose ) {
- printf( "bktr%d: %s", unit, bktr->card.name );
+ printf( "%s: %s", bktr_name(bktr), bktr->card.name );
if ( bktr->card.tuner )
printf( ", %s tuner", bktr->card.tuner->name );
if ( bktr->card.dbx )
diff -r 52e765755662 -r b8b8260a096e sys/dev/pci/bktr/bktr_core.c
--- a/sys/dev/pci/bktr/bktr_core.c Sun May 21 14:36:15 2000 +0000
+++ b/sys/dev/pci/bktr/bktr_core.c Sun May 21 15:43:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bktr_core.c,v 1.3 2000/05/07 14:43:32 veego Exp $ */
+/* $NetBSD: bktr_core.c,v 1.4 2000/05/21 15:43:57 wiz Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.106 2000/04/16 07:50:08 roger Exp */
@@ -157,6 +157,15 @@
#include "iicbus_if.h"
#endif
+char *
+bktr_name(bktr_ptr_t bktr)
+{
+ char buf[10];
+
+ snprintf(buf, sizeof(buf), "bktr%d", bktr->sc_dev.dv_unit);
+ return buf;
+}
+
#if (__FreeBSD__ == 2)
typedef unsigned int uintptr_t;
@@ -187,6 +196,12 @@
static int bt848_format = -1;
+char *
+bktr_name(bktr_ptr_t bktr)
+{
+ return (bktr->bktr_dev.dv_xname);
+}
+
#endif /* __NetBSD__ || __OpenBSD__ */
@@ -478,8 +493,8 @@
#endif
if ( bootverbose ) {
- printf("bktr%d: buffer size %d, addr 0x%x\n",
- unit, BROOKTREE_ALLOC, vtophys(buf));
+ printf("%s: buffer size %d, addr 0x%x\n",
+ bktr_name(bktr), BROOKTREE_ALLOC, vtophys(buf));
}
if ( buf != 0 ) {
@@ -637,7 +652,7 @@
status_sum |= (bktr_status & ~(BT848_INT_RSV0|BT848_INT_RSV1));
status_sum |= ((dstatus & (BT848_DSTATUS_COF|BT848_DSTATUS_LOF)) << 6);
#endif /* STATUS_SUM */
- /* printf( " STATUS %x %x %x \n",
+ /* printf( "%s: STATUS %x %x %x \n", bktr_name(bktr),
dstatus, bktr_status, INL(bktr, BKTR_RISC_COUNT) );
*/
@@ -697,7 +712,7 @@
return 0;
/**
- printf( "intr status %x %x %x\n",
+ printf( "%s: intr status %x %x %x\n", bktr_name(bktr),
bktr_status, dstatus, INL(bktr, BKTR_RISC_COUNT) );
*/
@@ -1126,7 +1141,8 @@
if (!status) /* successful capture */
status = uiomove((caddr_t)bktr->bigbuf, count, uio);
else
- printf ("bktr%d: read: tsleep error %d\n", unit, status);
+ printf ("%s: read: tsleep error %d\n",
+ bktr_name(bktr), status);
bktr->flags &= ~(METEOR_SINGLE | METEOR_WANT_MASK);
@@ -1522,8 +1538,9 @@
Home |
Main Index |
Thread Index |
Old Index