From patchwork Sun Nov 8 13:39:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 58536 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 nA8DdlKD017599 for ; Sun, 8 Nov 2009 13:39:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753239AbZKHNjk (ORCPT ); Sun, 8 Nov 2009 08:39:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753228AbZKHNjk (ORCPT ); Sun, 8 Nov 2009 08:39:40 -0500 Received: from mail-ew0-f207.google.com ([209.85.219.207]:62471 "EHLO mail-ew0-f207.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753213AbZKHNjj (ORCPT ); Sun, 8 Nov 2009 08:39:39 -0500 Received: by mail-ew0-f207.google.com with SMTP id 3so2371374ewy.37 for ; Sun, 08 Nov 2009 05:39:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=VpLd1k6OzCvHgGIBhCV/etcp9wu4R0XwA6b/xstsG1w=; b=tzzzpOoNyEMZunW/PjFp6N7um8TxtfFLIMfJJ6qUUy+fzhDdO2SfjVBUg5yDaxrPJi gnr+YITC8WLFg875zevU69crqdQ1cPAoDt3+0spW5AWt2vWWvhmif7FZtH/2VEv2oDyt wWlJ4mZcGNmIFCiqfvJbCpuDpSklVfYG0vrQg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=Z/0hh5NE/kcveMZg4hazSycDQQAdNHbP3mkOHY2zjnu+LKslyrwlzJXqpinTXOA7uF tyRiWA9iapbEPW9aEgO2wZbfu3KMXbQAFVkG/ohscSA2+NsNF0AjgqTDUz7dHY4zYpgC /0h9TPz6U/RlpsznivKiVQSH/oaBJ+a16eMO8= Received: by 10.216.87.206 with SMTP id y56mr2035576wee.207.1257687584594; Sun, 08 Nov 2009 05:39:44 -0800 (PST) Received: from localhost.localdomain (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id t2sm5391911gve.27.2009.11.08.05.39.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Nov 2009 05:39:42 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: linux-wireless@vger.kernel.org Cc: Ivo van Doorn , Bartlomiej Zolnierkiewicz , Gertjan van Wingerde Date: Sun, 08 Nov 2009 14:39:16 +0100 Message-Id: <20091108133916.23584.20632.sendpatchset@localhost.localdomain> In-Reply-To: <20091108133854.23584.86842.sendpatchset@localhost.localdomain> References: <20091108133854.23584.86842.sendpatchset@localhost.localdomain> Subject: [PATCH 4/9] rt2800usb: reorganize code in rt2800usb_probe_hw_mode() Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Index: b/drivers/net/wireless/rt2x00/rt2800usb.c =================================================================== --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c @@ -795,6 +795,27 @@ static int rt2800usb_probe_hw_mode(struc rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); /* + * Initialize hw_mode information. + */ + spec->supported_bands = SUPPORT_BAND_2GHZ; + spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM; + + if (rt2x00_rf(&rt2x00dev->chip, RF2820) || + rt2x00_rf(&rt2x00dev->chip, RF2720)) { + spec->num_channels = 14; + spec->channels = rf_vals; + } else if (rt2x00_rf(&rt2x00dev->chip, RF2850) || + rt2x00_rf(&rt2x00dev->chip, RF2750)) { + spec->supported_bands |= SUPPORT_BAND_5GHZ; + spec->num_channels = ARRAY_SIZE(rf_vals); + spec->channels = rf_vals; + } else if (rt2x00_rf(&rt2x00dev->chip, RF3020) || + rt2x00_rf(&rt2x00dev->chip, RF2020)) { + spec->num_channels = ARRAY_SIZE(rf_vals_3070); + spec->channels = rf_vals_3070; + } + + /* * Initialize HT information. */ spec->ht.ht_supported = true; @@ -826,27 +847,6 @@ static int rt2800usb_probe_hw_mode(struc } /* - * Initialize hw_mode information. - */ - spec->supported_bands = SUPPORT_BAND_2GHZ; - spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM; - - if (rt2x00_rf(&rt2x00dev->chip, RF2820) || - rt2x00_rf(&rt2x00dev->chip, RF2720)) { - spec->num_channels = 14; - spec->channels = rf_vals; - } else if (rt2x00_rf(&rt2x00dev->chip, RF2850) || - rt2x00_rf(&rt2x00dev->chip, RF2750)) { - spec->supported_bands |= SUPPORT_BAND_5GHZ; - spec->num_channels = ARRAY_SIZE(rf_vals); - spec->channels = rf_vals; - } else if (rt2x00_rf(&rt2x00dev->chip, RF3020) || - rt2x00_rf(&rt2x00dev->chip, RF2020)) { - spec->num_channels = ARRAY_SIZE(rf_vals_3070); - spec->channels = rf_vals_3070; - } - - /* * Create channel information array */ info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);