2 * Copyright (c) 1997-2000 LAN Media Corporation (LMC)
3 * All rights reserved. www.lanmedia.com
5 * This code is written by:
6 * Andrew Stanley-Jones (asj@cban.com)
7 * Rob Braun (bbraun@vix.com),
8 * Michael Graff (explorer@vix.com) and
9 * Matt Thomas (matt@3am-software.com).
16 * This software may be used and distributed according to the terms
17 * of the GNU General Public License version 2, incorporated herein by reference.
19 * Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards.
22 #include <linux/kernel.h>
23 #include <linux/string.h>
24 #include <linux/timer.h>
25 #include <linux/ptrace.h>
26 #include <linux/errno.h>
27 #include <linux/ioport.h>
28 #include <linux/interrupt.h>
30 #include <linux/if_arp.h>
31 #include <linux/netdevice.h>
32 #include <linux/etherdevice.h>
33 #include <linux/skbuff.h>
34 #include <linux/inet.h>
35 #include <linux/workqueue.h>
36 #include <linux/proc_fs.h>
37 #include <linux/bitops.h>
38 #include <asm/processor.h> /* Processor type for cache alignment. */
41 #include <linux/smp.h>
45 #include "lmc_debug.h"
46 #include "lmc_ioctl.h"
47 #include "lmc_proto.h"
50 void lmc_proto_attach(lmc_softc_t
*sc
) /*FOLD00*/
52 lmc_trace(sc
->lmc_device
, "lmc_proto_attach in");
53 if (sc
->if_type
== LMC_NET
) {
54 struct net_device
*dev
= sc
->lmc_device
;
56 * They set a few basics because they don't use HDLC
58 dev
->flags
|= IFF_POINTOPOINT
;
59 dev
->hard_header_len
= 0;
62 lmc_trace(sc
->lmc_device
, "lmc_proto_attach out");
65 int lmc_proto_ioctl(lmc_softc_t
*sc
, struct ifreq
*ifr
, int cmd
)
67 lmc_trace(sc
->lmc_device
, "lmc_proto_ioctl");
68 if (sc
->if_type
== LMC_PPP
)
69 return hdlc_ioctl(sc
->lmc_device
, ifr
, cmd
);
73 int lmc_proto_open(lmc_softc_t
*sc
)
77 lmc_trace(sc
->lmc_device
, "lmc_proto_open in");
79 if (sc
->if_type
== LMC_PPP
) {
80 ret
= hdlc_open(sc
->lmc_device
);
82 printk(KERN_WARNING
"%s: HDLC open failed: %d\n",
86 lmc_trace(sc
->lmc_device
, "lmc_proto_open out");
90 void lmc_proto_close(lmc_softc_t
*sc
)
92 lmc_trace(sc
->lmc_device
, "lmc_proto_close in");
94 if (sc
->if_type
== LMC_PPP
)
95 hdlc_close(sc
->lmc_device
);
97 lmc_trace(sc
->lmc_device
, "lmc_proto_close out");
100 __be16
lmc_proto_type(lmc_softc_t
*sc
, struct sk_buff
*skb
) /*FOLD00*/
102 lmc_trace(sc
->lmc_device
, "lmc_proto_type in");
105 return hdlc_type_trans(skb
, sc
->lmc_device
);
108 return htons(ETH_P_802_2
);
110 case LMC_RAW
: /* Packet type for skbuff kind of useless */
111 return htons(ETH_P_802_2
);
114 printk(KERN_WARNING
"%s: No protocol set for this interface, assuming 802.2 (which is wrong!!)\n", sc
->name
);
115 return htons(ETH_P_802_2
);
118 lmc_trace(sc
->lmc_device
, "lmc_proto_tye out");
122 void lmc_proto_netif(lmc_softc_t
*sc
, struct sk_buff
*skb
) /*FOLD00*/
124 lmc_trace(sc
->lmc_device
, "lmc_proto_netif in");
134 lmc_trace(sc
->lmc_device
, "lmc_proto_netif out");