[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libusb-devel
Subject:    Re: [libusb] USB Mass Storage Read-Only
From:       Tim Roberts <timr () probo ! com>
Date:       2016-11-30 17:31:49
Message-ID: 6ca83956-a5db-b4e2-1903-9955a72ed137 () probo ! com
[Download RAW message or body]

Jijian Zhao wrote:
>
> Question:
> I want USB Mass Storage device can be set read-only.And it is under
> host OS control.
> Which data packet that via libusb to usb mass storage device should
> filter out?
> Or have other ways?

This is not easy.  The USB Mass Storage protocol is essentially a
stripped down version of the SCSI command set.  Even the seemingly
simple task of returning an error for all write requests means you have
to parse the SCSI commands to figure out which are reads, which are
writes, and which are status updates.  The right method is to change the
properties that the device returns to indicate that it is set read-only,
but again that involves parsing the SCSI commands to figure out where to
do that.

Have you already downloaded the USB Mass Storage specifications, so you
can start on this process?

-- 
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.


------------------------------------------------------------------------------
_______________________________________________
libusb-devel mailing list
libusb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic