Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/stand/ofwboot Avoid conflict with sockets[] ...



details:   https://anonhg.NetBSD.org/src/rev/9e5a607d4659
branches:  trunk
changeset: 544167:9e5a607d4659
user:      drochner <drochner%NetBSD.org@localhost>
date:      Thu Mar 13 14:05:53 2003 +0000

description:
Avoid conflict with sockets[] definition in net.h
and add some typecasts.
Thanks to Juergen Hannken-Illjes for compile-checking.

diffstat:

 sys/arch/macppc/stand/ofwboot/netif_of.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r c50edb92f7c3 -r 9e5a607d4659 sys/arch/macppc/stand/ofwboot/netif_of.c
--- a/sys/arch/macppc/stand/ofwboot/netif_of.c  Thu Mar 13 13:59:11 2003 +0000
+++ b/sys/arch/macppc/stand/ofwboot/netif_of.c  Thu Mar 13 14:05:53 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netif_of.c,v 1.7 2003/03/13 12:15:31 drochner Exp $    */
+/*     $NetBSD: netif_of.c,v 1.8 2003/03/13 14:05:53 drochner Exp $    */
 
 /*
  * Copyright (C) 1995 Wolfgang Solfrank.
@@ -56,7 +56,7 @@
 
 #include "netif_of.h"
 
-struct iodesc sockets[1];
+static struct iodesc sdesc;
 
 struct iodesc *
 socktodesc(sock)
@@ -64,7 +64,7 @@
 {
        if (sock != 0)
                return NULL;
-       return sockets;
+       return &sdesc;
 }
 
 int
@@ -79,7 +79,7 @@
        printf("netif_open...");
 #endif
        /* find a free socket */
-       io = sockets;
+       io = &sdesc;
        if (io->io_netif) {
 #ifdef NETIF_DEBUG
                printf("device busy\n");
@@ -89,7 +89,7 @@
        }
        memset(io, 0, sizeof *io);
 
-       io->io_netif = op;
+       io->io_netif = (void *)op;
 
        /* Put our ethernet address in io->myea */
        OF_getprop(OF_instance_to_package(op->handle),
@@ -120,7 +120,7 @@
        }
 #endif
 
-       io = &sockets[fd];
+       io = &sdesc;
        io->io_netif = NULL;
 
 #ifdef NETIF_DEBUG
@@ -142,7 +142,7 @@
        ssize_t rv;
        size_t sendlen;
 
-       op = desc->io_netif;
+       op = (struct of_dev *)desc->io_netif;
 
 #ifdef NETIF_DEBUG
        {
@@ -193,7 +193,7 @@
        int tick0, tmo_ms;
        int len;
 
-       op = desc->io_netif;
+       op = (struct of_dev *)desc->io_netif;
 
 #ifdef NETIF_DEBUG
        printf("netif_get: pkt=0x%x, maxlen=%d, tmo=%d\n",



Home | Main Index | Thread Index | Old Index