From patchwork Wed Nov 4 17:36:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 57699 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 nA4Hf3uT014081 for ; Wed, 4 Nov 2009 17:41:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932437AbZKDRgp (ORCPT ); Wed, 4 Nov 2009 12:36:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932315AbZKDRgo (ORCPT ); Wed, 4 Nov 2009 12:36:44 -0500 Received: from fg-out-1718.google.com ([72.14.220.156]:57630 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932347AbZKDRga (ORCPT ); Wed, 4 Nov 2009 12:36:30 -0500 Received: by fg-out-1718.google.com with SMTP id 16so388166fgg.1 for ; Wed, 04 Nov 2009 09:36:34 -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=P83rB6haDQbyvGgNBZ657GNKq4XbV/gAjm5aTNO4ppY=; b=uwOG+Vs1EMrHKYEYvqDeXyoH06+4f+A8UvAbAr87k9TLKBH1TGjw+mZQTMew6GEscl Hp5lWvEsjE5L83PLGHB4E/z9KQDF99rj/8A0zaOwjyFb7Wi9QKWno2LP+Ys9m0cTd8I3 B8iSJLSE5g9M6UucsCC5QnPSdZS6I+TD7FUzY= 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=PyyG3rQdor3zKb5S2Q7qO99nvvb0Cl4tXo8lzD3tq1ncwFHczCm96gH8ts6UQ6aOKq BBySLxo7QTZ4ih6kwUwq8diZeUZResQ/aAEUzZHnqGfSJVSqlFUNnvgLcY8wJljQ2x5i wMW/H6/NKRPzkU4hPfjXzxYIZsQv3AYv4NRBU= Received: by 10.86.103.26 with SMTP id a26mr4147960fgc.40.1257356193755; Wed, 04 Nov 2009 09:36:33 -0800 (PST) Received: from localhost.localdomain (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id d4sm2220014fga.11.2009.11.04.09.36.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 04 Nov 2009 09:36:33 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: linux-wireless@vger.kernel.org Cc: Gertjan van Wingerde , Bartlomiej Zolnierkiewicz , Ivo van Doorn , linux-kernel@vger.kernel.org, "John W. Linville" Date: Wed, 04 Nov 2009 18:36:10 +0100 Message-Id: <20091104173610.28463.4270.sendpatchset@localhost.localdomain> In-Reply-To: <20091104173151.28463.68742.sendpatchset@localhost.localdomain> References: <20091104173151.28463.68742.sendpatchset@localhost.localdomain> Subject: [PATCH 34/41] rt2x00: add support for different chipset interfaces 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/rt2x00.h =================================================================== --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h @@ -144,6 +144,11 @@ struct avg_val { int avg_weight; }; +enum rt2x00_chip_intf { + RT2X00_CHIP_INTF_PCI, + RT2X00_CHIP_INTF_USB, +}; + /* * Chipset identification * The chipset on the device is composed of a RT and RF chip. @@ -169,6 +174,8 @@ struct rt2x00_chip { u16 rf; u32 rev; + + enum rt2x00_chip_intf intf; }; /* @@ -937,6 +944,28 @@ static inline bool rt2x00_check_rev(cons return ((chipset->rev & mask) == rev); } +static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev, + enum rt2x00_chip_intf intf) +{ + rt2x00dev->chip.intf = intf; +} + +static inline bool rt2x00_intf(const struct rt2x00_chip *chipset, + enum rt2x00_chip_intf intf) +{ + return (chipset->intf == intf); +} + +static inline bool rt2x00_intf_is_pci(struct rt2x00_dev *rt2x00dev) +{ + return rt2x00_intf(&rt2x00dev->chip, RT2X00_CHIP_INTF_PCI); +} + +static inline bool rt2x00_intf_is_usb(struct rt2x00_dev *rt2x00dev) +{ + return rt2x00_intf(&rt2x00dev->chip, RT2X00_CHIP_INTF_USB); +} + /** * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes. * @rt2x00dev: Pointer to &struct rt2x00_dev.