#86 __set_bit_{8,16,32} helper functions

closed-rejected
5
2001-12-18
2001-06-19
No

multicast filters are often hash based, and drivers
need a function
that sets the <n>th bit in an {byte,short,long} array.

* atomicity not required
* no special alignment requirements.
u16 hash __attribute__((aligned(sizeof(unsigned
long)));
is ugly [starfire.c]
* correct on big endian cpus

Some drivers contain their own implementation (tulip),
but it belongs into <linux/bitops.h>

Example:

u{8,16,32} hash[n];
for_all_mc_addr
__set_bit_{8,16,32}(crc(mc_addr),hash);
for(i<n)
out{b,w,l}(hash[i]);

Discussion

  • Manfred Spraul

    Manfred Spraul - 2001-06-19
     
  • Manfred Spraul

    Manfred Spraul - 2001-06-19
    • labels: --> net_drivers
    • assigned_to: nobody --> jgarzik
     
  • Jeff Garzik

    Jeff Garzik - 2001-12-18

    Logged In: YES
    user_id=17443

    Need to convince people other than me. Perhaps send to
    Linus for 2.5 sometime?

     
  • Jeff Garzik

    Jeff Garzik - 2001-12-18
    • status: open --> closed-rejected
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks