mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Safonov <insafonov@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ivan Safonov <insafonov@gmail.com>,
	Luca Ceresoli <luca@lucaceresoli.net>,
	William Blough <devel@blough.us>,
	Kyle Kuffermann <kyle.kuffermann@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jarod Wilson <jarod@redhat.com>, Phil Sutter <phil@nwl.cc>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] staging:r8188eu: update pkt->(data|tail|len) synchronously with rx_(data|tail|len) in recv_frame structure
Date: Mon,  6 Feb 2017 20:23:27 +0300	[thread overview]
Message-ID: <20170206172328.24674-3-insafonov@gmail.com> (raw)
In-Reply-To: <20170206172328.24674-1-insafonov@gmail.com>

Original driver code uses rx_* members to store skb (pkt) fields
(instead of pkt->* members), pkt->* updated only after data
completely formed, not in process.

Update pkt->* after data buffer changed (with rx_*).

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
 drivers/staging/rtl8188eu/include/rtw_recv.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 2e5caa4..d4d8a74 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -261,6 +261,8 @@ static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
 
 	if (precvframe == NULL)
 		return NULL;
+
+	skb_pull(precvframe->pkt, sz);
 	precvframe->rx_data += sz;
 	if (precvframe->rx_data > precvframe->rx_tail) {
 		precvframe->rx_data -= sz;
@@ -278,7 +280,7 @@ static inline u8 *recvframe_put(struct recv_frame *precvframe, int sz)
 
 	if (precvframe == NULL)
 		return NULL;
-
+	skb_put(precvframe->pkt, sz);
 	precvframe->rx_tail += sz;
 
 	if (precvframe->rx_tail > precvframe->pkt->end) {
@@ -299,6 +301,7 @@ static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, int sz)
 
 	if (precvframe == NULL)
 		return NULL;
+	skb_trim(precvframe->pkt, precvframe->pkt->len - sz);
 	precvframe->rx_tail -= sz;
 	if (precvframe->rx_tail < precvframe->rx_data) {
 		precvframe->rx_tail += sz;
-- 
2.10.2

  parent reply	other threads:[~2017-02-06 17:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06 17:23 [PATCH 1/4] staging:r8188eu: replace rx_end member of recv_frame with pkt->end Ivan Safonov
2017-02-06 17:23 ` [PATCH 2/4] staging:r8188eu: remove unused rtw_ieee80211_bar structure definition Ivan Safonov
2017-02-06 17:23 ` Ivan Safonov [this message]
2017-02-06 17:23 ` [PATCH 4/4] staging:r8188eu: replace recv_frame->rx_(data|len|tail) with pkt->(data|len|tail) and remove unused recvframe_(put|pull|pull_tail)() Ivan Safonov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170206172328.24674-3-insafonov@gmail.com \
    --to=insafonov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devel@blough.us \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jarod@redhat.com \
    --cc=kyle.kuffermann@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca@lucaceresoli.net \
    --cc=phil@nwl.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®