sio(4) driver

Thomas Moestl t.moestl at tu-bs.de
Thu Sep 4 06:05:51 PDT 2003


On Thu, 2003/09/04 at 01:53:14 +0300, Maxim Mazurok wrote:
> On Wed, Sep 03, 2003 at 11:21:30PM +0200, Thomas Moestl wrote:
> 
> >> >> >That's very strange. So you cannot see them in tcpdump if you do not
> >> >> >put the interface in promiscuous mode (by using the -p argument to
> >> >> >tcpdump)? Can you receive broadcast packets (e.g. a broadcast ping) at
> >> >> >all?
> >> >> 
> >> >> so... experiment:
> >> >> [...]
> >> >
> >> >Hmmm. Can you please repeat the experiment and send a tcpdump, this
> >> >time in promiscuous mode (i.e. without the -p option), if possible
> >> >from both the e250 and the cisco?
> >> 
> >> i not have e250 :(
> >
> >Oh, sorry, mixed that up.
> >
> >> i have Ultra AXi OEM motherboard.....
> >> tcpdump on cisco - it's problem. i can run packet debugger....
> >
> >Hmmm, the tcpdump from the sparc64 box might do for now.
> >
> >> so, experiment two: 
> >> 
> >> root at fang:~#ifconfig rl3
> >> rl3: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> >>         options=8<VLAN_MTU>
> >>         inet 193.201.116.249 netmask 0xfffffffc broadcast 193.201.116.251
> >>         ether 00:30:4f:21:bc:91
> >>         media: Ethernet 10baseT/UTP
> >>         status: active
> >> root at fang:~#tcpdump -n -i rl3
> >
> >Please include -e in the tcpdump flags; sorry for forgetting to
> >mention that.
> 
> root at fang:~#tcpdump -e -n -i rl3
> tcpdump: listening on rl3
> 01:47:28.400964 0:0:c:47:8a:c1 ff:ff:ff:ff:ff:ff 0800 114: 193.201.116.250 > 255.255.255.255: icmp: echo request
> 01:47:29.796714 0:0:c:47:8a:c1 1:0:c:cc:cc:cc 0125 307: CDP v2, ttl=180s DevID 'ap-ec' Addr (1): IPv4 193.201.116.250 PortID 'Ethernet0' CAP 0x01[|cdp]
> 01:47:30.398474 0:0:c:47:8a:c1 ff:ff:ff:ff:ff:ff 0800 114: 193.201.116.250 > 255.255.255.255: icmp: echo request
> 01:47:32.398607 0:0:c:47:8a:c1 ff:ff:ff:ff:ff:ff 0800 114: 193.201.116.250 > 255.255.255.255: icmp: echo request
> 01:47:34.398588 0:0:c:47:8a:c1 ff:ff:ff:ff:ff:ff 0800 114: 193.201.116.250 > 255.255.255.255: icmp: echo request
> 01:47:36.401175 0:0:c:47:8a:c1 ff:ff:ff:ff:ff:ff 0800 114: 193.201.116.250 > 255.255.255.255: icmp: echo request

OK, so arp is working fine; the real problem is that the station address
is not programmed correctly even with the patch that I sent you. The
issue is that it has do be programmed with 32-bit accesses - byte-wise
accesses, like my patch introduces, are seemingly not allowed. They
used to "work" before because we did not make the configuration
registers writable, so the byte writes would not change anything and
the address preloaded from the card ROM would be used.

I've attached a patch that uses stream accesses to program the address
instead. I've borrowed myself a rl card, and it seems to work fine
now (in fact I'm writing this over it).

	- Thomas

-- 
Thomas Moestl <t.moestl at tu-bs.de>	http://www.tu-bs.de/~y0015675/
              <tmm at FreeBSD.org>		http://people.FreeBSD.org/~tmm/
PGP fingerprint: 1C97 A604 2BD0 E492 51D0  9C0F 1FE6 4F1D 419C 776C
-------------- next part --------------
Index: if_rl.c
===================================================================
RCS file: /vol/ncvs/src/sys/pci/if_rl.c,v
retrieving revision 1.113
diff -u -r1.113 if_rl.c
--- if_rl.c	22 Aug 2003 07:13:21 -0000	1.113
+++ if_rl.c	4 Sep 2003 12:50:08 -0000
@@ -2673,8 +2673,8 @@
 	 * register write enable" mode to modify the ID registers.
 	 */
 	CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG);
-	CSR_WRITE_4(sc, RL_IDR0, *(u_int32_t *)(&sc->arpcom.ac_enaddr[0]));
-	CSR_WRITE_4(sc, RL_IDR4, *(u_int32_t *)(&sc->arpcom.ac_enaddr[4]));
+	CSR_WRITE_STREAM_4(sc, RL_IDR0, *(u_int32_t *)(&sc->arpcom.ac_enaddr[0]));
+	CSR_WRITE_STREAM_4(sc, RL_IDR4, *(u_int32_t *)(&sc->arpcom.ac_enaddr[4]));
 	CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
 
 	/*
Index: if_rlreg.h
===================================================================
RCS file: /vol/ncvs/src/sys/pci/if_rlreg.h,v
retrieving revision 1.33
diff -u -r1.33 if_rlreg.h
--- if_rlreg.h	15 Aug 2003 22:47:55 -0000	1.33
+++ if_rlreg.h	4 Sep 2003 12:46:41 -0000
@@ -667,6 +667,8 @@
 /*
  * register space access macros
  */
+#define	CSR_WRITE_STREAM_4(sc, reg, val)	\
+	bus_space_write_stream_4(sc->rl_btag, sc->rl_bhandle, reg, val)
 #define CSR_WRITE_4(sc, reg, val)	\
 	bus_space_write_4(sc->rl_btag, sc->rl_bhandle, reg, val)
 #define CSR_WRITE_2(sc, reg, val)	\


More information about the freebsd-sparc64 mailing list