9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] Raspberry Pi: won't recognize the USB mouse
Date: Fri, 28 Feb 2014 04:05:01 -0500	[thread overview]
Message-ID: <efb94564121ab0b3808a8e0e04b408e7@mikro.quanstro.net> (raw)
In-Reply-To: <20140228043127.GA55171@Grants-MacBook.local>

On Thu Feb 27 23:32:49 EST 2014, hcaulfield57@gmail.com wrote:
> This probably won't help, but what happened when I installed Plan 9 onto
> my Raspberry Pi, is the mouse worked but not the keyboard. So I ended up
> going to store and buying the cheapest keyboard that I could find. I
> plugged in the keyboard and it worked. It wasn't a power issue because
> Linux worked with the previous keyboard/mouse combo. I then configured
> the system as a cpu/fs/auth server so I don't have to worry about
> keyboard or mouse anymore :)
>
> Regardless, my solution was just trying different combinations of mouse
> and keyboard until I found one that would work, your mileage may vary.
> Hope this helps,

that sounds worse than my experience.  i have maybe 5-6 keyboards
and they all work with the pi.  i wonder if this isn't due to some
small descriptor handling changes in 9atom.  you can try them out
by copying the source from 9atom.org

	cd
	hget http://ftp.9atom.org/other/usbd.arm > usbd.test
	bind usbd.test /arm/bin/usb/usbd
	cd /sys/src/9/bcm
	mk clean; mk;
	diskparts; mount /dev/sdM0/dos /n/9fat	# from memory.  no pi here.
	cp 9pi /n/9fat				# from memory.  no pi here.

you can make this safer by duplicating the pi sd card first, then
replacing the kernel.  or, naming the kernel something else on
the sd card and editing CONFIG.TXT to match.  then you
can fix with any old machine.

- erik

; 9diff *
/n/sources/plan9/sys/src/cmd/usb/lib/dev.c:205,217 - dev.c:205,222
  loaddevstr(Dev *d, int sid)
  {
  	uchar buf[128];
- 	int type;
- 	int nr;
+ 	int type, langid, nr;

  	if(sid == 0)
  		return estrdup("none");
  	type = Rd2h|Rstd|Rdev;
- 	nr=usbcmd(d, type, Rgetdesc, Dstr<<8|sid, 0, buf, sizeof(buf));
+ 	nr = usbcmd(d, type, Rgetdesc, Dstr<<8|sid, 0, buf, sizeof(buf));
+ 	if(nr < 4)
+ 		langid = 0x0409;		/* english */
+ 	else
+ 		langid = buf[3]<<8 | buf[2];
+ 	nr = usbcmd(d, type, Rgetdesc, Dstr<<8|sid, langid, buf, sizeof(buf));
+
  	return mkstr(buf, nr);
  }

/n/sources/plan9/sys/src/cmd/usb/lib/dev.c:228,233 - dev.c:233,245
  	memset(buf, 0, Ddevlen);
  	if((nr=usbcmd(d, type, Rgetdesc, Ddev<<8|0, 0, buf, nr)) < 0)
  		return -1;
+ 	if(nr == 17){
+ 		print("%s: langid %.4ux\n", argv0, buf[3]<<8|buf[2]);
+ 		if((nr = usbcmd(d, type, Rgetdesc, Ddev<<8|0, buf[3]<<8|buf[2], buf, 18)) < 0)
+ 			return -1;
+ 		print("%s: nr = %d; buf[%d] = %.2ux\n", argv0, nr, nr, buf[nr]);
+ 	}
+
  	/*
  	 * Several hubs are returning descriptors of 17 bytes, not 18.
  	 * We accept them and leave number of configurations as zero.
/n/sources/plan9/sys/src/cmd/usb/lib/dev.c:234,241 - dev.c:246,253
  	 * (a get configuration descriptor also fails for them!)
  	 */
  	if(nr < Ddevlen){
- 		print("%s: %s: warning: device with short descriptor\n",
- 			argv0, d->dir);
+ 		print("%s: %s: warning: device with short descriptor: %d bytes\n",
+ 			argv0, d->dir, nr);
  		if(nr < Ddevlen-1){
  			werrstr("short device descriptor (%d bytes)", nr);
  			return -1;
/n/sources/plan9/sys/src/cmd/usb/lib/dev.c:254,259 - dev.c:266,273
  			d->usb->serial = loaddevstr(d, d->usb->ssid);
  		}
  	}
+ 	else
+ 		print("usbd: desc error: %r");
  	return nr;
  }




  reply	other threads:[~2014-02-28  9:05 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 16:27 Ramakrishnan Muthukrishnan
2014-02-26 17:19 ` Richard Miller
2014-02-27 16:27   ` Ramakrishnan Muthukrishnan
2014-02-27 16:35     ` Ramakrishnan Muthukrishnan
2014-02-27 17:05       ` Ramakrishnan Muthukrishnan
2014-02-27 17:08         ` Lyndon Nerenberg
2014-02-27 17:31           ` Ramakrishnan Muthukrishnan
2014-02-27 18:03             ` Bakul Shah
2014-02-28 11:10             ` Ramakrishnan Muthukrishnan
2014-02-28 11:28               ` Richard Miller
2014-02-28 14:12                 ` Ramakrishnan Muthukrishnan
2014-02-28 14:35                   ` Bakul Shah
2014-02-28 15:12                     ` Ramakrishnan Muthukrishnan
2014-02-28 14:45             ` Anthony Sorace
2014-02-28 15:15               ` Ramakrishnan Muthukrishnan
2014-02-28 16:24               ` Bakul Shah
2014-03-04 14:12                 ` Ramakrishnan Muthukrishnan
2014-03-04 14:27                   ` erik quanstrom
2014-03-04 15:54                     ` Ramakrishnan Muthukrishnan
2014-03-04 16:26                       ` erik quanstrom
2014-03-04 18:18                         ` Bakul Shah
2014-03-04 18:26                           ` erik quanstrom
2014-03-08 14:56                           ` Ramakrishnan Muthukrishnan
2014-03-08 14:59                             ` erik quanstrom
2014-03-09 13:25                               ` Ramakrishnan Muthukrishnan
2014-03-09 13:46                                 ` erik quanstrom
2014-03-05 10:57                     ` Richard Miller
2014-03-05 10:59                     ` Richard Miller
2014-02-27 17:10         ` erik quanstrom
2014-02-27 17:15       ` Steve Simon
2014-02-26 17:22 ` Ramakrishnan Muthukrishnan
2014-02-28  4:31   ` Grant Mather
2014-02-28  9:05     ` erik quanstrom [this message]
2014-03-01  5:43 Michael Hansen
2014-03-01 12:09 ` Richard Miller
2014-03-01 12:12 ` erik quanstrom
2014-03-02 10:46   ` Richard Miller
2014-03-02 14:57     ` erik quanstrom
2014-03-02 19:54       ` Richard Miller
2014-03-02 23:22         ` Winston Kodogo
2014-03-03  1:29         ` erik quanstrom
2014-03-03 11:05           ` Richard Miller
2014-03-03 11:24   ` Richard Miller
2014-03-03 13:39     ` erik quanstrom
2014-03-02  1:12 Michael Hansen
2014-03-02  1:39 ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=efb94564121ab0b3808a8e0e04b408e7@mikro.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).