Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix from OpenBSD:



details:   https://anonhg.NetBSD.org/src/rev/493665e043bb
branches:  trunk
changeset: 584267:493665e043bb
user:      xtraeme <xtraeme%NetBSD.org@localhost>
date:      Sun Sep 11 23:49:39 2005 +0000

description:
Fix from OpenBSD:

rev 1.56:

Don't initialize the card (and start an autonegotiation!) every time
the IP address changes. Makes 'dhclient sk0' invocations way faster
and more consistant. i.e. one DHCPREQUEST elicts the DHCPACK.

Fix from FreeBSD:

rev 1.109:

Solve "No PHY found" problem for more Yukon Lite variants.

These changes fixed the problem on my sk(4) trying to get an IP
via dhclient(8).

diffstat:

 sys/dev/pci/if_sk.c |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r 880f205457f0 -r 493665e043bb sys/dev/pci/if_sk.c
--- a/sys/dev/pci/if_sk.c       Sun Sep 11 23:49:20 2005 +0000
+++ b/sys/dev/pci/if_sk.c       Sun Sep 11 23:49:39 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sk.c,v 1.15 2005/05/30 04:35:22 christos Exp $      */
+/*     $NetBSD: if_sk.c,v 1.16 2005/09/11 23:49:39 xtraeme Exp $       */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -2331,11 +2331,21 @@
 {
        u_int32_t               /*mac, */phy;
        u_int16_t               reg;
+       struct sk_softc         *sc;
        int                     i;
 
        DPRINTFN(1, ("sk_init_yukon: start: sk_csr=%#x\n",
                     CSR_READ_4(sc_if->sk_softc, SK_CSR)));
 
+       sc = sc_if->sk_softc;
+       if (sc->sk_type == SK_YUKON_LITE &&
+           sc->sk_rev >= SK_YUKON_LITE_REV_A3) {
+               /* Take PHY out of reset. */
+               sk_win_write_4(sc, SK_GPIO,
+                       (sk_win_read_4(sc, SK_GPIO) | SK_GPIO_DIR9) & ~SK_GPIO_DAT9);
+       }
+
+
        /* GMAC and GPHY Reset */
        SK_IF_WRITE_4(sc_if, 0, SK_GPHY_CTRL, SK_GPHY_RESET_SET);
 
@@ -2464,6 +2474,11 @@
 
        s = splnet();
 
+       if (ifp->if_flags & IFF_RUNNING) {
+               splx(s);
+               return 0;
+       }
+
        /* Cancel pending I/O and free all RX/TX buffers. */
        sk_stop(ifp,0);
 



Home | Main Index | Thread Index | Old Index