# HG changeset patch # User Joseph Jezak # Node ID 7e98632fd19513b92a63ce7feefbd9123d8b367b # Parent 7bff8889dcba8e874fce4d0a565a26bb76ef1ab8 Stupid fixes. diff -r 7bff8889dcba -r 7e98632fd195 ieee80211softmac_io.c --- a/ieee80211softmac_io.c Wed Nov 30 14:06:45 2005 +++ b/ieee80211softmac_io.c Wed Nov 30 14:06:57 2005 @@ -49,33 +49,7 @@ return dst + len; } -/* - * Adds a Supported Rates Information Element to the frame - */ -static u8 * -ieee80211softmac_add_rates(u8 *dst, const struct ieee80211softmac_ratesinfo *r) -{ - int count; - *dst++ = MFIE_TYPE_RATES; - if(r->count > IEEE80211SOFTMAC_MAX_RATES_LEN) - { - *dst++ = IEEE80211SOFTMAC_MAX_RATES_LEN; - memcpy(dst, r->rates, count); - dst += count; - ieee80211softmac_add_ex_rates(dst, r); - } - else { - *dst++ = r->count; - memcpy(dst, r->rates, count); - dst = dst + count; - } - return dst; -} - -/* - * Adds an Extended Supported Rates Information Element to the frame - * - */ +/* Adds an Extended Supported Rates Information Element to the frame */ static u8 * ieee80211softmac_add_ex_rates(u8 *dst, const struct ieee80211softmac_ratesinfo *r) { @@ -88,6 +62,26 @@ *dst++ = count; memcpy(dst, r->rates + IEEE80211SOFTMAC_MAX_RATES_LEN, count); return dst + count; +} + +/* Adds a Supported Rates Information Element to the frame */ +static u8 * +ieee80211softmac_add_rates(u8 *dst, const struct ieee80211softmac_ratesinfo *r) +{ + *dst++ = MFIE_TYPE_RATES; + if(r->count > IEEE80211SOFTMAC_MAX_RATES_LEN) + { + *dst++ = IEEE80211SOFTMAC_MAX_RATES_LEN; + memcpy(dst, r->rates, IEEE80211SOFTMAC_MAX_RATES_LEN); + dst += IEEE80211SOFTMAC_MAX_RATES_LEN; + ieee80211softmac_add_ex_rates(dst, r); + } + else { + *dst++ = r->count; + memcpy(dst, r->rates, r->count); + dst = dst + r->count; + } + return dst; } /* Allocate a management frame */