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,7 +300,7 @@
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
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.
......
......@@ -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_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_LANMEDIA) += syncppp.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>
......
......@@ -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);
......@@ -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
......
......@@ -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);
......@@ -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;
u16 mii17;
int cable;
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;
lmc_gpio_mkoutput (sc, LMC_GEP_SSI_TXCLOCK);
lmc_gpio_mkoutput(sc, LMC_GEP_SSI_TXCLOCK);
}
static void
......@@ -681,8 +677,8 @@ 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;
......@@ -720,8 +716,8 @@ 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++;
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;
......@@ -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);
u16 mii17 = lmc_mii_readreg(sc, 0, 17);
if (((mii17 >> 3) & 7) == 7)
{
lmc_led_off (sc, LMC_MII16_LED2);
}
lmc_led_off(sc, LMC_MII16_LED2);
else
{
lmc_led_on (sc, LMC_MII16_LED2);
}
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,87 +78,38 @@ 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;
}
}
// reopen
void lmc_proto_reopen(lmc_softc_t *sc) /*FOLD00*/
{
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");
}
// 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:
lmc_trace(sc->lmc_device, "lmc_proto_ioctl");
if (sc->if_type == LMC_PPP)
return hdlc_ioctl(sc->lmc_device, ifr, cmd);
return -EOPNOTSUPP;
break;
}
lmc_trace(sc->lmc_device, "lmc_proto_ioctl out");
}
// open
void lmc_proto_open(lmc_softc_t *sc) /*FOLD00*/
int lmc_proto_open(lmc_softc_t *sc)
{
int ret;
int ret = 0;
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;
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;
}
// close
void lmc_proto_close(lmc_softc_t *sc) /*FOLD00*/
void lmc_proto_close(lmc_softc_t *sc)
{
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;
}
if (sc->if_type == LMC_PPP)
hdlc_close(sc->lmc_device);
lmc_trace(sc->lmc_device, "lmc_proto_close out");
}
......@@ -213,7 +118,7 @@ __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);
return hdlc_type_trans(skb, sc->lmc_device);
break;
case LMC_NET:
return htons(ETH_P_802_2);
......@@ -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);
......
......@@ -43,6 +43,7 @@
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/delay.h>
#include <linux/hdlc.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <asm/dma.h>
......@@ -51,7 +52,6 @@
#define RT_UNLOCK
#include <linux/spinlock.h>
#include <net/syncppp.h>
#include "z85230.h"
......@@ -440,43 +440,38 @@ static void z8530_tx(struct z8530_channel *c)
* A status event occurred in PIO synchronous mode. There are several
* reasons the chip will bother us here. A transmit underrun means we
* failed to feed the chip fast enough and just broke a packet. A DCD
* change is a line up or down. We communicate that back to the protocol
* layer for synchronous PPP to renegotiate.
* change is a line up or down.
*/
static void z8530_status(struct z8530_channel *chan)
{
u8 status, altered;
status=read_zsreg(chan, R0);
altered=chan->status^status;
status = read_zsreg(chan, R0);
altered = chan->status ^ status;
chan->status=status;
chan->status = status;
if(status&TxEOM)
{
if (status & TxEOM) {
/* printk("%s: Tx underrun.\n", chan->dev->name); */
chan->stats.tx_fifo_errors++;
chan->netdevice->stats.tx_fifo_errors++;
write_zsctrl(chan, ERR_RES);
z8530_tx_done(chan);
}
if(altered&chan->dcdcheck)
{
if(status&chan->dcdcheck)
if (altered & chan->dcdcheck)
{
if (status & chan->dcdcheck) {
printk(KERN_INFO "%s: DCD raised\n", chan->dev->name);
write_zsreg(chan, R3, chan->regs[3]|RxENABLE);
if(chan->netdevice &&
((chan->netdevice->type == ARPHRD_HDLC) ||
(chan->netdevice->type == ARPHRD_PPP)))
sppp_reopen(chan->netdevice);
}
else
{
write_zsreg(chan, R3, chan->regs[3] | RxENABLE);
if (chan->netdevice)
netif_carrier_on(chan->netdevice);
} else {
printk(KERN_INFO "%s: DCD lost\n", chan->dev->name);
write_zsreg(chan, R3, chan->regs[3]&~RxENABLE);
write_zsreg(chan, R3, chan->regs[3] & ~RxENABLE);
z8530_flush_fifo(chan);
if (chan->netdevice)
netif_carrier_off(chan->netdevice);
}
}
......@@ -484,7 +479,7 @@ static void z8530_status(struct z8530_channel *chan)
write_zsctrl(chan, RES_H_IUS);
}
struct z8530_irqhandler z8530_sync=
struct z8530_irqhandler z8530_sync =
{
z8530_rx,
z8530_tx,
......@@ -556,8 +551,7 @@ static void z8530_dma_tx(struct z8530_channel *chan)
*
* A status event occurred on the Z8530. We receive these for two reasons
* when in DMA mode. Firstly if we finished a packet transfer we get one
* and kick the next packet out. Secondly we may see a DCD change and
* have to poke the protocol layer.
* and kick the next packet out. Secondly we may see a DCD change.
*
*/
......@@ -586,22 +580,19 @@ static void z8530_dma_status(struct z8530_channel *chan)
}
}
if(altered&chan->dcdcheck)
{
if(status&chan->dcdcheck)
if (altered & chan->dcdcheck)
{
if (status & chan->dcdcheck) {
printk(KERN_INFO "%s: DCD raised\n", chan->dev->name);
write_zsreg(chan, R3, chan->regs[3]|RxENABLE);
if(chan->netdevice &&
((chan->netdevice->type == ARPHRD_HDLC) ||
(chan->netdevice->type == ARPHRD_PPP)))
sppp_reopen(chan->netdevice);
}
else
{
write_zsreg(chan, R3, chan->regs[3] | RxENABLE);
if (chan->netdevice)
netif_carrier_on(chan->netdevice);
} else {
printk(KERN_INFO "%s:DCD lost\n", chan->dev->name);
write_zsreg(chan, R3, chan->regs[3]&~RxENABLE);
write_zsreg(chan, R3, chan->regs[3] & ~RxENABLE);
z8530_flush_fifo(chan);
if (chan->netdevice)
netif_carrier_off(chan->netdevice);
}
}
......@@ -1459,10 +1450,10 @@ static void z8530_tx_begin(struct z8530_channel *c)
/*
* Check if we crapped out.
*/
if(get_dma_residue(c->txdma))
if (get_dma_residue(c->txdma))
{
c->stats.tx_dropped++;
c->stats.tx_fifo_errors++;
c->netdevice->stats.tx_dropped++;
c->netdevice->stats.tx_fifo_errors++;
}
release_dma_lock(flags);
}
......@@ -1541,14 +1532,14 @@ static void z8530_tx_done(struct z8530_channel *c)
struct sk_buff *skb;
/* Actually this can happen.*/
if(c->tx_skb==NULL)
if (c->tx_skb == NULL)
return;
skb=c->tx_skb;
c->tx_skb=NULL;
skb = c->tx_skb;
c->tx_skb = NULL;
z8530_tx_begin(c);
c->stats.tx_packets++;
c->stats.tx_bytes+=skb->len;
c->netdevice->stats.tx_packets++;
c->netdevice->stats.tx_bytes += skb->len;
dev_kfree_skb_irq(skb);
}
......@@ -1558,7 +1549,7 @@ static void z8530_tx_done(struct z8530_channel *c)
* @skb: The buffer
*
* We point the receive handler at this function when idle. Instead
* of syncppp processing the frames we get to throw them away.
* of processing the frames we get to throw them away.
*/
void z8530_null_rx(struct z8530_channel *c, struct sk_buff *skb)
......@@ -1635,7 +1626,8 @@ static void z8530_rx_done(struct z8530_channel *c)
else
/* Can't occur as we dont reenable the DMA irq until
after the flip is done */
printk(KERN_WARNING "%s: DMA flip overrun!\n", c->netdevice->name);
printk(KERN_WARNING "%s: DMA flip overrun!\n",
c->netdevice->name);
release_dma_lock(flags);
......@@ -1647,25 +1639,21 @@ static void z8530_rx_done(struct z8530_channel *c)
* a copychecksum.
*/
skb=dev_alloc_skb(ct);
if(skb==NULL)
{
c->stats.rx_dropped++;
printk(KERN_WARNING "%s: Memory squeeze.\n", c->netdevice->name);
}
else
{
skb = dev_alloc_skb(ct);
if (skb == NULL) {
c->netdevice->stats.rx_dropped++;
printk(KERN_WARNING "%s: Memory squeeze.\n",
c->netdevice->name);
} else {
skb_put(skb, ct);
skb_copy_to_linear_data(skb, rxb, ct);
c->stats.rx_packets++;
c->stats.rx_bytes+=ct;
c->netdevice->stats.rx_packets++;
c->netdevice->stats.rx_bytes += ct;
}
c->dma_ready=1;
}
else
{
c->dma_ready = 1;
} else {
RT_LOCK;
skb=c->skb;
skb = c->skb;
/*
* The game we play for non DMA is similar. We want to
......@@ -1684,41 +1672,32 @@ static void z8530_rx_done(struct z8530_channel *c)
c->skb = c->skb2;
c->count = 0;
c->max = c->mtu;
if(c->skb)
{
if (c->skb) {
c->dptr = c->skb->data;
c->max = c->mtu;
}
else
{
c->count= 0;
} else {
c->count = 0;
c->max = 0;
}
RT_UNLOCK;
c->skb2 = dev_alloc_skb(c->mtu);
if(c->skb2==NULL)
if (c->skb2 == NULL)
printk(KERN_WARNING "%s: memory squeeze.\n",
c->netdevice->name);
else
{
skb_put(c->skb2,c->mtu);
}
c->stats.rx_packets++;
c->stats.rx_bytes+=ct;
skb_put(c->skb2, c->mtu);
c->netdevice->stats.rx_packets++;
c->netdevice->stats.rx_bytes += ct;
}
/*
* If we received a frame we must now process it.
*/
if(skb)
{
if (skb) {
skb_trim(skb, ct);
c->rx_function(c,skb);
}
else
{
c->stats.rx_dropped++;
c->rx_function(c, skb);
} else {
c->netdevice->stats.rx_dropped++;
printk(KERN_ERR "%s: Lost a frame\n", c->netdevice->name);
}
}
......@@ -1799,24 +1778,6 @@ int z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb)
EXPORT_SYMBOL(z8530_queue_xmit);
/**
* z8530_get_stats - Get network statistics
* @c: The channel to use
*
* Get the statistics block. We keep the statistics in software as
* the chip doesn't do it for us.
*
* Locking is ignored here - we could lock for a copy but its
* not likely to be that big an issue
*/
struct net_device_stats *z8530_get_stats(struct z8530_channel *c)
{
return &c->stats;
}
EXPORT_SYMBOL(z8530_get_stats);
/*
* Module support
*/
......
......@@ -325,7 +325,6 @@ struct z8530_channel
void *private; /* For our owner */
struct net_device *netdevice; /* Network layer device */
struct net_device_stats stats; /* Network layer statistics */
/*
* Async features
......@@ -366,7 +365,7 @@ struct z8530_channel
unsigned char tx_active; /* character is being xmitted */
unsigned char tx_stopped; /* output is suspended */
spinlock_t *lock; /* Devicr lock */
spinlock_t *lock; /* Device lock */
};
/*
......@@ -408,7 +407,6 @@ extern int z8530_sync_txdma_open(struct net_device *, struct z8530_channel *);
extern int z8530_sync_txdma_close(struct net_device *, struct z8530_channel *);
extern int z8530_channel_load(struct z8530_channel *, u8 *);
extern int z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb);
extern struct net_device_stats *z8530_get_stats(struct z8530_channel *c);
extern void z8530_null_rx(struct z8530_channel *c, struct sk_buff *skb);
......
......@@ -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 */
......
......@@ -57,7 +57,6 @@
#include <linux/vmalloc.h> /* vmalloc, vfree */
#include <asm/uaccess.h> /* copy_to/from_user */
#include <linux/init.h> /* __initfunc et al. */
#include <net/syncppp.h>
#define KMEM_SAFETYZONE 8
......@@ -567,9 +566,6 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
{
wanif_conf_t *cnf;
struct net_device *dev = NULL;
#ifdef CONFIG_WANPIPE_MULTPPP
struct ppp_device *pppdev=NULL;
#endif
int err;
if ((wandev->state == WAN_UNCONFIGURED) || (wandev->new_if == NULL))
......@@ -588,25 +584,10 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
goto out;
if (cnf->config_id == WANCONFIG_MPPP) {
#ifdef CONFIG_WANPIPE_MULTPPP
pppdev = kzalloc(sizeof(struct ppp_device), GFP_KERNEL);
err = -ENOBUFS;
if (pppdev == NULL)
goto out;
pppdev->dev = kzalloc(sizeof(struct net_device), GFP_KERNEL);
if (pppdev->dev == NULL) {
kfree(pppdev);
err = -ENOBUFS;
goto out;
}
err = wandev->new_if(wandev, (struct net_device *)pppdev, cnf);
dev = pppdev->dev;
#else
printk(KERN_INFO "%s: Wanpipe Mulit-Port PPP support has not been compiled in!\n",
wandev->name);
err = -EPROTONOSUPPORT;
goto out;
#endif
} else {
dev = kzalloc(sizeof(struct net_device), GFP_KERNEL);
err = -ENOBUFS;
......@@ -661,17 +642,9 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
kfree(dev->priv);
dev->priv = NULL;
#ifdef CONFIG_WANPIPE_MULTPPP
if (cnf->config_id == WANCONFIG_MPPP)
kfree(pppdev);
else
kfree(dev);
#else
/* Sync PPP is disabled */
if (cnf->config_id != WANCONFIG_MPPP)
kfree(dev);
#endif
out:
kfree(cnf);
return err;
......
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