@@ -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
@@ -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:
deleted file mode 100644
@@ -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 <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/timer.h>
-#include <linux/ptrace.h>
-#include <linux/errno.h>
-#include <linux/ioport.h>
-#include <linux/interrupt.h>
-#include <linux/in.h>
-#include <linux/if_arp.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-#include <linux/inet.h>
-#include <linux/workqueue.h>
-#include <linux/proc_fs.h>
-#include <linux/bitops.h>
-#include <linux/io.h>
-#include <asm/processor.h> /* Processor type for cache alignment. */
-#include <asm/dma.h>
-#include <linux/smp.h>
-
-#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");
-}
deleted file mode 100644
@@ -1,18 +0,0 @@
-#ifndef _LMC_PROTO_H_
-#define _LMC_PROTO_H_
-
-#include <linux/hdlc.h>
-
-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