Port-ofppc archive

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

Re: ofppc port is started on MPC8260 FADS board



hi,

it's great to see some activity on MPC8xxx.


On Tue, Sep 17, 2002 at 04:07:03PM +0700, Alexander A. V'ushkov wrote:
> Hi, All
> Recently I've executed ofppc port on MPC8260 FADS board. Now it starts
> in single user mode and executed simple command, such as ls and ps :-).
> 
> The details:
> Ofppc port is started unchanged. Devices are accepted through Open
> Firmware Generic Drivers. Now supported only network device (Ethernet)
> on FCC2 and console device on SCC. ATM drivers and virtual disk to be
> implemented in future. Root device is mounted on network device.
> Open Firmware implementation for this board is written as my diploma
> project and now is going to be published. The exact location is become
> to be defined more precisely.
> 
> The problems:
> 1. There are problems with NFS access. Every request is sent twice. So
> time of access to NFS disk is incredible high. I suppose there is a bug
> in my implementation of Open Firmware, but I don't know exactly. Now I'm
> seeking for the error.

well, if you learn anything more, especially if it looks like a netbsd
problem, let us know.


> 2. There is a problem with ofnet driver. According to Open Firmware
> standard,
> network device should return 0 as len of received packet, if
> there are no new packets received. (addition requirements for the read
> method).
> 
> The code from ofnet.c, function ofnet_read()
> ----------
> while(1){
>   if ((len = OF_read(of->sc_ihandle, buf, sizeof buf)) < 0) {
>    if (len == -2 || len == 0)
>     return;
>    ifp->if_ierrors++;
>    continue;
>   }
> ...
> }
> ----------
> The only chance to leave infite loop is receive negative value of length
> from Open Firmware.
> So, the return value of 0 is treated as the packet is received, and  driver
> will hang-up. I've patched driver inside my Open Firmware implementation,
> but I think it is wrong.
> May be, I don't understand some statements of Open Firmware standard?

well, the code certainly doesn't make sense as it is.
however, the firepower box that I used to revive the ofppc port recently
returns -2 if there's no packet to read.  maybe this is another of those
FIRMWORKSBUGS things.  at any rate, does the attached patch fix this for you?

-Chuck
Index: dev/ofw/ofnet.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ofw/ofnet.c,v
retrieving revision 1.29
diff -u -r1.29 ofnet.c
--- dev/ofw/ofnet.c     2002/10/02 16:34:34     1.29
+++ dev/ofw/ofnet.c     2002/10/10 05:24:16
@@ -181,12 +181,9 @@
        ipkdbrint(kifp, ifp);
 #endif 
        for (;;) {
-               if ((len = OF_read(of->sc_ihandle, buf, sizeof buf)) < 0) {
-                       if (len == -2 || len == 0)
-                               break;
-                       ifp->if_ierrors++;
-                       continue;
-               }
+               len = OF_read(of->sc_ihandle, buf, sizeof buf);
+               if (len == -2 || len == 0)
+                       break;
                if (len < sizeof(struct ether_header)) {
                        ifp->if_ierrors++;
                        continue;


Home | Main Index | Thread Index | Old Index