From patchwork Sun Mar 29 15:28:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Beregalov X-Patchwork-Id: 25285 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 1AAE9DDDFA for ; Mon, 30 Mar 2009 02:28:31 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758228AbZC2P2T (ORCPT ); Sun, 29 Mar 2009 11:28:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757974AbZC2P2T (ORCPT ); Sun, 29 Mar 2009 11:28:19 -0400 Received: from fg-out-1718.google.com ([72.14.220.156]:49792 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757880AbZC2P2S (ORCPT ); Sun, 29 Mar 2009 11:28:18 -0400 Received: by fg-out-1718.google.com with SMTP id e12so576574fga.17 for ; Sun, 29 Mar 2009 08:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=VMvhvBMjJxoqGJevvBKWkjVHKkkXz6l2y0UYSIjekcI=; b=t8Ti4tsAvOxI0Izjpm0oAnm2KSd2QdKCs5ef7mwOox0iSGIsa+Q5r5m0YkgjLIv8d7 5rySTymTR2AceLXhpKzK8PJBWfuUu5/tQus4oiaCWnOW0oV7mgDKt2dMsUD/4oh0cqX9 G9jAXjaQkfVIRdIjYV+KfklZHDRpu01pVzDZs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=KFaUzVwfX+JcZt3fchyuB5/v+8lCZ3BxD/ytC9IMc1gMSeDq9bnAW1Z27Di3fVOe4i NJgtCuWZZEn+kCw3oPu2gazyOnx4aor7IO7PEytWHe70iEJLyBCGw0RU6lVZpnSJ7QrL b19fEkntwQ+FL/LT5g5wD78RJ0CzbG4jD57BE= Received: by 10.86.68.1 with SMTP id q1mr1205139fga.62.1238340495005; Sun, 29 Mar 2009 08:28:15 -0700 (PDT) Received: from orion (ppp91-76-231-215.pppoe.mtu-net.ru [91.76.231.215]) by mx.google.com with ESMTPS id e11sm4314476fga.20.2009.03.29.08.28.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 29 Mar 2009 08:28:14 -0700 (PDT) Date: Sun, 29 Mar 2009 19:28:11 +0400 From: Alexander Beregalov To: gregkh@suse.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 6/10] Staging: rt2870: convert to netdev_ops Message-ID: <20090329152811.GF11056@orion> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Alexander Beregalov Acked-by: David S. Miller --- drivers/staging/rt2870/rt_main_dev.c | 28 +++++++++++++++------------- 1 files changed, 15 insertions(+), 13 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/rt2870/rt_main_dev.c b/drivers/staging/rt2870/rt_main_dev.c index 313ecea..48ad411 100644 --- a/drivers/staging/rt2870/rt_main_dev.c +++ b/drivers/staging/rt2870/rt_main_dev.c @@ -855,6 +855,20 @@ err: return (-1); } /* End of rt28xx_open */ +static const struct net_device_ops rt2870_netdev_ops = { + .ndo_open = MainVirtualIF_open, + .ndo_stop = MainVirtualIF_close, + .ndo_do_ioctl = rt28xx_ioctl, + .ndo_get_stats = RT28xx_get_ether_stats, + .ndo_validate_addr = NULL, + .ndo_set_mac_address = eth_mac_addr, + .ndo_change_mtu = eth_change_mtu, +#ifdef IKANOS_VX_1X0 + .ndo_start_xmit = IKANOS_DataFramesTx, +#else + .ndo_start_xmit = rt28xx_send_packets, +#endif +}; /* Must not be called for mdev and apdev */ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER pAd) @@ -866,12 +880,6 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p //ether_setup(dev); - dev->hard_start_xmit = rt28xx_send_packets; - -#ifdef IKANOS_VX_1X0 - dev->hard_start_xmit = IKANOS_DataFramesTx; -#endif // IKANOS_VX_1X0 // - // dev->set_multicast_list = ieee80211_set_multicast_list; // dev->change_mtu = ieee80211_change_mtu; #ifdef CONFIG_STA_SUPPORT @@ -895,16 +903,10 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p #if WIRELESS_EXT < 21 dev->get_wireless_stats = rt28xx_get_wireless_stats; #endif - dev->get_stats = RT28xx_get_ether_stats; - dev->open = MainVirtualIF_open; //rt28xx_open; - dev->stop = MainVirtualIF_close; //rt28xx_close; // dev->uninit = ieee80211_if_reinit; // dev->destructor = ieee80211_if_free; dev->priv_flags = INT_MAIN; - dev->do_ioctl = rt28xx_ioctl; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) - dev->validate_addr = NULL; -#endif + dev->netdev_ops = &rt2870_netdev_ops; // find available device name for (i = 0; i < 8; i++) {