Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99dd1a2b authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'upstream-next' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

parents 7ef43eba 7d2e3cb7
Loading
Loading
Loading
Loading
+18 −19
Original line number Original line Diff line number Diff line
@@ -202,7 +202,6 @@ static void elmc_xmt_int(struct net_device *dev);
static void elmc_rnr_int(struct net_device *dev);
static void elmc_rnr_int(struct net_device *dev);


struct priv {
struct priv {
	struct net_device_stats stats;
	unsigned long base;
	unsigned long base;
	char *memtop;
	char *memtop;
	unsigned long mapped_start;		/* Start of ioremap */
	unsigned long mapped_start;		/* Start of ioremap */
@@ -989,18 +988,18 @@ static void elmc_rcv_int(struct net_device *dev)
					skb->protocol = eth_type_trans(skb, dev);
					skb->protocol = eth_type_trans(skb, dev);
					netif_rx(skb);
					netif_rx(skb);
					dev->last_rx = jiffies;
					dev->last_rx = jiffies;
					p->stats.rx_packets++;
					dev->stats.rx_packets++;
					p->stats.rx_bytes += totlen;
					dev->stats.rx_bytes += totlen;
				} else {
				} else {
					p->stats.rx_dropped++;
					dev->stats.rx_dropped++;
				}
				}
			} else {
			} else {
				printk(KERN_WARNING "%s: received oversized frame.\n", dev->name);
				printk(KERN_WARNING "%s: received oversized frame.\n", dev->name);
				p->stats.rx_dropped++;
				dev->stats.rx_dropped++;
			}
			}
		} else {	/* frame !(ok), only with 'save-bad-frames' */
		} else {	/* frame !(ok), only with 'save-bad-frames' */
			printk(KERN_WARNING "%s: oops! rfd-error-status: %04x\n", dev->name, status);
			printk(KERN_WARNING "%s: oops! rfd-error-status: %04x\n", dev->name, status);
			p->stats.rx_errors++;
			dev->stats.rx_errors++;
		}
		}
		p->rfd_top->status = 0;
		p->rfd_top->status = 0;
		p->rfd_top->last = RFD_SUSP;
		p->rfd_top->last = RFD_SUSP;
@@ -1018,7 +1017,7 @@ static void elmc_rnr_int(struct net_device *dev)
{
{
	struct priv *p = (struct priv *) dev->priv;
	struct priv *p = (struct priv *) dev->priv;


	p->stats.rx_errors++;
	dev->stats.rx_errors++;


	WAIT_4_SCB_CMD();	/* wait for the last cmd */
	WAIT_4_SCB_CMD();	/* wait for the last cmd */
	p->scb->cmd = RUC_ABORT;	/* usually the RU is in the 'no resource'-state .. abort it now. */
	p->scb->cmd = RUC_ABORT;	/* usually the RU is in the 'no resource'-state .. abort it now. */
@@ -1046,24 +1045,24 @@ static void elmc_xmt_int(struct net_device *dev)
		printk(KERN_WARNING "%s: strange .. xmit-int without a 'COMPLETE'\n", dev->name);
		printk(KERN_WARNING "%s: strange .. xmit-int without a 'COMPLETE'\n", dev->name);
	}
	}
	if (status & STAT_OK) {
	if (status & STAT_OK) {
		p->stats.tx_packets++;
		dev->stats.tx_packets++;
		p->stats.collisions += (status & TCMD_MAXCOLLMASK);
		dev->stats.collisions += (status & TCMD_MAXCOLLMASK);
	} else {
	} else {
		p->stats.tx_errors++;
		dev->stats.tx_errors++;
		if (status & TCMD_LATECOLL) {
		if (status & TCMD_LATECOLL) {
			printk(KERN_WARNING "%s: late collision detected.\n", dev->name);
			printk(KERN_WARNING "%s: late collision detected.\n", dev->name);
			p->stats.collisions++;
			dev->stats.collisions++;
		} else if (status & TCMD_NOCARRIER) {
		} else if (status & TCMD_NOCARRIER) {
			p->stats.tx_carrier_errors++;
			dev->stats.tx_carrier_errors++;
			printk(KERN_WARNING "%s: no carrier detected.\n", dev->name);
			printk(KERN_WARNING "%s: no carrier detected.\n", dev->name);
		} else if (status & TCMD_LOSTCTS) {
		} else if (status & TCMD_LOSTCTS) {
			printk(KERN_WARNING "%s: loss of CTS detected.\n", dev->name);
			printk(KERN_WARNING "%s: loss of CTS detected.\n", dev->name);
		} else if (status & TCMD_UNDERRUN) {
		} else if (status & TCMD_UNDERRUN) {
			p->stats.tx_fifo_errors++;
			dev->stats.tx_fifo_errors++;
			printk(KERN_WARNING "%s: DMA underrun detected.\n", dev->name);
			printk(KERN_WARNING "%s: DMA underrun detected.\n", dev->name);
		} else if (status & TCMD_MAXCOLL) {
		} else if (status & TCMD_MAXCOLL) {
			printk(KERN_WARNING "%s: Max. collisions exceeded.\n", dev->name);
			printk(KERN_WARNING "%s: Max. collisions exceeded.\n", dev->name);
			p->stats.collisions += 16;
			dev->stats.collisions += 16;
		}
		}
	}
	}


@@ -1215,12 +1214,12 @@ static struct net_device_stats *elmc_get_stats(struct net_device *dev)
	ovrn = p->scb->ovrn_errs;
	ovrn = p->scb->ovrn_errs;
	p->scb->ovrn_errs -= ovrn;
	p->scb->ovrn_errs -= ovrn;


	p->stats.rx_crc_errors += crc;
	dev->stats.rx_crc_errors += crc;
	p->stats.rx_fifo_errors += ovrn;
	dev->stats.rx_fifo_errors += ovrn;
	p->stats.rx_frame_errors += aln;
	dev->stats.rx_frame_errors += aln;
	p->stats.rx_dropped += rsc;
	dev->stats.rx_dropped += rsc;


	return &p->stats;
	return &dev->stats;
}
}


/********************************************************
/********************************************************
+21 −24
Original line number Original line Diff line number Diff line
@@ -158,7 +158,6 @@ struct mc32_local
	int slot;
	int slot;


	u32 base;
	u32 base;
	struct net_device_stats net_stats;
	volatile struct mc32_mailbox *rx_box;
	volatile struct mc32_mailbox *rx_box;
	volatile struct mc32_mailbox *tx_box;
	volatile struct mc32_mailbox *tx_box;
	volatile struct mc32_mailbox *exec_box;
	volatile struct mc32_mailbox *exec_box;
@@ -1093,24 +1092,24 @@ static void mc32_update_stats(struct net_device *dev)


	u32 rx_errors=0;
	u32 rx_errors=0;


	rx_errors+=lp->net_stats.rx_crc_errors   +=st->rx_crc_errors;
	rx_errors+=dev->stats.rx_crc_errors   +=st->rx_crc_errors;
	                                           st->rx_crc_errors=0;
	                                           st->rx_crc_errors=0;
	rx_errors+=lp->net_stats.rx_fifo_errors  +=st->rx_overrun_errors;
	rx_errors+=dev->stats.rx_fifo_errors  +=st->rx_overrun_errors;
	                                           st->rx_overrun_errors=0;
	                                           st->rx_overrun_errors=0;
	rx_errors+=lp->net_stats.rx_frame_errors +=st->rx_alignment_errors;
	rx_errors+=dev->stats.rx_frame_errors +=st->rx_alignment_errors;
 	                                           st->rx_alignment_errors=0;
 	                                           st->rx_alignment_errors=0;
	rx_errors+=lp->net_stats.rx_length_errors+=st->rx_tooshort_errors;
	rx_errors+=dev->stats.rx_length_errors+=st->rx_tooshort_errors;
	                                           st->rx_tooshort_errors=0;
	                                           st->rx_tooshort_errors=0;
	rx_errors+=lp->net_stats.rx_missed_errors+=st->rx_outofresource_errors;
	rx_errors+=dev->stats.rx_missed_errors+=st->rx_outofresource_errors;
	                                           st->rx_outofresource_errors=0;
	                                           st->rx_outofresource_errors=0;
        lp->net_stats.rx_errors=rx_errors;
        dev->stats.rx_errors=rx_errors;


	/* Number of packets which saw one collision */
	/* Number of packets which saw one collision */
	lp->net_stats.collisions+=st->dataC[10];
	dev->stats.collisions+=st->dataC[10];
	st->dataC[10]=0;
	st->dataC[10]=0;


	/* Number of packets which saw 2--15 collisions */
	/* Number of packets which saw 2--15 collisions */
	lp->net_stats.collisions+=st->dataC[11];
	dev->stats.collisions+=st->dataC[11];
	st->dataC[11]=0;
	st->dataC[11]=0;
}
}


@@ -1178,7 +1177,7 @@ static void mc32_rx_ring(struct net_device *dev)
				skb=dev_alloc_skb(length+2);
				skb=dev_alloc_skb(length+2);


				if(skb==NULL) {
				if(skb==NULL) {
					lp->net_stats.rx_dropped++;
					dev->stats.rx_dropped++;
					goto dropped;
					goto dropped;
				}
				}


@@ -1189,8 +1188,8 @@ static void mc32_rx_ring(struct net_device *dev)


			skb->protocol=eth_type_trans(skb,dev);
			skb->protocol=eth_type_trans(skb,dev);
			dev->last_rx = jiffies;
			dev->last_rx = jiffies;
 			lp->net_stats.rx_packets++;
 			dev->stats.rx_packets++;
 			lp->net_stats.rx_bytes += length;
 			dev->stats.rx_bytes += length;
			netif_rx(skb);
			netif_rx(skb);
		}
		}


@@ -1253,34 +1252,34 @@ static void mc32_tx_ring(struct net_device *dev)
			/* Not COMPLETED */
			/* Not COMPLETED */
			break;
			break;
		}
		}
		lp->net_stats.tx_packets++;
		dev->stats.tx_packets++;
		if(!(np->status & (1<<6))) /* Not COMPLETED_OK */
		if(!(np->status & (1<<6))) /* Not COMPLETED_OK */
		{
		{
			lp->net_stats.tx_errors++;
			dev->stats.tx_errors++;


			switch(np->status&0x0F)
			switch(np->status&0x0F)
			{
			{
				case 1:
				case 1:
					lp->net_stats.tx_aborted_errors++;
					dev->stats.tx_aborted_errors++;
					break; /* Max collisions */
					break; /* Max collisions */
				case 2:
				case 2:
					lp->net_stats.tx_fifo_errors++;
					dev->stats.tx_fifo_errors++;
					break;
					break;
				case 3:
				case 3:
					lp->net_stats.tx_carrier_errors++;
					dev->stats.tx_carrier_errors++;
					break;
					break;
				case 4:
				case 4:
					lp->net_stats.tx_window_errors++;
					dev->stats.tx_window_errors++;
					break;  /* CTS Lost */
					break;  /* CTS Lost */
				case 5:
				case 5:
					lp->net_stats.tx_aborted_errors++;
					dev->stats.tx_aborted_errors++;
					break; /* Transmit timeout */
					break; /* Transmit timeout */
			}
			}
		}
		}
		/* Packets are sent in order - this is
		/* Packets are sent in order - this is
		    basically a FIFO queue of buffers matching
		    basically a FIFO queue of buffers matching
		    the card ring */
		    the card ring */
		lp->net_stats.tx_bytes+=lp->tx_ring[t].skb->len;
		dev->stats.tx_bytes+=lp->tx_ring[t].skb->len;
		dev_kfree_skb_irq(lp->tx_ring[t].skb);
		dev_kfree_skb_irq(lp->tx_ring[t].skb);
		lp->tx_ring[t].skb=NULL;
		lp->tx_ring[t].skb=NULL;
		atomic_inc(&lp->tx_count);
		atomic_inc(&lp->tx_count);
@@ -1367,7 +1366,7 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id)
			case 6:
			case 6:
				/* Out of RX buffers stat */
				/* Out of RX buffers stat */
				/* Must restart rx */
				/* Must restart rx */
				lp->net_stats.rx_dropped++;
				dev->stats.rx_dropped++;
				mc32_rx_ring(dev);
				mc32_rx_ring(dev);
				mc32_start_transceiver(dev);
				mc32_start_transceiver(dev);
				break;
				break;
@@ -1489,10 +1488,8 @@ static int mc32_close(struct net_device *dev)


static struct net_device_stats *mc32_get_stats(struct net_device *dev)
static struct net_device_stats *mc32_get_stats(struct net_device *dev)
{
{
	struct mc32_local *lp = netdev_priv(dev);

	mc32_update_stats(dev);
	mc32_update_stats(dev);
	return &lp->net_stats;
	return &dev->stats;
}
}




+21 −22
Original line number Original line Diff line number Diff line
@@ -340,7 +340,6 @@ struct cp_private {
	u32			rx_config;
	u32			rx_config;
	u16			cpcmd;
	u16			cpcmd;


	struct net_device_stats net_stats;
	struct cp_extra_stats	cp_stats;
	struct cp_extra_stats	cp_stats;


	unsigned		rx_head		____cacheline_aligned;
	unsigned		rx_head		____cacheline_aligned;
@@ -457,8 +456,8 @@ static inline void cp_rx_skb (struct cp_private *cp, struct sk_buff *skb,
{
{
	skb->protocol = eth_type_trans (skb, cp->dev);
	skb->protocol = eth_type_trans (skb, cp->dev);


	cp->net_stats.rx_packets++;
	cp->dev->stats.rx_packets++;
	cp->net_stats.rx_bytes += skb->len;
	cp->dev->stats.rx_bytes += skb->len;
	cp->dev->last_rx = jiffies;
	cp->dev->last_rx = jiffies;


#if CP_VLAN_TAG_USED
#if CP_VLAN_TAG_USED
@@ -477,17 +476,17 @@ static void cp_rx_err_acct (struct cp_private *cp, unsigned rx_tail,
		printk (KERN_DEBUG
		printk (KERN_DEBUG
			"%s: rx err, slot %d status 0x%x len %d\n",
			"%s: rx err, slot %d status 0x%x len %d\n",
			cp->dev->name, rx_tail, status, len);
			cp->dev->name, rx_tail, status, len);
	cp->net_stats.rx_errors++;
	cp->dev->stats.rx_errors++;
	if (status & RxErrFrame)
	if (status & RxErrFrame)
		cp->net_stats.rx_frame_errors++;
		cp->dev->stats.rx_frame_errors++;
	if (status & RxErrCRC)
	if (status & RxErrCRC)
		cp->net_stats.rx_crc_errors++;
		cp->dev->stats.rx_crc_errors++;
	if ((status & RxErrRunt) || (status & RxErrLong))
	if ((status & RxErrRunt) || (status & RxErrLong))
		cp->net_stats.rx_length_errors++;
		cp->dev->stats.rx_length_errors++;
	if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag))
	if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag))
		cp->net_stats.rx_length_errors++;
		cp->dev->stats.rx_length_errors++;
	if (status & RxErrFIFO)
	if (status & RxErrFIFO)
		cp->net_stats.rx_fifo_errors++;
		cp->dev->stats.rx_fifo_errors++;
}
}


static inline unsigned int cp_rx_csum_ok (u32 status)
static inline unsigned int cp_rx_csum_ok (u32 status)
@@ -539,7 +538,7 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
			 * that RX fragments are never encountered
			 * that RX fragments are never encountered
			 */
			 */
			cp_rx_err_acct(cp, rx_tail, status, len);
			cp_rx_err_acct(cp, rx_tail, status, len);
			cp->net_stats.rx_dropped++;
			dev->stats.rx_dropped++;
			cp->cp_stats.rx_frags++;
			cp->cp_stats.rx_frags++;
			goto rx_next;
			goto rx_next;
		}
		}
@@ -556,7 +555,7 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
		buflen = cp->rx_buf_sz + RX_OFFSET;
		buflen = cp->rx_buf_sz + RX_OFFSET;
		new_skb = dev_alloc_skb (buflen);
		new_skb = dev_alloc_skb (buflen);
		if (!new_skb) {
		if (!new_skb) {
			cp->net_stats.rx_dropped++;
			dev->stats.rx_dropped++;
			goto rx_next;
			goto rx_next;
		}
		}


@@ -710,20 +709,20 @@ static void cp_tx (struct cp_private *cp)
				if (netif_msg_tx_err(cp))
				if (netif_msg_tx_err(cp))
					printk(KERN_DEBUG "%s: tx err, status 0x%x\n",
					printk(KERN_DEBUG "%s: tx err, status 0x%x\n",
					       cp->dev->name, status);
					       cp->dev->name, status);
				cp->net_stats.tx_errors++;
				cp->dev->stats.tx_errors++;
				if (status & TxOWC)
				if (status & TxOWC)
					cp->net_stats.tx_window_errors++;
					cp->dev->stats.tx_window_errors++;
				if (status & TxMaxCol)
				if (status & TxMaxCol)
					cp->net_stats.tx_aborted_errors++;
					cp->dev->stats.tx_aborted_errors++;
				if (status & TxLinkFail)
				if (status & TxLinkFail)
					cp->net_stats.tx_carrier_errors++;
					cp->dev->stats.tx_carrier_errors++;
				if (status & TxFIFOUnder)
				if (status & TxFIFOUnder)
					cp->net_stats.tx_fifo_errors++;
					cp->dev->stats.tx_fifo_errors++;
			} else {
			} else {
				cp->net_stats.collisions +=
				cp->dev->stats.collisions +=
					((status >> TxColCntShift) & TxColCntMask);
					((status >> TxColCntShift) & TxColCntMask);
				cp->net_stats.tx_packets++;
				cp->dev->stats.tx_packets++;
				cp->net_stats.tx_bytes += skb->len;
				cp->dev->stats.tx_bytes += skb->len;
				if (netif_msg_tx_done(cp))
				if (netif_msg_tx_done(cp))
					printk(KERN_DEBUG "%s: tx done, slot %d\n", cp->dev->name, tx_tail);
					printk(KERN_DEBUG "%s: tx done, slot %d\n", cp->dev->name, tx_tail);
			}
			}
@@ -956,7 +955,7 @@ static void cp_set_rx_mode (struct net_device *dev)
static void __cp_get_stats(struct cp_private *cp)
static void __cp_get_stats(struct cp_private *cp)
{
{
	/* only lower 24 bits valid; write any value to clear */
	/* only lower 24 bits valid; write any value to clear */
	cp->net_stats.rx_missed_errors += (cpr32 (RxMissed) & 0xffffff);
	cp->dev->stats.rx_missed_errors += (cpr32 (RxMissed) & 0xffffff);
	cpw32 (RxMissed, 0);
	cpw32 (RxMissed, 0);
}
}


@@ -971,7 +970,7 @@ static struct net_device_stats *cp_get_stats(struct net_device *dev)
 		__cp_get_stats(cp);
 		__cp_get_stats(cp);
	spin_unlock_irqrestore(&cp->lock, flags);
	spin_unlock_irqrestore(&cp->lock, flags);


	return &cp->net_stats;
	return &dev->stats;
}
}


static void cp_stop_hw (struct cp_private *cp)
static void cp_stop_hw (struct cp_private *cp)
@@ -1142,7 +1141,7 @@ static void cp_clean_rings (struct cp_private *cp)
					 PCI_DMA_TODEVICE);
					 PCI_DMA_TODEVICE);
			if (le32_to_cpu(desc->opts1) & LastFrag)
			if (le32_to_cpu(desc->opts1) & LastFrag)
				dev_kfree_skb(skb);
				dev_kfree_skb(skb);
			cp->net_stats.tx_dropped++;
			cp->dev->stats.tx_dropped++;
		}
		}
	}
	}


+26 −27
Original line number Original line Diff line number Diff line
@@ -574,7 +574,6 @@ struct rtl8139_private {
	u32			msg_enable;
	u32			msg_enable;
	struct napi_struct	napi;
	struct napi_struct	napi;
	struct net_device	*dev;
	struct net_device	*dev;
	struct net_device_stats	stats;


	unsigned char		*rx_ring;
	unsigned char		*rx_ring;
	unsigned int		cur_rx;	/* RX buf index of next pkt */
	unsigned int		cur_rx;	/* RX buf index of next pkt */
@@ -1711,7 +1710,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
		dev_kfree_skb(skb);
		dev_kfree_skb(skb);
	} else {
	} else {
		dev_kfree_skb(skb);
		dev_kfree_skb(skb);
		tp->stats.tx_dropped++;
		dev->stats.tx_dropped++;
		return 0;
		return 0;
	}
	}


@@ -1762,27 +1761,27 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
			if (netif_msg_tx_err(tp))
			if (netif_msg_tx_err(tp))
				printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n",
				printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n",
					dev->name, txstatus);
					dev->name, txstatus);
			tp->stats.tx_errors++;
			dev->stats.tx_errors++;
			if (txstatus & TxAborted) {
			if (txstatus & TxAborted) {
				tp->stats.tx_aborted_errors++;
				dev->stats.tx_aborted_errors++;
				RTL_W32 (TxConfig, TxClearAbt);
				RTL_W32 (TxConfig, TxClearAbt);
				RTL_W16 (IntrStatus, TxErr);
				RTL_W16 (IntrStatus, TxErr);
				wmb();
				wmb();
			}
			}
			if (txstatus & TxCarrierLost)
			if (txstatus & TxCarrierLost)
				tp->stats.tx_carrier_errors++;
				dev->stats.tx_carrier_errors++;
			if (txstatus & TxOutOfWindow)
			if (txstatus & TxOutOfWindow)
				tp->stats.tx_window_errors++;
				dev->stats.tx_window_errors++;
		} else {
		} else {
			if (txstatus & TxUnderrun) {
			if (txstatus & TxUnderrun) {
				/* Add 64 to the Tx FIFO threshold. */
				/* Add 64 to the Tx FIFO threshold. */
				if (tp->tx_flag < 0x00300000)
				if (tp->tx_flag < 0x00300000)
					tp->tx_flag += 0x00020000;
					tp->tx_flag += 0x00020000;
				tp->stats.tx_fifo_errors++;
				dev->stats.tx_fifo_errors++;
			}
			}
			tp->stats.collisions += (txstatus >> 24) & 15;
			dev->stats.collisions += (txstatus >> 24) & 15;
			tp->stats.tx_bytes += txstatus & 0x7ff;
			dev->stats.tx_bytes += txstatus & 0x7ff;
			tp->stats.tx_packets++;
			dev->stats.tx_packets++;
		}
		}


		dirty_tx++;
		dirty_tx++;
@@ -1818,7 +1817,7 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev,
	if (netif_msg_rx_err (tp))
	if (netif_msg_rx_err (tp))
		printk(KERN_DEBUG "%s: Ethernet frame had errors, status %8.8x.\n",
		printk(KERN_DEBUG "%s: Ethernet frame had errors, status %8.8x.\n",
			dev->name, rx_status);
			dev->name, rx_status);
	tp->stats.rx_errors++;
	dev->stats.rx_errors++;
	if (!(rx_status & RxStatusOK)) {
	if (!(rx_status & RxStatusOK)) {
		if (rx_status & RxTooLong) {
		if (rx_status & RxTooLong) {
			DPRINTK ("%s: Oversized Ethernet frame, status %4.4x!\n",
			DPRINTK ("%s: Oversized Ethernet frame, status %4.4x!\n",
@@ -1826,11 +1825,11 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev,
			/* A.C.: The chip hangs here. */
			/* A.C.: The chip hangs here. */
		}
		}
		if (rx_status & (RxBadSymbol | RxBadAlign))
		if (rx_status & (RxBadSymbol | RxBadAlign))
			tp->stats.rx_frame_errors++;
			dev->stats.rx_frame_errors++;
		if (rx_status & (RxRunt | RxTooLong))
		if (rx_status & (RxRunt | RxTooLong))
			tp->stats.rx_length_errors++;
			dev->stats.rx_length_errors++;
		if (rx_status & RxCRCErr)
		if (rx_status & RxCRCErr)
			tp->stats.rx_crc_errors++;
			dev->stats.rx_crc_errors++;
	} else {
	} else {
		tp->xstats.rx_lost_in_ring++;
		tp->xstats.rx_lost_in_ring++;
	}
	}
@@ -1913,9 +1912,9 @@ static void rtl8139_isr_ack(struct rtl8139_private *tp)
	/* Clear out errors and receive interrupts */
	/* Clear out errors and receive interrupts */
	if (likely(status != 0)) {
	if (likely(status != 0)) {
		if (unlikely(status & (RxFIFOOver | RxOverflow))) {
		if (unlikely(status & (RxFIFOOver | RxOverflow))) {
			tp->stats.rx_errors++;
			tp->dev->stats.rx_errors++;
			if (status & RxFIFOOver)
			if (status & RxFIFOOver)
				tp->stats.rx_fifo_errors++;
				tp->dev->stats.rx_fifo_errors++;
		}
		}
		RTL_W16_F (IntrStatus, RxAckBits);
		RTL_W16_F (IntrStatus, RxAckBits);
	}
	}
@@ -2016,8 +2015,8 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
			skb->protocol = eth_type_trans (skb, dev);
			skb->protocol = eth_type_trans (skb, dev);


			dev->last_rx = jiffies;
			dev->last_rx = jiffies;
			tp->stats.rx_bytes += pkt_size;
			dev->stats.rx_bytes += pkt_size;
			tp->stats.rx_packets++;
			dev->stats.rx_packets++;


			netif_receive_skb (skb);
			netif_receive_skb (skb);
		} else {
		} else {
@@ -2025,7 +2024,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
				printk (KERN_WARNING
				printk (KERN_WARNING
					"%s: Memory squeeze, dropping packet.\n",
					"%s: Memory squeeze, dropping packet.\n",
					dev->name);
					dev->name);
			tp->stats.rx_dropped++;
			dev->stats.rx_dropped++;
		}
		}
		received++;
		received++;


@@ -2072,7 +2071,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev,
	assert (ioaddr != NULL);
	assert (ioaddr != NULL);


	/* Update the error count. */
	/* Update the error count. */
	tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
	dev->stats.rx_missed_errors += RTL_R32 (RxMissed);
	RTL_W32 (RxMissed, 0);
	RTL_W32 (RxMissed, 0);


	if ((status & RxUnderrun) && link_changed &&
	if ((status & RxUnderrun) && link_changed &&
@@ -2082,12 +2081,12 @@ static void rtl8139_weird_interrupt (struct net_device *dev,
	}
	}


	if (status & (RxUnderrun | RxErr))
	if (status & (RxUnderrun | RxErr))
		tp->stats.rx_errors++;
		dev->stats.rx_errors++;


	if (status & PCSTimeout)
	if (status & PCSTimeout)
		tp->stats.rx_length_errors++;
		dev->stats.rx_length_errors++;
	if (status & RxUnderrun)
	if (status & RxUnderrun)
		tp->stats.rx_fifo_errors++;
		dev->stats.rx_fifo_errors++;
	if (status & PCIErr) {
	if (status & PCIErr) {
		u16 pci_cmd_status;
		u16 pci_cmd_status;
		pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status);
		pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status);
@@ -2227,7 +2226,7 @@ static int rtl8139_close (struct net_device *dev)
	RTL_W16 (IntrMask, 0);
	RTL_W16 (IntrMask, 0);


	/* Update the error counts. */
	/* Update the error counts. */
	tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
	dev->stats.rx_missed_errors += RTL_R32 (RxMissed);
	RTL_W32 (RxMissed, 0);
	RTL_W32 (RxMissed, 0);


	spin_unlock_irqrestore (&tp->lock, flags);
	spin_unlock_irqrestore (&tp->lock, flags);
@@ -2472,12 +2471,12 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)


	if (netif_running(dev)) {
	if (netif_running(dev)) {
		spin_lock_irqsave (&tp->lock, flags);
		spin_lock_irqsave (&tp->lock, flags);
		tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
		dev->stats.rx_missed_errors += RTL_R32 (RxMissed);
		RTL_W32 (RxMissed, 0);
		RTL_W32 (RxMissed, 0);
		spin_unlock_irqrestore (&tp->lock, flags);
		spin_unlock_irqrestore (&tp->lock, flags);
	}
	}


	return &tp->stats;
	return &dev->stats;
}
}


/* Set or clear the multicast filter for this adaptor.
/* Set or clear the multicast filter for this adaptor.
@@ -2561,7 +2560,7 @@ static int rtl8139_suspend (struct pci_dev *pdev, pm_message_t state)
	RTL_W8 (ChipCmd, 0);
	RTL_W8 (ChipCmd, 0);


	/* Update the error counts. */
	/* Update the error counts. */
	tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
	dev->stats.rx_missed_errors += RTL_R32 (RxMissed);
	RTL_W32 (RxMissed, 0);
	RTL_W32 (RxMissed, 0);


	spin_unlock_irqrestore (&tp->lock, flags);
	spin_unlock_irqrestore (&tp->lock, flags);
+0 −1
Original line number Original line Diff line number Diff line
@@ -69,7 +69,6 @@ struct ei_device {
	unsigned char reg0;		/* Register '0' in a WD8013 */
	unsigned char reg0;		/* Register '0' in a WD8013 */
	unsigned char reg5;		/* Register '5' in a WD8013 */
	unsigned char reg5;		/* Register '5' in a WD8013 */
	unsigned char saved_irq;	/* Original dev->irq value. */
	unsigned char saved_irq;	/* Original dev->irq value. */
	struct net_device_stats stat;	/* The new statistics table. */
	u32 *reg_offset;		/* Register mapping table */
	u32 *reg_offset;		/* Register mapping table */
	spinlock_t page_lock;		/* Page register locks */
	spinlock_t page_lock;		/* Page register locks */
	unsigned long priv;		/* Private field to store bus IDs etc. */
	unsigned long priv;		/* Private field to store bus IDs etc. */
Loading