wimax/i2400m: fix reboot echo/ack barker deadlock
authorInaky Perez-Gonzalez <inaky@linux.intel.com>
Fri, 4 Sep 2009 21:50:59 +0000 (14:50 -0700)
committerInaky Perez-Gonzalez <inaky@linux.intel.com>
Mon, 19 Oct 2009 06:55:55 +0000 (15:55 +0900)
commit923d708fed9d47c7b4d67694500d766337663e29
tree54cc91baf9f495f924e467625e2bf50cbce79f48
parentebc5f62b76ad540ff7b3e438506638009e7812a6
wimax/i2400m: fix reboot echo/ack barker deadlock

The i2400m based devices can get in a sort of a deadlock some times;
when they boot, they send a reboot "barker" (a magic number) and then
the driver has to echo that same barker to ack reception
(echo/ack). Then the device does a final ack by sending an ACK barker.

The first time this happens, we don't know ahead of time with barker
the device is going to send, as different device models and SKUs will
send different barker depending on the EEPROM programming.

If the device has sent the barker before the driver has been able to
read it, the driver looses, as it doesn't know which barker it has to
echo/ack back. With older devices, we tried a couple of combinations
and that always worked; but now, with adding support for more, in
which we have an unlimited number of new barkers, that is not an
option.

So we rework said case so that when the device gets stuck, we just
cycle through all the known types until one forces the device to send
an ack. Otherwise, the driver gives up and aborts.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
drivers/net/wimax/i2400m/fw.c
include/linux/wimax/i2400m.h