On Sat, 6 Jan 2007, Vaclav Barta wrote:

> On Thursday 04 January 2007 22:08, Alan Stern wrote:
> > On Wed, 3 Jan 2007, Vaclav Barta wrote:
> > All right.  Here's a list of plscsi commands that are exactly equivalent
> OK. Using both your patches, I've renamed sd_mod.ko, inserted the stick and 
> ran modprobe sg . Then, the plscsi commands work as follows:
> 
> [EMAIL PROTECTED] plscsi # ./plscsi -x '12 0 0 0 24 0' -i 36 /dev/sg0
> [EMAIL PROTECTED] plscsi # ./plscsi -x '23 0 0 0 0 0 0 0 fc 0' -i 252 /dev/sg0
> // sgioSay.ioctl: Operation not permitted
> // sgioSay x FFFFFFFF 0 0 0 (ioctl sihInfo sihResid sihSbLenWr)
> // -x0001 = -1 = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '23 0 0 0 0 0 0 0 fc 0' -i 252 /dev/sg0
> // sgioSay.ioctl: Operation not permitted
> // sgioSay x FFFFFFFF 0 0 0 (ioctl sihInfo sihResid sihSbLenWr)
> // -x0001 = -1 = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '12 0 0 0 24 0' -i 36 /dev/sg1
> [EMAIL PROTECTED] plscsi # ./plscsi -x '23 0 0 0 0 0 0 0 fc 0' -i 252 /dev/sg1
> // sgioSay.ioctl: Operation not permitted
> // sgioSay x FFFFFFFF 0 0 0 (ioctl sihInfo sihResid sihSbLenWr)
> // -x0001 = -1 = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '23 0 0 0 0 0 0 0 fc 0' -i 252 /dev/sg1
> // sgioSay.ioctl: Operation not permitted
> // sgioSay x FFFFFFFF 0 0 0 (ioctl sihInfo sihResid sihSbLenWr)
> // -x0001 = -1 = plscsi.main exit int

Unfortunately Linux's SCSI ioctl permissions don't allow this command to 
be sent.

> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg0
> // x 6 28 sense // 8 residue
> // -x0102 = -258 = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '28 0 0 0 0 0 0 0 1 0' -i 512 /dev/sg0
> // x 3 11 sense // x200 (512) residue
> // -x0102 = -258 = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '1a 0 1c 0 c0 0' -i 192 /dev/sg0
> // 188 = xBC = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '1a 0 3f 0 c0 0' -i 192 /dev/sg0
> // 156 = x9C = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg0
> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg0
> [EMAIL PROTECTED] plscsi # ./plscsi -x '28 0 0 0 0 0 0 0 1 0' -i 512 /dev/sg0
> // x 3 11 sense // x200 (512) residue
> // -x0102 = -258 = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '28 0 0 0 0 0 0 0 1 0' -i 512 /dev/sg0
> // x 3 11 sense // x200 (512) residue
> // -x0102 = -258 = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg0
> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg0
> [EMAIL PROTECTED] plscsi # ./plscsi -x '28 0 0 0 0 0 0 0 1 0' -i 512 /dev/sg0
> // x 3 11 sense // x200 (512) residue
> // -x0102 = -258 = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg1
> // x 6 28 sense // 8 residue
> // -x0102 = -258 = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '28 0 0 0 0 0 0 0 1 0' -i 512 /dev/sg1
> [EMAIL PROTECTED] plscsi # ./plscsi -x '1a 0 1c 0 c0 0' -i 192 /dev/sg1
> // 188 = xBC = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '1a 0 3f 0 c0 0' -i 192 /dev/sg1
> // 156 = x9C = plscsi.main exit int
> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg1
> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg1
> [EMAIL PROTECTED] plscsi # ./plscsi -x '28 0 0 0 0 0 0 0 1 0' -i 512 /dev/sg1
> [EMAIL PROTECTED] plscsi # ./plscsi -x '28 0 0 0 0 0 0 0 1 0' -i 512 /dev/sg1
> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg1
> [EMAIL PROTECTED] plscsi # ./plscsi -x '25 0 0 0 0 0 0 0 0 0' -i 8 /dev/sg1
> [EMAIL PROTECTED] plscsi # ./plscsi -x '28 0 0 0 0 0 0 0 1 0' -i 512 /dev/sg0
> 
> > Etc.  You may have noticed that Windows repeats itself a lot.  I have no
> > idea why it does.
> Looks like the command succeeds when it's repeated persistently enough...

Or maybe it wants to see some of those commands for /dev/sg1 before it 
will let /dev/sg0 work.  Try doing something just as simple as this:

        ./plscsi -x '0 0 0 0 0 0' /dev/sg0
        ./plscsi -x '0 0 0 0 0 0' /dev/sg0
        ./plscsi -x '0 0 0 0 0 0' /dev/sg1
        ./plscsi -x '0 0 0 0 0 0' /dev/sg1
        ./plscsi -x '28 0 0 0 0 0 0 0 1 0' -i 512 /dev/sg0

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to