From ef027c528caa653d24fa42d5378385c57efa02d4 Mon Sep 17 00:00:00 2001 From: Kip Macy Date: Wed, 19 Mar 2008 20:56:51 +0000 Subject: [PATCH] fix link management bug and conditionally allow the PHY to be kept on at all times for allowing non-conformant link state checks --- sys/dev/cxgb/cxgb_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index c20fbaa0c193..07ad574d8e32 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -1029,8 +1029,10 @@ cxgb_port_attach(device_t dev) /* Get the latest mac address, User can use a LAA */ bcopy(IF_LLADDR(p->ifp), p->hw_addr, ETHER_ADDR_LEN); t3_sge_init_port(p); +#if defined(LINK_ATTACH) cxgb_link_start(p); t3_link_changed(sc, p->port_id); +#endif return (0); } @@ -1817,6 +1819,10 @@ cxgb_init_locked(struct port_info *p) log(LOG_WARNING, "Could not initialize offload capabilities\n"); } +#if !defined(LINK_ATTACH) + cxgb_link_start(p); + t3_link_changed(sc, p->port_id); +#endif ifp->if_baudrate = p->link_config.speed * 1000000; device_printf(sc->dev, "enabling interrupts on port=%d\n", p->port_id); @@ -1869,9 +1875,9 @@ cxgb_stop_locked(struct port_info *pi) } else ADAPTER_UNLOCK(pi->adapter); +#if !defined(LINK_ATTACH) DELAY(100); - /* Wait for TXFIFO empty */ t3_wait_op_done(pi->adapter, A_XGM_TXFIFO_CFG + pi->mac.offset, F_TXFIFO_EMPTY, 1, 20, 5); @@ -1880,7 +1886,7 @@ cxgb_stop_locked(struct port_info *pi) t3_mac_disable(&pi->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX); pi->phy.ops->power_down(&pi->phy, 1); - +#endif }