Hi,
I've added some comments to the source. I had a hard time finding some
info about the ATA registers we have to access. When I finally found
something, I added it as a few comments in the code, so that it is close
to where we need it.
One register (0x1f7) functions as the 'command register', and that is
where you write the commands to. "What commands?" is the immediate
questions, and /usr/include/linux/hdreg.h is the answer. The most
immediately interesting one is WIN_IDENTIFY (0xEC), which sends back 256
words, or 512 bytes full with information, like number of sectors and
number of heads and such things (a struct hd_driveid actually).
So, the thing to do is: Wait till ATA is ready to accept commands
(usbat2_get_ata_status does that, including the retry if ATA is busy).
Then I'd expect to send a EC to register 17 (the sniff-001 does it in a
multiple register write). Then we set up a bulk transfer to receive the
information (no idea how to that that at this instant), and then we can
proudly tell how big the memcard is. Biggest problem is, that my day is
coming to an end, and I'm afraid I won't finish it today. So instead of
writing a bit of code, I thought I'd share my thoughts with you, so that
maybe I can just cvs update tomorrow to get it working. :-)
Greetings,
Chris
--
I've been down so long, if I'd cheer up, I'd still be depressed.
- Lisa Simpson, Moanin' Lisa Blues.