Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/usbmast/scsi_ms.c

    rae3a941 rb7fd2a0  
    22 * Copyright (c) 2011 Vojtech Horky
    33 * Copyright (c) 2011 Jiri Svoboda
    4  * Copyright (c) 2018 Ondrej Hlavaty
    54 * All rights reserved.
    65 *
     
    8887        rc = usb_massstor_cmd(mfun, 0xDEADBEEF, &cmd);
    8988
    90         if (rc != EOK) {
     89        if (rc != EOK) {
    9190                usb_log_error("Test Unit Ready failed on device %s: %s.",
    92                     usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     91                   usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    9392                return rc;
    9493        }
     
    9897        if (cmd.status != CMDS_GOOD)
    9998                usb_log_warning("Test Unit Ready command failed on device %s.",
    100                     usb_device_get_name(mfun->mdev->usb_dev));
     99                   usb_device_get_name(mfun->mdev->usb_dev));
    101100
    102101        return EOK;
     
    117116                rc = usb_massstor_unit_ready(mfun);
    118117                if (rc != EOK) {
    119                         usb_log_error("Inquiry transport failed, device %s: %s.",
    120                             usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     118                        usb_log_error("Inquiry transport failed, device %s: %s.\n",
     119                           usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    121120                        return rc;
    122121                }
     
    124123                rc = usb_massstor_cmd(mfun, 0xDEADBEEF, cmd);
    125124                if (rc != EOK) {
    126                         usb_log_error("Inquiry transport failed, device %s: %s.",
    127                             usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     125                        usb_log_error("Inquiry transport failed, device %s: %s.\n",
     126                           usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    128127                        return rc;
    129128                }
     
    132131                        return EOK;
    133132
    134                 usb_log_error("SCSI command failed, device %s.",
     133                usb_log_error("SCSI command failed, device %s.\n",
    135134                    usb_device_get_name(mfun->mdev->usb_dev));
    136135
    137136                rc = usbmast_request_sense(mfun, &sense_buf, sizeof(sense_buf));
    138137                if (rc != EOK) {
    139                         usb_log_error("Failed to read sense data.");
     138                        usb_log_error("Failed to read sense data.\n");
    140139                        return EIO;
    141140                }
     
    183182
    184183        if (rc != EOK) {
    185                 usb_log_error("Inquiry transport failed, device %s: %s.",
    186                     usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     184                usb_log_error("Inquiry transport failed, device %s: %s.\n",
     185                   usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    187186                return rc;
    188187        }
    189188
    190189        if (cmd.status != CMDS_GOOD) {
    191                 usb_log_error("Inquiry command failed, device %s.",
    192                     usb_device_get_name(mfun->mdev->usb_dev));
     190                usb_log_error("Inquiry command failed, device %s.\n",
     191                   usb_device_get_name(mfun->mdev->usb_dev));
    193192                return EIO;
    194193        }
    195194
    196195        if (cmd.rcvd_size < SCSI_STD_INQUIRY_DATA_MIN_SIZE) {
    197                 usb_log_error("SCSI Inquiry response too short (%zu).",
    198                      cmd.rcvd_size);
     196                usb_log_error("SCSI Inquiry response too short (%zu).\n",
     197                    cmd.rcvd_size);
    199198                return EIO;
    200199        }
     
    250249        rc = usb_massstor_cmd(mfun, 0xDEADBEEF, &cmd);
    251250
    252         if (rc != EOK || cmd.status != CMDS_GOOD) {
    253                 usb_log_error("Request Sense failed, device %s: %s.",
    254                     usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     251        if (rc != EOK || cmd.status != CMDS_GOOD) {
     252                usb_log_error("Request Sense failed, device %s: %s.\n",
     253                   usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    255254                return rc;
    256255        }
     
    292291        rc = usbmast_run_cmd(mfun, &cmd);
    293292
    294         if (rc != EOK) {
    295                 usb_log_error("Read Capacity (10) transport failed, device %s: %s.",
    296                     usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     293        if (rc != EOK) {
     294                usb_log_error("Read Capacity (10) transport failed, device %s: %s.\n",
     295                   usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    297296                return rc;
    298297        }
    299298
    300299        if (cmd.status != CMDS_GOOD) {
    301                 usb_log_error("Read Capacity (10) command failed, device %s.",
    302                     usb_device_get_name(mfun->mdev->usb_dev));
     300                usb_log_error("Read Capacity (10) command failed, device %s.\n",
     301                   usb_device_get_name(mfun->mdev->usb_dev));
    303302                return EIO;
    304303        }
    305304
    306305        if (cmd.rcvd_size < sizeof(data)) {
    307                 usb_log_error("SCSI Read Capacity response too short (%zu).",
    308                      cmd.rcvd_size);
     306                usb_log_error("SCSI Read Capacity response too short (%zu).\n",
     307                    cmd.rcvd_size);
    309308                return EIO;
    310309        }
     
    350349
    351350        if (rc != EOK) {
    352                 usb_log_error("Read (10) transport failed, device %s: %s.",
    353                     usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     351                usb_log_error("Read (10) transport failed, device %s: %s.\n",
     352                   usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    354353                return rc;
    355354        }
    356355
    357356        if (cmd.status != CMDS_GOOD) {
    358                 usb_log_error("Read (10) command failed, device %s.",
    359                     usb_device_get_name(mfun->mdev->usb_dev));
     357                usb_log_error("Read (10) command failed, device %s.\n",
     358                   usb_device_get_name(mfun->mdev->usb_dev));
    360359                return EIO;
    361360        }
    362361
    363362        if (cmd.rcvd_size < nblocks * mfun->block_size) {
    364                 usb_log_error("SCSI Read response too short (%zu).",
     363                usb_log_error("SCSI Read response too short (%zu).\n",
    365364                    cmd.rcvd_size);
    366365                return EIO;
     
    405404        rc = usbmast_run_cmd(mfun, &cmd);
    406405
    407         if (rc != EOK) {
    408                 usb_log_error("Write (10) transport failed, device %s: %s.",
    409                     usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     406        if (rc != EOK) {
     407                usb_log_error("Write (10) transport failed, device %s: %s.\n",
     408                   usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    410409                return rc;
    411410        }
    412411
    413412        if (cmd.status != CMDS_GOOD) {
    414                 usb_log_error("Write (10) command failed, device %s.",
    415                     usb_device_get_name(mfun->mdev->usb_dev));
     413                usb_log_error("Write (10) command failed, device %s.\n",
     414                   usb_device_get_name(mfun->mdev->usb_dev));
    416415                return EIO;
    417416        }
     
    450449        const errno_t rc = usbmast_run_cmd(mfun, &cmd);
    451450
    452         if (rc != EOK) {
    453                 usb_log_error("Synchronize Cache (10) transport failed, device %s: %s.",
    454                     usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     451        if (rc != EOK) {
     452                usb_log_error("Synchronize Cache (10) transport failed, device %s: %s.\n",
     453                   usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    455454                return rc;
    456455        }
    457456
    458457        if (cmd.status != CMDS_GOOD) {
    459                 usb_log_error("Synchronize Cache (10) command failed, device %s.",
    460                     usb_device_get_name(mfun->mdev->usb_dev));
     458                usb_log_error("Synchronize Cache (10) command failed, device %s.\n",
     459                   usb_device_get_name(mfun->mdev->usb_dev));
    461460                return EIO;
    462461        }
Note: See TracChangeset for help on using the changeset viewer.