From patchwork Wed Jan 14 07:38:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 18392 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 5B934DE14D for ; Wed, 14 Jan 2009 18:40:27 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759795AbZANHkY (ORCPT ); Wed, 14 Jan 2009 02:40:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759643AbZANHkX (ORCPT ); Wed, 14 Jan 2009 02:40:23 -0500 Received: from rv-out-0506.google.com ([209.85.198.228]:64689 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758763AbZANHkV (ORCPT ); Wed, 14 Jan 2009 02:40:21 -0500 Received: by rv-out-0506.google.com with SMTP id k40so409124rvb.1 for ; Tue, 13 Jan 2009 23:40:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=JI2STToDdxwExiTsDExjt1KUDy+L6V0uZC+GBxIYunY=; b=FpYRpb6aYZQiuR4lVWCZYkIIoIrwl3X+TeeewUYlds2+e5Wi0t1SMezAQOruCSsoSs 09z61Vritua6AWAedEx8OGYYwXoeibefO6dZA8NhCCDbmeTwBi+SCJaDxDhaNi9bjDD0 aJWTTagBI+k6rrMrxfxPN8SVaIEiVDsnU+rXE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=qmwW8SpheS4GeCzVNjMy3qSWV003xuzQKSV3HbfNqdq07amC3vlECt99KbCnNM1XqK YWNdU4pnNyFaesngjMJnhgIhtzBMRIYY1csqoZ5oB2rU9pnbSoDbe2ZSZqQ+O76yA9xN l0MC94lPGbhO96C11ukA1mCvKlcQFC6VViVjo= Received: by 10.141.129.14 with SMTP id g14mr15751428rvn.8.1231918820466; Tue, 13 Jan 2009 23:40:20 -0800 (PST) Received: from rx1.opensource.se (114.8.221.202.ts.2iij.net [202.221.8.114]) by mx.google.com with ESMTPS id b8sm17309837rvf.9.2009.01.13.23.40.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 13 Jan 2009 23:40:19 -0800 (PST) From: Magnus Damm To: netdev@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org, shemminger@vyatta.com, ben-linux@fluff.org, davem@davemloft.net Date: Wed, 14 Jan 2009 16:38:27 +0900 Message-Id: <20090114073827.26909.56261.sendpatchset@rx1.opensource.se> Subject: [PATCH] ax88796: start_xmit fix using net_device_ops Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Magnus Damm This patch hooks up the start_xmit/tx_timeout/get_stats callbacks in the ax88796 driver since they no longer are installed by the lib8390 code. Without this patch the function dev_hard_start_xmit() crashes due to a start_xmit callback with the value NULL. While at it, update the ax88796 driver to make use of use of struct net_device_ops. Signed-off-by: Magnus Damm --- This patch fixes the backplane ethernet crash on SuperH Highlander. drivers/net/ax88796.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 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 --- 0001/drivers/net/ax88796.c +++ work/drivers/net/ax88796.c 2009-01-14 15:06:13.000000000 +0900 @@ -37,7 +37,10 @@ static int phy_debug = 0; #define __ei_open ax_ei_open #define __ei_close ax_ei_close #define __ei_poll ax_ei_poll +#define __ei_start_xmit ax_ei_start_xmit #define __ei_tx_timeout ax_ei_tx_timeout +#define __ei_get_stats ax_ei_get_stats +#define __ei_set_multicast_list ax_ei_set_multicast_list #define __ei_interrupt ax_ei_interrupt #define ____alloc_ei_netdev ax__alloc_ei_netdev #define __NS8390_init ax_NS8390_init @@ -623,6 +626,23 @@ static void ax_eeprom_register_write(str } #endif +static const struct net_device_ops ax_netdev_ops = { + .ndo_open = ax_open, + .ndo_stop = ax_close, + .ndo_do_ioctl = ax_ioctl, + + .ndo_start_xmit = ax_ei_start_xmit, + .ndo_tx_timeout = ax_ei_tx_timeout, + .ndo_get_stats = ax_ei_get_stats, + .ndo_set_multicast_list = ax_ei_set_multicast_list, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = eth_mac_addr, + .ndo_change_mtu = eth_change_mtu, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = ax_ei_poll, +#endif +}; + /* setup code */ static void ax_initial_setup(struct net_device *dev, struct ei_device *ei_local) @@ -738,9 +758,7 @@ static int ax_init_dev(struct net_device ei_status.get_8390_hdr = &ax_get_8390_hdr; ei_status.priv = 0; - dev->open = ax_open; - dev->stop = ax_close; - dev->do_ioctl = ax_ioctl; + dev->netdev_ops = &ax_netdev_ops; dev->ethtool_ops = &ax_ethtool_ops; ax->msg_enable = NETIF_MSG_LINK; @@ -753,9 +771,6 @@ static int ax_init_dev(struct net_device ax->mii.mdio_write = ax_phy_write; ax->mii.dev = dev; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = ax_ei_poll; -#endif ax_NS8390_init(dev, 0); if (first_init)