ipwireless: Fix blocked sending
authorDavid Sterba <dsterba@suse.cz>
Fri, 6 Jun 2008 08:56:35 +0000 (10:56 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jun 2008 18:31:02 +0000 (11:31 -0700)
commiteb4e545d4ac82d9018487edb4419b33b9930c857
tree2b7d2e5b7338a77dea99b9a61026f163dc38b791
parent979b0fea2d9ae5d57237a368d571cbc84655fba6
ipwireless: Fix blocked sending

Packet sending is driven by two flags, tx_ready and tx_queued.
It was possible, that there were queued data for sending and
hardware was flagged as blocked but in fact it was not.

The tx_queued was indicator but should be really a counter else
first fragmented packet resets tx_queued flag, but there may be
pending packets which do not get sent.

New semantics:
tx_ready - set, if hw is ready to send packet, no packet is being
           transferred right now
           set the flag right at the place where data are copied
           into hw memory and not earlier without checking if it
           was succesful
tx_queued - count of enqueued packets, including fragments

Tested-by: Michal Rokos <michal.rokos@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/pcmcia/ipwireless/hardware.c