linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sbni: update last_rx after netif_rx
@ 2001-02-27  1:49 Arnaldo Carvalho de Melo
  2001-02-27 12:42 ` Yaroslav S. Polyakov
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2001-02-27  1:49 UTC (permalink / raw)
  To: Alan Cox, Yaroslav Polyakov; +Cc: linux-kernel

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;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sbni: update last_rx after netif_rx
  2001-02-27  1:49 [PATCH] sbni: update last_rx after netif_rx Arnaldo Carvalho de Melo
@ 2001-02-27 12:42 ` Yaroslav S. Polyakov
  0 siblings, 0 replies; 2+ messages in thread
From: Yaroslav S. Polyakov @ 2001-02-27 12:42 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: Alan Cox, Yaroslav Polyakov, linux-kernel

hi!

 Because there is no stable linux-2.4 version of sbni driver at the moment
 (2.2 driver that comes with 2.4 kernel doesn't working) i dont think
 there is a need in this patch for current kernels. But I'll surely made
 these changes in 2.4 driver before releasing. 
 Thanks for ideas.

                                       .
	       Better the devil you know than the devil you don't
                          Granch ltd.  Security Analyst


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-27 12:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-27  1:49 [PATCH] sbni: update last_rx after netif_rx Arnaldo Carvalho de Melo
2001-02-27 12:42 ` Yaroslav S. Polyakov

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).