From patchwork Mon Nov 17 23:42:31 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 9290 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 24AA1DDECA for ; Tue, 18 Nov 2008 11:01:29 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279AbYKRABO (ORCPT ); Mon, 17 Nov 2008 19:01:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752947AbYKRABL (ORCPT ); Mon, 17 Nov 2008 19:01:11 -0500 Received: from suva.vyatta.com ([76.74.103.44]:55102 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752020AbYKRAAQ (ORCPT ); Mon, 17 Nov 2008 19:00:16 -0500 Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id mAI00Eoe018197; Mon, 17 Nov 2008 16:00:14 -0800 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id mAI00ERd018196; Mon, 17 Nov 2008 16:00:14 -0800 Message-Id: <20081117234356.835021131@vyatta.com> References: <20081117234207.854110282@vyatta.com> User-Agent: quilt/0.46-1 Date: Mon, 17 Nov 2008 15:42:31 -0800 From: Stephen Hemminger To: David Miller Cc: netdev@vger.kernel.org Subject: [PATCH 24/33] via-velocity: convert to net_device_ops Content-Disposition: inline; filename=via-netdev_ops.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Convert this driver to network device ops. Compile tested only. Signed-off-by: Stephen Hemminger --- a/drivers/net/via-velocity.c 2008-11-17 12:56:02.000000000 -0800 +++ b/drivers/net/via-velocity.c 2008-11-17 12:58:13.000000000 -0800 @@ -849,6 +849,19 @@ static int velocity_soft_reset(struct ve return 0; } +static const struct net_device_ops velocity_netdev_ops = { + .open = velocity_open, + .stop = velocity_close, + .get_stats = velocity_get_stats, + .validate_addr = eth_validate_addr, + .set_multicast_list = velocity_set_multi, + .change_mtu = velocity_change_mtu, + .do_ioctl = velocity_ioctl, + .vlan_rx_add_vid = velocity_vlan_rx_add_vid, + .vlan_rx_kill_vid = velocity_vlan_rx_kill_vid, + .vlan_rx_register = velocity_vlan_rx_register, +}; + /** * velocity_found1 - set up discovered velocity card * @pdev: PCI device @@ -958,18 +971,9 @@ static int __devinit velocity_found1(str vptr->phy_id = MII_GET_PHY_ID(vptr->mac_regs); dev->irq = pdev->irq; - dev->open = velocity_open; dev->hard_start_xmit = velocity_xmit; - dev->stop = velocity_close; - dev->get_stats = velocity_get_stats; - dev->set_multicast_list = velocity_set_multi; - dev->do_ioctl = velocity_ioctl; + dev->netdev_ops = &velocity_netdev_ops; dev->ethtool_ops = &velocity_ethtool_ops; - dev->change_mtu = velocity_change_mtu; - - dev->vlan_rx_add_vid = velocity_vlan_rx_add_vid; - dev->vlan_rx_kill_vid = velocity_vlan_rx_kill_vid; - dev->vlan_rx_register = velocity_vlan_rx_register; #ifdef VELOCITY_ZERO_COPY_SUPPORT dev->features |= NETIF_F_SG;