Thread (7 messages) 7 messages, 2 authors, 2008-10-30

Re: [PATCH for 2.6.28] mac80211: fix basic rates

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2008-10-30 14:54:56

On Thu, 2008-10-30 at 16:51 +0200, Tomas Winkler wrote:
Oh, I now I got it out of index. What about coding it in more readable way?


for (i = 0; i < elems.supp_rates_len; i++) {
                int rate = (elems.supp_rates[i] & 0x7f) * 5;
                bool is_basic = !!(elems.supp_rates[i] & 0x80);

                if (rate > 110)
                        have_higher_than_11mbit = true;

                for (j = 0; j < sband->n_bitrates; j++) {
                        if (sband->bitrates[j].bitrate == rate) {
                                rates |= BIT(j);
                                if (is_basic)
                                        basic_rates |= BIT(j);
                                break;
yeah, that works too, and the break is probably a good idea, want to
send a patch to supersede this one?

johannes

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help