linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Afonso Graner Fessel <pafessel@zaz.com.br>
To: linux-kernel@vger.kernel.org
Cc: hollis@austin.rr.com, torben.mathiasen@compaq.com
Subject: Probable endianess problem in TLAN driver
Date: Sat, 09 Jun 2001 01:35:28 -0300	[thread overview]
Message-ID: <3B21A790.63F428CE@zaz.com.br> (raw)

Hello.

I'm trying to use a Compaq Dual Netteligent card in a Apple Macintosh
Performa 6360. Basically, my purpose is to use this system as a more
powerful firewall than that the one I have today.

To make things shorter, the TLAN driver on its atual incarnation does
not work in PowerPC machines. It isn't detected on 2.2 kernel unless I
activate it with setpci; OTOH, it is detected on 2.4, but does not work.
I get messages like "TLAN: Adaptor Error: 0x180005" every time I try to
ping other hosts; when this message appears, the link is reset and goes
online again. Also I get occasional panics when I try to ping the
machine from other machines in my Ethernet network. I've noticed also
that the board statistics don't change: all values are zero, always.

Physical media disruption was ruled out, since mii-diag reported that
the link was up and I could verify this on the leds of the board and of
the hub I use; both reported link up for the connection. mii-diag also
detects correctly when the link is up or down.

As I'm really no kernel hacker, I started looking for help. I've found
Hollis of openprojects.org (CC:ed in this message), and we begun to
think what could be the problem. I've generated backtraces of the panics
I've got, but there wasn't nothing really conclusive. So Hollis
inspected the code and found lines like these:

	host_int = inw( dev->base_addr + TLAN_HOST_INT );
        outw( host_int, dev->base_addr + TLAN_HOST_INT );

or

	outl( virt_to_bus( tail_list ), dev->base_addr + TLAN_CH_PARM
);                
	outl( TLAN_HC_GO, dev->base_addr + TLAN_HOST_CMD );

He said me that these funtions don't address the endianess question, and
sent me a patch. He said that this probably wouldn't work, but I've
decided to give a try anyway. Here is the patch:

--- tlan.c.old  Thu Jun  7 21:24:25 2001
+++ tlan.c      Thu Jun  7 21:37:42 2001
@@ -172,6 +172,12 @@
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 
+#if defined(__powerpc__)
+#define inw(addr)                      le32_to_cpu(inw(addr))
+#define inl(addr)                      le32_to_cpu(inl(addr))
+#define outw(val, addr)                outw(cpu_to_le32(val), addr)
+#define outl(val, addr)                outl(cpu_to_le32(val), addr)
+#endif

It's very clear (even to me) what it does: it takes into account the
big-endianess of PowerPC for out[l,w] and in[l,w]. I've applied this
patch, and for my surprise it brought some good effects. The error
messages stopped, and the machine does not crash anymore. Also, I'm now
able to see changes on the statistics of the board, even if they are
completely bogus nowadays. It's a real change for good but for one
thing: I still can't communicate with the other computers on my network.

I've tried to contact Torben, but oddly seems that he is not around. The
driver page in tlan.kernel.dk has not been updated since October 2000,
and there is no recent activity either on the TLAN driver mailing list
or in the new project page on Compaq
(http://linuxalpha.compaq.com/sourceforge/project/?group_id=12). Again,
as I'm no kernel hacker, I'd like to ask the linux-kernel list for help
(even if to point me to sources about correcting this problem).

Please answer directly to me, as I'm not subscribed to linux-kernel.

TIA,

Paulo Fessel

             reply	other threads:[~2001-06-09  4:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-09  4:35 Paulo Afonso Graner Fessel [this message]
2001-06-09 10:23 ` Probable endianess problem in TLAN driver Adrian Cox
2001-06-09 22:38 ` David S. Miller
2001-06-09 22:58   ` Riley Williams
2001-06-09 23:36     ` David Woodhouse
2001-06-10  6:45     ` David S. Miller
2001-06-09 23:12   ` David S. Miller
2001-06-09 10:11 Mathiasen, Torben
2001-06-09 16:21 ` Paulo Afonso Graner Fessel

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=3B21A790.63F428CE@zaz.com.br \
    --to=pafessel@zaz.com.br \
    --cc=hollis@austin.rr.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torben.mathiasen@compaq.com \
    /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).