[rt2x00-users] [RFC 1/6] rt2x00: Introduce 3 queue commands in drivers (start, kick, stop).
Helmut Schaa
helmut.schaa at googlemail.com
Tue Nov 23 08:00:36 UTC 2010
Am Montag 22 November 2010 schrieb Ivo van Doorn:
> As part of the queue refactoring, we now introduce
> 3 queue commands: start, kick, stop.
>
> - Start: will enable a queue, for TX this will
> not mean anything, while for beacons and RX
> this will update the registers to enable the queue.
> - Kick: This will kick all pending frames to
> the hardware. This is needed for the TX queue
> to push all frames to the HW after the queue
> has been started
> - Stop: This will stop the queue in the hardware,
> and cancel any pending work (So this doesn't
> mean the queue is empty after a stop!).
>
> Move all code from the drivers into the appropriate
> functions, and link those calls to the old rt2x00lib
> callback functions (we will fix this later when we
> refactor the queue control inside rt2x00lib).
>
> Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2400pci.c | 123 +++++++++++++++++---------
> drivers/net/wireless/rt2x00/rt2500pci.c | 123 +++++++++++++++++---------
> drivers/net/wireless/rt2x00/rt2500usb.c | 72 +++++++++++-----
> drivers/net/wireless/rt2x00/rt2800pci.c | 141 +++++++++++++++++++----------
> drivers/net/wireless/rt2x00/rt2800usb.c | 72 +++++++++++-----
> drivers/net/wireless/rt2x00/rt2x00usb.c | 12 ++--
> drivers/net/wireless/rt2x00/rt2x00usb.h | 8 +-
> drivers/net/wireless/rt2x00/rt61pci.c | 146 +++++++++++++++++++++----------
> drivers/net/wireless/rt2x00/rt73usb.c | 72 +++++++++++-----
> 9 files changed, 522 insertions(+), 247 deletions(-)
[...]
> +static void rt2800pci_stop_queue(struct data_queue *queue)
> +{
> + struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
> + u32 reg;
> +
> + switch (queue->qid) {
> + case QID_AC_BE:
> + rt2800_register_read(rt2x00dev, WPDMA_RST_IDX, ®);
> + rt2x00_set_field32(®, WPDMA_RST_IDX_DTX_IDX0, 1);
> + rt2800_register_write(rt2x00dev, WPDMA_RST_IDX, reg);
The function is called stop_queue but this will reset the tx queue index
within the device. and thus drop all tx entries still in there. Is that
what stop_queue is expected to do?
If the tx queue flush before stop_queue fails we would have to clear all
entries that are still in the queue and also reset our own tx queue index?
Otherwise there might be a queue corruption after an ifdown/ifup cycle.
I guess the same applies to the other pci drivers as well.
Helmut
More information about the users
mailing list