From patchwork Sat Jul 31 15:05:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Krzysztof Halasa X-Patchwork-Id: 60429 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.180.67]) by ozlabs.org (Postfix) with ESMTP id AF8851007D3 for ; Sun, 1 Aug 2010 01:07:43 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756534Ab0GaPGO (ORCPT ); Sat, 31 Jul 2010 11:06:14 -0400 Received: from khc.piap.pl ([195.187.100.11]:52516 "EHLO khc.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756437Ab0GaPGM (ORCPT ); Sat, 31 Jul 2010 11:06:12 -0400 Received: from intrepid.localdomain (intrepid.localdomain [10.0.0.2]) by khc.piap.pl (Postfix) with ESMTP id 84B30987E; Sat, 31 Jul 2010 17:05:53 +0200 (CEST) From: Krzysztof Halasa To: David Miller Cc: Subject: [PATCH 06/29] LMC: Remove stub files proto.[ch]. Date: Sat, 31 Jul 2010 17:05:29 +0200 Message-Id: <1280588752-9340-6-git-send-email-khc@pm.waw.pl> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: References: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Krzysztof Hałasa Signed-off-by: Krzysztof Hałasa --- drivers/net/wan/lmc/Makefile | 2 +- drivers/net/wan/lmc/main.c | 29 ++++++------- drivers/net/wan/lmc/proto.c | 95 ------------------------------------------ drivers/net/wan/lmc/proto.h | 18 -------- 4 files changed, 14 insertions(+), 130 deletions(-) delete mode 100644 drivers/net/wan/lmc/proto.c delete mode 100644 drivers/net/wan/lmc/proto.h diff --git a/drivers/net/wan/lmc/Makefile b/drivers/net/wan/lmc/Makefile index 2c14b98..2f461a7 100644 --- a/drivers/net/wan/lmc/Makefile +++ b/drivers/net/wan/lmc/Makefile @@ -5,7 +5,7 @@ obj-$(CONFIG_LANMEDIA) += lmc.o -lmc-objs := debug.o media.o main.o proto.o +lmc-objs := debug.o media.o main.o # Like above except every packet gets echoed to KERN_DEBUG # in hex diff --git a/drivers/net/wan/lmc/main.c b/drivers/net/wan/lmc/main.c index a6de32f..13bb6f6 100644 --- a/drivers/net/wan/lmc/main.c +++ b/drivers/net/wan/lmc/main.c @@ -72,7 +72,6 @@ #include "var.h" #include "ioctl.h" #include "debug.h" -#include "proto.h" static int LMC_PKT_BUF_SZ = 1542; @@ -104,6 +103,12 @@ static void lmc_reset(struct card * const sc); static void lmc_dec_reset(struct card * const sc); static void lmc_driver_timeout(struct net_device *dev); +static inline struct card* dev_to_sc(struct net_device *dev) +{ + return (struct card *)dev_to_hdlc(dev)->priv; +} + + /* linux reserves 16 device specific IOCTLs. We call them LMCIOC* to control various bits of our world. */ int lmc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) @@ -566,7 +571,7 @@ int lmc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) break; default: /* If we don't know what to do, give the protocol a shot. */ - ret = lmc_proto_ioctl(sc, ifr, cmd); + ret = hdlc_ioctl(sc->lmc_device, ifr, cmd); break; } @@ -795,12 +800,6 @@ static int __devinit lmc_init_one(struct pci_dev *pdev, pci_set_drvdata(pdev, dev); SET_NETDEV_DEV(dev, &pdev->dev); - /* - * This will get the protocol layer ready and do any 1 time init's - * Must have a valid sc and dev structure - */ - lmc_proto_attach(sc); - /* Init the spin lock so can call it latter */ spin_lock_init(&sc->lmc_lock); @@ -973,9 +972,7 @@ static int lmc_open(struct net_device *dev) sc->lmc_media->set_crc_length(sc, sc->ictl.crc_length); /* Acknowledge the Terminal Active and light LEDs */ - /* dev->flags |= IFF_UP; */ - - if ((err = lmc_proto_open(sc)) != 0) + if ((err = hdlc_open(sc->lmc_device)) != 0) return err; netif_start_queue(dev); @@ -1059,7 +1056,7 @@ static int lmc_close(struct net_device *dev) sc->lmc_ok = 0; sc->lmc_media->set_link_status(sc, 0); del_timer(&sc->timer); - lmc_proto_close(sc); + hdlc_close(sc->lmc_device); lmc_ifdown(dev); lmc_trace(dev, "lmc_close out"); @@ -1489,11 +1486,11 @@ give_it_anyways: sc->lmc_rxring[i].buffer1 = 0x0; skb_put(skb, len); - skb->protocol = lmc_proto_type(sc, skb); + skb->protocol = hdlc_type_trans(skb, sc->lmc_device); skb_reset_mac_header(skb); /* skb_reset_network_header(skb); */ skb->dev = dev; - lmc_proto_netif(sc, skb); + netif_rx(skb); /* This skb will be destroyed by the upper layers, make a new one */ @@ -1520,11 +1517,11 @@ give_it_anyways: if (!nsb) goto give_it_anyways; skb_copy_from_linear_data(skb, skb_put(nsb, len), len); - nsb->protocol = lmc_proto_type(sc, nsb); + nsb->protocol = hdlc_type_trans(nsb, sc->lmc_device); skb_reset_mac_header(nsb); /* skb_reset_network_header(nsb); */ nsb->dev = dev; - lmc_proto_netif(sc, nsb); + netif_rx(nsb); } skip_packet: diff --git a/drivers/net/wan/lmc/proto.c b/drivers/net/wan/lmc/proto.c deleted file mode 100644 index ffd952a..0000000 --- a/drivers/net/wan/lmc/proto.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 1997-2000 LAN Media Corporation (LMC) - * All rights reserved. www.lanmedia.com - * - * This code is written by: - * Andrew Stanley-Jones (asj@cban.com) - * Rob Braun (bbraun@vix.com), - * Michael Graff (explorer@vix.com) and - * Matt Thomas (matt@3am-software.com). - * - * With Help By: - * David Boggs - * Ron Crane - * Allan Cox - * - * This software may be used and distributed according to the terms of - * the GNU General Public License version 2, incorporated herein by reference. - * - * Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* Processor type for cache alignment. */ -#include -#include - -#include "lmc.h" -#include "var.h" -#include "debug.h" -#include "ioctl.h" -#include "proto.h" - -void lmc_proto_attach(struct card *sc) -{ - lmc_trace(sc->lmc_device, "lmc_proto_attach in"); - lmc_trace(sc->lmc_device, "lmc_proto_attach out"); -} - -int lmc_proto_ioctl(struct card *sc, struct ifreq *ifr, int cmd) -{ - lmc_trace(sc->lmc_device, "lmc_proto_ioctl"); - return hdlc_ioctl(sc->lmc_device, ifr, cmd); -} - -int lmc_proto_open(struct card *sc) -{ - int ret = 0; - - lmc_trace(sc->lmc_device, "lmc_proto_open in"); - - ret = hdlc_open(sc->lmc_device); - if (ret < 0) - printk(KERN_WARNING "%s: HDLC open failed: %d\n", - sc->name, ret); - - lmc_trace(sc->lmc_device, "lmc_proto_open out"); - return ret; -} - -void lmc_proto_close(struct card *sc) -{ - lmc_trace(sc->lmc_device, "lmc_proto_close in"); - hdlc_close(sc->lmc_device); - lmc_trace(sc->lmc_device, "lmc_proto_close out"); -} - -__be16 lmc_proto_type(struct card *sc, struct sk_buff *skb) -{ - lmc_trace(sc->lmc_device, "lmc_proto_type in"); - return hdlc_type_trans(skb, sc->lmc_device); - lmc_trace(sc->lmc_device, "lmc_proto_tye out"); -} - -void lmc_proto_netif(struct card *sc, struct sk_buff *skb) -{ - lmc_trace(sc->lmc_device, "lmc_proto_netif in"); - netif_rx(skb); - lmc_trace(sc->lmc_device, "lmc_proto_netif out"); -} diff --git a/drivers/net/wan/lmc/proto.h b/drivers/net/wan/lmc/proto.h deleted file mode 100644 index 23094ed..0000000 --- a/drivers/net/wan/lmc/proto.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _LMC_PROTO_H_ -#define _LMC_PROTO_H_ - -#include - -void lmc_proto_attach(struct card *sc); -int lmc_proto_ioctl(struct card *sc, struct ifreq *ifr, int cmd); -int lmc_proto_open(struct card *sc); -void lmc_proto_close(struct card *sc); -__be16 lmc_proto_type(struct card *sc, struct sk_buff *skb); -void lmc_proto_netif(struct card *sc, struct sk_buff *skb); - -static inline struct card* dev_to_sc(struct net_device *dev) -{ - return (struct card *)dev_to_hdlc(dev)->priv; -} - -#endif