Commit 3859069b authored by Jeff Garzik's avatar Jeff Garzik Committed by Jeff Garzik
parents e2c709b0 867240f7
......@@ -69,12 +69,6 @@
device to be used as both a tty interface and as a synchronous
controller is a project for Linux post the 2.4 release
</para>
<para>
The support code handles most common card configurations and
supports running both Cisco HDLC and Synchronous PPP. With extra
glue the frame relay and X.25 protocols can also be used with this
driver.
</para>
</chapter>
<chapter id="Driver_Modes">
......@@ -179,35 +173,27 @@
<para>
If you wish to use the network interface facilities of the driver,
then you need to attach a network device to each channel that is
present and in use. In addition to use the SyncPPP and Cisco HDLC
present and in use. In addition to use the generic HDLC
you need to follow some additional plumbing rules. They may seem
complex but a look at the example hostess_sv11 driver should
reassure you.
</para>
<para>
The network device used for each channel should be pointed to by
the netdevice field of each channel. The dev-&gt; priv field of the
the netdevice field of each channel. The hdlc-&gt; priv field of the
network device points to your private data - you will need to be
able to find your ppp device from this. In addition to use the
sync ppp layer the private data must start with a void * pointer
to the syncppp structures.
able to find your private data from this.
</para>
<para>
The way most drivers approach this particular problem is to
create a structure holding the Z8530 device definition and
put that and the syncppp pointer into the private field of
the network device. The network device fields of the channels
then point back to the network devices. The ppp_device can also
be put in the private structure conveniently.
put that into the private field of the network device. The
network device fields of the channels then point back to the
network devices.
</para>
<para>
If you wish to use the synchronous ppp then you need to attach
the syncppp layer to the network device. You should do this before
you register the network device. The
<function>sppp_attach</function> requires that the first void *
pointer in your private data is pointing to an empty struct
ppp_device. The function fills in the initial data for the
ppp/hdlc layer.
If you wish to use the generic HDLC then you need to register
the HDLC device.
</para>
<para>
Before you register your network device you will also need to
......@@ -314,10 +300,10 @@
buffer in sk_buff format and queues it for transmission. The
caller must provide the entire packet with the exception of the
bitstuffing and CRC. This is normally done by the caller via
the syncppp interface layer. It returns 0 if the buffer has been
queued and non zero values for queue full. If the function accepts
the buffer it becomes property of the Z8530 layer and the caller
should not free it.
the generic HDLC interface layer. It returns 0 if the buffer has been
queued and non zero values for queue full. If the function accepts
the buffer it becomes property of the Z8530 layer and the caller
should not free it.
</para>
<para>
The function <function>z8530_get_stats</function> returns a pointer
......
......@@ -232,7 +232,6 @@ typedef struct _mgslpc_info {
/* SPPP/Cisco HDLC device parts */
int netcount;
int dosyncppp;
spinlock_t netlock;
#if SYNCLINK_GENERIC_HDLC
......@@ -459,13 +458,11 @@ static int ttymajor=0;
static int debug_level = 0;
static int maxframe[MAX_DEVICE_COUNT] = {0,};
static int dosyncppp[MAX_DEVICE_COUNT] = {1,1,1,1};
module_param(break_on_load, bool, 0);
module_param(ttymajor, int, 0);
module_param(debug_level, int, 0);
module_param_array(maxframe, int, NULL, 0);
module_param_array(dosyncppp, int, NULL, 0);
MODULE_LICENSE("GPL");
......@@ -2915,7 +2912,6 @@ static void mgslpc_add_device(MGSLPC_INFO *info)
if (info->line < MAX_DEVICE_COUNT) {
if (maxframe[info->line])
info->max_frame_size = maxframe[info->line];
info->dosyncppp = dosyncppp[info->line];
}
mgslpc_device_count++;
......
......@@ -304,7 +304,6 @@ struct mgsl_struct {
/* generic HDLC device parts */
int netcount;
int dosyncppp;
spinlock_t netlock;
#if SYNCLINK_GENERIC_HDLC
......@@ -868,7 +867,6 @@ static int irq[MAX_ISA_DEVICES];
static int dma[MAX_ISA_DEVICES];
static int debug_level;
static int maxframe[MAX_TOTAL_DEVICES];
static int dosyncppp[MAX_TOTAL_DEVICES];
static int txdmabufs[MAX_TOTAL_DEVICES];
static int txholdbufs[MAX_TOTAL_DEVICES];
......@@ -879,7 +877,6 @@ module_param_array(irq, int, NULL, 0);
module_param_array(dma, int, NULL, 0);
module_param(debug_level, int, 0);
module_param_array(maxframe, int, NULL, 0);
module_param_array(dosyncppp, int, NULL, 0);
module_param_array(txdmabufs, int, NULL, 0);
module_param_array(txholdbufs, int, NULL, 0);
......@@ -4258,7 +4255,6 @@ static void mgsl_add_device( struct mgsl_struct *info )
if (info->line < MAX_TOTAL_DEVICES) {
if (maxframe[info->line])
info->max_frame_size = maxframe[info->line];
info->dosyncppp = dosyncppp[info->line];
if (txdmabufs[info->line]) {
info->num_tx_dma_buffers = txdmabufs[info->line];
......
......@@ -128,17 +128,14 @@ static int slgt_device_count;
static int ttymajor;
static int debug_level;
static int maxframe[MAX_DEVICES];
static int dosyncppp[MAX_DEVICES];
module_param(ttymajor, int, 0);
module_param(debug_level, int, 0);
module_param_array(maxframe, int, NULL, 0);
module_param_array(dosyncppp, int, NULL, 0);
MODULE_PARM_DESC(ttymajor, "TTY major device number override: 0=auto assigned");
MODULE_PARM_DESC(debug_level, "Debug syslog output: 0=disabled, 1 to 5=increasing detail");
MODULE_PARM_DESC(maxframe, "Maximum frame size used by device (4096 to 65535)");
MODULE_PARM_DESC(dosyncppp, "Enable synchronous net device, 0=disable 1=enable");
/*
* tty support and callbacks
......@@ -349,7 +346,6 @@ struct slgt_info {
/* SPPP/Cisco HDLC device parts */
int netcount;
int dosyncppp;
spinlock_t netlock;
#if SYNCLINK_GENERIC_HDLC
struct net_device *netdev;
......@@ -3405,7 +3401,6 @@ static void add_device(struct slgt_info *info)
if (info->line < MAX_DEVICES) {
if (maxframe[info->line])
info->max_frame_size = maxframe[info->line];
info->dosyncppp = dosyncppp[info->line];
}
slgt_device_count++;
......
......@@ -270,7 +270,6 @@ typedef struct _synclinkmp_info {
/* SPPP/Cisco HDLC device parts */
int netcount;
int dosyncppp;
spinlock_t netlock;
#if SYNCLINK_GENERIC_HDLC
......@@ -469,13 +468,11 @@ static int ttymajor = 0;
*/
static int debug_level = 0;
static int maxframe[MAX_DEVICES] = {0,};
static int dosyncppp[MAX_DEVICES] = {0,};
module_param(break_on_load, bool, 0);
module_param(ttymajor, int, 0);
module_param(debug_level, int, 0);
module_param_array(maxframe, int, NULL, 0);
module_param_array(dosyncppp, int, NULL, 0);
static char *driver_name = "SyncLink MultiPort driver";
static char *driver_version = "$Revision: 4.38 $";
......@@ -3752,7 +3749,6 @@ static void add_device(SLMP_INFO *info)
if (info->line < MAX_DEVICES) {
if (maxframe[info->line])
info->max_frame_size = maxframe[info->line];
info->dosyncppp = dosyncppp[info->line];
}
synclinkmp_device_count++;
......
......@@ -25,7 +25,7 @@ if WAN
# There is no way to detect a comtrol sv11 - force it modular for now.
config HOSTESS_SV11
tristate "Comtrol Hostess SV-11 support"
depends on ISA && m && ISA_DMA_API && INET
depends on ISA && m && ISA_DMA_API && INET && HDLC
help
Driver for Comtrol Hostess SV-11 network card which
operates on low speed synchronous serial links at up to
......@@ -37,7 +37,7 @@ config HOSTESS_SV11
# The COSA/SRP driver has not been tested as non-modular yet.
config COSA
tristate "COSA/SRP sync serial boards support"
depends on ISA && m && ISA_DMA_API
depends on ISA && m && ISA_DMA_API && HDLC
---help---
Driver for COSA and SRP synchronous serial boards.
......@@ -61,7 +61,7 @@ config COSA
#
config LANMEDIA
tristate "LanMedia Corp. SSI/V.35, T1/E1, HSSI, T3 boards"
depends on PCI && VIRT_TO_BUS
depends on PCI && VIRT_TO_BUS && HDLC
---help---
Driver for the following Lan Media family of serial boards:
......@@ -78,9 +78,8 @@ config LANMEDIA
- LMC 5245 board connects directly to a T3 circuit saving the
additional external hardware.
To change setting such as syncPPP vs Cisco HDLC or clock source you
will need lmcctl. It is available at <ftp://ftp.lanmedia.com/>
(broken link).
To change setting such as clock source you will need lmcctl.
It is available at <ftp://ftp.lanmedia.com/> (broken link).
To compile this driver as a module, choose M here: the
module will be called lmc.
......@@ -88,7 +87,7 @@ config LANMEDIA
# There is no way to detect a Sealevel board. Force it modular
config SEALEVEL_4021
tristate "Sealevel Systems 4021 support"
depends on ISA && m && ISA_DMA_API && INET
depends on ISA && m && ISA_DMA_API && INET && HDLC
help
This is a driver for the Sealevel Systems ACB 56 serial I/O adapter.
......
......@@ -21,12 +21,11 @@ pc300-y := pc300_drv.o
pc300-$(CONFIG_PC300_MLPPP) += pc300_tty.o
pc300-objs := $(pc300-y)
obj-$(CONFIG_HOSTESS_SV11) += z85230.o syncppp.o hostess_sv11.o
obj-$(CONFIG_SEALEVEL_4021) += z85230.o syncppp.o sealevel.o
obj-$(CONFIG_COSA) += syncppp.o cosa.o
obj-$(CONFIG_FARSYNC) += syncppp.o farsync.o
obj-$(CONFIG_DSCC4) += dscc4.o
obj-$(CONFIG_LANMEDIA) += syncppp.o
obj-$(CONFIG_HOSTESS_SV11) += z85230.o hostess_sv11.o
obj-$(CONFIG_SEALEVEL_4021) += z85230.o sealevel.o
obj-$(CONFIG_COSA) += cosa.o
obj-$(CONFIG_FARSYNC) += farsync.o
obj-$(CONFIG_DSCC4) += dscc4.o
obj-$(CONFIG_X25_ASY) += x25_asy.o
obj-$(CONFIG_LANMEDIA) += lmc/
......
This diff is collapsed.
......@@ -103,7 +103,6 @@
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <net/syncppp.h>
#include <linux/hdlc.h>
#include <linux/mutex.h>
......
......@@ -47,10 +47,7 @@ MODULE_LICENSE("GPL");
/* Default parameters for the link
*/
#define FST_TX_QUEUE_LEN 100 /* At 8Mbps a longer queue length is
* useful, the syncppp module forces
* this down assuming a slower line I
* guess.
*/
* useful */
#define FST_TXQ_DEPTH 16 /* This one is for the buffering
* of frames on the way down to the card
* so that we can keep the card busy
......
......@@ -54,9 +54,6 @@
/* Ioctl call command values
*
* The first three private ioctls are used by the sync-PPP module,
* allowing a little room for expansion we start our numbering at 10.
*/
#define FSTWRITE (SIOCDEVPRIVATE+10)
#define FSTCPURESET (SIOCDEVPRIVATE+11)
......@@ -202,9 +199,6 @@ struct fstioc_info {
#define J1 7
/* "proto" */
#define FST_HDLC 1 /* Cisco compatible HDLC */
#define FST_PPP 2 /* Sync PPP */
#define FST_MONITOR 3 /* Monitor only (raw packet reception) */
#define FST_RAW 4 /* Two way raw packets */
#define FST_GEN_HDLC 5 /* Using "Generic HDLC" module */
......
......@@ -22,20 +22,19 @@
* - proto->start() and stop() are called with spin_lock_irq held.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/errno.h>
#include <linux/hdlc.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/pkt_sched.h>
#include <linux/inetdevice.h>
#include <linux/lapb.h>
#include <linux/poll.h>
#include <linux/rtnetlink.h>
#include <linux/notifier.h>
#include <linux/hdlc.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <net/net_namespace.h>
......@@ -109,7 +108,7 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event,
if (dev->get_stats != hdlc_get_stats)
return NOTIFY_DONE; /* not an HDLC device */
if (event != NETDEV_CHANGE)
return NOTIFY_DONE; /* Only interrested in carrier changes */
......@@ -357,7 +356,7 @@ static struct packet_type hdlc_packet_type = {
static struct notifier_block hdlc_notifier = {
.notifier_call = hdlc_device_event,
.notifier_call = hdlc_device_event,
};
......@@ -367,8 +366,8 @@ static int __init hdlc_module_init(void)
printk(KERN_INFO "%s\n", version);
if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0)
return result;
dev_add_pack(&hdlc_packet_type);
return result;
dev_add_pack(&hdlc_packet_type);
return 0;
}
......
......@@ -9,19 +9,18 @@
* as published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/errno.h>
#include <linux/hdlc.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pkt_sched.h>
#include <linux/inetdevice.h>
#include <linux/lapb.h>
#include <linux/poll.h>
#include <linux/rtnetlink.h>
#include <linux/hdlc.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#undef DEBUG_HARD_HEADER
......@@ -68,9 +67,9 @@ struct cisco_state {
static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr);
static inline struct cisco_state * state(hdlc_device *hdlc)
static inline struct cisco_state* state(hdlc_device *hdlc)
{
return(struct cisco_state *)(hdlc->state);
return (struct cisco_state *)hdlc->state;
}
......@@ -172,7 +171,7 @@ static int cisco_rx(struct sk_buff *skb)
data->address != CISCO_UNICAST)
goto rx_error;
switch(ntohs(data->protocol)) {
switch (ntohs(data->protocol)) {
case CISCO_SYS_INFO:
/* Packet is not needed, drop it. */
dev_kfree_skb_any(skb);
......@@ -336,7 +335,7 @@ static struct hdlc_proto proto = {
static const struct header_ops cisco_header_ops = {
.create = cisco_hard_header,
};
static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
{
cisco_proto __user *cisco_s = ifr->ifr_settings.ifs_ifsu.cisco;
......@@ -359,10 +358,10 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
return 0;
case IF_PROTO_CISCO:
if(!capable(CAP_NET_ADMIN))
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if(dev->flags & IFF_UP)
if (dev->flags & IFF_UP)
return -EBUSY;
if (copy_from_user(&new_settings, cisco_s, size))
......@@ -372,7 +371,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
new_settings.timeout < 2)
return -EINVAL;
result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
result = hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
if (result)
return result;
......
......@@ -33,20 +33,19 @@
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/errno.h>
#include <linux/etherdevice.h>
#include <linux/hdlc.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pkt_sched.h>
#include <linux/inetdevice.h>
#include <linux/lapb.h>
#include <linux/poll.h>
#include <linux/rtnetlink.h>
#include <linux/etherdevice.h>
#include <linux/hdlc.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#undef DEBUG_PKT
#undef DEBUG_ECN
......@@ -96,7 +95,7 @@ typedef struct {
unsigned ea1: 1;
unsigned cr: 1;
unsigned dlcih: 6;
unsigned ea2: 1;
unsigned de: 1;
unsigned becn: 1;
......
......@@ -9,19 +9,18 @@
* as published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/errno.h>
#include <linux/hdlc.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pkt_sched.h>
#include <linux/inetdevice.h>
#include <linux/lapb.h>
#include <linux/poll.h>
#include <linux/rtnetlink.h>
#include <linux/hdlc.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <net/syncppp.h>
struct ppp_state {
......
......@@ -9,19 +9,18 @@
* as published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/errno.h>
#include <linux/hdlc.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pkt_sched.h>
#include <linux/inetdevice.h>
#include <linux/lapb.h>
#include <linux/poll.h>
#include <linux/rtnetlink.h>
#include <linux/hdlc.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
static int raw_ioctl(struct net_device *dev, struct ifreq *ifr);
......
......@@ -9,20 +9,19 @@
* as published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/errno.h>
#include <linux/etherdevice.h>
#include <linux/hdlc.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pkt_sched.h>
#include <linux/inetdevice.h>
#include <linux/lapb.h>
#include <linux/poll.h>
#include <linux/rtnetlink.h>
#include <linux/etherdevice.h>
#include <linux/hdlc.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
static int raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr);
......
......@@ -9,20 +9,19 @@
* as published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/errno.h>
#include <linux/hdlc.h>
#include <linux/if_arp.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/pkt_sched.h>
#include <linux/inetdevice.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/lapb.h>
#include <linux/module.h>
#include <linux/pkt_sched.h>
#include <linux/poll.h>
#include <linux/rtnetlink.h>
#include <linux/hdlc.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <net/x25device.h>
static int x25_ioctl(struct net_device *dev, struct ifreq *ifr);
......
This diff is collapsed.
......@@ -11,12 +11,12 @@ unsigned lmc_mii_readreg(lmc_softc_t * const sc, unsigned
devaddr, unsigned regno);
void lmc_mii_writereg(lmc_softc_t * const sc, unsigned devaddr,
unsigned regno, unsigned data);
void lmc_led_on(lmc_softc_t * const, u_int32_t);
void lmc_led_off(lmc_softc_t * const, u_int32_t);
void lmc_led_on(lmc_softc_t * const, u32);
void lmc_led_off(lmc_softc_t * const, u32);
unsigned lmc_mii_readreg(lmc_softc_t * const, unsigned, unsigned);
void lmc_mii_writereg(lmc_softc_t * const, unsigned, unsigned, unsigned);
void lmc_gpio_mkinput(lmc_softc_t * const sc, u_int32_t bits);
void lmc_gpio_mkoutput(lmc_softc_t * const sc, u_int32_t bits);
void lmc_gpio_mkinput(lmc_softc_t * const sc, u32 bits);
void lmc_gpio_mkoutput(lmc_softc_t * const sc, u32 bits);
int lmc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
......@@ -26,8 +26,7 @@ extern lmc_media_t lmc_t1_media;
extern lmc_media_t lmc_hssi_media;
#ifdef _DBG_EVENTLOG
static void lmcEventLog( u_int32_t EventNum, u_int32_t arg2, u_int32_t arg3 );
static void lmcEventLog(u32 EventNum, u32 arg2, u32 arg3);
#endif
#endif
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/interrupt.h>
......@@ -48,10 +47,10 @@ void lmcConsoleLog(char *type, unsigned char *ucData, int iLen)
#endif
#ifdef DEBUG
u_int32_t lmcEventLogIndex = 0;
u_int32_t lmcEventLogBuf[LMC_EVENTLOGSIZE * LMC_EVENTLOGARGS];
u32 lmcEventLogIndex;
u32 lmcEventLogBuf[LMC_EVENTLOGSIZE * LMC_EVENTLOGARGS];
void lmcEventLog (u_int32_t EventNum, u_int32_t arg2, u_int32_t arg3)
void lmcEventLog(u32 EventNum, u32 arg2, u32 arg3)
{
lmcEventLogBuf[lmcEventLogIndex++] = EventNum;
lmcEventLogBuf[lmcEventLogIndex++] = arg2;
......
......@@ -38,15 +38,15 @@
#ifdef DEBUG
extern u_int32_t lmcEventLogIndex;
extern u_int32_t lmcEventLogBuf[LMC_EVENTLOGSIZE * LMC_EVENTLOGARGS];
extern u32 lmcEventLogIndex;
extern u32 lmcEventLogBuf[LMC_EVENTLOGSIZE * LMC_EVENTLOGARGS];
#define LMC_EVENT_LOG(x, y, z) lmcEventLog((x), (y), (z))
#else
#define LMC_EVENT_LOG(x,y,z)
#endif /* end ifdef _DBG_EVENTLOG */
void lmcConsoleLog(char *type, unsigned char *ucData, int iLen);
void lmcEventLog (u_int32_t EventNum, u_int32_t arg2, u_int32_t arg3);
void lmcEventLog(u32 EventNum, u32 arg2, u32 arg3);
void lmc_trace(struct net_device *dev, char *msg);
#endif
......@@ -61,7 +61,7 @@
/*
* IFTYPE defines
*/
#define LMC_PPP 1 /* use sppp interface */
#define LMC_PPP 1 /* use generic HDLC interface */
#define LMC_NET 2 /* use direct net interface */
#define LMC_RAW 3 /* use direct net interface */
......
This diff is collapsed.
......@@ -16,8 +16,6 @@
#include <linux/inet.h>
#include <linux/bitops.h>
#include <net/syncppp.h>
#include <asm/processor.h> /* Processor type for cache alignment. */
#include <asm/io.h>
#include <asm/dma.h>
......@@ -95,8 +93,7 @@ static void lmc_dummy_set_1 (lmc_softc_t * const, int);
static void lmc_dummy_set2_1 (lmc_softc_t * const, lmc_ctl_t *);
static inline void write_av9110_bit (lmc_softc_t *, int);
static void write_av9110 (lmc_softc_t *, u_int32_t, u_int32_t, u_int32_t,
u_int32_t, u_int32_t);
static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
lmc_media_t lmc_ds3_media = {
lmc_ds3_init, /* special media init stuff */
......@@ -427,7 +424,7 @@ lmc_ds3_set_scram (lmc_softc_t * const sc, int ie)
static int
lmc_ds3_get_link_status (lmc_softc_t * const sc)
{
u_int16_t link_status, link_status_11;
u16 link_status, link_status_11;
int ret = 1;
lmc_mii_writereg (sc, 0, 17, 7);
......@@ -449,7 +446,7 @@ lmc_ds3_get_link_status (lmc_softc_t * const sc)
(link_status & LMC_FRAMER_REG0_OOFS)){
ret = 0;
if(sc->last_led_err[3] != 1){
u16 r1;
u16 r1;
lmc_mii_writereg (sc, 0, 17, 01); /* Turn on Xbit error as our cisco does */
r1 = lmc_mii_readreg (sc, 0, 18);
r1 &= 0xfe;
......@@ -462,7 +459,7 @@ lmc_ds3_get_link_status (lmc_softc_t * const sc)
else {
lmc_led_off(sc, LMC_DS3_LED3); /* turn on red LED */
if(sc->last_led_err[3] == 1){
u16 r1;
u16 r1;
lmc_mii_writereg (sc, 0, 17, 01); /* Turn off Xbit error */
r1 = lmc_mii_readreg (sc, 0, 18);
r1 |= 0x01;
......@@ -540,20 +537,19 @@ lmc_ds3_watchdog (lmc_softc_t * const sc)
* SSI methods
*/
static void
lmc_ssi_init (lmc_softc_t * const sc)
static void lmc_ssi_init(lmc_softc_t * const sc)
{
u_int16_t mii17;
int cable;
u16 mii17;
int cable;
sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1000;
sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1000;
mii17 = lmc_mii_readreg (sc, 0, 17);
mii17 = lmc_mii_readreg(sc, 0, 17);
cable = (mii17 & LMC_MII17_SSI_CABLE_MASK) >> LMC_MII17_SSI_CABLE_SHIFT;
sc->ictl.cable_type = cable;
cable = (mii17 & LMC_MII17_SSI_CABLE_MASK) >> LMC_MII17_SSI_CABLE_SHIFT;
sc->ictl.cable_type = cable;
lmc_gpio_mkoutput (sc, LMC_GEP_SSI_TXCLOCK);
lmc_gpio_mkoutput(sc, LMC_GEP_SSI_TXCLOCK);
}
static void
......@@ -681,11 +677,11 @@ lmc_ssi_set_speed (lmc_softc_t * const sc, lmc_ctl_t * ctl)
static int
lmc_ssi_get_link_status (lmc_softc_t * const sc)
{
u_int16_t link_status;
u_int32_t ticks;
u16 link_status;
u32 ticks;
int ret = 1;
int hw_hdsk = 1;
/*
* missing CTS? Hmm. If we require CTS on, we may never get the
* link to come up, so omit it in this test.
......@@ -720,9 +716,9 @@ lmc_ssi_get_link_status (lmc_softc_t * const sc)
}
else if (ticks == 0 ) { /* no clock found ? */
ret = 0;
if(sc->last_led_err[3] != 1){
sc->stats.tx_lossOfClockCnt++;
printk(KERN_WARNING "%s: Lost Clock, Link Down\n", sc->name);
if (sc->last_led_err[3] != 1) {
sc->extra_stats.tx_lossOfClockCnt++;
printk(KERN_WARNING "%s: Lost Clock, Link Down\n", sc->name);
}
sc->last_led_err[3] = 1;
lmc_led_on (sc, LMC_MII16_LED3); /* turn ON red LED */
......@@ -838,9 +834,7 @@ write_av9110_bit (lmc_softc_t * sc, int c)
LMC_CSR_WRITE (sc, csr_gp, sc->lmc_gpio);
}
static void
write_av9110 (lmc_softc_t * sc, u_int32_t n, u_int32_t m, u_int32_t v,
u_int32_t x, u_int32_t r)
static void write_av9110(lmc_softc_t *sc, u32 n, u32 m, u32 v, u32 x, u32 r)
{
int i;
......@@ -887,19 +881,13 @@ write_av9110 (lmc_softc_t * sc, u_int32_t n, u_int32_t m, u_int32_t v,
| LMC_GEP_SSI_GENERATOR));
}
static void
lmc_ssi_watchdog (lmc_softc_t * const sc)
static void lmc_ssi_watchdog(lmc_softc_t * const sc)
{
u_int16_t mii17 = lmc_mii_readreg (sc, 0, 17);
if (((mii17 >> 3) & 7) == 7)
{
lmc_led_off (sc, LMC_MII16_LED2);
}
else
{
lmc_led_on (sc, LMC_MII16_LED2);
}
u16 mii17 = lmc_mii_readreg(sc, 0, 17);
if (((mii17 >> 3) & 7) == 7)
lmc_led_off(sc, LMC_MII16_LED2);
else
lmc_led_on(sc, LMC_MII16_LED2);
}
/*
......@@ -929,7 +917,7 @@ lmc_t1_read (lmc_softc_t * const sc, int a)
static void
lmc_t1_init (lmc_softc_t * const sc)
{
u_int16_t mii16;
u16 mii16;
int i;
sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1200;
......@@ -1028,7 +1016,7 @@ lmc_t1_set_status (lmc_softc_t * const sc, lmc_ctl_t * ctl)
*/ static int
lmc_t1_get_link_status (lmc_softc_t * const sc)
{
u_int16_t link_status;
u16 link_status;
int ret = 1;
/* LMC5245 (DS3) & LMC1200 (DS1) LED definitions
......
......@@ -36,9 +36,6 @@
#include <linux/workqueue.h>
#include <linux/proc_fs.h>
#include <linux/bitops.h>
#include <net/syncppp.h>
#include <asm/processor.h> /* Processor type for cache alignment. */
#include <asm/io.h>
#include <asm/dma.h>
......@@ -50,48 +47,6 @@
#include "lmc_ioctl.h"
#include "lmc_proto.h"
/*
* The compile-time variable SPPPSTUP causes the module to be
* compiled without referencing any of the sync ppp routines.
*/
#ifdef SPPPSTUB
#define SPPP_detach(d) (void)0
#define SPPP_open(d) 0
#define SPPP_reopen(d) (void)0
#define SPPP_close(d) (void)0
#define SPPP_attach(d) (void)0
#define SPPP_do_ioctl(d,i,c) -EOPNOTSUPP
#else
#define SPPP_attach(x) sppp_attach((x)->pd)
#define SPPP_detach(x) sppp_detach((x)->pd->dev)
#define SPPP_open(x) sppp_open((x)->pd->dev)
#define SPPP_reopen(x) sppp_reopen((x)->pd->dev)
#define SPPP_close(x) sppp_close((x)->pd->dev)
#define SPPP_do_ioctl(x, y, z) sppp_do_ioctl((x)->pd->dev, (y), (z))
#endif
// init
void lmc_proto_init(lmc_softc_t *sc) /*FOLD00*/
{
lmc_trace(sc->lmc_device, "lmc_proto_init in");
switch(sc->if_type){
case LMC_PPP:
sc->pd = kmalloc(sizeof(struct ppp_device), GFP_KERNEL);
if (!sc->pd) {
printk("lmc_proto_init(): kmalloc failure!\n");
return;
}
sc->pd->dev = sc->lmc_device;
sc->if_ptr = sc->pd;
break;
case LMC_RAW:
break;
default:
break;
}
lmc_trace(sc->lmc_device, "lmc_proto_init out");
}
// attach
void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/
{
......@@ -100,7 +55,6 @@ void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/
case LMC_PPP:
{
struct net_device *dev = sc->lmc_device;
SPPP_attach(sc);
dev->do_ioctl = lmc_ioctl;
}
break;
......@@ -108,7 +62,7 @@ void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/
{
struct net_device *dev = sc->lmc_device;
/*
* They set a few basics because they don't use sync_ppp
* They set a few basics because they don't use HDLC
*/
dev->flags |= IFF_POINTOPOINT;
......@@ -124,88 +78,39 @@ void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/
lmc_trace(sc->lmc_device, "lmc_proto_attach out");
}
// detach
void lmc_proto_detach(lmc_softc_t *sc) /*FOLD00*/
int lmc_proto_ioctl(lmc_softc_t *sc, struct ifreq *ifr, int cmd)
{
switch(sc->if_type){
case LMC_PPP:
SPPP_detach(sc);
break;
case LMC_RAW: /* Tell someone we're detaching? */
break;
default:
break;
}
lmc_trace(sc->lmc_device, "lmc_proto_ioctl");
if (sc->if_type == LMC_PPP)
return hdlc_ioctl(sc->lmc_device, ifr, cmd);
return -EOPNOTSUPP;
}
// reopen
void lmc_proto_reopen(lmc_softc_t *sc) /*FOLD00*/
int lmc_proto_open(lmc_softc_t *sc)
{
lmc_trace(sc->lmc_device, "lmc_proto_reopen in");
switch(sc->if_type){
case LMC_PPP:
SPPP_reopen(sc);
break;
case LMC_RAW: /* Reset the interface after being down, prerape to receive packets again */
break;
default:
break;
}
lmc_trace(sc->lmc_device, "lmc_proto_reopen out");
}
int ret = 0;
lmc_trace(sc->lmc_device, "lmc_proto_open in");
// ioctl
int lmc_proto_ioctl(lmc_softc_t *sc, struct ifreq *ifr, int cmd) /*FOLD00*/
{
lmc_trace(sc->lmc_device, "lmc_proto_ioctl out");
switch(sc->if_type){
case LMC_PPP:
return SPPP_do_ioctl (sc, ifr, cmd);
break;
default:
return -EOPNOTSUPP;
break;
}
lmc_trace(sc->lmc_device, "lmc_proto_ioctl out");
if (sc->if_type == LMC_PPP) {
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;
}
// open
void lmc_proto_open(lmc_softc_t *sc) /*FOLD00*/
void lmc_proto_close(lmc_softc_t *sc)
{
int ret;
lmc_trace(sc->lmc_device, "lmc_proto_close in");
lmc_trace(sc->lmc_device, "lmc_proto_open in");
switch(sc->if_type){
case LMC_PPP:
ret = SPPP_open(sc);
if(ret < 0)
printk("%s: syncPPP open failed: %d\n", sc->name, ret);
break;
case LMC_RAW: /* We're about to start getting packets! */
break;
default:
break;
}
lmc_trace(sc->lmc_device, "lmc_proto_open out");
}
// close
if (sc->if_type == LMC_PPP)
hdlc_close(sc->lmc_device);
void lmc_proto_close(lmc_softc_t *sc) /*FOLD00*/
{
lmc_trace(sc->lmc_device, "lmc_proto_close in");
switch(sc->if_type){
case LMC_PPP:
SPPP_close(sc);
break;
case LMC_RAW: /* Interface going down */
break;
default:
break;
}
lmc_trace(sc->lmc_device, "lmc_proto_close out");
lmc_trace(sc->lmc_device, "lmc_proto_close out");
}
__be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
......@@ -213,8 +118,8 @@ __be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
lmc_trace(sc->lmc_device, "lmc_proto_type in");
switch(sc->if_type){
case LMC_PPP:
return htons(ETH_P_WAN_PPP);
break;
return hdlc_type_trans(skb, sc->lmc_device);
break;
case LMC_NET:
return htons(ETH_P_802_2);
break;
......@@ -245,4 +150,3 @@ void lmc_proto_netif(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
}
lmc_trace(sc->lmc_device, "lmc_proto_netif out");
}
#ifndef _LMC_PROTO_H_
#define _LMC_PROTO_H_
void lmc_proto_init(lmc_softc_t *sc);
#include <linux/hdlc.h>
void lmc_proto_attach(lmc_softc_t *sc);
void lmc_proto_detach(lmc_softc_t *sc);
void lmc_proto_reopen(lmc_softc_t *sc);
int lmc_proto_ioctl(lmc_softc_t *sc, struct ifreq *ifr, int cmd);
void lmc_proto_open(lmc_softc_t *sc);
int lmc_proto_open(lmc_softc_t *sc);
void lmc_proto_close(lmc_softc_t *sc);
__be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb);
void lmc_proto_netif(lmc_softc_t *sc, struct sk_buff *skb);
int lmc_skb_rawpackets(char *buf, char **start, off_t offset, int len, int unused);
#endif
static inline lmc_softc_t* dev_to_sc(struct net_device *dev)
{
return (lmc_softc_t *)dev_to_hdlc(dev)->priv;
}
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -230,13 +230,6 @@ static void sppp_input (struct net_device *dev, struct sk_buff *skb)
skb->dev=dev;
skb_reset_mac_header(skb);
if (dev->flags & IFF_RUNNING)
{
/* Count received bytes, add FCS and one flag */
sp->ibytes+= skb->len + 3;
sp->ipkts++;
}
if (!pskb_may_pull(skb, PPP_HEADER_LEN)) {
/* Too small packet, drop it. */
if (sp->pp_flags & PP_DEBUG)
......@@ -832,7 +825,6 @@ static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type,
sppp_print_bytes ((u8*) (lh+1), len);
printk (">\n");
}
sp->obytes += skb->len;
/* Control is high priority so it doesn't get queued behind data */
skb->priority=TC_PRIO_CONTROL;
skb->dev = dev;
......@@ -875,7 +867,6 @@ static void sppp_cisco_send (struct sppp *sp, int type, u32 par1, u32 par2)
printk (KERN_WARNING "%s: cisco output: <%xh %xh %xh %xh %xh-%xh>\n",
dev->name, ntohl (ch->type), ch->par1,
ch->par2, ch->rel, ch->time0, ch->time1);
sp->obytes += skb->len;
skb->priority=TC_PRIO_CONTROL;
skb->dev = dev;
skb_queue_tail(&tx_queue, skb);
......
This diff is collapsed.
This diff is collapsed.
......@@ -43,8 +43,6 @@ struct sppp
u32 pp_rseq; /* remote sequence number */
struct slcp lcp; /* LCP params */
struct sipcp ipcp; /* IPCP params */
u32 ibytes,obytes; /* Bytes in/out */
u32 ipkts,opkts; /* Packets in/out */
struct timer_list pp_timer;
struct net_device *pp_if;
char pp_link_state; /* Link status */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment