From patchwork Tue May 11 21:51:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gertjan van Wingerde X-Patchwork-Id: 98839 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4BLq5LA031226 for ; Tue, 11 May 2010 21:52:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753059Ab0EKVv6 (ORCPT ); Tue, 11 May 2010 17:51:58 -0400 Received: from cpsmtpb-ews03.kpnxchange.com ([213.75.39.6]:1250 "EHLO cpsmtpb-ews03.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753010Ab0EKVvy (ORCPT ); Tue, 11 May 2010 17:51:54 -0400 Received: from cpbrm-ews30.kpnxchange.com ([10.94.84.161]) by cpsmtpb-ews03.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 May 2010 23:51:48 +0200 Received: from CPSMTPM-EML102.kpnxchange.com ([195.121.3.6]) by cpbrm-ews30.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 May 2010 23:51:48 +0200 Received: from wingerd.gvw.nl ([86.87.118.224]) by CPSMTPM-EML102.kpnxchange.com with Microsoft SMTPSVC(7.0.6001.18000); Tue, 11 May 2010 23:51:48 +0200 Received: by wingerd.gvw.nl (Postfix, from userid 501) id CE95260037; Tue, 11 May 2010 23:51:47 +0200 (CEST) From: Gertjan van Wingerde To: "John W. Linville" Cc: Ivo van Doorn , , , Gertjan van Wingerde Subject: [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc. Date: Tue, 11 May 2010 23:51:44 +0200 Message-Id: <1273614705-25118-9-git-send-email-gwingerde@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1273614705-25118-1-git-send-email-gwingerde@gmail.com> References: <1273614705-25118-1-git-send-email-gwingerde@gmail.com> X-OriginalArrivalTime: 11 May 2010 21:51:48.0403 (UTC) FILETIME=[27FEB030:01CAF154] X-RecipientDomain: vger.kernel.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 11 May 2010 21:52:05 +0000 (UTC) diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index fcca30c..bbd6481 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c @@ -614,18 +614,10 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev, /* * TX descriptor initialization */ -static int rt2800pci_write_tx_data(struct queue_entry* entry, - struct txentry_desc *txdesc) +static void rt2800pci_add_tx_datadesc(struct queue_entry* entry, + struct txentry_desc *txdesc) { - int ret; - - ret = rt2x00pci_write_tx_data(entry, txdesc); - if (ret) - return ret; - rt2800_write_txwi(entry->skb, txdesc); - - return 0; } @@ -1080,7 +1072,8 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { .reset_tuner = rt2800_reset_tuner, .link_tuner = rt2800_link_tuner, .write_tx_desc = rt2800pci_write_tx_desc, - .write_tx_data = rt2800pci_write_tx_data, + .write_tx_data = rt2x00pci_write_tx_data, + .add_tx_datadesc = rt2800pci_add_tx_datadesc, .write_beacon = rt2800pci_write_beacon, .kick_tx_queue = rt2800pci_kick_tx_queue, .kill_tx_queue = rt2800pci_kill_tx_queue, diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 6c1ff4c..5f2531f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h @@ -551,6 +551,8 @@ struct rt2x00lib_ops { struct txentry_desc *txdesc); int (*write_tx_data) (struct queue_entry *entry, struct txentry_desc *txdesc); + void (*add_tx_datadesc) (struct queue_entry *entry, + struct txentry_desc *txdesc); void (*write_beacon) (struct queue_entry *entry, struct txentry_desc *txdesc); int (*get_tx_data_len) (struct queue_entry *entry); diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index ff80ef7..cd61d6f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c @@ -80,6 +80,12 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry, return -EINVAL; } + /* + * Call the driver's add_tx_datadesc function, if it exists. + */ + if (rt2x00dev->ops->lib->add_tx_datadesc) + rt2x00dev->ops->lib->add_tx_datadesc(entry, txdesc); + return 0; } EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data); diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index a4f0551..e731389 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c @@ -247,6 +247,12 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry, */ skb_pull(entry->skb, entry->queue->desc_size); + /* + * Call the driver's add_tx_datadesc function, if it exists. + */ + if (rt2x00dev->ops->lib->add_tx_datadesc) + rt2x00dev->ops->lib->add_tx_datadesc(entry, txdesc); + return 0; } EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data);