[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Buildd



> On Mon, Dec 04, 2006 at 10:07:44AM +0100, Michael Schmitz wrote:
> > The mace driver has some hallmarks of a half finshed project - not to slag
> > jmt, maybe he never saw the transmit timeouts... He's to be credited for
> > figuring out the PSC stuff, that should be the only difference to the
> > powermac MACE then. txdma and rxdma reset are implemented, the rest
> > should be similar to powermac.
>
> He was always too busy to finish anything by himself, but did a great
> job if he had someone else testing and making suggestions. He did a
> lot of the IIfx related code as well (OSS/IOP support), but most of
> that code came through me before it really went anywhere. This was
> one thing he didn't ever get much of a response on. I think we kind
> of wore him out because he was covering a lot of code more or less
> by himself. I haven't seen him on the lists in a little while.

I recall his initial work - probably got too busy now. The mac port has
been mostly a one-man show practically from the beginning, for a long time
:-)

> > pmac_zilog should be a straightforward port (I looked at it while fixing
> > the Atari serial driver) but we'll have no end of trouble to get rid of
> > incoming characters now that the tty flip buffer can't be flushed from
> > interrupt context. Anyway, the mac serial I can help out with, having
> > hardware to test. The MACE driver I can only cook up a speculative patch.
>
> I have hardware for most of the major 68k mac features now, but some of
> my systems have issues. The only major thing I don't have is probably
> the Q900/Q950/WGS95 system. So no caboose or some of the other odd stuff.

Well, here's my best guess how a transmit timeout should be handled by the
MACE driver. Can you add this to your next build, Christian? Untested, of
course, but the powermac driver does basically the same (modulo dbdma
stuff). Should not hurt, at least ...

--- drivers/net/macmace.c.ms-org	2004-02-18 20:36:08.000000000 +0100
+++ drivers/net/macmace.c	2006-12-04 17:07:20.000000000 +0100
@@ -592,10 +592,57 @@
 	return IRQ_HANDLED;
 }

+/*
+ * A transmit timeout happened. We reset everything and restart the queue.
+ */
+
 static void mace_tx_timeout(struct net_device *dev)
 {
-/*	struct mace_data *mp = (struct mace_data *) dev->priv; */
-//	volatile struct mace *mb = mp->mace;
+	struct mace_data *mp = (struct mace_data *) dev->priv;
+	volatile struct mace *mb = mp->mace;
+	unsigned long flags;
+	u8 maccc, imr;
+
+	local_irq_save(flags);
+
+	// save state
+	maccc = mb->maccc;
+	imr   = mb->imr;
+
+	// stop card
+	mb->maccc = 0;		/* disable rx and tx	 */
+	mb->imr = 0xFF;		/* disable all irqs	 */
+	mace_dma_off(dev);
+
+	// reset card
+	mb->biucc = XMTSP_64;
+	mb->fifocc = XMTFW_16 | RCVFW_64 | XMTFWU | RCVFWU | XMTBRST | RCVBRST;
+	mb->xmtfc = AUTO_PAD_XMIT;
+	mb->plscc = PORTSEL_AUI;
+
+	/* Not sure what these do - perhaps reset the PSC ??? */
+
+	psc_write_word(PSC_ENETWR_CTL, 0x9000);
+	psc_write_word(PSC_ENETRD_CTL, 0x9000);
+	psc_write_word(PSC_ENETWR_CTL, 0x0400);
+	psc_write_word(PSC_ENETRD_CTL, 0x0400);
+
+	// reset both DMAs
+	mace_rxdma_reset(dev);
+	mace_txdma_reset(dev);
+
+	// free skb's - not necessary, already done in mace_xmit_start
+	// ring buffer pointers reset in txdma_reset, so just log error
+	mp->stats.tx_errors++;
+
+	// re-kick upper level
+	netif_wake_queue(dev);
+
+	// re-enable card, using saved imr/maccc (where is this ever set?)
+	mb->maccc = maccc;
+	mb->imr   = imr;
+
+	local_irq_restore(flags);
 }

 /*

Signed-Off-By: <schmitz@biophys.uni-duesseldorf.de>

	Michael



Reply to: