Ticket #4813: bug4813_ata_inquiry_fix.patch

File bug4813_ata_inquiry_fix.patch, 761 bytes (added by dachaac, 14 years ago)

Bugfix for ATADevice::Inquiry to byte swap according to ATA string conventions.

  • src/add-ons/kernel/bus_managers/ata/ATADevice.cpp

     
    148148    // the following fields are *much* to small, sigh...
    149149    memcpy(data.vendor_ident, fInfoBlock.model_number,
    150150        sizeof(data.vendor_ident));
     151    swap_words(data.vendor_ident, sizeof(data.vendor_ident));
     152
    151153    memcpy(data.product_ident, fInfoBlock.model_number + 8,
    152154        sizeof(data.product_ident));
     155    swap_words(data.product_ident, sizeof(data.product_ident));
     156
    153157    memcpy(data.product_rev, "    ", sizeof(data.product_rev));
    154158
    155159    uint32 allocationLength = command->allocation_length;