aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2007-07-10 02:21:40 -0400
committerGuido Guenther <agx@bogon.sigxcpu.org>2007-07-15 12:19:02 -0400
commitac96fad34ab7b4b5bc63c4aa317baa707955b9ec (patch)
tree6dabc3f4b23e6fd67abc30bc7a4f12c3a84268de
parent4fdfb6dbfcfb6f6e25cfc7e5a50e44b1c4498378 (diff)
[PATCH] Make at76_match_mode() more readable
Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r--at76_usb.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/at76_usb.c b/at76_usb.c
index ffabc67..d0721de 100644
--- a/at76_usb.c
+++ b/at76_usb.c
@@ -4158,22 +4158,26 @@ static inline int at76_match_mode(struct at76_priv *priv, struct bss_info *ptr)
static int at76_match_rates(struct at76_priv *priv, struct bss_info *ptr)
{
int i;
- u8 *rate;
-
- for (i = 0, rate = ptr->rates; i < ptr->rates_len; i++, rate++)
- if (*rate & 0x80) {
- /* this is a basic rate we have to support
- (see IEEE802.11, ch. 7.3.2.2) */
- if (*rate != (0x80 | hw_rates[0])
- && *rate != (0x80 | hw_rates[1])
- && *rate != (0x80 | hw_rates[2])
- && *rate != (0x80 | hw_rates[3])) {
- at76_dbg(DBG_BSS_MATCH,
- "%s: bss table entry %p: basic rate %02x not supported",
- priv->netdev->name, ptr, *rate);
- return 0;
- }
+
+ for (i = 0; i < ptr->rates_len; i++) {
+ u8 rate = ptr->rates[i];
+
+ if (!(rate & 0x80))
+ continue;
+
+ /* this is a basic rate we have to support
+ (see IEEE802.11, ch. 7.3.2.2) */
+ if (rate != (0x80 | hw_rates[0])
+ && rate != (0x80 | hw_rates[1])
+ && rate != (0x80 | hw_rates[2])
+ && rate != (0x80 | hw_rates[3])) {
+ at76_dbg(DBG_BSS_MATCH,
+ "%s: bss table entry %p: basic rate %02x not "
+ "supported", priv->netdev->name, ptr, rate);
+ return 0;
}
+ }
+
/* if we use short preamble, the bss must support it */
if (priv->preamble_type == PREAMBLE_TYPE_SHORT &&
!(ptr->capa & WLAN_CAPABILITY_SHORT_PREAMBLE)) {