~mcf/plan9front

9cd55a085de274abb937a2d586b3d0a4e4d0e1b1 — cinap_lenrek 2 years ago 0e3a955
nusb/ether: remove csp check for rndis, already done in nusbrc
2 files changed, 2 insertions(+), 18 deletions(-)

M sys/src/9/boot/nusbrc
M sys/src/cmd/nusb/ether/rndis.c
M sys/src/9/boot/nusbrc => sys/src/9/boot/nusbrc +1 -1
@@ 33,7 33,7 @@ if(! nusb/usbd)
			switch($4){
			case *03
				nusb/kb $id
			case ff0202 0104ef
			case ff0202 0104ef 0301e0
				nusb/ether -t rndis $etherargs $id
			case *02
				# CDC ethernet

M sys/src/cmd/nusb/ether/rndis.c => sys/src/cmd/nusb/ether/rndis.c +1 -17
@@ 111,23 111,7 @@ int
rndisinit(Dev *d)
{
	uchar res[128];
	int r, i, off, sz;
	ulong csp;
	Ep *ep;

	r = 0;
	for(i = 0; i < nelem(d->usb->ep); i++){
		if((ep = d->usb->ep[i]) == nil)
			continue;
		csp = ep->iface->csp;
		// ff0202 is canonical CSP per Linux kernel; 301e0 used by Nexus 5
		if(csp == 0xff0202 || csp == 0x0301e0 || csp == 0x0104ef)
			r = 1;
	}
	if(!r){
		werrstr("no rndis found");
		return -1;
	}
	int off, sz, r;

	/* initialize */
	PUT4(minit+20, 1580); /* max xfer = 1580 */