diff options
author | simokawa <simokawa@FreeBSD.org> | 2002-12-06 02:17:30 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2002-12-06 02:17:30 +0000 |
commit | 9c9831e97c90eab105eb658c4bedb207a8363e10 (patch) | |
tree | a5a5a63b54d3a7c27a5a9c067b7ba8bba916f1bc /sys | |
parent | 034f320d20296db72be9a1984be54abef543e563 (diff) | |
download | FreeBSD-src-9c9831e97c90eab105eb658c4bedb207a8363e10.zip FreeBSD-src-9c9831e97c90eab105eb658c4bedb207a8363e10.tar.gz |
Reduce and improve debug messages.
Approved by: re
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/firewire/firewire.c | 35 | ||||
-rw-r--r-- | sys/dev/firewire/fwohci.c | 30 | ||||
-rw-r--r-- | sys/dev/firewire/fwohci_pci.c | 3 | ||||
-rw-r--r-- | sys/dev/firewire/if_fwe.c | 3 | ||||
-rw-r--r-- | sys/dev/firewire/sbp.c | 6 |
5 files changed, 47 insertions, 30 deletions
diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c index ea89b60..9c75447 100644 --- a/sys/dev/firewire/firewire.c +++ b/sys/dev/firewire/firewire.c @@ -520,7 +520,6 @@ firewire_attach( device_t dev ) #else sc->dev[i] = d; #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); /* 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 */ 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); fw_asyreq(fc, -1, xfer); } @@ -1341,7 +1341,9 @@ loop: 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->ongoaddr = CSRROMOFF; @@ -1389,7 +1391,8 @@ loop: done: /* fw_attach_devs */ fc->status = FWBUSEXPDONE; - printf("bus_explore done\n"); + if (firewire_debug) + printf("bus_explore done\n"); fw_attach_dev(fc); return; @@ -1638,11 +1641,12 @@ fw_attach_dev(struct firewire_comm *fc) continue; fwdev->maxrec = (fwdev->csrrom[2] >> 12) & 0xf; + device_printf(fc->dev, "Device "); switch(fwdev->spec){ case CSRVAL_ANSIT10: switch(fwdev->ver){ case CSRVAL_T10SBP2: - printf("Device SBP-II"); + printf("SBP-II"); break; default: break; @@ -1651,38 +1655,39 @@ fw_attach_dev(struct firewire_comm *fc) case CSRVAL_1394TA: switch(fwdev->ver){ case CSR_PROTAVC: - printf("Device AV/C"); + printf("AV/C"); break; case CSR_PROTCAL: - printf("Device CAL"); + printf("CAL"); break; case CSR_PROTEHS: - printf("Device EHS"); + printf("EHS"); break; case CSR_PROTHAVI: - printf("Device HAVi"); + printf("HAVi"); break; case CSR_PROTCAM104: - printf("Device 1394 Cam 1.04"); + printf("1394 Cam 1.04"); break; case CSR_PROTCAM120: - printf("Device 1394 Cam 1.20"); + printf("1394 Cam 1.20"); break; case CSR_PROTCAM130: - printf("Device 1394 Cam 1.30"); + printf("1394 Cam 1.30"); break; case CSR_PROTDPP: - printf("Device 1394 Direct print"); + printf("1394 Direct print"); break; case CSR_PROTIICP: - printf("Device Industrial & Instrument"); + printf("Industrial & Instrument"); break; default: - printf("Device unkwon 1394TA"); + printf("unknown 1394TA"); break; } break; default: + printf("unknown spec"); break; } fwdev->status = FWDEVATTACHED; diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c index 1ee7e75..a72d26d 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -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++) DELAY(100); bm = OREAD(sc, OHCI_CSR_DATA); - if((bm & 0x3f) == 0x3f){ - printf("fw_set_bus_manager: %d->%d (loop=%d)\n", bm, node, i); + if((bm & 0x3f) == 0x3f) bm = node; - }else{ - printf("fw_set_bus_manager: %d-X%d (loop=%d)\n", bm, node, i); - } + if (bootverbose) + device_printf(sc->fc.dev, + "fw_set_bus_manager: %d->%d (loop=%d)\n", bm, node, i); return(bm); } @@ -471,13 +470,15 @@ fwohci_init(struct fwohci_softc *sc, device_t dev) /* FLUSH FIFO and reset Transmitter/Reciever */ OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET); - device_printf(dev, "resetting OHCI..."); + if (bootverbose) + device_printf(dev, "resetting OHCI..."); i = 0; while(OREAD(sc, OHCI_HCCCTL) & OHCI_HCC_RESET) { if (i++ > 100) break; DELAY(1000); } - printf("done (%d)\n", i); + if (bootverbose) + printf("done (%d)\n", i); OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LPS); /* XXX wait for SCLK. */ DELAY(100000); @@ -487,7 +488,8 @@ fwohci_init(struct fwohci_softc *sc, device_t dev) /* XXX */ if (((reg & 0x0000f000) >> 12) < 10) 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_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 */ if (e1394a) { #endif - device_printf(dev, "Enable 1394a Enhancements\n"); + if (bootverbose) + device_printf(dev, + "Enable 1394a Enhancements\n"); /* enable EAA EMC */ reg2 |= 0x03; /* set aPhyEnhanceEnable */ @@ -781,7 +785,7 @@ txloop: if(db_tr != dbch->bottom){ goto txloop; } 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; } kick: @@ -791,7 +795,8 @@ kick: if(dbch->xferq.flag & FWXFERQ_RUNNING) { OWRITE(sc, OHCI_DMACTL(off), OHCI_CNTL_DMA_WAKE); } 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))); OWRITE(sc, OHCI_DMACMD(off), vtophys(dbch->top->db) | fsegment); 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; 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) { sc->intmask |= OHCI_INT_EN; OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_EN); diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c index dcb6063..a2a0684 100644 --- a/sys/dev/firewire/fwohci_pci.c +++ b/sys/dev/firewire/fwohci_pci.c @@ -183,7 +183,8 @@ fwohci_pci_attach(device_t self) cache_line = DEF_CACHE_LINE; pci_write_config(self, PCIR_CACHELNSZ, cache_line, 1); #endif - printf("cache size %d.\n", (int) cache_line); + if (bootverbose) + device_printf(self, "cache size %d.\n", (int) cache_line); /**/ rid = PCI_CBMEM; sc->bsr = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index 5433bb9..dca079d 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -174,7 +174,8 @@ fwe_attach(device_t dev) eaddr[3] = fwe->fd.fc->eui[5]; eaddr[4] = fwe->fd.fc->eui[6]; 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]); /* fill the rest and attach interface */ diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index 27359fc..83d692ba 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -129,7 +129,7 @@ static char *orb_fun_name[] = { #define ORB_RES_ILLE 2 #define ORB_RES_VEND 3 -static int debug = 1; +static int debug = 0; static int auto_login = 1; static int max_speed = 2; @@ -555,8 +555,10 @@ END_DEBUG } break; } +SBP_DEBUG(0) sbp_show_sdev_info(sdev, (sdev->status == SBP_DEV_TOATTACH)); +END_DEBUG } else { switch (sdev->status) { case SBP_DEV_ATTACHED: @@ -1063,8 +1065,10 @@ sbp_mgm_orb(struct sbp_dev *sdev, int func) sdev->target->target_id, sdev->lun_id)); +SBP_DEBUG(0) sbp_show_sdev_info(sdev, 2); printf("%s\n", orb_fun_name[(func>>16)&0xf]); +END_DEBUG switch (func) { case ORB_FUN_LGI: ocb->orb[2] = htonl(nid << 16); |