From patchwork Fri Nov 21 23:21:57 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 10153 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 AA837DDE1F for ; Sat, 22 Nov 2008 10:23:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755609AbYKUXXp (ORCPT ); Fri, 21 Nov 2008 18:23:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755505AbYKUXXn (ORCPT ); Fri, 21 Nov 2008 18:23:43 -0500 Received: from suva.vyatta.com ([76.74.103.44]:57069 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754636AbYKUXXg (ORCPT ); Fri, 21 Nov 2008 18:23:36 -0500 Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id mALNNX0G031529; Fri, 21 Nov 2008 15:23:33 -0800 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id mALNNX6Z031509; Fri, 21 Nov 2008 15:23:33 -0800 Message-Id: <20081121232240.517617345@vyatta.com> References: <20081121232138.343333942@vyatta.com> User-Agent: quilt/0.46-1 Date: Fri, 21 Nov 2008 15:21:57 -0800 From: Stephen Hemminger To: David Miller , Jeff Garzik Cc: netdev@vger.kernel.org Subject: [PATCH 19/22] qla3xxx: convert to net_device_ops Content-Disposition: inline; filename=qla3xxx.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Convert this driver to net_device_ops. Compile tested only. Signed-off-by: Stephen Hemminger --- a/drivers/net/qla3xxx.c 2008-11-21 14:37:52.000000000 -0800 +++ b/drivers/net/qla3xxx.c 2008-11-21 14:41:14.000000000 -0800 @@ -3900,6 +3900,17 @@ static void ql3xxx_timer(unsigned long p queue_delayed_work(qdev->workqueue, &qdev->link_state_work, 0); } +static const struct net_device_ops ql3xxx_netdev_ops = { + .ndo_open = ql3xxx_open, + .ndo_start_xmit = ql3xxx_send, + .ndo_stop = ql3xxx_close, + .ndo_set_multicast_list = NULL, /* not allowed on NIC side */ + .ndo_change_mtu = eth_change_mtu, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = ql3xxx_set_mac_address, + .ndo_tx_timeout = ql3xxx_tx_timeout, +}; + static int __devinit ql3xxx_probe(struct pci_dev *pdev, const struct pci_device_id *pci_entry) { @@ -3978,17 +3989,8 @@ static int __devinit ql3xxx_probe(struct spin_lock_init(&qdev->hw_lock); /* Set driver entry points */ - ndev->open = ql3xxx_open; - ndev->hard_start_xmit = ql3xxx_send; - ndev->stop = ql3xxx_close; - /* ndev->set_multicast_list - * This device is one side of a two-function adapter - * (NIC and iSCSI). Promiscuous mode setting/clearing is - * not allowed from the NIC side. - */ + ndev->netdev_ops = &ql3xxx_netdev_ops; SET_ETHTOOL_OPS(ndev, &ql3xxx_ethtool_ops); - ndev->set_mac_address = ql3xxx_set_mac_address; - ndev->tx_timeout = ql3xxx_tx_timeout; ndev->watchdog_timeo = 5 * HZ; netif_napi_add(ndev, &qdev->napi, ql_poll, 64);