projects
/
openwrt-10.03
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
keep track of the wifi interface state in /var/state/wireless
[openwrt-10.03/.git]
/
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 c264ea500b77f2ee58d308291b8920b6a2a74afc..7592f230ade72acc73f68211c47b2cf95fa354c5 100644
(file)
--- 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;
+}
+