From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>, Yaroslav Polyakov <xenon@granch.ru>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] sbni: update last_rx after netif_rx
Date: Mon, 26 Feb 2001 22:49:11 -0300 [thread overview]
Message-ID: <20010226224911.C8692@conectiva.com.br> (raw)
Hi,
Please consider applying.
- Arnaldo
--- linux-2.4.2/drivers/net/wan/sbni.c Tue Feb 13 19:15:05 2001
+++ linux-2.4.2.acme/drivers/net/wan/sbni.c Tue Feb 27 00:19:32 2001
@@ -460,7 +460,7 @@
* generate Ethernet address (0x00ff01xxxxxx)
*/
- *(u16*)dev->dev_addr = htons(0x00ff);
+ *(u16*)dev->dev_addr = __constant_htons(0x00ff);
*(u32*)(dev->dev_addr+2) = htonl(((def_mac ? def_mac : (u32) dev->priv) & 0x00ffffff) | 0x01000000);
lp = dev->priv;
@@ -962,12 +962,17 @@
static inline void sbni_get_packet(struct net_device* dev)
{
struct net_local* lp = (struct net_local*)dev->priv;
+ int pktlen = lp->inppos - ETH_HLEN + sizeof(struct sbni_hard_header);
+ struct net_device* rx_dev =
+#ifdef KATYUSHA
+ lp->m;
+#else
+ dev;
+#endif
struct sk_buff* skb;
unsigned char *rawp;
-
-
- skb = dev_alloc_skb(lp->inppos - ETH_HLEN + sizeof(struct sbni_hard_header));
+ skb = dev_alloc_skb(pktlen);
if(skb == NULL)
{
@@ -975,11 +980,7 @@
lp->stats.rx_dropped++;
return;
} else {
-#ifdef KATYUSHA
- skb->dev = lp->m;
-#else
- skb->dev = dev;
-#endif
+ skb->dev = rx_dev;
memcpy((unsigned char*)skb_put(skb, lp->inppos + 8)+8,
lp->eth_rcv_buffer,
lp->inppos);
@@ -1006,9 +1007,9 @@
{
rawp = (unsigned char*)(&lp->eth_rcv_buffer[2*ETH_ALEN]);
if (*(unsigned short *)rawp == 0xFFFF)
- skb->protocol=htons(ETH_P_802_3);
+ skb->protocol=__constant_htons(ETH_P_802_3);
else
- skb->protocol=htons(ETH_P_802_2);
+ skb->protocol=__constant_htons(ETH_P_802_2);
}
@@ -1016,6 +1017,8 @@
netif_rx(skb);
lp->stats.rx_packets++;
+ lp->stats.rx_bytes += pktlen;
+ rx_dev->last_rx = jiffies;
}
return;
}
next reply other threads:[~2001-02-27 3:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-27 1:49 Arnaldo Carvalho de Melo [this message]
2001-02-27 12:42 ` [PATCH] sbni: update last_rx after netif_rx Yaroslav S. Polyakov
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=20010226224911.C8692@conectiva.com.br \
--to=acme@conectiva.com.br \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=xenon@granch.ru \
/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;
as well as URLs for NNTP newsgroup(s).