From patchwork Tue Nov 10 21:42:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gertjan van Wingerde X-Patchwork-Id: 59160 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAALgjAG021520 for ; Tue, 10 Nov 2009 21:42:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758340AbZKJVmi (ORCPT ); Tue, 10 Nov 2009 16:42:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758345AbZKJVmi (ORCPT ); Tue, 10 Nov 2009 16:42:38 -0500 Received: from cpsmtpm-eml105.kpnxchange.com ([195.121.3.9]:56687 "EHLO CPSMTPM-EML105.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758303AbZKJVmi (ORCPT ); Tue, 10 Nov 2009 16:42:38 -0500 Received: from localhost.localdomain ([86.87.118.224]) by CPSMTPM-EML105.kpnxchange.com with Microsoft SMTPSVC(7.0.6001.18000); Tue, 10 Nov 2009 22:42:42 +0100 From: Gertjan van Wingerde To: users@host1.serialmonkey.com, linux-wireless@vger.kernel.org Cc: Ivo van Doorn , Bartlomiej Zolnierkiewicz , Gertjan van Wingerde Subject: [PATCH v2] rt2x00: Initialize rf302x RF values properly for rt2800pci. Date: Tue, 10 Nov 2009 22:42:40 +0100 Message-Id: <1257889360-388-1-git-send-email-gwingerde@gmail.com> X-Mailer: git-send-email 1.6.5.2 X-OriginalArrivalTime: 10 Nov 2009 21:42:42.0303 (UTC) FILETIME=[BB4FF0F0:01CA624E] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index a848cf5..75d3d00 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c @@ -1,5 +1,6 @@ /* Copyright (C) 2009 Bartlomiej Zolnierkiewicz + Copyright (C) 2009 Gertjan van Wingerde Based on the original rt2800pci.c and rt2800usb.c. Copyright (C) 2009 Ivo van Doorn @@ -806,8 +807,9 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, unsigned int tx_pin; u8 bbp; - if (rt2x00_rt(&rt2x00dev->chip, RT3070) && - (rt2x00_rf(&rt2x00dev->chip, RF2020) || + if ((rt2x00_rt(&rt2x00dev->chip, RT3070) || + rt2x00_rt(&rt2x00dev->chip, RT3090)) && + (rt2x00_rf(&rt2x00dev->chip, RF2020) || rt2x00_rf(&rt2x00dev->chip, RF3020) || rt2x00_rf(&rt2x00dev->chip, RF3021) || rt2x00_rf(&rt2x00dev->chip, RF3022))) @@ -1989,7 +1991,7 @@ static const struct rf_channel rf_vals[] = { * RF value list for rt3070 * Supports: 2.4 GHz */ -static const struct rf_channel rf_vals_3070[] = { +static const struct rf_channel rf_vals_302x[] = { {1, 241, 2, 2 }, {2, 241, 2, 7 }, {3, 242, 2, 2 }, @@ -2046,26 +2048,19 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) if (rt2x00_rf(chip, RF2820) || rt2x00_rf(chip, RF2720) || - (rt2x00_intf_is_pci(rt2x00dev) && - (rt2x00_rf(chip, RF3020) || - rt2x00_rf(chip, RF3021) || - rt2x00_rf(chip, RF3022) || - rt2x00_rf(chip, RF2020) || - rt2x00_rf(chip, RF3052)))) { + (rt2x00_intf_is_pci(rt2x00dev) && rt2x00_rf(chip, RF3052))) { spec->num_channels = 14; spec->channels = rf_vals; - } else if (rt2x00_rf(chip, RF2850) || - rt2x00_rf(chip, RF2750)) { + } else if (rt2x00_rf(chip, RF2850) || rt2x00_rf(chip, RF2750)) { spec->supported_bands |= SUPPORT_BAND_5GHZ; spec->num_channels = ARRAY_SIZE(rf_vals); spec->channels = rf_vals; - } else if (rt2x00_intf_is_usb(rt2x00dev) && - (rt2x00_rf(chip, RF3020) || - rt2x00_rf(chip, RF2020) || - rt2x00_rf(chip, RF3021) || - rt2x00_rf(chip, RF3022))) { - spec->num_channels = ARRAY_SIZE(rf_vals_3070); - spec->channels = rf_vals_3070; + } else if (rt2x00_rf(chip, RF3020) || + rt2x00_rf(chip, RF2020) || + rt2x00_rf(chip, RF3021) || + rt2x00_rf(chip, RF3022)) { + spec->num_channels = ARRAY_SIZE(rf_vals_302x); + spec->channels = rf_vals_302x; } /*