[haiku-commits] haiku: hrev46380 - src/add-ons/kernel/drivers/disk/usb/usb_disk

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 17 Nov 2013 18:14:25 +0100 (CET)

hrev46380 adds 1 changeset to branch 'master'
old head: bca45352395a526b5e32a67b96ac0ccb2bbe6204
new head: b38fed9370deb68349657e011e27d59e693d51dc
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=b38fed9+%5Ebca4535

----------------------------------------------------------------------------

b38fed9: usb_disk: accept B_DEV_MEDIA_CHANGED as a ready unit.

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev46380
Commit:      b38fed9370deb68349657e011e27d59e693d51dc
URL:         http://cgit.haiku-os.org/haiku/commit/?id=b38fed9
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Mon Oct  7 17:25:55 2013 UTC

----------------------------------------------------------------------------

1 file changed, 4 insertions(+), 3 deletions(-)
src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp | 7 ++++---

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp 
b/src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp
index 6c874f3..5da2965 100644
--- a/src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp
+++ b/src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp
@@ -481,7 +481,7 @@ usb_disk_request_sense(device_lun *lun, err_act *_action)
                lun->media_present = false;
                usb_disk_reset_capacity(lun);
        }
-       
+
        if (_action != NULL)
                *_action = action;
 
@@ -799,7 +799,8 @@ usb_disk_device_added(usb_device newDevice, void **cookie)
                        TRACE("usb lun %"B_PRIu8" inquiry attempt %"B_PRIu32" 
begin\n",
                                i, tries);
                        status_t ready = usb_disk_test_unit_ready(lun, &action);
-                       if (ready == B_OK || ready == B_DEV_NO_MEDIA) {
+                       if (ready == B_OK || ready == B_DEV_NO_MEDIA
+                               || ready == B_DEV_MEDIA_CHANGED) {
                                if (lun->device_type == B_CD)
                                        lun->write_protected = true;
                                // TODO: check for write protection; disabled 
since some
@@ -1100,7 +1101,7 @@ usb_disk_ioctl(void *cookie, uint32 op, void *buffer, 
size_t length)
                                        break;
                                }
                                snooze(500000);
-                       }                       
+                       }
                        TRACE("B_GET_MEDIA_STATUS: 0x%08" B_PRIx32 "\n",
                                *(status_t *)buffer);
                        result = B_OK;


Other related posts:

  • » [haiku-commits] haiku: hrev46380 - src/add-ons/kernel/drivers/disk/usb/usb_disk - korli