Return-path: Received: from mail-iy0-f174.google.com ([209.85.210.174]:34979 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754879Ab0LTJbK convert rfc822-to-8bit (ORCPT ); Mon, 20 Dec 2010 04:31:10 -0500 Received: by iyi12 with SMTP id 12so2039006iyi.19 for ; Mon, 20 Dec 2010 01:31:09 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <201012200955.22087.helmut.schaa@googlemail.com> References: <1292833909-20138-1-git-send-email-ismael.luceno@gmail.com> <201012200955.22087.helmut.schaa@googlemail.com> From: Julian Calaby Date: Mon, 20 Dec 2010 20:30:49 +1100 Message-ID: Subject: Re: [PATCH 1/2] rt2x00: Write the frame *after* padding (rt2800 usb devices) To: Helmut Schaa Cc: Ismael Luceno , linux-wireless , Ivo Van Doorn , Gertjan van Wingerde Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, Dec 20, 2010 at 19:55, Helmut Schaa wrote: > Hi, > > Am Montag, 20. Dezember 2010 schrieb Ismael Luceno: >> Signed-off-by: Ismael Luceno >> --- >> ?drivers/net/wireless/rt2x00/rt2800usb.c | ? ?7 ++++--- >> ?1 files changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c >> index 3e0205d..85185de 100644 >> --- a/drivers/net/wireless/rt2x00/rt2800usb.c >> +++ b/drivers/net/wireless/rt2x00/rt2800usb.c >> @@ -378,9 +378,10 @@ static void rt2800usb_write_tx_data(struct queue_entry *entry, >> ? ? ? ?* | TXINFO | TXWI | 802.11 header | L2 pad | payload | pad | USB end pad | >> ? ? ? ?* ? ? ? ? ? ? ? ? |<------------- tx_pkt_len ------------->| >> ? ? ? ?*/ >> - ? ? ? ?rt2800_write_tx_data(entry, txdesc); >> - ? ? ? ?padding_len = roundup(entry->skb->len + 4, 4) - entry->skb->len; >> - ? ? ? ?memset(skb_put(entry->skb, padding_len), 0, padding_len); >> + ? ? padding_len = roundup(entry->skb->len + 4, 4) - entry->skb->len; >> + ? ? memset(skb_put(entry->skb, padding_len), 0, padding_len); >> + >> + ? ? rt2800_write_tx_data(entry, txdesc); > > Could you please explain this change in more detail please? > Why is it needed? rt2800_write_tx_data only adds the TXWI to the front of the > buffer, doing that before or after the padding doesn't make a difference, no? Semantically it makes more sense this way, why modify a entry before writing it - but maybe the issue is that the name of the function makes it's function ambiguous, maybe renaming it to something along the lines of "rt2800_prepend_TXWI" would make it's purpose clearer. Thanks, -- Julian Calaby Email: julian.calaby@gmail.com Profile: http://www.google.com/profiles/julian.calaby/ .Plan: http://sites.google.com/site/juliancalaby/