VirtualBox

Changeset 43475 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 30, 2012 9:30:51 PM (12 years ago)
Author:
vboxsync
Message:

BIOS: Support for SCSI CD-ROMs, larger than 64K SCSI transfers.

Location:
trunk/src/VBox/Devices/PC/BIOS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/biosint.h

    r42935 r43475  
    5353#define DEBUG_ATA       0
    5454#define DEBUG_AHCI      0
     55#define DEBUG_SCSI      0
    5556#define DEBUG_CD_BOOT   0
    5657#define DEBUG_ELTORITO  0
  • trunk/src/VBox/Devices/PC/BIOS/ebda.h

    r39651 r43475  
    215215} disk_req_t;
    216216
    217 uint16_t ahci_cmd_packet(uint16_t device_id, uint8_t cmdlen, char __far *cmdbuf,
    218                          uint16_t header, uint32_t length, uint8_t inout, char __far *buffer);
    219 
    220 uint16_t ata_cmd_packet(uint16_t device, uint8_t cmdlen, char __far *cmdbuf,
    221                         uint16_t header, uint32_t length, uint8_t inout, char __far *buffer);
     217extern uint16_t ahci_cmd_packet(uint16_t device_id, uint8_t cmdlen, char __far *cmdbuf,
     218                                uint16_t header, uint32_t length, uint8_t inout, char __far *buffer);
     219extern uint16_t scsi_cmd_packet(uint16_t device, uint8_t cmdlen, char __far *cmdbuf,
     220                                uint16_t header, uint32_t length, uint8_t inout, char __far *buffer);
     221extern uint16_t ata_cmd_packet(uint16_t device, uint8_t cmdlen, char __far *cmdbuf,
     222                               uint16_t header, uint32_t length, uint8_t inout, char __far *buffer);
    222223
    223224/* All BIOS disk information. Disk-related code in the BIOS should not need
     
    244245    /* SCSI bus-specific device information. */
    245246    scsi_dev_t  scsidev[BX_MAX_SCSI_DEVICES];
    246     uint8_t     scsi_hdcount;       /* Number of SCSI disks. */
     247    uint8_t     scsi_devcount;      /* Number of SCSI devices. */
    247248#endif
    248249
  • trunk/src/VBox/Devices/PC/BIOS/eltorito.c

    r41653 r43475  
    268268    {
    269269        //@todo: Use indirect calls instead?
    270         if (device > BX_MAX_ATA_DEVICES)
     270        if (VBOX_IS_AHCI_DEVICE(device))
    271271            error = ahci_cmd_packet(device, 12, (char __far *)&atapicmd, 0, 2048L, ATA_DATA_IN, &buffer);
     272        else if (VBOX_IS_SCSI_DEVICE(device))
     273            error = scsi_cmd_packet(device, 12, (char __far *)&atapicmd, 0, 2048L, ATA_DATA_IN, &buffer);
    272274        else
    273275            error = ata_cmd_packet(device, 12, (char __far *)&atapicmd, 0, 2048L, ATA_DATA_IN, &buffer);
     
    304306#endif
    305307
    306     if (device > BX_MAX_ATA_DEVICES)
     308    if (VBOX_IS_AHCI_DEVICE(device))
    307309        error = ahci_cmd_packet(device, 12, (char __far *)&atapicmd, 0, 2048L, ATA_DATA_IN, &buffer);
     310    else if (VBOX_IS_SCSI_DEVICE(device))
     311        error = scsi_cmd_packet(device, 12, (char __far *)&atapicmd, 0, 2048L, ATA_DATA_IN, &buffer);
    308312    else
    309313        error = ata_cmd_packet(device, 12, (char __far *)&atapicmd, 0, 2048L, ATA_DATA_IN, &buffer);
     
    368372    bios_dsk->drqp.skip_a = 2048 - nbsectors * 512UL % 2048;
    369373
    370     if (device > BX_MAX_ATA_DEVICES)
     374    if (VBOX_IS_AHCI_DEVICE(device))
    371375        error = ahci_cmd_packet(device, 12, (char __far *)&atapicmd, 0, nbsectors*512L, ATA_DATA_IN, MK_FP(boot_segment,0));
     376    else if (VBOX_IS_SCSI_DEVICE(device))
     377        error = scsi_cmd_packet(device, 12, (char __far *)&atapicmd, 0, nbsectors*512L, ATA_DATA_IN, MK_FP(boot_segment,0));
    372378    else
    373379        error = ata_cmd_packet(device, 12, (char __far *)&atapicmd, 0, nbsectors*512L, ATA_DATA_IN, MK_FP(boot_segment,0));
     
    554560        bios_dsk->drqp.skip_a = 2048 - nbsectors * 512UL % 2048 - bios_dsk->drqp.skip_b;
    555561
    556         if (device > BX_MAX_ATA_DEVICES)
     562        if (VBOX_IS_AHCI_DEVICE(device))
    557563            status = ahci_cmd_packet(device, 12, (char __far *)&atapicmd, before*512, nbsectors*512L, ATA_DATA_IN, MK_FP(segment,offset));
     564        else if (VBOX_IS_SCSI_DEVICE(device))
     565            status = scsi_cmd_packet(device, 12, (char __far *)&atapicmd, before*512, nbsectors*512L, ATA_DATA_IN, MK_FP(segment,offset));
    558566        else
    559567            status = ata_cmd_packet(device, 12, (char __far *)&atapicmd, before*512, nbsectors*512L, ATA_DATA_IN, MK_FP(segment,offset));
     
    758766        bios_dsk->drqp.sect_sz = 2048;
    759767
    760         if (device > BX_MAX_ATA_DEVICES)
     768        if (VBOX_IS_AHCI_DEVICE(device))
    761769            status = ahci_cmd_packet(device, 12, (char __far *)&atapicmd, 0, count*2048L, ATA_DATA_IN, MK_FP(segment,offset));
     770        else if (VBOX_IS_SCSI_DEVICE(device))
     771            status = scsi_cmd_packet(device, 12, (char __far *)&atapicmd, 0, count*2048L, ATA_DATA_IN, MK_FP(segment,offset));
    762772        else
    763773            status = ata_cmd_packet(device, 12, (char __far *)&atapicmd, 0, count*2048L, ATA_DATA_IN, MK_FP(segment,offset));
  • trunk/src/VBox/Devices/PC/BIOS/scsi.c

    r42811 r43475  
    2323
    2424
    25 //#define VBOX_SCSI_DEBUG 1 /* temporary */
    26 
    27 #ifdef VBOX_SCSI_DEBUG
    28 # define VBSCSI_DEBUG(...)    BX_INFO(__VA_ARGS__)
     25#if DEBUG_SCSI
     26# define DBG_SCSI(...)  BX_INFO(__VA_ARGS__)
    2927#else
    30 # define VBSCSI_DEBUG(...)
     28# define DBG_SCSI(...)
    3129#endif
    3230
     
    7371ct_assert(sizeof(cdb_rw10) == 10);
    7472
    75 int scsi_cmd_data_in(uint16_t io_base, uint8_t device_id, uint8_t __far *aCDB,
    76                      uint8_t cbCDB, uint8_t __far *buffer, uint16_t cbBuffer)
     73
     74void insb_discard(unsigned nbytes, unsigned port);
     75#pragma aux insb_discard =  \
     76    ".286"                  \
     77    "again:"                \
     78    "in al,dx"              \
     79    "loop again"            \
     80    parm [cx] [dx] modify exact [cx ax] nomemory;
     81
     82
     83int scsi_cmd_data_in(uint16_t io_base, uint8_t target_id, uint8_t __far *aCDB,
     84                     uint8_t cbCDB, uint8_t __far *buffer, uint32_t cbBuffer)
    7785{
    7886    /* Check that the adapter is ready. */
    79     uint8_t     status;
     87    uint8_t     status, sizes;
    8088    uint16_t    i;
    8189
    8290    do
    83     {
    84         status = inb(io_base+VBSCSI_REGISTER_STATUS);
    85     } while (status & VBSCSI_BUSY);
    86 
    87     /* Write target ID. */
    88     outb(io_base+VBSCSI_REGISTER_COMMAND, device_id);
    89     /* Write transfer direction. */
    90     outb(io_base+VBSCSI_REGISTER_COMMAND, SCSI_TXDIR_FROM_DEVICE);
    91     /* Write the CDB size. */
    92     outb(io_base+VBSCSI_REGISTER_COMMAND, cbCDB);
    93     /* Write buffer size. */
    94     outb(io_base+VBSCSI_REGISTER_COMMAND, cbBuffer);
    95     outb(io_base+VBSCSI_REGISTER_COMMAND, (cbBuffer >> 8));
    96     /* Write the CDB. */
    97     for (i = 0; i < cbCDB; i++)
    98         outb(io_base+VBSCSI_REGISTER_COMMAND, aCDB[i]);
     91        status = inb(io_base + VBSCSI_REGISTER_STATUS);
     92    while (status & VBSCSI_BUSY);
     93
     94   
     95    sizes = ((cbBuffer >> 12) & 0xF0) | cbCDB;
     96    outb(io_base + VBSCSI_REGISTER_COMMAND, target_id);                 /* Write the target ID. */
     97    outb(io_base + VBSCSI_REGISTER_COMMAND, SCSI_TXDIR_FROM_DEVICE);    /* Write the transfer direction. */
     98    outb(io_base + VBSCSI_REGISTER_COMMAND, sizes);                     /* Write CDB size and top bufsize bits. */
     99    outb(io_base + VBSCSI_REGISTER_COMMAND, cbBuffer);                  /* Write the buffer size. */
     100    outb(io_base + VBSCSI_REGISTER_COMMAND, (cbBuffer >> 8));   
     101    for (i = 0; i < cbCDB; i++)                                         /* Write the CDB. */
     102        outb(io_base + VBSCSI_REGISTER_COMMAND, aCDB[i]);
    99103
    100104    /* Now wait for the command to complete. */
    101105    do
    102     {
    103         status = inb(io_base+VBSCSI_REGISTER_STATUS);
    104     } while (status & VBSCSI_BUSY);
     106        status = inb(io_base + VBSCSI_REGISTER_STATUS);
     107    while (status & VBSCSI_BUSY);
    105108
    106109    /* Get the read data. */
     
    110113}
    111114
    112 int scsi_cmd_data_out(uint16_t io_base, uint8_t device_id, uint8_t __far *aCDB,
    113                       uint8_t cbCDB, uint8_t __far *buffer, uint16_t cbBuffer)
     115int scsi_cmd_data_out(uint16_t io_base, uint8_t target_id, uint8_t __far *aCDB,
     116                      uint8_t cbCDB, uint8_t __far *buffer, uint32_t cbBuffer)
    114117{
    115118    /* Check that the adapter is ready. */
    116     uint8_t     status;
     119    uint8_t     status, sizes;
    117120    uint16_t    i;
    118121
    119122    do
    120     {
    121         status = inb(io_base+VBSCSI_REGISTER_STATUS);
    122     } while (status & VBSCSI_BUSY);
    123 
    124     /* Write target ID. */
    125     outb(io_base+VBSCSI_REGISTER_COMMAND, device_id);
    126     /* Write transfer direction. */
    127     outb(io_base+VBSCSI_REGISTER_COMMAND, SCSI_TXDIR_TO_DEVICE);
    128     /* Write the CDB size. */
    129     outb(io_base+VBSCSI_REGISTER_COMMAND, cbCDB);
    130     /* Write buffer size. */
    131     outb(io_base+VBSCSI_REGISTER_COMMAND, cbBuffer);
    132     outb(io_base+VBSCSI_REGISTER_COMMAND, (cbBuffer >> 8));
    133     /* Write the CDB. */
    134     for (i = 0; i < cbCDB; i++)
    135         outb(io_base+VBSCSI_REGISTER_COMMAND, aCDB[i]);
     123        status = inb(io_base + VBSCSI_REGISTER_STATUS);
     124    while (status & VBSCSI_BUSY);
     125
     126   
     127    sizes = ((cbBuffer >> 12) & 0xF0) | cbCDB;
     128    outb(io_base + VBSCSI_REGISTER_COMMAND, target_id);                 /* Write the target ID. */
     129    outb(io_base + VBSCSI_REGISTER_COMMAND, SCSI_TXDIR_TO_DEVICE);      /* Write the transfer direction. */
     130    outb(io_base + VBSCSI_REGISTER_COMMAND, sizes);                     /* Write CDB size and top bufsize bits. */
     131    outb(io_base + VBSCSI_REGISTER_COMMAND, cbBuffer);                  /* Write the buffer size. */
     132    outb(io_base + VBSCSI_REGISTER_COMMAND, (cbBuffer >> 8));
     133    for (i = 0; i < cbCDB; i++)                                         /* Write the CDB. */
     134        outb(io_base + VBSCSI_REGISTER_COMMAND, aCDB[i]);
    136135
    137136    /* Write data to I/O port. */
     
    140139    /* Now wait for the command to complete. */
    141140    do
    142     {
    143         status = inb(io_base+VBSCSI_REGISTER_STATUS);
    144     } while (status & VBSCSI_BUSY);
     141        status = inb(io_base + VBSCSI_REGISTER_STATUS);
     142    while (status & VBSCSI_BUSY);
    145143
    146144    return 0;
     
    181179
    182180    rc = scsi_cmd_data_in(io_base, target_id, (void __far *)&cdb, 10,
    183                           bios_dsk->drqp.buffer, (count * 512));
     181                          bios_dsk->drqp.buffer, (count * 512L));
    184182
    185183    if (!rc)
    186184    {
    187185        bios_dsk->drqp.trsfsectors = count;
    188         bios_dsk->drqp.trsfbytes   = count * 512;
     186        bios_dsk->drqp.trsfbytes   = count * 512L;
    189187    }
    190188
     
    225223
    226224    rc = scsi_cmd_data_out(io_base, target_id, (void __far *)&cdb, 10,
    227                            bios_dsk->drqp.buffer, (count * 512));
     225                           bios_dsk->drqp.buffer, (count * 512L));
    228226
    229227    if (!rc)
    230228    {
    231229        bios_dsk->drqp.trsfsectors = count;
    232         bios_dsk->drqp.trsfbytes   = (count * 512);
     230        bios_dsk->drqp.trsfbytes   = (count * 512L);
    233231    }
    234232
    235233    return rc;
     234}
     235
     236
     237//@todo: move
     238#define ATA_DATA_NO      0x00
     239#define ATA_DATA_IN      0x01
     240#define ATA_DATA_OUT     0x02
     241
     242/**
     243 * Perform a "packet style" read with supplied CDB.
     244 *
     245 * @returns status code.
     246 * @param   bios_dsk    Pointer to disk request packet (in the
     247 *                      EBDA).
     248 */
     249uint16_t scsi_cmd_packet(uint16_t device_id, uint8_t cmdlen, char __far *cmdbuf,
     250                         uint16_t before, uint32_t length, uint8_t inout, char __far *buffer)
     251{
     252    bio_dsk_t __far *bios_dsk = read_word(0x0040, 0x000E) :> &EbdaData->bdisk;
     253    uint8_t         status, sizes;
     254    uint16_t        i;
     255    uint16_t        io_base;
     256    uint8_t         target_id;
     257
     258    /* Data out is currently not supported. */
     259    if (inout == ATA_DATA_OUT) {
     260        BX_INFO("%s: DATA_OUT not supported yet\n", __func__);
     261        return 1;
     262    }
     263
     264    /* Convert to SCSI specific device number. */
     265    device_id = VBOX_GET_SCSI_DEVICE(device_id);
     266
     267    DBG_SCSI("%s: reading %lu bytes, skip %u/%u, device %d, target %d\n", __func__,
     268             length, bios_dsk->drqp.skip_b, bios_dsk->drqp.skip_a,
     269             device_id, bios_dsk->scsidev[device_id].target_id);
     270    DBG_SCSI("%s: reading %u %u-byte sectors\n", __func__,
     271             bios_dsk->drqp.nsect, bios_dsk->drqp.sect_sz);
     272
     273    //@todo: why do we need to do this?
     274    cmdlen -= 2; // ATAPI uses 12 bytes for a READ 10 CDB??
     275
     276    io_base   = bios_dsk->scsidev[device_id].io_base;
     277    target_id = bios_dsk->scsidev[device_id].target_id;
     278
     279    /* Wait until the adapter is ready. */
     280    do
     281        status = inb(io_base + VBSCSI_REGISTER_STATUS);
     282    while (status & VBSCSI_BUSY);
     283
     284    sizes = (((length + before) >> 12) & 0xF0) | cmdlen;
     285    outb(io_base + VBSCSI_REGISTER_COMMAND, target_id);                 /* Write the target ID. */
     286    outb(io_base + VBSCSI_REGISTER_COMMAND, SCSI_TXDIR_FROM_DEVICE);    /* Write the transfer direction. */
     287    outb(io_base + VBSCSI_REGISTER_COMMAND, sizes);                     /* Write the CDB size. */
     288    outb(io_base + VBSCSI_REGISTER_COMMAND, length + before);           /* Write the buffer size. */
     289    outb(io_base + VBSCSI_REGISTER_COMMAND, (length + before) >> 8);
     290    for (i = 0; i < cmdlen; i++)                                        /* Write the CDB. */
     291        outb(io_base + VBSCSI_REGISTER_COMMAND, cmdbuf[i]);
     292
     293    /* Now wait for the command to complete. */
     294    do
     295        status = inb(io_base + VBSCSI_REGISTER_STATUS);
     296    while (status & VBSCSI_BUSY);
     297
     298    /* Transfer the data read from the device. */
     299
     300    if (before)     /* If necessary, throw away data which needs to be skipped. */
     301        insb_discard(before, io_base + VBSCSI_REGISTER_DATA_IN);
     302
     303    bios_dsk->drqp.trsfbytes = length;
     304
     305    /* The requested length may be exactly 64K or more, which needs
     306     * a bit of care when we're using 16-bit 'rep ins'.
     307     */
     308    while (length > 32768) {
     309        DBG_SCSI("%s: reading 32K to %X:%X\n", __func__, FP_SEG(buffer), FP_OFF(buffer));
     310        rep_insb(buffer, 32768, io_base + VBSCSI_REGISTER_DATA_IN);
     311        length -= 32768;
     312        buffer = (FP_SEG(buffer) + (32768 >> 4)) :> FP_OFF(buffer);
     313    }
     314    DBG_SCSI("%s: reading %ld bytes to %X:%X\n", __func__, length, FP_SEG(buffer), FP_OFF(buffer));
     315    rep_insb(buffer, length, io_base + VBSCSI_REGISTER_DATA_IN);
     316
     317    return 0;
    236318}
    237319
     
    255337        uint8_t     rc;
    256338        uint8_t     aCDB[10];
     339        uint8_t     hd_index, devcount_scsi;
    257340
    258341        aCDB[0] = SCSI_INQUIRY;
     
    265348        rc = scsi_cmd_data_in(io_base, i, aCDB, 6, buffer, 5);
    266349        if (rc != 0)
    267             BX_PANIC("scsi_enumerate_attached_devices: SCSI_INQUIRY failed\n");
    268 
    269         /* Check if there is a disk attached. */
     350            BX_PANIC("%s: SCSI_INQUIRY failed\n", __func__);
     351
     352        /* Check the attached device. */
    270353        if (   ((buffer[0] & 0xe0) == 0)
    271354            && ((buffer[0] & 0x1f) == 0x00))
    272355        {
    273             VBSCSI_DEBUG("scsi_enumerate_attached_devices: Disk detected at %d\n", i);
     356            DBG_SCSI("%s: Disk detected at %d\n", __func__, i);
    274357
    275358            /* We add the disk only if the maximum is not reached yet. */
    276             if (bios_dsk->scsi_hdcount < BX_MAX_SCSI_DEVICES)
     359            if (bios_dsk->scsi_devcount < BX_MAX_SCSI_DEVICES)
    277360            {
    278361                uint32_t    sectors, sector_size, cylinders;
    279362                uint16_t    heads, sectors_per_track;
    280                 uint8_t     hdcount, hdcount_scsi, hd_index;
     363                uint8_t     hdcount;
    281364
    282365                /* Issue a read capacity command now. */
     
    286369                rc = scsi_cmd_data_in(io_base, i, aCDB, 10, buffer, 8);
    287370                if (rc != 0)
    288                     BX_PANIC("scsi_enumerate_attached_devices: SCSI_READ_CAPACITY failed\n");
     371                    BX_PANIC("%s: SCSI_READ_CAPACITY failed\n", __func__);
    289372
    290373                /* Build sector number and size from the buffer. */
     
    327410                }
    328411                cylinders = (uint32_t)(sectors / (heads * sectors_per_track));
    329                 hdcount_scsi = bios_dsk->scsi_hdcount;
     412                devcount_scsi = bios_dsk->scsi_devcount;
    330413
    331414                /* Calculate index into the generic disk table. */
    332                 hd_index = hdcount_scsi + BX_MAX_ATA_DEVICES;
    333 
    334                 bios_dsk->scsidev[hdcount_scsi].io_base   = io_base;
    335                 bios_dsk->scsidev[hdcount_scsi].target_id = i;
     415                hd_index = devcount_scsi + BX_MAX_ATA_DEVICES;
     416
     417                bios_dsk->scsidev[devcount_scsi].io_base   = io_base;
     418                bios_dsk->scsidev[devcount_scsi].target_id = i;
    336419                bios_dsk->devices[hd_index].type        = DSK_TYPE_SCSI;
    337420                bios_dsk->devices[hd_index].device      = DSK_DEVICE_HD;
     
    361444                /* Store the id of the disk in the ata hdidmap. */
    362445                hdcount = bios_dsk->hdcount;
    363                 bios_dsk->hdidmap[hdcount] = hdcount_scsi + BX_MAX_ATA_DEVICES;
     446                bios_dsk->hdidmap[hdcount] = devcount_scsi + BX_MAX_ATA_DEVICES;
    364447                hdcount++;
    365448                bios_dsk->hdcount = hdcount;
     
    370453                write_byte(0x40, 0x75, hdcount);
    371454
    372                 hdcount_scsi++;
    373                 bios_dsk->scsi_hdcount = hdcount_scsi;
     455                devcount_scsi++;
     456                bios_dsk->scsi_devcount = devcount_scsi;
    374457            }
    375458            else
     
    379462            }
    380463        }
     464        else if (   ((buffer[0] & 0xe0) == 0)
     465                 && ((buffer[0] & 0x1f) == 0x05))
     466        {
     467            uint8_t     cdcount;
     468            uint8_t     removable;
     469
     470            DBG_SCSI("%s: CD/DVD-ROM detected at %d\n", __func__, i);
     471
     472            /* Calculate index into the generic device table. */
     473            hd_index = devcount_scsi + BX_MAX_ATA_DEVICES;
     474
     475            removable = buffer[1] & 0x80 ? 1 : 0;
     476
     477            bios_dsk->scsidev[devcount_scsi].io_base   = io_base;
     478            bios_dsk->scsidev[devcount_scsi].target_id = i;
     479            bios_dsk->devices[hd_index].type      = DSK_TYPE_SCSI;
     480            bios_dsk->devices[hd_index].device    = DSK_DEVICE_CDROM;
     481            bios_dsk->devices[hd_index].removable = removable;
     482            bios_dsk->devices[hd_index].blksize   = 2048;
     483
     484            /* Store the ID of the device in the BIOS cdidmap. */
     485            cdcount = bios_dsk->cdcount;
     486            bios_dsk->cdidmap[cdcount] = devcount_scsi + BX_MAX_ATA_DEVICES;
     487            cdcount++;
     488            bios_dsk->cdcount = cdcount;
     489
     490            devcount_scsi++;
     491            bios_dsk->scsi_devcount = devcount_scsi;
     492        }
    381493        else
    382             VBSCSI_DEBUG("scsi_enumerate_attached_devices: No disk detected at %d\n", i);
     494            DBG_SCSI("%s: No supported device detected at %d\n", __func__, i);
    383495    }
    384496}
     
    394506    bios_dsk = read_word(0x0040, 0x000E) :> &EbdaData->bdisk;
    395507
    396     bios_dsk->scsi_hdcount = 0;
     508    bios_dsk->scsi_devcount = 0;
    397509
    398510    identifier = 0;
    399511
    400     /* Detect BusLogic adapter. */
     512    /* Detect the BusLogic adapter. */
    401513    outb(BUSLOGIC_BIOS_IO_PORT+VBSCSI_REGISTER_IDENTIFY, 0x55);
    402514    identifier = inb(BUSLOGIC_BIOS_IO_PORT+VBSCSI_REGISTER_IDENTIFY);
     
    405517    {
    406518        /* Detected - Enumerate attached devices. */
    407         VBSCSI_DEBUG("scsi_init: BusLogic SCSI adapter detected\n");
     519        DBG_SCSI("scsi_init: BusLogic SCSI adapter detected\n");
    408520        outb(BUSLOGIC_BIOS_IO_PORT+VBSCSI_REGISTER_RESET, 0);
    409521        scsi_enumerate_attached_devices(BUSLOGIC_BIOS_IO_PORT);
     
    411523    else
    412524    {
    413         VBSCSI_DEBUG("scsi_init: BusLogic SCSI adapter not detected\n");
    414     }
    415 
    416     /* Detect LsiLogic adapter. */
     525        DBG_SCSI("scsi_init: BusLogic SCSI adapter not detected\n");
     526    }
     527
     528    /* Detect the LSI Logic parallel SCSI adapter. */
    417529    outb(LSILOGIC_BIOS_IO_PORT+VBSCSI_REGISTER_IDENTIFY, 0x55);
    418530    identifier = inb(LSILOGIC_BIOS_IO_PORT+VBSCSI_REGISTER_IDENTIFY);
     
    421533    {
    422534        /* Detected - Enumerate attached devices. */
    423         VBSCSI_DEBUG("scsi_init: LSI Logic SCSI adapter detected\n");
     535        DBG_SCSI("scsi_init: LSI Logic SCSI adapter detected\n");
    424536        outb(LSILOGIC_BIOS_IO_PORT+VBSCSI_REGISTER_RESET, 0);
    425537        scsi_enumerate_attached_devices(LSILOGIC_BIOS_IO_PORT);
     
    427539    else
    428540    {
    429         VBSCSI_DEBUG("scsi_init: LSI Logic SCSI adapter not detected\n");
    430     }
    431 
    432     /* Detect LsiLogic SAS adapter. */
     541        DBG_SCSI("scsi_init: LSI Logic SCSI adapter not detected\n");
     542    }
     543
     544    /* Detect the LSI Logic SAS adapter. */
    433545    outb(LSILOGIC_SAS_BIOS_IO_PORT+VBSCSI_REGISTER_IDENTIFY, 0x55);
    434546    identifier = inb(LSILOGIC_SAS_BIOS_IO_PORT+VBSCSI_REGISTER_IDENTIFY);
     
    437549    {
    438550        /* Detected - Enumerate attached devices. */
    439         VBSCSI_DEBUG("scsi_init: LSI Logic SAS adapter detected\n");
     551        DBG_SCSI("scsi_init: LSI Logic SAS adapter detected\n");
    440552        outb(LSILOGIC_SAS_BIOS_IO_PORT+VBSCSI_REGISTER_RESET, 0);
    441553        scsi_enumerate_attached_devices(LSILOGIC_SAS_BIOS_IO_PORT);
     
    443555    else
    444556    {
    445         VBSCSI_DEBUG("scsi_init: LSI Logic SAS adapter not detected\n");
    446     }
    447 }
     557        DBG_SCSI("scsi_init: LSI Logic SAS adapter not detected\n");
     558    }
     559}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette