diff --git a/sys/dev/usb/usb_msctest.c b/sys/dev/usb/usb_msctest.c --- a/sys/dev/usb/usb_msctest.c +++ b/sys/dev/usb/usb_msctest.c @@ -3,6 +3,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2008,2011 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2021-2022 Idwer Vollering. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,9 +30,6 @@ /* * The following file contains code that will detect USB autoinstall * disks. - * - * TODO: Potentially we could add code to automatically detect USB - * mass storage quirks for not supported SCSI commands! */ #ifdef USB_GLOBAL_INCLUDE_FILE @@ -807,7 +805,7 @@ goto done; } - err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + err = bbb_command_start(sc, DIR_NONE, 0, NULL, 0, &scsi_test_unit_ready, sizeof(scsi_test_unit_ready), USB_MS_HZ); @@ -815,14 +813,15 @@ if (err != ERR_CSW_FAILED) goto error; DPRINTF("Test unit ready failed\n"); + usbd_add_dynamic_quirk(udev, UQ_MSC_NO_TEST_UNIT_READY); } - err = bbb_command_start(sc, DIR_OUT, 0, NULL, 0, + err = bbb_command_start(sc, DIR_NONE, 0, NULL, 0, &scsi_prevent_removal, sizeof(scsi_prevent_removal), USB_MS_HZ); if (err == 0) { - err = bbb_command_start(sc, DIR_OUT, 0, NULL, 0, + err = bbb_command_start(sc, DIR_NONE, 0, NULL, 0, &scsi_allow_removal, sizeof(scsi_allow_removal), USB_MS_HZ); }