X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/f52d66ff00b24111f87c274d3d7085ef2e1d27b1..fd9f96ada81aa0b4466316c716b01d47936dbfb8:/package/broadcom-wl/src/kmod/bcmutils.c diff --git a/package/broadcom-wl/src/kmod/bcmutils.c b/package/broadcom-wl/src/kmod/bcmutils.c index c264ea500..7592f230a 100644 --- a/package/broadcom-wl/src/kmod/bcmutils.c +++ b/package/broadcom-wl/src/kmod/bcmutils.c @@ -855,3 +855,19 @@ bcm_bprintf(struct bcmstrbuf *b, const char *fmt, ...) return r; } + +uint +bcm_bitcount(uint8 *bitmap, uint length) +{ + uint bitcount = 0, i; + uint8 tmp; + for (i = 0; i < length; i++) { + tmp = bitmap[i]; + while (tmp) { + bitcount++; + tmp &= (tmp - 1); + } + } + return bitcount; +} +