Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2008 05:03:28 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 134816 for review
Message-ID:  <200802050503.m1553SHh096324@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134816

Change 134816 by kmacy@kmacy:storage:toehead on 2008/02/05 05:02:47

	allow users to get link status without bringing the interface up

Affected files ...

.. //depot/projects/toehead/sys/dev/cxgb/cxgb_main.c#5 edit

Differences ...

==== //depot/projects/toehead/sys/dev/cxgb/cxgb_main.c#5 (text+ko) ====

@@ -1119,9 +1119,6 @@
 	struct port_info *pi = &adapter->port[port_id];
 	struct cmac *mac = &adapter->port[port_id].mac;
 
-	if ((pi->ifp->if_flags & IFF_UP) == 0)
-		return;
-
 	if (link_status) {
 		t3_mac_enable(mac, MAC_DIRECTION_RX);
 		if_link_state_change(pi->ifp, LINK_STATE_UP);
@@ -1806,6 +1803,12 @@
 		break;
 	case SIOCSIFMEDIA:
 	case SIOCGIFMEDIA:
+		/*
+		 * This is a convenient place to check the link status when
+		 * no interfaces are up and thus the callout is not running
+		 */
+		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+			cxgb_tick_handler(p->adapter, 0);
 		error = ifmedia_ioctl(ifp, ifr, &p->media, command);
 		break;
 	case SIOCSIFCAP:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802050503.m1553SHh096324>