Src/SCSIBusInquiry.c

/*                              SCSIBusInquiry.c                                */
/*
 * SCSIBusInquiry.c
 * Copyright © 1992-93 Apple Computer Inc. All Rights Reserved.
 *
 * Get information on a specified host bus adaptor (HBA) incluing the number
 * of HBA's installed.
 *
 * This function will crash if the New SCSI Manager is not installed.
 *
 */
#include "SCSIAsyncSample.h"
 
OSErr
GetHostBusCount(
        short                       *busCount
    )
{
 
        OSErr                       status;
        SCSIBusInquiryPB            busInquiryPB;
#define PB                          (busInquiryPB)
 
        CLEAR(PB);
        PB.scsiPBLength = sizeof PB;
        PB.scsiFunctionCode = SCSIBusInquiry;
        PB.scsiDevice.bus = 0;
        status = SCSIAction((SCSI_PB *) &PB);
        if (status == noErr)
            *busCount = PB.scsiHiBusID;
        return (status);
}