X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/8afe76304a4a092f6100c0f75df0e58bb2821833..a2aaaeedfcefa6230c505c7e498ec2be4bc7a0a2:/package/broadcom-wl/src/kmod/bcmutils.c?ds=sidebyside 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; +} +