Reduce and improve debug messages.

Approved by: re
This commit is contained in:
Hidetoshi Shimokawa 2002-12-06 02:17:30 +00:00
parent 45289b43fb
commit 17c3d42c9e
5 changed files with 47 additions and 30 deletions

View File

@ -520,7 +520,6 @@ firewire_attach( device_t dev )
#else #else
sc->dev[i] = d; sc->dev[i] = d;
#endif #endif
printf("%s: firewire bus attach\n", device_get_nameunit(sc->fc->dev));
sc->fc->timeouthandle = timeout((timeout_t *)sc->fc->timeout, (void *)sc->fc, hz * 10); sc->fc->timeouthandle = timeout((timeout_t *)sc->fc->timeout, (void *)sc->fc, hz * 10);
/* Locate our children */ /* Locate our children */
@ -1069,7 +1068,8 @@ fw_phy_config(struct firewire_comm *fc, int root_node, int gap_count)
/* XXX Dangerous, how to pass PHY packet to device driver */ /* XXX Dangerous, how to pass PHY packet to device driver */
fp->mode.common.tcode |= FWTCODE_PHY; fp->mode.common.tcode |= FWTCODE_PHY;
printf("send phy_config root_node=%d gap_count=%d\n", if (firewire_debug)
printf("send phy_config root_node=%d gap_count=%d\n",
root_node, gap_count); root_node, gap_count);
fw_asyreq(fc, -1, xfer); fw_asyreq(fc, -1, xfer);
} }
@ -1341,7 +1341,9 @@ loop:
TAILQ_INSERT_BEFORE(tfwdev, fwdev, link); TAILQ_INSERT_BEFORE(tfwdev, fwdev, link);
} }
printf("%s:Discover new %s device ID:%08x%08x\n", device_get_nameunit(fc->dev), linkspeed[fwdev->speed], fc->ongoeui.hi, fc->ongoeui.lo); device_printf(fc->dev, "New %s device ID:%08x%08x\n",
linkspeed[fwdev->speed],
fc->ongoeui.hi, fc->ongoeui.lo);
fc->ongodev = fwdev; fc->ongodev = fwdev;
fc->ongoaddr = CSRROMOFF; fc->ongoaddr = CSRROMOFF;
@ -1389,7 +1391,8 @@ loop:
done: done:
/* fw_attach_devs */ /* fw_attach_devs */
fc->status = FWBUSEXPDONE; fc->status = FWBUSEXPDONE;
printf("bus_explore done\n"); if (firewire_debug)
printf("bus_explore done\n");
fw_attach_dev(fc); fw_attach_dev(fc);
return; return;
@ -1638,11 +1641,12 @@ fw_attach_dev(struct firewire_comm *fc)
continue; continue;
fwdev->maxrec = (fwdev->csrrom[2] >> 12) & 0xf; fwdev->maxrec = (fwdev->csrrom[2] >> 12) & 0xf;
device_printf(fc->dev, "Device ");
switch(fwdev->spec){ switch(fwdev->spec){
case CSRVAL_ANSIT10: case CSRVAL_ANSIT10:
switch(fwdev->ver){ switch(fwdev->ver){
case CSRVAL_T10SBP2: case CSRVAL_T10SBP2:
printf("Device SBP-II"); printf("SBP-II");
break; break;
default: default:
break; break;
@ -1651,38 +1655,39 @@ fw_attach_dev(struct firewire_comm *fc)
case CSRVAL_1394TA: case CSRVAL_1394TA:
switch(fwdev->ver){ switch(fwdev->ver){
case CSR_PROTAVC: case CSR_PROTAVC:
printf("Device AV/C"); printf("AV/C");
break; break;
case CSR_PROTCAL: case CSR_PROTCAL:
printf("Device CAL"); printf("CAL");
break; break;
case CSR_PROTEHS: case CSR_PROTEHS:
printf("Device EHS"); printf("EHS");
break; break;
case CSR_PROTHAVI: case CSR_PROTHAVI:
printf("Device HAVi"); printf("HAVi");
break; break;
case CSR_PROTCAM104: case CSR_PROTCAM104:
printf("Device 1394 Cam 1.04"); printf("1394 Cam 1.04");
break; break;
case CSR_PROTCAM120: case CSR_PROTCAM120:
printf("Device 1394 Cam 1.20"); printf("1394 Cam 1.20");
break; break;
case CSR_PROTCAM130: case CSR_PROTCAM130:
printf("Device 1394 Cam 1.30"); printf("1394 Cam 1.30");
break; break;
case CSR_PROTDPP: case CSR_PROTDPP:
printf("Device 1394 Direct print"); printf("1394 Direct print");
break; break;
case CSR_PROTIICP: case CSR_PROTIICP:
printf("Device Industrial & Instrument"); printf("Industrial & Instrument");
break; break;
default: default:
printf("Device unkwon 1394TA"); printf("unknown 1394TA");
break; break;
} }
break; break;
default: default:
printf("unknown spec");
break; break;
} }
fwdev->status = FWDEVATTACHED; fwdev->status = FWDEVATTACHED;

View File

@ -292,12 +292,11 @@ fwohci_set_bus_manager(struct firewire_comm *fc, u_int node)
for (i = 0; !(OREAD(sc, OHCI_CSR_CONT) & (1<<31)) && (i < 1000); i++) for (i = 0; !(OREAD(sc, OHCI_CSR_CONT) & (1<<31)) && (i < 1000); i++)
DELAY(100); DELAY(100);
bm = OREAD(sc, OHCI_CSR_DATA); bm = OREAD(sc, OHCI_CSR_DATA);
if((bm & 0x3f) == 0x3f){ if((bm & 0x3f) == 0x3f)
printf("fw_set_bus_manager: %d->%d (loop=%d)\n", bm, node, i);
bm = node; bm = node;
}else{ if (bootverbose)
printf("fw_set_bus_manager: %d-X%d (loop=%d)\n", bm, node, i); device_printf(sc->fc.dev,
} "fw_set_bus_manager: %d->%d (loop=%d)\n", bm, node, i);
return(bm); return(bm);
} }
@ -471,13 +470,15 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
/* FLUSH FIFO and reset Transmitter/Reciever */ /* FLUSH FIFO and reset Transmitter/Reciever */
OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET); OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET);
device_printf(dev, "resetting OHCI..."); if (bootverbose)
device_printf(dev, "resetting OHCI...");
i = 0; i = 0;
while(OREAD(sc, OHCI_HCCCTL) & OHCI_HCC_RESET) { while(OREAD(sc, OHCI_HCCCTL) & OHCI_HCC_RESET) {
if (i++ > 100) break; if (i++ > 100) break;
DELAY(1000); DELAY(1000);
} }
printf("done (%d)\n", i); if (bootverbose)
printf("done (%d)\n", i);
OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LPS); OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LPS);
/* XXX wait for SCLK. */ /* XXX wait for SCLK. */
DELAY(100000); DELAY(100000);
@ -487,7 +488,8 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
/* XXX */ /* XXX */
if (((reg & 0x0000f000) >> 12) < 10) if (((reg & 0x0000f000) >> 12) < 10)
reg2 = (reg2 & 0xffff0fff) | (10 << 12); reg2 = (reg2 & 0xffff0fff) | (10 << 12);
device_printf(dev, "BUS_OPT 0x%x -> 0x%x\n", reg, reg2); if (bootverbose)
device_printf(dev, "BUS_OPT 0x%x -> 0x%x\n", reg, reg2);
OWRITE(sc, OHCI_BUS_OPT, reg2); OWRITE(sc, OHCI_BUS_OPT, reg2);
OWRITE(sc, OHCI_CROMHDR, sc->fc.config_rom[0]); OWRITE(sc, OHCI_CROMHDR, sc->fc.config_rom[0]);
@ -544,7 +546,9 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
#else /* XXX force to enable 1394a */ #else /* XXX force to enable 1394a */
if (e1394a) { if (e1394a) {
#endif #endif
device_printf(dev, "Enable 1394a Enhancements\n"); if (bootverbose)
device_printf(dev,
"Enable 1394a Enhancements\n");
/* enable EAA EMC */ /* enable EAA EMC */
reg2 |= 0x03; reg2 |= 0x03;
/* set aPhyEnhanceEnable */ /* set aPhyEnhanceEnable */
@ -781,7 +785,7 @@ txloop:
if(db_tr != dbch->bottom){ if(db_tr != dbch->bottom){
goto txloop; goto txloop;
} else { } else {
printf("fwohci_start: lack of db_trq\n"); device_printf(sc->fc.dev, "fwohci_start: lack of db_trq\n");
dbch->flags |= FWOHCI_DBCH_FULL; dbch->flags |= FWOHCI_DBCH_FULL;
} }
kick: kick:
@ -791,7 +795,8 @@ kick:
if(dbch->xferq.flag & FWXFERQ_RUNNING) { if(dbch->xferq.flag & FWXFERQ_RUNNING) {
OWRITE(sc, OHCI_DMACTL(off), OHCI_CNTL_DMA_WAKE); OWRITE(sc, OHCI_DMACTL(off), OHCI_CNTL_DMA_WAKE);
} else { } else {
printf("start AT DMA status=%x\n", if (bootverbose)
device_printf(sc->fc.dev, "start AT DMA status=%x\n",
OREAD(sc, OHCI_DMACTL(off))); OREAD(sc, OHCI_DMACTL(off)));
OWRITE(sc, OHCI_DMACMD(off), vtophys(dbch->top->db) | fsegment); OWRITE(sc, OHCI_DMACMD(off), vtophys(dbch->top->db) | fsegment);
OWRITE(sc, OHCI_DMACTL(off), OHCI_CNTL_DMA_RUN); OWRITE(sc, OHCI_DMACTL(off), OHCI_CNTL_DMA_RUN);
@ -1720,7 +1725,8 @@ fwohci_set_intr(struct firewire_comm *fc, int enable)
struct fwohci_softc *sc; struct fwohci_softc *sc;
sc = (struct fwohci_softc *)fc; sc = (struct fwohci_softc *)fc;
printf("fwochi_set_intr: %d\n", enable); if (bootverbose)
device_printf(sc->fc.dev, "fwochi_set_intr: %d\n", enable);
if (enable) { if (enable) {
sc->intmask |= OHCI_INT_EN; sc->intmask |= OHCI_INT_EN;
OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_EN); OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_EN);

View File

@ -183,7 +183,8 @@ fwohci_pci_attach(device_t self)
cache_line = DEF_CACHE_LINE; cache_line = DEF_CACHE_LINE;
pci_write_config(self, PCIR_CACHELNSZ, cache_line, 1); pci_write_config(self, PCIR_CACHELNSZ, cache_line, 1);
#endif #endif
printf("cache size %d.\n", (int) cache_line); if (bootverbose)
device_printf(self, "cache size %d.\n", (int) cache_line);
/**/ /**/
rid = PCI_CBMEM; rid = PCI_CBMEM;
sc->bsr = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, sc->bsr = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,

View File

@ -174,7 +174,8 @@ fwe_attach(device_t dev)
eaddr[3] = fwe->fd.fc->eui[5]; eaddr[3] = fwe->fd.fc->eui[5];
eaddr[4] = fwe->fd.fc->eui[6]; eaddr[4] = fwe->fd.fc->eui[6];
eaddr[5] = fwe->fd.fc->eui[7]; eaddr[5] = fwe->fd.fc->eui[7];
printf("if_fwe%d: %02x:%02x:%02x:%02x:%02x:%02x\n", unit, printf("if_fwe%d: Fake Ethernet address: "
"%02x:%02x:%02x:%02x:%02x:%02x\n", unit,
eaddr[0], eaddr[1], eaddr[2], eaddr[3], eaddr[4], eaddr[5]); eaddr[0], eaddr[1], eaddr[2], eaddr[3], eaddr[4], eaddr[5]);
/* fill the rest and attach interface */ /* fill the rest and attach interface */

View File

@ -129,7 +129,7 @@ static char *orb_fun_name[] = {
#define ORB_RES_ILLE 2 #define ORB_RES_ILLE 2
#define ORB_RES_VEND 3 #define ORB_RES_VEND 3
static int debug = 1; static int debug = 0;
static int auto_login = 1; static int auto_login = 1;
static int max_speed = 2; static int max_speed = 2;
@ -555,8 +555,10 @@ END_DEBUG
} }
break; break;
} }
SBP_DEBUG(0)
sbp_show_sdev_info(sdev, sbp_show_sdev_info(sdev,
(sdev->status == SBP_DEV_TOATTACH)); (sdev->status == SBP_DEV_TOATTACH));
END_DEBUG
} else { } else {
switch (sdev->status) { switch (sdev->status) {
case SBP_DEV_ATTACHED: case SBP_DEV_ATTACHED:
@ -1063,8 +1065,10 @@ sbp_mgm_orb(struct sbp_dev *sdev, int func)
sdev->target->target_id, sdev->target->target_id,
sdev->lun_id)); sdev->lun_id));
SBP_DEBUG(0)
sbp_show_sdev_info(sdev, 2); sbp_show_sdev_info(sdev, 2);
printf("%s\n", orb_fun_name[(func>>16)&0xf]); printf("%s\n", orb_fun_name[(func>>16)&0xf]);
END_DEBUG
switch (func) { switch (func) {
case ORB_FUN_LGI: case ORB_FUN_LGI:
ocb->orb[2] = htonl(nid << 16); ocb->orb[2] = htonl(nid << 16);