Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS-7795 libdiskmgt doesn't always list all disks #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions usr/src/uts/common/io/usb/scsa2usb/scsa2usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ static struct blacklist {

/* Western Digital External HDD */
{MS_WD_VID, MS_WD_PID, 0,
SCSA2USB_ATTRS_INQUIRY_EVPD},

/* QNAP TR-004 */
{MS_QNAP_VID, MS_QNAP_TR_004_PID, 0,
SCSA2USB_ATTRS_INQUIRY_EVPD}
};

Expand Down Expand Up @@ -1768,6 +1772,15 @@ scsa2usb_validate_attrs(scsa2usb_state_t *scsa2usbp)
}
scsa2usbp->scsa2usb_cmd_protocol |= SCSA2USB_UFI_CMDSET;
}
/*
* QNAP TR-004 reports the enclosure SN for all disks.
* This causes zfs to assign the same devid for all disks, confusing
* libdiskmgt. A Let's try clearing it.
*/
if ((desc->idVendor == MS_QNAP_VID) &&
(desc->idProduct == MS_QNAP_TR_004_PID)) {
scsa2usbp->scsa2usb_dev_data->dev_serial = 0x0;
}

if (scsa2usbp->scsa2usb_attrs != SCSA2USB_ALL_ATTRS) {
USB_DPRINTF_L2(DPRINT_MASK_SCSA,
Expand Down
3 changes: 3 additions & 0 deletions usr/src/uts/common/sys/usb/scsa2usb/scsa2usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ extern "C" {
#define MS_WD_VID 0x1058 /* Vendor ID of Western Digital */
#define MS_WD_PID 0x1001 /* PID for Western Digital USB External HDD */

#define MS_QNAP_VID 0x1c04 /* Vendor ID of QNAP */
#define MS_QNAP_TR_004_PID 0x0013 /* PID for QNAP TR-004 */

/*
* The AMI virtual floppy device is not a real USB storage device, but
* emulated by the SP firmware shipped together with important Sun x86
Expand Down