On Fri, 2012-03-02 at 02:41 +0100, Dmitry Tarnyagin wrote: > The code implements cw1200 TX queues, used for holding TX frames pending > transmission. The code supports garbage collecting and accounting of the frames. > > Note that link_id_map here and in the rest of the code is used to track > (ieee80211) power management state of connected stations in AP mode. > > Signed-off-by: Dmitry Tarnyagin <dmitry.tarnyagin@xxxxxxxxxxxxxx> > --- > drivers/staging/cw1200/queue.c | 584 ++++++++++++++++++++++++++++++++++++++++ > drivers/staging/cw1200/queue.h | 116 ++++++++ > 2 files changed, 700 insertions(+), 0 deletions(-) > create mode 100644 drivers/staging/cw1200/queue.c > create mode 100644 drivers/staging/cw1200/queue.h > > diff --git a/drivers/staging/cw1200/queue.c b/drivers/staging/cw1200/queue.c > new file mode 100644 > index 0000000..014e6b2 > --- /dev/null > +++ b/drivers/staging/cw1200/queue.c > @@ -0,0 +1,584 @@ > +/* > + * O(1) TX queue with built-in allocator for ST-Ericsson CW1200 drivers > + * > + * Copyright (c) 2010, ST-Ericsson > + * Author: Dmitry Tarnyagin <dmitry.tarnyagin@xxxxxxxxxxxxxx> > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > + > +#include <net/mac80211.h> > +#include <linux/sched.h> > +#include "queue.h" > +#include "cw1200.h" > +#include "debug.h" > + > +/* private */ struct cw1200_queue_item > +{ > + struct list_head head; > + struct sk_buff *skb; > + u32 packetID; > + unsigned long queue_timestamp; > + unsigned long xmit_timestamp; > + struct cw1200_txpriv txpriv; > + u8 generation; > +}; > + > +static inline void __cw1200_queue_lock(struct cw1200_queue *queue) > +{ > + struct cw1200_queue_stats *stats = queue->stats; > + if (queue->tx_locked_cnt++ == 0) { Is there some common lock that prevents this getting corrupted? mac80211 and higher layers do not have any synchronisation between the different TX queues, and you'll need to call this from a few places ... maybe it needs to be atomic_t? johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html