static void
ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info,
		      u_int our_id, char channel, u_int target_id)
{
	struct  scsi_target *starget;
	struct	ahd_initiator_tinfo *tinfo;
	struct	ahd_tmode_tstate *tstate;
	int	lun;

	tinfo = ahd_fetch_transinfo(ahd, channel, our_id,
				    target_id, &tstate);
	copy_info(info, "Target %d Negotiation Settings\n", target_id);
	copy_info(info, "\tUser: "******"\tGoal: ");
	ahd_format_transinfo(info, &tinfo->goal);
	copy_info(info, "\tCurr: ");
	ahd_format_transinfo(info, &tinfo->curr);

	for (lun = 0; lun < AHD_NUM_LUNS; lun++) {
		struct scsi_device *dev;

		dev = scsi_device_lookup_by_target(starget, lun);

		if (dev == NULL)
			continue;

		ahd_dump_device_state(info, dev);
	}
}
Example #2
0
static void
ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
                      u_int our_id, char channel, u_int target_id,
                      u_int target_offset)
{
    struct	scsi_target *starget;
    struct	ahc_initiator_tinfo *tinfo;
    struct	ahc_tmode_tstate *tstate;
    int	lun;

    tinfo = ahc_fetch_transinfo(ahc, channel, our_id,
                                target_id, &tstate);
    if ((ahc->features & AHC_TWIN) != 0)
        copy_info(info, "Channel %c ", channel);
    copy_info(info, "Target %d Negotiation Settings\n", target_id);
    copy_info(info, "\tUser: "******"\tGoal: ");
    ahc_format_transinfo(info, &tinfo->goal);
    copy_info(info, "\tCurr: ");
    ahc_format_transinfo(info, &tinfo->curr);

    for (lun = 0; lun < AHC_NUM_LUNS; lun++) {
        struct scsi_device *sdev;

        sdev = scsi_device_lookup_by_target(starget, lun);

        if (sdev == NULL)
            continue;

        ahc_dump_device_state(info, sdev);
    }
}