7 #include <linux/bitmap.h>
8 #include <linux/bitops.h>
18 static inline unsigned long bitmap_size(
int num_ssid,
int num_id)
27 set =
vmalloc(
sizeof(
struct idset) + bitmap_size(num_ssid, num_id));
31 memset(
set->bitmap, 0, bitmap_size(num_ssid, num_id));
51 static inline void idset_add(
struct idset *
set,
int ssid,
int id)
56 static inline void idset_del(
struct idset *
set,
int ssid,
int id)
61 static inline int idset_contains(
struct idset *
set,
int ssid,
int id)
66 static inline int idset_get_first(
struct idset *
set,
int *
ssid,
int *
id)
71 if (bitnum >=
set->num_ssid *
set->num_id)
73 *ssid = bitnum /
set->num_id;
74 *
id = bitnum %
set->num_id;
103 return idset_contains(
set, schid.
ssid, schid.
sch_no);
112 rc = idset_get_first(
set, &ssid, &
id);
114 init_subchannel_id(schid);
123 return bitmap_empty(
set->bitmap,
set->num_ssid *
set->num_id);