From patchwork Mon Mar 23 10:17:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 24911 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 8A066DE29B for ; Mon, 23 Mar 2009 21:18:10 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from gw1.transmode.se (gw1.transmode.se [213.115.205.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 090C0DDEE8 for ; Mon, 23 Mar 2009 21:17:44 +1100 (EST) Received: from sesr04.transmode.se (sesr04.transmode.se [192.168.201.15]) by gw1.transmode.se (Postfix) with ESMTP id 0A1184F159; Mon, 23 Mar 2009 11:17:39 +0100 (CET) To: leoli@freescale.com, netdev@vger.kernel.org, linuxppc-dev@ozlabs.org, Anton Vorontsov MIME-Version: 1.0 Subject: [PATCH] ucc_geth: Convert to net_device_ops X-KeepSent: 2EE08546:DF677136-C1257582:0037C87E; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5 December 05, 2008 Message-ID: From: Joakim Tjernlund Date: Mon, 23 Mar 2009 11:17:39 +0100 X-MIMETrack: Serialize by Router on sesr04/Transmode(Release 8.5|December 05, 2008) at 2009-03-23 11:17:39 X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Signed-off-by: Joakim Tjernlund --- Sorry for the WS damaged patch, but my current company mailer cannot handle inline patches. Due to this we are setting up a new mail system but it will be a few days before this is ready. Therefore I am attaching this patch as well, use that one to apply instaed of the inline variant. drivers/net/ucc_geth.c | 28 +++++++++++++++++++--------- 1 files changed, 19 insertions(+), 9 deletions(-) { struct device *device = &ofdev->dev; @@ -3715,19 +3733,11 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma /* Fill in the dev structure */ uec_set_ethtool_ops(dev); - dev->open = ucc_geth_open; - dev->hard_start_xmit = ucc_geth_start_xmit; - dev->tx_timeout = ucc_geth_timeout; + dev->netdev_ops = &ucc_geth_netdev_ops; dev->watchdog_timeo = TX_TIMEOUT; INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work); netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT); -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = ucc_netpoll; -#endif - dev->stop = ucc_geth_close; -// dev->change_mtu = ucc_geth_change_mtu; dev->mtu = 1500; - dev->set_multicast_list = ucc_geth_set_multi; ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT); ugeth->phy_interface = phy_interface; diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 12e5c3d..d3f6eee 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c @@ -3503,6 +3503,24 @@ static phy_interface_t to_phy_interface(const char *phy_connection_type) return PHY_INTERFACE_MODE_MII; } +static const struct net_device_ops ucc_geth_netdev_ops = { + .ndo_open = ucc_geth_open, + .ndo_stop = ucc_geth_close, + .ndo_start_xmit = ucc_geth_start_xmit, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_multicast_list = ucc_geth_set_multi, +#if 0 +/* not yet */ + .ndo_set_mac_address = ucc_geth_set_mac_address, + .ndo_change_mtu = ucc_geth_change_mtu, + .ndo_do_ioctl = ucc_geth_do_ioctl, +#endif + .ndo_tx_timeout = ucc_geth_timeout, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = ucc_netpoll, +#endif +}; + static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *match)