On Tue, 2010-10-12 at 10:53 +0200, Ido Yariv wrote: > On each TX descriptor allocation, a free entry is found by traversing the TX > descriptors array. > > Improve this by holding a bitmap of all TX descriptors, and using efficient > bit operations to search for free entries. > The bitmap is 32 bits long, assuming that the maximum number of > descriptors (ACX_TX_DESCRIPTORS) will never exceed 32. > > Signed-off-by: Ido Yariv <ido@xxxxxxxxxx> > --- > drivers/net/wireless/wl12xx/wl1271.h | 1 + > drivers/net/wireless/wl12xx/wl1271_main.c | 1 + > drivers/net/wireless/wl12xx/wl1271_tx.c | 38 ++++++++++++++++------------ > 3 files changed, 24 insertions(+), 16 deletions(-) > > diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h > index 4a034a3..ddecc96 100644 > --- a/drivers/net/wireless/wl12xx/wl1271.h > +++ b/drivers/net/wireless/wl12xx/wl1271.h > @@ -398,6 +398,7 @@ struct wl1271 { > struct work_struct tx_work; > > /* Pending TX frames */ > + unsigned long tx_frames_map; > struct sk_buff *tx_frames[ACX_TX_DESCRIPTORS]; Just use unsigned long tx_frames_map[BITS_TO_LONGS(ACX_TX_DESCRIPTORS)]; instead and you don't have to worry about the number anywhere. 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