WIP SDIO works!

(Josh, check out line 7030 of cfg80211.c - this affects USB work too.)

 * *  Weirdness warning!  * *
If you comment out "define PTHREAD_PRINTER" on sdio.c:3873, you get
[00017.665] 02952.05847> brcmfmac 0x41c8954f6000 (brcmf_sdio_wd_timer)(0): 'WD would be active, but state is 0'
[00017.665] 02952.03371> aml_sd_emmc_irq_thread: Got a spurious interrupt
[00017.734] 02319.02556> Waiting for GPIO Test Input Interrupt
...and I have no idea why. But in 10 trials each, it happens if
and only if that line is commented out.

To get the driver working, I completely disabled the interrupt
handling thread, and I'm polling for interrupts every 10 msec.
GPIO interrupt just doesn't work yet. Depending on which firmware
file I use, we either get one interrupt and then never again, or
we get constant interrupts although the chipset says there's no
interrupt condition. Penguin can't reproduce the constant-interrupts.

F2 transfers larger than 512 bytes fail. I worked around that in bcmsdh.c.
[00166.884] 02935.02981> brcmfmac main (brcmf_proto_bcdc_query_dcmd)(56): 'Enter, cmd 262 len 1546, ifidx 0'
[00166.894] 02935.05849> Request transfer size is greater than max transfer size
[00166.894] 02935.05849> aml_sd_emmc_request: Failed to setup data descriptors
[00166.894] 02935.05849> sdio: SDIO_IO_RW_DIRECT_EXTENDED failed, retcode = -2
[00166.894] 02935.05849> sdio_rw_data: Error reading data.func: 2 status: -2
[00166.894] 02935.05849> brcmfmac bwdg (brcmf_sdiod_transfer)(58): 'Why did this fail?? result -2'

Porting errors I've made (look out for similar ones):
 - Not resetting a completion, causing it to fall through before it
 was signaled the second time the code waits.
 - Putting an extra & on a pointer (taking its address rather than
 reading its data) - I've done this at least twice.

If you want to see what the firmware is doing,
brcmf_debug_check_console() may be useful with tonight's "debug"
firmware from Penguin (I'll send it via email). Also,
PTHREAD_PRINTER will dump all SDIO transactions after a
time delay (adjust the delay to something useful).

Test: All the following work:
wlan scan
wlan connect GoogleGuest-Legacy
ping google.com
curl www.google.com

Change-Id: I18c803dc48690633bcf9e1e925fad98a533a074b
20 files changed