From patchwork Sun Nov 8 13:39:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 58537 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 nA8Ddtwu017643 for ; Sun, 8 Nov 2009 13:39:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753248AbZKHNjs (ORCPT ); Sun, 8 Nov 2009 08:39:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753228AbZKHNjs (ORCPT ); Sun, 8 Nov 2009 08:39:48 -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 S1752178AbZKHNjr (ORCPT ); Sun, 8 Nov 2009 08:39:47 -0500 Received: by mail-ew0-f207.google.com with SMTP id 3so2371374ewy.37 for ; Sun, 08 Nov 2009 05:39:52 -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=28YpMmaQEcli7rO/5DnDG3n0W/Q11fmflw7yKcu2bXo=; b=OrgWQdsfBaZGZxGSxcUC0DUPhpgoOtev8vYM8Yrwb2mKlF+ZAHYfkdJvvbuorrUuku pNj1CCgrHzF7EpItfUOJWJ+5Vd5mkq+wdWla9FCNx2Pdm/GNwpid8/tTcGqzu89bvWPi 0k4iXBaBLRs+/SVvm4sgW9Si/Hd2rMvvg1cxU= 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=MLxBVDwdyvh1sfmyxu4sYbF8vgzHH3eBQTRxPyJXPtGwROY4iqsCAzYOT0MVe3aHa1 +zB0E53oYA8WIPw2Q1fGKI6ERxp9NkA4acj5Z7AWp+8U3r1iK8tBD33fXz8Od8HN8R9L iuTGn+b1epp8EgGdIFilADJ9SvSuj389sik9A= Received: by 10.216.86.16 with SMTP id v16mr2152789wee.162.1257687592103; Sun, 08 Nov 2009 05:39:52 -0800 (PST) Received: from localhost.localdomain (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id t2sm5400223gve.12.2009.11.08.05.39.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Nov 2009 05:39:51 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: linux-wireless@vger.kernel.org Cc: Gertjan van Wingerde , Bartlomiej Zolnierkiewicz , Ivo van Doorn Date: Sun, 08 Nov 2009 14:39:25 +0100 Message-Id: <20091108133925.23584.37879.sendpatchset@localhost.localdomain> In-Reply-To: <20091108133854.23584.86842.sendpatchset@localhost.localdomain> References: <20091108133854.23584.86842.sendpatchset@localhost.localdomain> Subject: [PATCH 5/9] rt2800: prepare for rt2800*_probe_hw_mode() unification 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/rt2800pci.c =================================================================== --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c @@ -1175,6 +1175,7 @@ static const struct rf_channel rf_vals[] static int rt2800pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) { + struct rt2x00_chip *chip = &rt2x00dev->chip; struct hw_mode_spec *spec = &rt2x00dev->spec; struct channel_info *info; char *tx_power1; @@ -1190,7 +1191,9 @@ static int rt2800pci_probe_hw_mode(struc IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_SUPPORTS_PS | IEEE80211_HW_PS_NULLFUNC_STACK; - rt2x00dev->hw->extra_tx_headroom = TXWI_DESC_SIZE; + + if (rt2x00_intf_is_pci(rt2x00dev)) + rt2x00dev->hw->extra_tx_headroom = TXWI_DESC_SIZE; SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, @@ -1205,17 +1208,18 @@ static int rt2800pci_probe_hw_mode(struc 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) || - rt2x00_rf(&rt2x00dev->chip, RF3020) || - rt2x00_rf(&rt2x00dev->chip, RF3021) || - rt2x00_rf(&rt2x00dev->chip, RF3022) || - rt2x00_rf(&rt2x00dev->chip, RF2020) || - rt2x00_rf(&rt2x00dev->chip, RF3052)) { + 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)))) { spec->num_channels = 14; spec->channels = rf_vals; - } else if (rt2x00_rf(&rt2x00dev->chip, RF2850) || - rt2x00_rf(&rt2x00dev->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; Index: b/drivers/net/wireless/rt2x00/rt2800usb.c =================================================================== --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c @@ -770,6 +770,7 @@ static const struct rf_channel rf_vals_3 static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) { + struct rt2x00_chip *chip = &rt2x00dev->chip; struct hw_mode_spec *spec = &rt2x00dev->spec; struct channel_info *info; char *tx_power1; @@ -785,7 +786,10 @@ static int rt2800usb_probe_hw_mode(struc IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_SUPPORTS_PS | IEEE80211_HW_PS_NULLFUNC_STACK; - rt2x00dev->hw->extra_tx_headroom = TXINFO_DESC_SIZE + TXWI_DESC_SIZE; + + if (rt2x00_intf_is_usb(rt2x00dev)) + rt2x00dev->hw->extra_tx_headroom = + TXINFO_DESC_SIZE + TXWI_DESC_SIZE; SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, @@ -800,17 +804,18 @@ static int rt2800usb_probe_hw_mode(struc 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)) { + if (rt2x00_rf(chip, RF2820) || + rt2x00_rf(chip, RF2720)) { spec->num_channels = 14; spec->channels = rf_vals; - } else if (rt2x00_rf(&rt2x00dev->chip, RF2850) || - rt2x00_rf(&rt2x00dev->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_rf(&rt2x00dev->chip, RF3020) || - rt2x00_rf(&rt2x00dev->chip, RF2020)) { + } else if (rt2x00_intf_is_usb(rt2x00dev) && + (rt2x00_rf(chip, RF3020) || + rt2x00_rf(chip, RF2020))) { spec->num_channels = ARRAY_SIZE(rf_vals_3070); spec->channels = rf_vals_3070; }