From: Mark McLoughlin Subject: [PATCH] netfront: support ethtool's get_link() Date: Fri, 14 Jul 2006 16:16:07 +0100 Message-ID: <1152890168.12312.5.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-Jt4YrlgO56DdtzWKt821" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-Jt4YrlgO56DdtzWKt821 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, Attached is a very simple patch to support ethtool's get_link() operation. This allows things like NetworkManager's and anaconda's carrier detection code to work with netfront. It seems sane to take the simple approach of reporting the link as active as soon as we've connected to the backend device. It's irrelevant whether the physical device in dom0 has link, since there could well be someone else on the bridge responding. I haven't looked at any of the other ethtool operations. Cheers, Mark. --=-Jt4YrlgO56DdtzWKt821 Content-Disposition: attachment; filename=xennet-ethtool.patch Content-Type: text/x-patch; name=xennet-ethtool.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit --- ./drivers/xen/netfront/netfront.c.ethtool 2006-07-14 16:49:22.000000000 +0100 +++ ./drivers/xen/netfront/netfront.c 2006-07-14 16:51:38.000000000 +0100 @@ -179,6 +179,10 @@ return dev->features & NETIF_F_SG; } +static struct ethtool_ops netfront_ethtool_ops = { + .get_link = ethtool_op_get_link, +}; + /** * Entry point to this code when a new device is created. Allocate the basic * structures and the ring buffers for communication with the backend, and @@ -211,6 +215,8 @@ info = netdev_priv(netdev); dev->data = info; + SET_ETHTOOL_OPS(netdev, &netfront_ethtool_ops); + err = talk_to_backend(dev, info); if (err) { xennet_sysfs_delif(info->netdev); --=-Jt4YrlgO56DdtzWKt821 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-Jt4YrlgO56DdtzWKt821--