Changeset df6ded8 in mainline for uspace/drv/block/usbmast/scsi_ms.c


Ignore:
Timestamp:
2018-02-28T16:37:50Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b20da0
Parents:
f5e5f73 (diff), b2dca8de (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jakub Jermar <jakub@…> (2018-02-28 16:06:42)
git-committer:
Jakub Jermar <jakub@…> (2018-02-28 16:37:50)
Message:

Merge github.com:helenos-xhci-team/helenos

This commit merges support for USB 3 and generally refactors, fixes,
extends and cleans up the existing USB framework.

Notable additions and features:

  • new host controller driver has been implemented to control various xHC models (among others, NEC Renesas uPD720200)
  • isochronous data transfer mode
  • support for explicit USB device removal
  • USB tablet driver
File:
1 edited

Legend:

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

    rf5e5f73 rdf6ded8  
    22 * Copyright (c) 2011 Vojtech Horky
    33 * Copyright (c) 2011 Jiri Svoboda
     4 * Copyright (c) 2018 Ondrej Hlavaty
    45 * All rights reserved.
    56 *
     
    8788        rc = usb_massstor_cmd(mfun, 0xDEADBEEF, &cmd);
    8889
    89         if (rc != EOK) {
     90        if (rc != EOK) {
    9091                usb_log_error("Test Unit Ready failed on device %s: %s.",
    91                    usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     92                    usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    9293                return rc;
    9394        }
     
    9798        if (cmd.status != CMDS_GOOD)
    9899                usb_log_warning("Test Unit Ready command failed on device %s.",
    99                    usb_device_get_name(mfun->mdev->usb_dev));
     100                    usb_device_get_name(mfun->mdev->usb_dev));
    100101
    101102        return EOK;
     
    116117                rc = usb_massstor_unit_ready(mfun);
    117118                if (rc != EOK) {
    118                         usb_log_error("Inquiry transport failed, device %s: %s.\n",
    119                            usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     119                        usb_log_error("Inquiry transport failed, device %s: %s.",
     120                            usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    120121                        return rc;
    121122                }
     
    123124                rc = usb_massstor_cmd(mfun, 0xDEADBEEF, cmd);
    124125                if (rc != EOK) {
    125                         usb_log_error("Inquiry transport failed, device %s: %s.\n",
    126                            usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     126                        usb_log_error("Inquiry transport failed, device %s: %s.",
     127                            usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    127128                        return rc;
    128129                }
     
    131132                        return EOK;
    132133
    133                 usb_log_error("SCSI command failed, device %s.\n",
     134                usb_log_error("SCSI command failed, device %s.",
    134135                    usb_device_get_name(mfun->mdev->usb_dev));
    135136
    136137                rc = usbmast_request_sense(mfun, &sense_buf, sizeof(sense_buf));
    137138                if (rc != EOK) {
    138                         usb_log_error("Failed to read sense data.\n");
     139                        usb_log_error("Failed to read sense data.");
    139140                        return EIO;
    140141                }
     
    182183
    183184        if (rc != EOK) {
    184                 usb_log_error("Inquiry transport failed, device %s: %s.\n",
    185                    usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     185                usb_log_error("Inquiry transport failed, device %s: %s.",
     186                    usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    186187                return rc;
    187188        }
    188189
    189190        if (cmd.status != CMDS_GOOD) {
    190                 usb_log_error("Inquiry command failed, device %s.\n",
    191                    usb_device_get_name(mfun->mdev->usb_dev));
     191                usb_log_error("Inquiry command failed, device %s.",
     192                    usb_device_get_name(mfun->mdev->usb_dev));
    192193                return EIO;
    193194        }
    194195
    195196        if (cmd.rcvd_size < SCSI_STD_INQUIRY_DATA_MIN_SIZE) {
    196                 usb_log_error("SCSI Inquiry response too short (%zu).\n",
    197                     cmd.rcvd_size);
     197                usb_log_error("SCSI Inquiry response too short (%zu).",
     198                     cmd.rcvd_size);
    198199                return EIO;
    199200        }
     
    249250        rc = usb_massstor_cmd(mfun, 0xDEADBEEF, &cmd);
    250251
    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));
     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));
    254255                return rc;
    255256        }
     
    291292        rc = usbmast_run_cmd(mfun, &cmd);
    292293
    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));
     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));
    296297                return rc;
    297298        }
    298299
    299300        if (cmd.status != CMDS_GOOD) {
    300                 usb_log_error("Read Capacity (10) command failed, device %s.\n",
    301                    usb_device_get_name(mfun->mdev->usb_dev));
     301                usb_log_error("Read Capacity (10) command failed, device %s.",
     302                    usb_device_get_name(mfun->mdev->usb_dev));
    302303                return EIO;
    303304        }
    304305
    305306        if (cmd.rcvd_size < sizeof(data)) {
    306                 usb_log_error("SCSI Read Capacity response too short (%zu).\n",
    307                     cmd.rcvd_size);
     307                usb_log_error("SCSI Read Capacity response too short (%zu).",
     308                     cmd.rcvd_size);
    308309                return EIO;
    309310        }
     
    349350
    350351        if (rc != EOK) {
    351                 usb_log_error("Read (10) transport failed, device %s: %s.\n",
    352                    usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
     352                usb_log_error("Read (10) transport failed, device %s: %s.",
     353                    usb_device_get_name(mfun->mdev->usb_dev), str_error(rc));
    353354                return rc;
    354355        }
    355356
    356357        if (cmd.status != CMDS_GOOD) {
    357                 usb_log_error("Read (10) command failed, device %s.\n",
    358                    usb_device_get_name(mfun->mdev->usb_dev));
     358                usb_log_error("Read (10) command failed, device %s.",
     359                    usb_device_get_name(mfun->mdev->usb_dev));
    359360                return EIO;
    360361        }
    361362
    362363        if (cmd.rcvd_size < nblocks * mfun->block_size) {
    363                 usb_log_error("SCSI Read response too short (%zu).\n",
     364                usb_log_error("SCSI Read response too short (%zu).",
    364365                    cmd.rcvd_size);
    365366                return EIO;
     
    404405        rc = usbmast_run_cmd(mfun, &cmd);
    405406
    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));
     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));
    409410                return rc;
    410411        }
    411412
    412413        if (cmd.status != CMDS_GOOD) {
    413                 usb_log_error("Write (10) command failed, device %s.\n",
    414                    usb_device_get_name(mfun->mdev->usb_dev));
     414                usb_log_error("Write (10) command failed, device %s.",
     415                    usb_device_get_name(mfun->mdev->usb_dev));
    415416                return EIO;
    416417        }
     
    449450        const errno_t rc = usbmast_run_cmd(mfun, &cmd);
    450451
    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));
     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));
    454455                return rc;
    455456        }
    456457
    457458        if (cmd.status != CMDS_GOOD) {
    458                 usb_log_error("Synchronize Cache (10) command failed, device %s.\n",
    459                    usb_device_get_name(mfun->mdev->usb_dev));
     459                usb_log_error("Synchronize Cache (10) command failed, device %s.",
     460                    usb_device_get_name(mfun->mdev->usb_dev));
    460461                return EIO;
    461462        }
Note: See TracChangeset for help on using the changeset viewer.