diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
commit | 78c388aed2b7184182c08428db1de6c872d815f5 (patch) | |
tree | 4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /drivers/net/hamradio | |
parent | eb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff) |
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'drivers/net/hamradio')
-rw-r--r-- | drivers/net/hamradio/6pack.c | 2 | ||||
-rw-r--r-- | drivers/net/hamradio/baycom_epp.c | 14 | ||||
-rw-r--r-- | drivers/net/hamradio/baycom_par.c | 12 | ||||
-rw-r--r-- | drivers/net/hamradio/dmascc.c | 57 | ||||
-rw-r--r-- | drivers/net/hamradio/hdlcdrv.c | 1 | ||||
-rw-r--r-- | drivers/net/hamradio/mkiss.c | 1 | ||||
-rw-r--r-- | drivers/net/hamradio/soundmodem/sm.c | 6 | ||||
-rw-r--r-- | drivers/net/hamradio/z8530.h | 6 |
8 files changed, 60 insertions, 39 deletions
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 198ba1633..99bd59e9a 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -726,7 +726,7 @@ static int sp_open_dev(struct device *dev) #ifdef MODULE static int sixpack_init_ctrl_dev(void) #else /* !MODULE */ -__initfunc sixpack_init_ctrl_dev(struct device *dummy) +__initfunc(int sixpack_init_ctrl_dev(struct device *dummy)) #endif /* !MODULE */ { int status; diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 2a2f4e909..f7b3156fc 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c @@ -1010,14 +1010,6 @@ static struct net_device_stats *baycom_get_stats(struct device *dev) /* --------------------------------------------------------------------- */ -static int epp_preempt(void *handle) -{ - /* we cannot relinquish the port in the middle of an operation */ - return 1; -} - -/* --------------------------------------------------------------------- */ - static void epp_wakeup(void *handle) { struct device *dev = (struct device *)handle; @@ -1070,8 +1062,8 @@ static int epp_open(struct device *dev) } #endif memset(&bc->modem, 0, sizeof(bc->modem)); - if (!(bc->pdev = parport_register_device(pp, dev->name, epp_preempt, epp_wakeup, - epp_interrupt, PARPORT_DEV_LURK, dev))) { + if (!(bc->pdev = parport_register_device(pp, dev->name, NULL, epp_wakeup, + epp_interrupt, PARPORT_DEV_EXCL, dev))) { printk(KERN_ERR "%s: cannot register parport at 0x%lx\n", bc_drvname, pp->base); return -ENXIO; } @@ -1548,7 +1540,7 @@ __initfunc(void baycom_epp_setup(char *str, int *ints)) return; } baycom_ports[i].mode = str; - baycom_ports[i].irq = ints[1]; + baycom_ports[i].iobase = ints[1]; if (i < NR_PORTS-1) baycom_ports[i+1].mode = NULL; } diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c index e79a00ef6..bbc29e4c1 100644 --- a/drivers/net/hamradio/baycom_par.c +++ b/drivers/net/hamradio/baycom_par.c @@ -357,14 +357,6 @@ static void par96_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* --------------------------------------------------------------------- */ -static int par96_preempt(void *handle) -{ - /* we cannot relinquish the port in the middle of an operation */ - return 1; -} - -/* --------------------------------------------------------------------- */ - static void par96_wakeup(void *handle) { struct device *dev = (struct device *)handle; @@ -396,8 +388,8 @@ static int par96_open(struct device *dev) } memset(&bc->modem, 0, sizeof(bc->modem)); bc->hdrv.par.bitrate = 9600; - if (!(bc->pdev = parport_register_device(pp, dev->name, par96_preempt, par96_wakeup, - par96_interrupt, PARPORT_DEV_LURK, dev))) { + if (!(bc->pdev = parport_register_device(pp, dev->name, NULL, par96_wakeup, + par96_interrupt, PARPORT_DEV_EXCL, dev))) { printk(KERN_ERR "baycom_par: cannot register parport at 0x%lx\n", pp->base); return -ENXIO; } diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index bf453dc53..ac474d0b9 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c @@ -1,5 +1,5 @@ /* - * $Id: dmascc.c,v 1.2.1.4 1998/06/10 02:24:11 kudielka Exp $ + * $Id: dmascc.c,v 1.3 1998/09/07 04:41:56 kudielka Exp $ * * Driver for high-speed SCC boards (those with DMA support) * Copyright (C) 1997 Klaus Kudielka @@ -62,6 +62,14 @@ #define test_and_set_bit(x,y) set_bit(x,y) #define register_netdevice(x) register_netdev(x) #define unregister_netdevice(x) unregister_netdev(x) +#define dev_kfree_skb(x) dev_kfree_skb(x,FREE_WRITE) +#define SET_DEV_INIT(x) (x=dmascc_dev_init) + +#define SHDLCE 0x01 /* WR15 */ + +#define AUTOEOM 0x02 /* WR7' */ +#define RXFIFOH 0x08 +#define TXFIFOE 0x20 static int dmascc_dev_init(struct device *dev) { @@ -83,7 +91,7 @@ static void dev_init_buffers(struct device *dev) #include <linux/init.h> #include <asm/uaccess.h> -#define dmascc_dev_init NULL +#define SET_DEV_INIT(x) #endif @@ -286,7 +294,7 @@ static unsigned long rand; #ifdef MODULE -MODULE_AUTHOR("Klaus Kudielka <oe1kib@oe1xtu.ampr.org>"); +MODULE_AUTHOR("Klaus Kudielka"); MODULE_DESCRIPTION("Driver for high-speed SCC boards"); MODULE_PARM(io, "1-" __MODULE_STRING(MAX_NUM_DEVS) "i"); @@ -462,8 +470,8 @@ __initfunc(int setup_adapter(int io, int h, int n)) /* Reset 8530 */ write_scc(cmd, R9, FHWRES | MIE | NV); - /* Determine type of chip */ - write_scc(cmd, R15, 1); + /* Determine type of chip by enabling SDLC/HDLC enhancements */ + write_scc(cmd, R15, SHDLCE); if (!read_scc(cmd, R15)) { /* WR7' not present. This is an ordinary Z8530 SCC. */ chip = Z8530; @@ -575,7 +583,7 @@ __initfunc(int setup_adapter(int io, int h, int n)) dev->hard_header = ax25_encapsulate; dev->rebuild_header = ax25_rebuild_header; dev->set_mac_address = scc_set_mac_address; - dev->init = dmascc_dev_init; + SET_DEV_INIT(dev->init); dev->type = ARPHRD_AX25; dev->hard_header_len = 73; dev->mtu = 1500; @@ -662,17 +670,17 @@ static int scc_open(struct device *dev) switch (info->chip) { case Z85C30: /* Select WR7' */ - write_scc(cmd, R15, 1); + write_scc(cmd, R15, SHDLCE); /* Auto EOM reset */ - write_scc(cmd, R7, 0x02); + write_scc(cmd, R7, AUTOEOM); write_scc(cmd, R15, 0); break; case Z85230: /* Select WR7' */ - write_scc(cmd, R15, 1); + write_scc(cmd, R15, SHDLCE); /* RX FIFO half full (interrupt only), Auto EOM reset, TX FIFO empty (DMA only) */ - write_scc(cmd, R7, dev->dma ? 0x22 : 0x0a); + write_scc(cmd, R7, AUTOEOM | (dev->dma ? TXFIFOE : RXFIFOH)); write_scc(cmd, R15, 0); break; } @@ -958,6 +966,7 @@ static void special_condition(struct device *dev, int rc) { struct scc_priv *priv = dev->priv; int cb, cmd = priv->cmd; + unsigned long flags; /* See Figure 2-15. Only overrun and EOF need to be checked. */ @@ -968,9 +977,12 @@ static void special_condition(struct device *dev, int rc) } else if (rc & END_FR) { /* End of frame. Get byte count */ if (dev->dma) { + flags=claim_dma_lock(); disable_dma(dev->dma); clear_dma_ff(dev->dma); cb = BUF_SIZE - get_dma_residue(dev->dma) - 2; + release_dma_lock(flags); + } else { cb = priv->rx_ptr - 2; } @@ -1005,9 +1017,13 @@ static void special_condition(struct device *dev, int rc) } /* Get ready for new frame */ if (dev->dma) { + + flags=claim_dma_lock(); set_dma_addr(dev->dma, (int) priv->rx_buf[priv->rx_head]); set_dma_count(dev->dma, BUF_SIZE); enable_dma(dev->dma); + release_dma_lock(flags); + } else { priv->rx_ptr = 0; } @@ -1094,6 +1110,7 @@ static void es_isr(struct device *dev) struct scc_info *info = priv->info; int i, cmd = priv->cmd; int st, dst, res; + unsigned long flags; /* Read status and reset interrupt bit */ st = read_scc(cmd, R0); @@ -1110,9 +1127,11 @@ static void es_isr(struct device *dev) /* Get remaining bytes */ i = priv->tx_tail; if (dev->dma) { + flags=claim_dma_lock(); disable_dma(dev->dma); clear_dma_ff(dev->dma); res = get_dma_residue(dev->dma); + release_dma_lock(flags); } else { res = priv->tx_len[i] - priv->tx_ptr; if (res) write_scc(cmd, R0, RES_Tx_P); @@ -1125,9 +1144,11 @@ static void es_isr(struct device *dev) /* Check if another frame is available and we are allowed to transmit */ if (priv->tx_count && (jiffies - priv->tx_start) < priv->param.txtime) { if (dev->dma) { + flags=claim_dma_lock(); set_dma_addr(dev->dma, (int) priv->tx_buf[priv->tx_tail]); set_dma_count(dev->dma, priv->tx_len[priv->tx_tail]); enable_dma(dev->dma); + release_dma_lock(flags); } else { /* If we have an ESCC, we are allowed to write data bytes immediately. Otherwise we have to wait for the next @@ -1162,12 +1183,14 @@ static void es_isr(struct device *dev) if (st & DCD) { if (dev->dma) { /* Program DMA controller */ + flags=claim_dma_lock(); disable_dma(dev->dma); clear_dma_ff(dev->dma); set_dma_mode(dev->dma, DMA_MODE_READ); set_dma_addr(dev->dma, (int) priv->rx_buf[priv->rx_head]); set_dma_count(dev->dma, BUF_SIZE); enable_dma(dev->dma); + release_dma_lock(flags); /* Configure PackeTwin DMA */ if (info->type == TYPE_TWIN) { outb_p((dev->dma == 1) ? TWIN_DMA_HDX_R1 : TWIN_DMA_HDX_R3, @@ -1187,7 +1210,12 @@ static void es_isr(struct device *dev) } } else { /* Disable DMA */ - if (dev->dma) disable_dma(dev->dma); + if (dev->dma) + { + flags=claim_dma_lock(); + disable_dma(dev->dma); + release_dma_lock(flags); + } /* Disable receiver */ write_scc(cmd, R3, Rx8); /* DMA disable, RX int disable, Ext int enable */ @@ -1220,11 +1248,13 @@ static void es_isr(struct device *dev) while (read_scc(cmd, R0) & Rx_CH_AV) read_scc(cmd, R8); priv->rx_over = 0; if (dev->dma) { + flags=claim_dma_lock(); disable_dma(dev->dma); clear_dma_ff(dev->dma); set_dma_addr(dev->dma, (int) priv->rx_buf[priv->rx_head]); set_dma_count(dev->dma, BUF_SIZE); enable_dma(dev->dma); + release_dma_lock(flags); } else { priv->rx_ptr = 0; } @@ -1237,6 +1267,7 @@ static void tm_isr(struct device *dev) struct scc_priv *priv = dev->priv; struct scc_info *info = priv->info; int cmd = priv->cmd; + unsigned long flags; switch (priv->tx_state) { case TX_OFF: @@ -1258,12 +1289,16 @@ static void tm_isr(struct device *dev) priv->tx_state = TX_ACTIVE; if (dev->dma) { /* Program DMA controller */ + + flags=claim_dma_lock(); disable_dma(dev->dma); clear_dma_ff(dev->dma); set_dma_mode(dev->dma, DMA_MODE_WRITE); set_dma_addr(dev->dma, (int) priv->tx_buf[priv->tx_tail]); set_dma_count(dev->dma, priv->tx_len[priv->tx_tail]); enable_dma(dev->dma); + release_dma_lock(flags); + /* Configure PackeTwin DMA */ if (info->type == TYPE_TWIN) { outb_p((dev->dma == 1) ? TWIN_DMA_HDX_T1 : TWIN_DMA_HDX_T3, diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index 1b2ee9eac..258c5c58c 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c @@ -42,6 +42,7 @@ #include <linux/config.h> #include <linux/module.h> +#include <linux/version.h> #include <linux/types.h> #include <linux/net.h> #include <linux/in.h> diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 4d7b96c40..ab1ecab6a 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c @@ -894,7 +894,6 @@ static int ax_set_dev_mac_address(struct device *dev, void *addr) static int ax25_disp_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg) { struct ax_disp *ax = (struct ax_disp *)tty->disc_data; - int err; unsigned int tmp; /* First make sure we're connected. */ diff --git a/drivers/net/hamradio/soundmodem/sm.c b/drivers/net/hamradio/soundmodem/sm.c index fbfbb7e36..d1760af4b 100644 --- a/drivers/net/hamradio/soundmodem/sm.c +++ b/drivers/net/hamradio/soundmodem/sm.c @@ -554,17 +554,17 @@ static int sm_ioctl(struct device *dev, struct ifreq *ifr, cp = hi->data.modename; while (*hwp) { if ((*hwp)->hw_name) - cp += sprintf("%s:,", (*hwp)->hw_name); + cp += sprintf(cp, "%s:,", (*hwp)->hw_name); hwp++; } while (*mtp) { if ((*mtp)->name) - cp += sprintf(">%s,", (*mtp)->name); + cp += sprintf(cp, ">%s,", (*mtp)->name); mtp++; } while (*mrp) { if ((*mrp)->name) - cp += sprintf("<%s,", (*mrp)->name); + cp += sprintf(cp, "<%s,", (*mrp)->name); mrp++; } cp[-1] = '\0'; diff --git a/drivers/net/hamradio/z8530.h b/drivers/net/hamradio/z8530.h index 3d4a918d7..8bef54857 100644 --- a/drivers/net/hamradio/z8530.h +++ b/drivers/net/hamradio/z8530.h @@ -219,15 +219,17 @@ /* Read Register 15 (value of WR 15) */ -/* 8580/85180/85280 Enhanced SCC register definitions */ +/* Z85C30/Z85230 Enhanced SCC register definitions */ /* Write Register 7' (SDLC/HDLC Programmable Enhancements) */ #define AUTOTXF 0x01 /* Auto Tx Flag */ #define AUTOEOM 0x02 /* Auto EOM Latch Reset */ #define AUTORTS 0x04 /* Auto RTS */ #define TXDNRZI 0x08 /* TxD Pulled High in SDLC NRZI mode */ +#define RXFIFOH 0x08 /* Z85230: Int on RX FIFO half full */ #define FASTDTR 0x10 /* Fast DTR/REQ Mode */ #define CRCCBCR 0x20 /* CRC Check Bytes Completely Received */ +#define TXFIFOE 0x20 /* Z85230: Int on TX FIFO completely empty */ #define EXTRDEN 0x40 /* Extended Read Enabled */ /* Write Register 15 (external/status interrupt control) */ @@ -240,4 +242,4 @@ /* Read Register 7 (frame status FIFO) */ #define BCMSB 0x3f /* MSB of 14 bits count */ #define FDA 0x40 /* FIFO Data Available Status */ -#define FOY 0x80 /* FIFO Overflow Status */ +#define FOS 0x80 /* FIFO Overflow Status */ |