kernel/disk: Remove use of "%b" format.
authorzrj <rimvydas.jasinskas@gmail.com>
Sun, 4 Feb 2018 14:27:27 +0000 (16:27 +0200)
committerzrj <zrj@dragonflybsd.org>
Wed, 14 Feb 2018 08:14:10 +0000 (10:14 +0200)
Switch to args safe "%pb%i" internal format.

18 files changed:
sys/dev/disk/ahci/ahci.c
sys/dev/disk/ahci/ahci_attach.c
sys/dev/disk/ahci/ahci_pm.c
sys/dev/disk/fd/fd.c
sys/dev/disk/nata/ata-queue.c
sys/dev/disk/nata/ata-raid.c
sys/dev/disk/sili/sili.c
sys/dev/disk/sili/sili_pm.c
sys/dev/raid/aac/aac.c
sys/dev/raid/aac/aac_debug.c
sys/dev/raid/ciss/ciss.c
sys/dev/raid/mfi/mfi_debug.c
sys/dev/raid/mlx/mlx.c
sys/dev/raid/mly/mly.c
sys/dev/raid/mps/mps.c
sys/dev/raid/mps/mps_table.c
sys/dev/raid/twe/twe.c
sys/dev/raid/twe/twereg.h

index 98d1ef9..32aa887 100644 (file)
@@ -95,8 +95,8 @@ ahci_init(struct ahci_softc *sc)
        int             i;
        struct ahci_port *ap;
 
-       DPRINTF(AHCI_D_VERBOSE, " GHC 0x%b",
-               ahci_read(sc, AHCI_REG_GHC), AHCI_FMT_GHC);
+       DPRINTF(AHCI_D_VERBOSE, " GHC 0x%pb%i",
+               AHCI_FMT_GHC, ahci_read(sc, AHCI_REG_GHC));
 
        /*
         * AHCI version.
@@ -1016,13 +1016,13 @@ ahci_port_start(struct ahci_port *ap)
                is = ahci_pread(ap, AHCI_PREG_IS);
                tfd = ahci_pread(ap, AHCI_PREG_TFD);
                kprintf("%s: Cannot start command DMA\n"
-                       "NCMP=%b NSERR=%b\n"
-                       "NEWIS=%b\n"
-                       "NEWTFD=%b\n",
+                       "NCMP=%pb%i NSERR=%pb%i\n"
+                       "NEWIS=%pb%i\n"
+                       "NEWTFD=%pb%i\n",
                        PORTNAME(ap),
-                       r, AHCI_PFMT_CMD, s, AHCI_PFMT_SERR,
-                       is, AHCI_PFMT_IS,
-                       tfd, AHCI_PFMT_TFD_STS);
+                       AHCI_PFMT_CMD, r, AHCI_PFMT_SERR, s,
+                       AHCI_PFMT_IS, is,
+                       AHCI_PFMT_TFD_STS, tfd);
                return (1);
        }
 
@@ -1180,8 +1180,8 @@ ahci_port_softreset(struct ahci_port *ap)
        error = EIO;
 
        if (bootverbose) {
-               kprintf("%s: START SOFTRESET %b\n", PORTNAME(ap),
-                       ahci_pread(ap, AHCI_PREG_CMD), AHCI_PFMT_CMD);
+               kprintf("%s: START SOFTRESET %pb%i\n", PORTNAME(ap),
+                       AHCI_PFMT_CMD, ahci_pread(ap, AHCI_PREG_CMD));
        }
 
        DPRINTF(AHCI_D_VERBOSE, "%s: soft reset\n", PORTNAME(ap));
@@ -1301,9 +1301,9 @@ ahci_port_softreset(struct ahci_port *ap)
 
        if (ahci_pwait_clr(ap, AHCI_PREG_TFD,
                            AHCI_PREG_TFD_STS_BSY | AHCI_PREG_TFD_STS_DRQ)) {
-               kprintf("%s: device didn't come ready after reset, TFD: 0x%b\n",
-                       PORTNAME(ap),
-                       ahci_pread(ap, AHCI_PREG_TFD), AHCI_PFMT_TFD_STS);
+               kprintf("%s: device didn't come ready after reset, "
+                       "TFD: 0x%pb%i\n", PORTNAME(ap),
+                       AHCI_PFMT_TFD_STS, ahci_pread(ap, AHCI_PREG_TFD));
                error = EBUSY;
                goto err;
        }
@@ -1585,10 +1585,8 @@ retry:
        ahci_flush_tfd(ap);
        if (ahci_pwait_clr_to(ap, 8000, AHCI_PREG_TFD,
                            AHCI_PREG_TFD_STS_BSY | AHCI_PREG_TFD_STS_DRQ)) {
-               kprintf("%s: Device BUSY: %b\n",
-                       PORTNAME(ap),
-                       ahci_pread(ap, AHCI_PREG_TFD),
-                               AHCI_PFMT_TFD_STS);
+               kprintf("%s: Device BUSY: %pb%i\n", PORTNAME(ap),
+                       AHCI_PFMT_TFD_STS, ahci_pread(ap, AHCI_PREG_TFD));
                if (retries == 0) {
                        kprintf("%s: Retrying\n", PORTNAME(ap));
                        retries = 1;
@@ -2101,11 +2099,12 @@ ahci_poll(struct ahci_ccb *ccb, int timeout,
        } while (timeout > 0);
 
        if ((ccb->ccb_xa.flags & ATA_F_SILENT) == 0) {
-               kprintf("%s: Poll timeout slot %d CMD: %b TFD: 0x%b SERR: %b\n",
+               kprintf("%s: Poll timeout slot %d "
+                       "CMD: %pb%i TFD: 0x%pb%i SERR: %pb%i\n",
                        ATANAME(ap, ccb->ccb_xa.at), ccb->ccb_slot,
-                       ahci_pread(ap, AHCI_PREG_CMD), AHCI_PFMT_CMD,
-                       ahci_pread(ap, AHCI_PREG_TFD), AHCI_PFMT_TFD_STS,
-                       ahci_pread(ap, AHCI_PREG_SERR), AHCI_PFMT_SERR);
+                       AHCI_PFMT_CMD, ahci_pread(ap, AHCI_PREG_CMD),
+                       AHCI_PFMT_TFD_STS, ahci_pread(ap, AHCI_PREG_TFD),
+                       AHCI_PFMT_SERR, ahci_pread(ap, AHCI_PREG_SERR));
        }
 
        timeout_fn(ccb);
@@ -2787,9 +2786,8 @@ finish_error:
                        err_slot = AHCI_PREG_CMD_CCS(
                                                ahci_pread(ap, AHCI_PREG_CMD));
                        ccb = &ap->ap_ccbs[err_slot];
-                       kprintf("%s: DHRS tfd=%b err_slot=%d cmd=%02x\n",
-                               PORTNAME(ap),
-                               tfd, AHCI_PFMT_TFD_STS,
+                       kprintf("%s: DHRS tfd=%pb%i err_slot=%d cmd=%02x\n",
+                               PORTNAME(ap), AHCI_PFMT_TFD_STS, tfd,
                                err_slot, ccb->ccb_xa.fis->command);
                        goto process_error;
                }
@@ -2845,10 +2843,9 @@ finish_error:
                u_int32_t serr = ahci_pread(ap, AHCI_PREG_SERR);
                if ((ap->ap_flags & AP_F_IFS_IGNORED) == 0) {
                        kprintf("%s: IFS during PM probe (ignored) "
-                               "IS=%b, SERR=%b\n",
-                               PORTNAME(ap),
-                               is, AHCI_PFMT_IS,
-                               serr, AHCI_PFMT_SERR);
+                               "IS=%pb%i, SERR=%pb%i\n", PORTNAME(ap),
+                               AHCI_PFMT_IS, is,
+                               AHCI_PFMT_SERR, serr);
                        ap->ap_flags |= AP_F_IFS_IGNORED;
                }
 
@@ -2928,8 +2925,8 @@ finish_error:
                        ahci_os_sleep(1000);
                        goto failall;
                }
-               kprintf("%s: Transient Errors: %b (%d)\n",
-                       PORTNAME(ap), is, AHCI_PFMT_IS, ap->ap_probe);
+               kprintf("%s: Transient Errors: %pb%i (%d)\n",
+                       PORTNAME(ap), AHCI_PFMT_IS, is, ap->ap_probe);
                is &= ~(AHCI_PREG_IS_PCS | AHCI_PREG_IS_PRCS);
                ahci_os_sleep(200);
 
@@ -2985,12 +2982,9 @@ skip_pcs:
                                  AHCI_PREG_IS_IFS | AHCI_PREG_IS_OFS |
                                  AHCI_PREG_IS_UFS));
                serr = ahci_pread(ap, AHCI_PREG_SERR);
-               kprintf("%s: Unrecoverable errors (IS: %b, SERR: %b), "
-                       "disabling port.\n",
-                       PORTNAME(ap),
-                       is, AHCI_PFMT_IS,
-                       serr, AHCI_PFMT_SERR
-               );
+               kprintf("%s: Unrecoverable errors (IS: %pb%i, SERR: %pb%i), "
+                       "disabling port.\n", PORTNAME(ap),
+                       AHCI_PFMT_IS, is, AHCI_PFMT_SERR, serr);
                is &= ~(AHCI_PREG_IS_TFES | AHCI_PREG_IS_HBFS |
                        AHCI_PREG_IS_IFS | AHCI_PREG_IS_OFS |
                        AHCI_PREG_IS_UFS);
@@ -3768,20 +3762,20 @@ ahci_ata_cmd_timeout(struct ahci_ccb *ccb)
 
        kprintf("%s: CMD TIMEOUT state=%d slot=%d\n"
                "\tglb-status 0x%08x\n"
-               "\tcmd-reg 0x%b\n"
-               "\tport_status 0x%b\n"
+               "\tcmd-reg 0x%pb%i\n"
+               "\tport_status 0x%pb%i\n"
                "\tsactive=%08x active=%08x expired=%08x\n"
                "\t   sact=%08x     ci=%08x\n"
-               "\t    STS=%b\n",
+               "\t    STS=%pb%i\n",
                ATANAME(ap, at),
                ccb->ccb_xa.state, ccb->ccb_slot,
                ahci_read(ap->ap_sc, AHCI_REG_IS),
-               ahci_pread(ap, AHCI_PREG_CMD), AHCI_PFMT_CMD,
-               ahci_pread(ap, AHCI_PREG_IS), AHCI_PFMT_IS,
+               AHCI_PFMT_CMD, ahci_pread(ap, AHCI_PREG_CMD),
+               AHCI_PFMT_IS, ahci_pread(ap, AHCI_PREG_IS),
                ap->ap_sactive, ap->ap_active, ap->ap_expired,
                ahci_pread(ap, AHCI_PREG_SACT),
                ahci_pread(ap, AHCI_PREG_CI),
-               ahci_pread(ap, AHCI_PREG_TFD), AHCI_PFMT_TFD_STS
+               AHCI_PFMT_TFD_STS, ahci_pread(ap, AHCI_PREG_TFD)
        );
 
 
index d79a8ec..3f76499 100644 (file)
@@ -448,19 +448,19 @@ ahci_pci_attach(device_t dev)
        if (reg >= AHCI_REG_VS_1_3) {
                cap2 = ahci_read(sc, AHCI_REG_CAP2);
                device_printf(dev,
-                             "%s cap 0x%b cap2 0x%b, %d ports, "
+                             "%s cap 0x%pb%i cap2 0x%pb%i, %d ports, "
                              "%d tags/port, gen %s\n",
                              revbuf,
-                             cap, AHCI_FMT_CAP,
-                             cap2, AHCI_FMT_CAP2,
+                             AHCI_FMT_CAP, cap,
+                             AHCI_FMT_CAP2, cap2,
                              AHCI_REG_CAP_NP(cap), sc->sc_ncmds, gen);
        } else {
                cap2 = 0;
                device_printf(dev,
-                             "%s cap 0x%b, %d ports, "
+                             "%s cap 0x%pb%i, %d ports, "
                              "%d tags/port, gen %s\n",
                              revbuf,
-                             cap, AHCI_FMT_CAP,
+                             AHCI_FMT_CAP, cap,
                              AHCI_REG_CAP_NP(cap), sc->sc_ncmds, gen);
        }
        sc->sc_cap2 = cap2;
index 85b1841..311052f 100644 (file)
@@ -211,9 +211,8 @@ retry:
        ccb->ccb_xa.state = ATA_S_PENDING;
 
        if (bootverbose) {
-               kprintf("%s: PMPROBE PreStatus 0x%b\n",
-                       PORTNAME(ap),
-                       ahci_pread(ap, AHCI_PREG_TFD), AHCI_PFMT_TFD_STS);
+               kprintf("%s: PMPROBE PreStatus 0x%pb%i\n", PORTNAME(ap),
+                       AHCI_PFMT_TFD_STS, ahci_pread(ap, AHCI_PREG_TFD));
        }
 
        /*
@@ -244,9 +243,8 @@ retry:
        }
 
        if (bootverbose) {
-               kprintf("%s: PMPROBE PosStatus 0x%b\n",
-                       PORTNAME(ap),
-                       ahci_pread(ap, AHCI_PREG_TFD), AHCI_PFMT_TFD_STS);
+               kprintf("%s: PMPROBE PosStatus 0x%pb%i\n", PORTNAME(ap),
+                       AHCI_PFMT_TFD_STS, ahci_pread(ap, AHCI_PREG_TFD));
        }
 #if 0
        /*
@@ -471,11 +469,8 @@ ahci_pm_identify(struct ahci_port *ap)
                        --nports;
        }
 
-       kprintf("%s: Port multiplier: chip=%08x rev=0x%b nports=%d\n",
-               PORTNAME(ap),
-               chipid,
-               rev, SATA_PFMT_PM_REV,
-               nports);
+       kprintf("%s: Port multiplier: chip=%08x rev=0x%pb%i nports=%d\n",
+               PORTNAME(ap), chipid, SATA_PFMT_PM_REV, rev, nports);
        if (has_dummy_port) {
                kprintf("%s: Port multiplier: Ignoring dummy port #%d\n",
                PORTNAME(ap), nports);
@@ -486,16 +481,12 @@ ahci_pm_identify(struct ahci_port *ap)
                kprintf("%s: Port multiplier: Warning, "
                        "cannot read feature register\n", PORTNAME(ap));
        } else {
-               kprintf("%s: Port multiplier features: 0x%b\n",
-                       PORTNAME(ap),
-                       data1,
-                       SATA_PFMT_PM_FEA);
+               kprintf("%s: Port multiplier features: 0x%pb%i\n",
+                       PORTNAME(ap), SATA_PFMT_PM_FEA, data1);
        }
        if (ahci_pm_read(ap, 15, SATA_PMREG_FEAEN, &data2) == 0) {
-               kprintf("%s: Port multiplier defaults: 0x%b\n",
-                       PORTNAME(ap),
-                       data2,
-                       SATA_PFMT_PM_FEA);
+               kprintf("%s: Port multiplier defaults: 0x%pb%i\n",
+                       PORTNAME(ap), SATA_PFMT_PM_FEA, data2);
        }
 
        /*
index 7df0014..965f48e 100644 (file)
@@ -1817,8 +1817,8 @@ fdstate(fdc_p fdc)
                                        failed = 1;
                                if ((st3 & NE7_ST3_T0) == 0) {
                                        kprintf(
-               "fd%d: Seek to cyl 0, but not really there (ST3 = %b)\n",
-                                              fdu, st3, NE7_ST3BITS);
+               "fd%d: Seek to cyl 0, but not really there (ST3 = %pb%i)\n",
+                                              fdu, NE7_ST3BITS, st3);
                                        failed = 1;
                                }
 
@@ -2111,8 +2111,8 @@ fdstate(fdc_p fdc)
                                 * this one if it seems to be the first
                                 * time in a line
                                 */
-                               kprintf("fd%d: recal failed ST0 %b cyl %d\n",
-                                      fdu, st0, NE7_ST0BITS, cyl);
+                               kprintf("fd%d: recal failed ST0 %pb%i cyl %d\n",
+                                      fdu, NE7_ST0BITS, st0, cyl);
                        if(fdc->retry < 3) fdc->retry = 3;
                        return (retrier(fdc));
                }
@@ -2211,10 +2211,10 @@ retrier(struct fdc_data *fdc)
                        if (printerror) {
                                if (fdc->flags & FDC_STAT_VALID)
                                        kprintf(
-                       " (ST0 %b ST1 %b ST2 %b cyl %u hd %u sec %u)\n",
-                                              fdc->status[0], NE7_ST0BITS,
-                                              fdc->status[1], NE7_ST1BITS,
-                                              fdc->status[2], NE7_ST2BITS,
+                       " (ST0 %pb%i ST1 %pb%i ST2 %pb%i cyl %u hd %u sec %u)\n",
+                                              NE7_ST0BITS, fdc->status[0],
+                                              NE7_ST1BITS, fdc->status[1],
+                                              NE7_ST2BITS, fdc->status[2],
                                               fdc->status[3], fdc->status[4],
                                               fdc->status[5]);
                                else
index f093aa5..eb94a01 100644 (file)
@@ -393,14 +393,16 @@ ata_completed(void *context, int dummy)
        if (!request->result && request->status & ATA_S_ERROR) {
            if (!(request->flags & ATA_R_QUIET)) {
                device_printf(request->dev,
-                             "FAILURE - %s status=%b error=%b", 
+                             "FAILURE - %s status=%pb%i error=%pb%i",
                              ata_cmd2str(request),
-                             request->status, "\20\10BUSY\7READY\6DMA_READY"
+                             "\20\10BUSY\7READY\6DMA_READY"
                              "\5DSC\4DRQ\3CORRECTABLE\2INDEX\1ERROR",
-                             request->error, "\20\10ICRC\7UNCORRECTABLE"
+                             request->status,
+                             "\20\10ICRC\7UNCORRECTABLE"
                              "\6MEDIA_CHANGED\5NID_NOT_FOUND"
                              "\4MEDIA_CHANGE_REQEST"
-                             "\3ABORTED\2NO_MEDIA\1ILLEGAL_LENGTH");
+                             "\3ABORTED\2NO_MEDIA\1ILLEGAL_LENGTH",
+                             request->error);
                if ((request->flags & ATA_R_DMA) &&
                    (request->dmastat & ATA_BMSTAT_ERROR))
                    kprintf(" dma=0x%02x", request->dmastat);
index 3ee99ad..2490a19 100644 (file)
@@ -4320,8 +4320,8 @@ ata_raid_print_meta(struct ar_softc *raid)
     kprintf("=================================================\n");
     kprintf("format              %s\n", ata_raid_format(raid));
     kprintf("type                %s\n", ata_raid_type(raid));
-    kprintf("flags               0x%02x %b\n", raid->status, raid->status,
-          "\20\3REBUILDING\2DEGRADED\1READY\n");
+    kprintf("flags               0x%02x %pb%i\n", raid->status,
+          "\20\3REBUILDING\2DEGRADED\1READY\n", raid->status);
     kprintf("magic_0             0x%016jx\n", raid->magic_0);
     kprintf("magic_1             0x%016jx\n",raid->magic_1);
     kprintf("generation          %u\n", raid->generation);
@@ -4334,8 +4334,8 @@ ata_raid_print_meta(struct ar_softc *raid)
     kprintf("interleave          %u\n", raid->interleave);
     kprintf("total_disks         %u\n", raid->total_disks);
     for (i = 0; i < raid->total_disks; i++) {
-       kprintf("    disk %d:      flags = 0x%02x %b\n", i, raid->disks[i].flags,
-              raid->disks[i].flags, "\20\4ONLINE\3SPARE\2ASSIGNED\1PRESENT\n");
+       kprintf("    disk %d:      flags = 0x%02x %pb%i\n", i, raid->disks[i].flags,
+              "\20\4ONLINE\3SPARE\2ASSIGNED\1PRESENT\n", raid->disks[i].flags);
        if (raid->disks[i].dev) {
            kprintf("        ");
            device_printf(raid->disks[i].dev, " sectors %jd\n",
@@ -4520,8 +4520,8 @@ ata_raid_hptv3_print_meta(struct hptv3_raid_conf *meta)
        kprintf("    total_disks         %u\n", meta->configs[i].total_disks);
        kprintf("    disk_number         %u\n", meta->configs[i].disk_number);
        kprintf("    stripe_shift        %u\n", meta->configs[i].stripe_shift);
-       kprintf("    status              %b\n", meta->configs[i].status,
-              "\20\2RAID5\1NEED_REBUILD\n");
+       kprintf("    status              %pb%i\n",
+              "\20\2RAID5\1NEED_REBUILD\n", meta->configs[i].status);
        kprintf("    critical_disks      %u\n", meta->configs[i].critical_disks);
        kprintf("    rebuild_lba         %ju\n",
               meta->configs_high[0].rebuild_lba +
@@ -4534,8 +4534,8 @@ ata_raid_hptv3_print_meta(struct hptv3_raid_conf *meta)
     kprintf("checksum_1          0x%02x\n", meta->checksum_1);
     kprintf("dummy_0             0x%02x\n", meta->dummy_0);
     kprintf("dummy_1             0x%02x\n", meta->dummy_1);
-    kprintf("flags               %b\n", meta->flags,
-          "\20\4RCACHE\3WCACHE\2NCQ\1TCQ\n");
+    kprintf("flags               %pb%i\n",
+          "\20\4RCACHE\3WCACHE\2NCQ\1TCQ\n", meta->flags);
     kprintf("=================================================\n");
 }
 
@@ -4864,12 +4864,12 @@ ata_raid_promise_print_meta(struct promise_raid_conf *meta)
     kprintf("magic_0             0x%016jx\n", meta->magic_0);
     kprintf("magic_1             0x%04x\n", meta->magic_1);
     kprintf("magic_2             0x%08x\n", meta->magic_2);
-    kprintf("integrity           0x%08x %b\n", meta->raid.integrity,
-               meta->raid.integrity, "\20\10VALID\n" );
-    kprintf("flags               0x%02x %b\n",
-          meta->raid.flags, meta->raid.flags,
+    kprintf("integrity           0x%08x %pb%i\n", meta->raid.integrity,
+          "\20\10VALID\n", meta->raid.integrity);
+    kprintf("flags               0x%02x %pb%i\n",
+          meta->raid.flags,
           "\20\10READY\7DOWN\6REDIR\5DUPLICATE\4SPARE"
-          "\3ASSIGNED\2ONLINE\1VALID\n");
+          "\3ASSIGNED\2ONLINE\1VALID\n", meta->raid.flags);
     kprintf("disk_number         %d\n", meta->raid.disk_number);
     kprintf("channel             0x%02x\n", meta->raid.channel);
     kprintf("device              0x%02x\n", meta->raid.device);
@@ -4878,9 +4878,10 @@ ata_raid_promise_print_meta(struct promise_raid_conf *meta)
     kprintf("disk_sectors        %u\n", meta->raid.disk_sectors);
     kprintf("rebuild_lba         0x%08x\n", meta->raid.rebuild_lba);
     kprintf("generation          0x%04x\n", meta->raid.generation);
-    kprintf("status              0x%02x %b\n",
-           meta->raid.status, meta->raid.status,
-          "\20\6MARKED\5DEGRADED\4READY\3INITED\2ONLINE\1VALID\n");
+    kprintf("status              0x%02x %pb%i\n",
+           meta->raid.status,
+          "\20\6MARKED\5DEGRADED\4READY\3INITED\2ONLINE\1VALID\n",
+           meta->raid.status);
     kprintf("type                %s\n", ata_raid_promise_type(meta->raid.type));
     kprintf("total_disks         %u\n", meta->raid.total_disks);
     kprintf("stripe_shift        %u\n", meta->raid.stripe_shift);
@@ -4893,10 +4894,10 @@ ata_raid_promise_print_meta(struct promise_raid_conf *meta)
     kprintf("magic_1             0x%016jx\n", meta->raid.magic_1);
     kprintf("DISK#   flags dummy_0 channel device  magic_0\n");
     for (i = 0; i < 8; i++) {
-       kprintf("  %d    %b    0x%02x  0x%02x  0x%02x  ",
-              i, meta->raid.disk[i].flags,
+       kprintf("  %d    %pb%i    0x%02x  0x%02x  0x%02x  ", i,
               "\20\10READY\7DOWN\6REDIR\5DUPLICATE\4SPARE"
-              "\3ASSIGNED\2ONLINE\1VALID\n", meta->raid.disk[i].dummy_0,
+              "\3ASSIGNED\2ONLINE\1VALID\n",
+              meta->raid.disk[i].flags, meta->raid.disk[i].dummy_0,
               meta->raid.disk[i].channel, meta->raid.disk[i].device);
        kprintf("0x%016jx\n", meta->raid.disk[i].magic_0);
     }
@@ -4942,9 +4943,8 @@ ata_raid_sii_print_meta(struct sii_raid_conf *meta)
     kprintf("raid1_ident         %u\n", meta->raid1_ident);
     kprintf("rebuild_lba         %ju\n", meta->rebuild_lba);
     kprintf("generation          0x%08x\n", meta->generation);
-    kprintf("status              0x%02x %b\n",
-           meta->status, meta->status,
-          "\20\1READY\n");
+    kprintf("status              0x%02x %pb%i\n",
+           meta->status, "\20\1READY\n", meta->status);
     kprintf("base_raid1_position %02x\n", meta->base_raid1_position);
     kprintf("base_raid0_position %02x\n", meta->base_raid0_position);
     kprintf("position            %02x\n", meta->position);
index 23cc996..e476634 100644 (file)
@@ -93,8 +93,8 @@ static void sili_ata_cmd_done(struct sili_ccb *ccb);
 int
 sili_init(struct sili_softc *sc)
 {
-       DPRINTF(SILI_D_VERBOSE, " GHC 0x%b",
-               sili_read(sc, SILI_REG_GHC), SILI_FMT_GHC);
+       DPRINTF(SILI_D_VERBOSE, " GHC 0x%pb%i",
+               SILI_FMT_GHC, sili_read(sc, SILI_REG_GHC));
 
        /*
         * Reset the entire chip.  This also resets all ports.
@@ -1709,10 +1709,10 @@ sili_port_intr(struct sili_port *ap, int blockable)
                active = ap->ap_active & ~ap->ap_expired;
                error = sili_pread(ap, SILI_PREG_CERROR);
                kprintf("%s.%d target error %d active=%08x hactive=%08x "
-                       "SERR=%b\n",
+                       "SERR=%pb%i\n",
                        PORTNAME(ap), target, error,
                        active, sili_pread(ap, SILI_PREG_SLOTST),
-                       sili_pread(ap, SILI_PREG_SERR), SILI_PFMT_SERR);
+                       SILI_PFMT_SERR, sili_pread(ap, SILI_PREG_SERR));
 
                while (active) {
                        slot = ffs(active) - 1;
@@ -1829,11 +1829,11 @@ sili_port_intr(struct sili_port *ap, int blockable)
                sili_pwrite(ap, SILI_PREG_INT_STATUS, is & fatal_mask);
 
                serr = sili_pread(ap, SILI_PREG_SERR);
-               kprintf("%s: Unrecoverable errors (IS: %b, SERR: %b), "
+               kprintf("%s: Unrecoverable errors (IS: %pb%i, SERR: %pb%i), "
                        "disabling port.\n",
                        PORTNAME(ap),
-                       is, SILI_PFMT_INT_STATUS,
-                       serr, SILI_PFMT_SERR
+                       SILI_PFMT_INT_STATUS, is,
+                       SILI_PFMT_SERR, serr
                );
                is &= ~fatal_mask;
                /* XXX try recovery first */
@@ -2356,9 +2356,9 @@ sili_ata_cmd(struct ata_xfer *xa)
        if (ccb->ccb_port->ap_state == AP_S_FATAL_ERROR)
                goto failcmd;
 #if 0
-       kprintf("%s: started std command %b ccb %d ccb_at %p %d\n",
+       kprintf("%s: started std command %pb%i ccb %d ccb_at %p %d\n",
                ATANAME(ccb->ccb_port, ccb->ccb_xa.at),
-               sili_pread(ccb->ccb_port, SILI_PREG_CMD), SILI_PFMT_CMD,
+               SILI_PFMT_CMD, sili_pread(ccb->ccb_port, SILI_PREG_CMD),
                ccb->ccb_slot,
                ccb->ccb_xa.at,
                ccb->ccb_xa.at ? ccb->ccb_xa.at->at_target : -1);
index 2b09d5b..871e1f9 100644 (file)
@@ -193,10 +193,10 @@ sili_pm_identify(struct sili_port *ap)
                        --nports;
        }
 
-       kprintf("%s: Port multiplier: chip=%08x rev=0x%b nports=%d\n",
+       kprintf("%s: Port multiplier: chip=%08x rev=0x%pb%i nports=%d\n",
                PORTNAME(ap),
                chipid,
-               rev, SATA_PFMT_PM_REV,
+               SATA_PFMT_PM_REV, rev,
                nports);
        if (has_dummy_port) {
                kprintf("%s: Port multiplier: Ignoring dummy port #%d\n",
@@ -208,16 +208,12 @@ sili_pm_identify(struct sili_port *ap)
                kprintf("%s: Port multiplier: Warning, "
                        "cannot read feature register\n", PORTNAME(ap));
        } else {
-               kprintf("%s: Port multiplier features: 0x%b\n",
-                       PORTNAME(ap),
-                       data1,
-                       SATA_PFMT_PM_FEA);
+               kprintf("%s: Port multiplier features: 0x%pb%i\n",
+                       PORTNAME(ap), SATA_PFMT_PM_FEA, data1);
        }
        if (sili_pm_read(ap, 15, SATA_PMREG_FEAEN, &data2) == 0) {
-               kprintf("%s: Port multiplier defaults: 0x%b\n",
-                       PORTNAME(ap),
-                       data2,
-                       SATA_PFMT_PM_FEA);
+               kprintf("%s: Port multiplier defaults: 0x%pb%i\n",
+                       PORTNAME(ap), SATA_PFMT_PM_FEA, data2);
        }
 
        /*
index 7953312..80ae066 100644 (file)
@@ -2719,8 +2719,7 @@ aac_describe_controller(struct aac_softc *sc)
                    info->KernelRevision.buildNumber,
                    (u_int32_t)(info->SerialNumber & 0xffffff));
 
-               device_printf(sc->aac_dev, "Supported Options=%b\n",
-                             sc->supported_options,
+               device_printf(sc->aac_dev, "Supported Options=%pb%i\n",
                              "\20"
                              "\1SNAPSHOT"
                              "\2CLUSTERS"
@@ -2740,7 +2739,8 @@ aac_describe_controller(struct aac_softc *sc)
                              "\21ADPTINFO"
                              "\22NEWCOMM"
                              "\23ARRAY64BIT"
-                             "\24HEATSENSOR");
+                             "\24HEATSENSOR"
+                             , sc->supported_options);
        }
 
        if (sc->supported_options & AAC_SUPPORTED_SUPPLEMENT_ADAPTER_INFO) {
index 3eb7c0b..8aa66d1 100644 (file)
@@ -173,7 +173,7 @@ aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, const char *caller)
                return;
        }
        device_printf(sc->aac_dev, "%s: FIB @ %p\n", caller, fib);
-       device_printf(sc->aac_dev, "  XferState %b\n", fib->Header.XferState,
+       device_printf(sc->aac_dev, "  XferState %pb%i\n",
                      "\20"
                      "\1HOSTOWNED"
                      "\2ADAPTEROWNED"
@@ -195,7 +195,7 @@ aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, const char *caller)
                      "\22ADAPMICROFIB"
                      "\23BIOSFIB"
                      "\24FAST_RESPONSE"
-                     "\25APIFIB\n");
+                     "\25APIFIB\n", fib->Header.XferState);
        device_printf(sc->aac_dev, "  Command       %d\n", fib->Header.Command);
        device_printf(sc->aac_dev, "  StructType    %d\n",
                      fib->Header.StructType);
index 6b0ec4d..84387a1 100644 (file)
@@ -1213,11 +1213,12 @@ ciss_identify_adapter(struct ciss_softc *sc)
 
        ciss_printf(sc, "  signature '%.4s'\n", sc->ciss_cfg->signature);
        ciss_printf(sc, "  valence %d\n", sc->ciss_cfg->valence);
-       ciss_printf(sc, "  supported I/O methods 0x%b\n",
-                   sc->ciss_cfg->supported_methods,
-                   "\20\1READY\2simple\3performant\4MEMQ\n");
-       ciss_printf(sc, "  active I/O method 0x%b\n",
-                   sc->ciss_cfg->active_method, "\20\2simple\3performant\4MEMQ\n");
+       ciss_printf(sc, "  supported I/O methods 0x%pb%i\n",
+                   "\20\1READY\2simple\3performant\4MEMQ\n",
+                   sc->ciss_cfg->supported_methods);
+       ciss_printf(sc, "  active I/O method 0x%pb%i\n",
+                   "\20\2simple\3performant\4MEMQ\n",
+                   sc->ciss_cfg->active_method);
        ciss_printf(sc, "  4G page base 0x%08x\n",
                    sc->ciss_cfg->command_physlimit);
        ciss_printf(sc, "  interrupt coalesce delay %dus\n",
@@ -1226,8 +1227,9 @@ ciss_identify_adapter(struct ciss_softc *sc)
                    sc->ciss_cfg->interrupt_coalesce_count);
        ciss_printf(sc, "  max outstanding commands %d\n",
                    sc->ciss_cfg->max_outstanding_commands);
-       ciss_printf(sc, "  bus types 0x%b\n", sc->ciss_cfg->bus_types,
-                   "\20\1ultra2\2ultra3\10fibre1\11fibre2\n");
+       ciss_printf(sc, "  bus types 0x%pb%i\n",
+                   "\20\1ultra2\2ultra3\10fibre1\11fibre2\n",
+                   sc->ciss_cfg->bus_types);
        ciss_printf(sc, "  server name '%.16s'\n", sc->ciss_cfg->server_name);
        ciss_printf(sc, "  heartbeat 0x%x\n", sc->ciss_cfg->heartbeat);
     }
@@ -3938,12 +3940,12 @@ ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn)
        switch (cn->detail) {
        case 0:
            ciss_name_device(sc, bus, target);
-           ciss_printf(sc, "logical drive %d (%s) changed status %s->%s, spare status 0x%b\n",
+           ciss_printf(sc, "logical drive %d (%s) changed status %s->%s, spare status 0x%pb%i\n",
                        cn->data.logical_status.logical_drive, ld->cl_name,
                        ciss_name_ldrive_status(cn->data.logical_status.previous_state),
                        ciss_name_ldrive_status(cn->data.logical_status.new_state),
-                       cn->data.logical_status.spare_state,
-                       "\20\1configured\2rebuilding\3failed\4in use\5available\n");
+                       "\20\1configured\2rebuilding\3failed\4in use\5available\n",
+                       cn->data.logical_status.spare_state);
 
            /*
             * Update our idea of the drive's status.
@@ -4152,9 +4154,9 @@ ciss_print_request(struct ciss_request *cr)
     cc = cr->cr_cc;
 
     ciss_printf(sc, "REQUEST @ %p\n", cr);
-    ciss_printf(sc, "  data %p/%d  tag %d  flags %b\n",
-             cr->cr_data, cr->cr_length, cr->cr_tag, cr->cr_flags,
-             "\20\1mapped\2sleep\3poll\4dataout\5datain\n");
+    ciss_printf(sc, "  data %p/%d  tag %d  flags %pb%i\n",
+             cr->cr_data, cr->cr_length, cr->cr_tag,
+             "\20\1mapped\2sleep\3poll\4dataout\5datain\n", cr->cr_flags);
     ciss_printf(sc, "  sg list/total %d/%d  host tag 0x%x\n",
                cc->header.sg_in_list, cc->header.sg_total, cc->header.host_tag);
     switch(cc->header.address.mode.mode) {
@@ -4279,8 +4281,9 @@ ciss_print_adapter(struct ciss_softc *sc)
            sc->ciss_qstat[i].q_max);
     }
     ciss_printf(sc, "max_requests %d\n", sc->ciss_max_requests);
-    ciss_printf(sc, "flags %b\n", sc->ciss_flags,
-       "\20\1notify_ok\2control_open\3aborting\4running\21fake_synch\22bmic_abort\n");
+    ciss_printf(sc, "flags %pb%i\n",
+       "\20\1notify_ok\2control_open\3aborting\4running\21fake_synch\22bmic_abort\n",
+       sc->ciss_flags);
 
     for (i = 0; i < sc->ciss_max_logical_bus; i++) {
        for (j = 0; j < CISS_MAX_LOGICAL; j++) {
index e9057b9..dea84ca 100644 (file)
 static void
 mfi_print_frame_flags(device_t dev, uint32_t flags)
 {
-       device_printf(dev, "flags=%b\n", flags,
+       device_printf(dev, "flags=%pb%i\n",
            "\20"
            "\1NOPOST"
            "\2SGL64"
            "\3SENSE64"
            "\4WRITE"
            "\5READ"
-           "\6IEEESGL");
+           "\6IEEESGL", flags);
 }
 
 static void
@@ -197,7 +197,7 @@ mfi_print_cmd(struct mfi_command *cm)
        device_printf(dev, "cm=%p index=%d total_frame_size=%d "
            "extra_frames=%d\n", cm, cm->cm_index, cm->cm_total_frame_size,
            cm->cm_extra_frames);
-       device_printf(dev, "flags=%b\n", cm->cm_flags,
+       device_printf(dev, "flags=%pb%i\n",
            "\20"
            "\1MAPPED"
            "\2DATAIN"
@@ -206,7 +206,7 @@ mfi_print_cmd(struct mfi_command *cm)
            "\5POLLED"
            "\6Q_FREE"
            "\7Q_READY"
-           "\10Q_BUSY");
+           "\10Q_BUSY", cm->cm_flags);
 
        switch (cm->cm_frame->header.cmd) {
        case MFI_CMD_DCMD:
index f759ece..75e4f3e 100644 (file)
@@ -2833,9 +2833,9 @@ mlx_describe_controller(struct mlx_softc *sc)
                      8 << (sc->mlx_enq2->me_scsi_cap & 0x3));
        device_printf(sc->mlx_dev, "  Firmware Build Number       %d\n", sc->mlx_enq2->me_firmware_build);
        device_printf(sc->mlx_dev, "  Fault Management Type       %d\n", sc->mlx_enq2->me_fault_mgmt_type);
-       device_printf(sc->mlx_dev, "  Features                    %b\n", sc->mlx_enq2->me_firmware_features,
-                     "\20\4Background Init\3Read Ahead\2MORE\1Cluster\n");
-       
+       device_printf(sc->mlx_dev, "  Features                    %pb%i\n",
+                     "\20\4Background Init\3Read Ahead\2MORE\1Cluster\n",
+                     sc->mlx_enq2->me_firmware_features);
     }
 }
 
index b575966..8cd6de8 100644 (file)
@@ -2607,7 +2607,9 @@ mly_print_command(struct mly_command *mc)
     if (mc->mc_packet != NULL)
        mly_print_packet(mc);
     mly_printf(sc, "  data      %p/%d\n", mc->mc_data, mc->mc_length);
-    mly_printf(sc, "  flags     %b\n", mc->mc_flags, "\20\1busy\2complete\3slotted\4mapped\5datain\6dataout\n");
+    mly_printf(sc, "  flags     %pb%i\n",
+              "\20\1busy\2complete\3slotted\4mapped\5datain\6dataout\n",
+              mc->mc_flags);
     mly_printf(sc, "  complete  %p\n", mc->mc_complete);
     mly_printf(sc, "  private   %p\n", mc->mc_private);
 }
index a2b5a48..1d65841 100644 (file)
@@ -1061,10 +1061,11 @@ mps_attach(struct mps_softc *sc)
 
        mps_printf(sc, "Firmware: %s, Driver: %s\n", sc->fw_version,
            MPS_DRIVER_VERSION);
-       mps_printf(sc, "IOCCapabilities: %b\n", sc->facts->IOCCapabilities,
+       mps_printf(sc, "IOCCapabilities: %pb%i\n",
            "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf"
            "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR"
-           "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc");
+           "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc",
+           sc->facts->IOCCapabilities);
 
        /*
         * If the chip doesn't support event replay then a hard reset will be
index ef4fcdf..8942205 100644 (file)
@@ -188,10 +188,10 @@ struct mps_table_lookup mps_sasdev_reason[] = {
 void
 mps_describe_devinfo(uint32_t devinfo, char *string, int len)
 {
-       ksnprintf(string, len, "%b,%s", devinfo,
+       ksnprintf(string, len, "%pb%i,%s",
            "\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit"
            "\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct"
-           "\15LsiDev" "\16AtapiDev" "\17SepDev",
+           "\15LsiDev" "\16AtapiDev" "\17SepDev", devinfo,
            mps_describe_table(mps_sasdev0_devtype, devinfo & 0x03));
 }
 
@@ -210,11 +210,11 @@ mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
        MPS_PRINTFIELD(sc, facts, NumberOfPorts, %d);
        MPS_PRINTFIELD(sc, facts, RequestCredit, %d);
        MPS_PRINTFIELD(sc, facts, ProductID, 0x%x);
-       mps_dprint_field(sc, MPS_INFO, "IOCCapabilities: %b\n",
-           facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace"
+       mps_dprint_field(sc, MPS_INFO, "IOCCapabilities: %pb%i\n",
+           "\20" "\3ScsiTaskFull" "\4DiagTrace"
            "\5SnapBuf" "\6ExtBuf" "\7EEDP" "\10BiDirTarg" "\11Multicast"
            "\14TransRetry" "\15IR" "\16EventReplay" "\17RaidAccel"
-           "\20MSIXIndex" "\21HostDisc");
+           "\20MSIXIndex" "\21HostDisc", facts->IOCCapabilities);
        mps_dprint_field(sc, MPS_INFO, "FWVersion= %d-%d-%d-%d\n",
            facts->FWVersion.Struct.Major,
            facts->FWVersion.Struct.Minor,
@@ -225,8 +225,8 @@ mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts)
        MPS_PRINTFIELD(sc, facts, MaxTargets, %d);
        MPS_PRINTFIELD(sc, facts, MaxSasExpanders, %d);
        MPS_PRINTFIELD(sc, facts, MaxEnclosures, %d);
-       mps_dprint_field(sc, MPS_INFO, "ProtocolFlags: %b\n",
-           facts->ProtocolFlags, "\20" "\1ScsiTarg" "\2ScsiInit");
+       mps_dprint_field(sc, MPS_INFO, "ProtocolFlags: %pb%i\n",
+           "\20" "\1ScsiTarg" "\2ScsiInit", facts->ProtocolFlags);
        MPS_PRINTFIELD(sc, facts, HighPriorityCredit, %d);
        MPS_PRINTFIELD(sc, facts, MaxReplyDescriptorPostQueueDepth, %d);
        MPS_PRINTFIELD(sc, facts, ReplyFrameSize, %d);
@@ -271,10 +271,10 @@ mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf)
        MPS_PRINTFIELD(sc, buf, DevHandle, 0x%x);
        MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x);
        MPS_PRINTFIELD(sc, buf, ZoneGroup, %d);
-       mps_dprint_field(sc, MPS_INFO, "DeviceInfo: %b,%s\n", buf->DeviceInfo,
+       mps_dprint_field(sc, MPS_INFO, "DeviceInfo: %pb%i,%s\n",
            "\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit"
            "\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct"
-           "\15LsiDev" "\16AtapiDev" "\17SepDev",
+           "\15LsiDev" "\16AtapiDev" "\17SepDev", buf->DeviceInfo,
            mps_describe_table(mps_sasdev0_devtype, buf->DeviceInfo & 0x03));
        MPS_PRINTFIELD(sc, buf, Flags, 0x%x);
        MPS_PRINTFIELD(sc, buf, PhysicalPort, %d);
@@ -298,20 +298,20 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event)
                MPI2_EVENT_DATA_SAS_DISCOVERY *data;
 
                data = (MPI2_EVENT_DATA_SAS_DISCOVERY *)&event->EventData;
-               mps_dprint_field(sc, MPS_EVENT, "Flags: %b\n", data->Flags,
-                   "\20" "\1InProgress" "\2DeviceChange");
+               mps_dprint_field(sc, MPS_EVENT, "Flags: %pb%i\n",
+                   "\20" "\1InProgress" "\2DeviceChange", data->Flags);
                mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n",
                    mps_describe_table(mps_sasdisc_reason, data->ReasonCode));
                MPS_EVENTFIELD(sc, data, PhysicalPort, %d);
-               mps_dprint_field(sc, MPS_EVENT, "DiscoveryStatus: %b\n",
-                   data->DiscoveryStatus,  "\20"
+               mps_dprint_field(sc, MPS_EVENT, "DiscoveryStatus: %pb%i\n",
+                   "\20"
                    "\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout"
                    "\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed"
                    "\11SmpCrcError" "\12SubSubLink" "\13TableTableLink"
                    "\14UnsupDevice" "\15TableSubLink" "\16MultiDomain"
                    "\17MultiSub" "\20MultiSubSub" "\34DownstreamInit"
                    "\35MaxPhys" "\36MaxTargs" "\37MaxExpanders"
-                   "\40MaxEnclosures");
+                   "\40MaxEnclosures", data->DiscoveryStatus);
                break;
        }
        case MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST:
@@ -400,11 +400,11 @@ mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf)
        mps_dprint_field(sc, MPS_INFO, "PhyInfo Reason: %s (0x%x)\n",
            mps_describe_table(mps_phyinfo_reason_names,
            (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo);
-       mps_dprint_field(sc, MPS_INFO, "AttachedDeviceInfo: %b,%s\n",
-           buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit"
+       mps_dprint_field(sc, MPS_INFO, "AttachedDeviceInfo: %pb%i,%s\n",
+           "\20" "\4SATAhost" "\5SMPinit" "\6STPinit"
            "\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg"
            "\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev",
-           mps_describe_table(mps_sasdev0_devtype,
+           buf->AttachedDeviceInfo, mps_describe_table(mps_sasdev0_devtype,
            buf->AttachedDeviceInfo & 0x03));
        MPS_PRINTFIELD(sc, buf, ExpanderDevHandle, 0x%04x);
        MPS_PRINTFIELD(sc, buf, ChangeCount, %d);
index 1c2a3ba..989e680 100644 (file)
@@ -1739,16 +1739,18 @@ twe_check_bits(struct twe_softc *sc, u_int32_t status_reg)
      * TWE_DEBUG is not set, which will call us again as part of the soft reset.
      */
     if ((status_reg & TWE_STATUS_PANIC_BITS) != 0) {
-       twe_printf(sc, "FATAL STATUS BIT(S) %b\n", status_reg & TWE_STATUS_PANIC_BITS,
-                  TWE_STATUS_BITS_DESCRIPTION);
+       twe_printf(sc, "FATAL STATUS BIT(S) %pb%i\n",
+                  TWE_STATUS_BITS_DESCRIPTION,
+                  status_reg & TWE_STATUS_PANIC_BITS);
        twe_panic(sc, "fatal status bits");
     }
 
     result = 0;
     if ((status_reg & TWE_STATUS_EXPECTED_BITS) != TWE_STATUS_EXPECTED_BITS) {
        if (time_uptime > (lastwarn[0] + 5)) {
-           twe_printf(sc, "missing expected status bit(s) %b\n", ~status_reg & TWE_STATUS_EXPECTED_BITS, 
-                      TWE_STATUS_BITS_DESCRIPTION);
+           twe_printf(sc, "missing expected status bit(s) %pb%i\n",
+                      TWE_STATUS_BITS_DESCRIPTION,
+                      ~status_reg & TWE_STATUS_EXPECTED_BITS);
            lastwarn[0] = time_uptime;
        }
        result = 1;
@@ -1756,8 +1758,9 @@ twe_check_bits(struct twe_softc *sc, u_int32_t status_reg)
 
     if ((status_reg & TWE_STATUS_UNEXPECTED_BITS) != 0) {
        if (time_uptime > (lastwarn[1] + 5)) {
-           twe_printf(sc, "unexpected status bit(s) %b\n", status_reg & TWE_STATUS_UNEXPECTED_BITS, 
-                      TWE_STATUS_BITS_DESCRIPTION);
+           twe_printf(sc, "unexpected status bit(s) %pb%i\n",
+                      TWE_STATUS_BITS_DESCRIPTION,
+                      status_reg & TWE_STATUS_UNEXPECTED_BITS);
            lastwarn[1] = time_uptime;
        }
        result = 1;
@@ -1900,7 +1903,7 @@ twe_print_controller(struct twe_softc *sc)
     u_int32_t          status_reg;
 
     status_reg = TWE_STATUS(sc);
-    twe_printf(sc, "status   %b\n", status_reg, TWE_STATUS_BITS_DESCRIPTION);
+    twe_printf(sc, "status   %pb%i\n", TWE_STATUS_BITS_DESCRIPTION, status_reg);
     twe_printf(sc, "          current  max    min\n");
     twe_printf(sc, "free      %04d     %04d   %04d\n",
        sc->twe_qstat[TWEQ_FREE].q_length, sc->twe_qstat[TWEQ_FREE].q_max, sc->twe_qstat[TWEQ_FREE].q_min);
index 58828f6..65f31f5 100644 (file)
@@ -83,7 +83,7 @@
 /* XXX this is a little harsh, but necessary to chase down firmware problems */
 #define TWE_STATUS_PANIC_BITS                  (TWE_STATUS_MICROCONTROLLER_ERROR)
 
-/* for use with the %b kprintf format */
+/* for use with the %pb%i or deprecated %b printf formats */
 #define TWE_STATUS_BITS_DESCRIPTION \
        "\20\15CQEMPTY\16UCREADY\17RQEMPTY\20CQFULL\21RINTR\22CINTR\23AINTR\24HINTR\25PCIABRT\26MCERR\27QERR\30PCIPERR\n"