9front - general discussion about 9front
 help / color / mirror / Atom feed
* two nusb tweaks
@ 2017-02-15  6:04 Nick Owens
  2017-02-15  8:01 ` [9front] " cinap_lenrek
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Owens @ 2017-02-15  6:04 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

attached is a patch for two tweaks to nusb.

one is to hack in support for USB attached SCSI protocol in nusb/disk.
i don't think this is really correct, but somehow lets nusb/disk talk
bulk to my device (unitek Y-3363). still slow as a dog.

the other is for nusb/ptp to correctly represent directories that my
phone (LG G5) presents. the association type that my phone sends is 0
(Undefined), but it does correctly say the type is association
(0x3001). without this, i just see the directiories as 'files'.

i would appreciate any testing if someone has a USB UAS device, or
cell phone/camera with MTP capabilities.

if these are ok, i'll commit them.

[-- Attachment #2: nusb.diff --]
[-- Type: text/plain, Size: 1486 bytes --]

diff -r 12e494045696 sys/src/cmd/nusb/disk/disk.c
--- a/sys/src/cmd/nusb/disk/disk.c	Mon Feb 13 22:28:35 2017 +0100
+++ b/sys/src/cmd/nusb/disk/disk.c	Wed Feb 15 05:53:52 2017 -0800
@@ -939,7 +939,7 @@
 			continue;
 		csp = ep->iface->csp;
 		sc = Subclass(csp);
-		if(!(Class(csp) == Clstorage && (Proto(csp) == Protobulk)))
+		if(!(Class(csp) == Clstorage && (Proto(csp) == Protobulk || Proto(csp) == Protouasp)))
 			continue;
 		if(sc != Subatapi && sc != Sub8070 && sc != Subscsi)
 			fprint(2, "disk: subclass %#ulx not supported. trying anyway\n", sc);
diff -r 12e494045696 sys/src/cmd/nusb/disk/ums.h
--- a/sys/src/cmd/nusb/disk/ums.h	Mon Feb 13 22:28:35 2017 +0100
+++ b/sys/src/cmd/nusb/disk/ums.h	Wed Feb 15 05:53:52 2017 -0800
@@ -14,6 +14,7 @@
 	Protocbi =	0,	/* control/bulk/interrupt; mainly floppies */
 	Protocb =	1,	/*   "  with no interrupt; mainly floppies */
 	Protobulk =	0x50,	/* bulk only */
+	Protouasp =	0x62,	/* USB attached SCSI protocol */
 
 	Subrbc =	1,	/* reduced blk cmds */
 	Subatapi =	2,	/* cd/dvd using sff-8020i or mmc-2 cmd blks */
diff -r 12e494045696 sys/src/cmd/nusb/ptp/ptp.c
--- a/sys/src/cmd/nusb/ptp/ptp.c	Mon Feb 13 22:28:35 2017 +0100
+++ b/sys/src/cmd/nusb/ptp/ptp.c	Wed Feb 15 05:53:52 2017 -0800
@@ -555,7 +555,7 @@
 		x->handle = NUM(path);
 		x->store = GET4(p);
 		x->format = GET2(p+4);
-		if(x->format == 0x3001 && GET2(p+42) == 1){
+		if(x->format == 0x3001){
 			x->d.qid.type = QTDIR;
 			x->d.mode = DMDIR|0777;
 		} else {


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] two nusb tweaks
  2017-02-15  6:04 two nusb tweaks Nick Owens
@ 2017-02-15  8:01 ` cinap_lenrek
  0 siblings, 0 replies; 2+ messages in thread
From: cinap_lenrek @ 2017-02-15  8:01 UTC (permalink / raw)
  To: 9front

looks ok to me.

--
cinap


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-15  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15  6:04 two nusb tweaks Nick Owens
2017-02-15  8:01 ` [9front] " cinap_lenrek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).