Commit d1ebc3c8 authored by Jeff Garzik's avatar Jeff Garzik

Merge mandrakesoft.com:/home/jgarzik/vanilla/linus-2.5

into mandrakesoft.com:/home/jgarzik/repo/misc-2.5
parents 8cceac24 add91990
#!/bin/sh
# A script to format BK changeset output in a manner that is easy to read.
# Andreas Dilger <adilger@turbolabs.com> 13/02/2002
#
# Add diffstat output after Changelog <adilger@turbolabs.com> 21/02/2002
PROG=bksend
usage() {
echo "usage: $PROG -r<rev>"
echo -e "\twhere <rev> is of the form '1.23', '1.23..', '1.23..1.27',"
echo -e "\tor '+' to indicate the most recent revision"
exit 1
}
case $1 in
-r) REV=$2; shift ;;
-r*) REV=`echo $1 | sed 's/^-r//'` ;;
*) echo "$PROG: no revision given, you probably don't want that";;
esac
[ -z "$REV" ] && usage
echo "You can import this changeset into BK by piping this whole message to:"
echo "'| bk receive [path to repository]' or apply the patch as usual."
SEP="\n===================================================================\n\n"
echo -e $SEP
bk changes -r$REV
echo
bk export -tpatch -du -h -r$REV | diffstat
echo; echo
bk export -tpatch -du -h -r$REV
echo -e $SEP
bk send -wgzip_uu -r$REV -
#!/bin/sh
# bz64wrap - the sending side of a bzip2 | base64 stream
# Andreas Dilger <adilger@clusterfs.com> Jan 2002
PATH=$PATH:/usr/bin:/usr/local/bin:/usr/freeware/bin
# A program to generate base64 encoding on stdout
BASE64_ENCODE="uuencode -m /dev/stdout"
BASE64_BEGIN=
BASE64_END=
BZIP=NO
BASE64=NO
# Test if we have the bzip program installed
bzip2 -c /dev/null > /dev/null 2>&1 && BZIP=YES
# Test if uuencode can handle the -m (MIME) encoding option
$BASE64_ENCODE < /dev/null > /dev/null 2>&1 && BASE64=YES
if [ $BASE64 = NO ]; then
BASE64_ENCODE=mimencode
BASE64_BEGIN="begin-base64 644 -"
BASE64_END="===="
$BASE64_ENCODE < /dev/null > /dev/null 2>&1 && BASE64=YES
fi
if [ $BZIP = NO -o $BASE64 = NO ]; then
echo "$0: can't use bz64 encoding: bzip2=$BZIP, $BASE64_ENCODE=$BASE64"
exit 1
fi
# Sadly, mimencode does not appear to have good "begin" and "end" markers
# like uuencode does, and it is picky about getting the right start/end of
# the base64 stream, so we handle this internally.
echo "$BASE64_BEGIN"
bzip2 -9 | $BASE64_ENCODE
echo "$BASE64_END"
#!/usr/bin/perl5.6.1 -w #!/usr/bin/perl -w
use strict; use strict;
......
#!/usr/bin/perl5.6.1 -w #!/usr/bin/perl -w
use strict; use strict;
......
#!/bin/sh
# unbz64wrap - the receiving side of a bzip2 | base64 stream
# Andreas Dilger <adilger@clusterfs.com> Jan 2002
# Sadly, mimencode does not appear to have good "begin" and "end" markers
# like uuencode does, and it is picky about getting the right start/end of
# the base64 stream, so we handle this explicitly here.
PATH=$PATH:/usr/bin:/usr/local/bin:/usr/freeware/bin
if mimencode -u < /dev/null > /dev/null 2>&1 ; then
SHOW=
while read LINE; do
case $LINE in
begin-base64*) SHOW=YES ;;
====) SHOW= ;;
*) [ "$SHOW" ] && echo $LINE ;;
esac
done | mimencode -u | bunzip2
exit $?
else
cat - | uudecode -o /dev/stdout | bunzip2
exit $?
fi
...@@ -59,8 +59,8 @@ z8530book.sgml: z8530book.tmpl $(TOPDIR)/drivers/net/wan/z85230.c ...@@ -59,8 +59,8 @@ z8530book.sgml: z8530book.tmpl $(TOPDIR)/drivers/net/wan/z85230.c
$(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/net/wan/z85230.c \ $(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/net/wan/z85230.c \
<z8530book.tmpl >z8530book.sgml <z8530book.tmpl >z8530book.sgml
via-audio.sgml: via-audio.tmpl $(TOPDIR)/drivers/sound/via82cxxx_audio.c via-audio.sgml: via-audio.tmpl $(TOPDIR)/sound/oss/via82cxxx_audio.c
$(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/sound/via82cxxx_audio.c \ $(TOPDIR)/scripts/docgen $(TOPDIR)/sound/oss/via82cxxx_audio.c \
<via-audio.tmpl >via-audio.sgml <via-audio.tmpl >via-audio.sgml
tulip-user.sgml: tulip-user.tmpl tulip-user.sgml: tulip-user.tmpl
...@@ -100,8 +100,8 @@ APISOURCES := $(TOPDIR)/drivers/media/video/videodev.c \ ...@@ -100,8 +100,8 @@ APISOURCES := $(TOPDIR)/drivers/media/video/videodev.c \
$(TOPDIR)/drivers/hotplug/pci_hotplug_core.c \ $(TOPDIR)/drivers/hotplug/pci_hotplug_core.c \
$(TOPDIR)/drivers/hotplug/pci_hotplug_util.c \ $(TOPDIR)/drivers/hotplug/pci_hotplug_util.c \
$(TOPDIR)/drivers/block/ll_rw_blk.c \ $(TOPDIR)/drivers/block/ll_rw_blk.c \
$(TOPDIR)/drivers/sound/sound_core.c \ $(TOPDIR)/sound/sound_core.c \
$(TOPDIR)/drivers/sound/sound_firmware.c \ $(TOPDIR)/sound/sound_firmware.c \
$(TOPDIR)/drivers/net/wan/syncppp.c \ $(TOPDIR)/drivers/net/wan/syncppp.c \
$(TOPDIR)/drivers/net/wan/z85230.c \ $(TOPDIR)/drivers/net/wan/z85230.c \
$(TOPDIR)/drivers/usb/hcd.c \ $(TOPDIR)/drivers/usb/hcd.c \
......
...@@ -587,7 +587,9 @@ Version 1.1.4 ...@@ -587,7 +587,9 @@ Version 1.1.4
<chapter id="intfunctions"> <chapter id="intfunctions">
<title>Internal Functions</title> <title>Internal Functions</title>
!Idrivers/sound/via82cxxx_audio.c !Isound/oss/via82cxxx_audio.c
</chapter> </chapter>
</book> </book>
...@@ -42,10 +42,6 @@ ...@@ -42,10 +42,6 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/version.h> #include <linux/version.h>
#ifdef CONFIG_PCI
#define ENABLE_PCI
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/major.h> #include <linux/major.h>
...@@ -63,15 +59,8 @@ ...@@ -63,15 +59,8 @@
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#ifdef ENABLE_PCI
#include <linux/pci.h> #include <linux/pci.h>
#if (LINUX_VERSION_CODE < 0x020163) /* 2.1.99 */
#include <linux/bios32.h>
#endif
#endif
#if (LINUX_VERSION_CODE >= 131343) /* 2.1.15 -- XX get correct version */
#include <linux/init.h> #include <linux/init.h>
#endif
#include "rocket_int.h" #include "rocket_int.h"
#ifdef LOCAL_ROCKET_H #ifdef LOCAL_ROCKET_H
...@@ -154,7 +143,6 @@ static unsigned long time_stat_long; ...@@ -154,7 +143,6 @@ static unsigned long time_stat_long;
static unsigned long time_counter; static unsigned long time_counter;
#endif #endif
#if ((LINUX_VERSION_CODE > 0x020111) && defined(MODULE))
MODULE_AUTHOR("Theodore Ts'o"); MODULE_AUTHOR("Theodore Ts'o");
MODULE_DESCRIPTION("Comtrol Rocketport driver"); MODULE_DESCRIPTION("Comtrol Rocketport driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -170,39 +158,8 @@ MODULE_PARM(controller, "i"); ...@@ -170,39 +158,8 @@ MODULE_PARM(controller, "i");
MODULE_PARM_DESC(controller, "I/O port for (ISA) rocketport controller"); MODULE_PARM_DESC(controller, "I/O port for (ISA) rocketport controller");
MODULE_PARM(support_low_speed, "i"); MODULE_PARM(support_low_speed, "i");
MODULE_PARM_DESC(support_low_speed, "0 means support 50 baud, 1 means support 460400 baud"); MODULE_PARM_DESC(support_low_speed, "0 means support 50 baud, 1 means support 460400 baud");
#endif
#if (LINUX_VERSION_CODE < 131336)
int copy_from_user(void *to, const void *from_user, unsigned long len)
{
int error;
error = verify_area(VERIFY_READ, from_user, len);
if (error)
return len;
memcpy_fromfs(to, from_user, len);
return 0;
}
int copy_to_user(void *to_user, const void *from, unsigned long len)
{
int error;
error = verify_area(VERIFY_WRITE, to_user, len);
if (error)
return len;
memcpy_tofs(to_user, from, len);
return 0;
}
static inline int signal_pending(struct task_struct *p)
{
return (p->signal & ~p->blocked) != 0;
}
#else
#include <asm/uaccess.h> #include <asm/uaccess.h>
#endif
/* /*
* tmp_buf is used as a temporary buffer by rp_write. We need to * tmp_buf is used as a temporary buffer by rp_write. We need to
...@@ -497,7 +454,7 @@ static void rp_do_poll(unsigned long dummy) ...@@ -497,7 +454,7 @@ static void rp_do_poll(unsigned long dummy)
continue; continue;
ctlp= sCtlNumToCtlPtr(ctrl); ctlp= sCtlNumToCtlPtr(ctrl);
#ifdef ENABLE_PCI #ifdef CONFIG_PCI
if(ctlp->BusType == isPCI) if(ctlp->BusType == isPCI)
CtlMask= sPCIGetControllerIntStatus(ctlp); CtlMask= sPCIGetControllerIntStatus(ctlp);
else else
...@@ -611,12 +568,6 @@ static void init_r_port(int board, int aiop, int chan) ...@@ -611,12 +568,6 @@ static void init_r_port(int board, int aiop, int chan)
rp_table[line] = info; rp_table[line] = info;
} }
#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */
static int baud_table[] = {
0, 50, 75, 110, 134, 150, 200, 300,
600, 1200, 1800, 2400, 4800, 9600, 19200,
38400, 57600, 115200, 230400, 460800, 0 };
#endif
/* /*
* This routine configures a rocketport port so according to its * This routine configures a rocketport port so according to its
...@@ -627,9 +578,6 @@ static void configure_r_port(struct r_port *info) ...@@ -627,9 +578,6 @@ static void configure_r_port(struct r_port *info)
unsigned cflag; unsigned cflag;
unsigned long flags; unsigned long flags;
int bits, baud; int bits, baud;
#if (LINUX_VERSION_CODE < 131393) /* Linux 2.1.65 */
int i;
#endif
CHANNEL_t *cp; CHANNEL_t *cp;
if (!info->tty || !info->tty->termios) if (!info->tty || !info->tty->termios)
...@@ -665,31 +613,9 @@ static void configure_r_port(struct r_port *info) ...@@ -665,31 +613,9 @@ static void configure_r_port(struct r_port *info)
} }
/* baud rate */ /* baud rate */
#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */
i = cflag & CBAUD;
if (i & CBAUDEX) {
i &= ~CBAUDEX;
if (i < 1 || i > 4)
info->tty->termios->c_cflag &= ~CBAUDEX;
else
i += 15;
}
if (i == 15) {
if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_HI)
i += 1;
if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_VHI)
i += 2;
if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_SHI)
i += 3;
if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_WARP)
i += 4;
}
baud = baud_table[i] ? baud_table[i] : 9600;
#else
baud = tty_get_baud_rate(info->tty); baud = tty_get_baud_rate(info->tty);
if (!baud) if (!baud)
baud = 9600; baud = 9600;
#endif
info->cps = baud / bits; info->cps = baud / bits;
sSetBaud(cp, (rp_baud_base/baud) - 1); sSetBaud(cp, (rp_baud_base/baud) - 1);
...@@ -990,7 +916,6 @@ static int rp_open(struct tty_struct *tty, struct file * filp) ...@@ -990,7 +916,6 @@ static int rp_open(struct tty_struct *tty, struct file * filp)
info->flags |= ROCKET_INITIALIZED; info->flags |= ROCKET_INITIALIZED;
#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */
/* /*
* Set up the tty->alt_speed kludge * Set up the tty->alt_speed kludge
*/ */
...@@ -1002,7 +927,6 @@ static int rp_open(struct tty_struct *tty, struct file * filp) ...@@ -1002,7 +927,6 @@ static int rp_open(struct tty_struct *tty, struct file * filp)
info->tty->alt_speed = 230400; info->tty->alt_speed = 230400;
if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_WARP) if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_WARP)
info->tty->alt_speed = 460800; info->tty->alt_speed = 460800;
#endif
configure_r_port(info); configure_r_port(info);
if (tty->termios->c_cflag & CBAUD) { if (tty->termios->c_cflag & CBAUD) {
...@@ -1094,10 +1018,8 @@ static void rp_close(struct tty_struct *tty, struct file * filp) ...@@ -1094,10 +1018,8 @@ static void rp_close(struct tty_struct *tty, struct file * filp)
* If transmission was throttled by the application request, * If transmission was throttled by the application request,
* just flush the xmit buffer. * just flush the xmit buffer.
*/ */
#if (LINUX_VERSION_CODE >= 131343)
if (tty->flow_stopped) if (tty->flow_stopped)
rp_flush_buffer(tty); rp_flush_buffer(tty);
#endif
/* /*
* Wait for the transmit buffer to clear * Wait for the transmit buffer to clear
...@@ -1218,17 +1140,6 @@ static void rp_set_termios(struct tty_struct *tty, struct termios *old_termios) ...@@ -1218,17 +1140,6 @@ static void rp_set_termios(struct tty_struct *tty, struct termios *old_termios)
/* /*
* Here are the routines used by rp_ioctl * Here are the routines used by rp_ioctl
*/ */
#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */
static void send_break( struct r_port * info, int duration)
{
current->state = TASK_INTERRUPTIBLE;
cli();
sSendBreak(&info->channel);
schedule_timeout(duration);
sClrBreak(&info->channel);
sti();
}
#else
static void rp_break(struct tty_struct *tty, int break_state) static void rp_break(struct tty_struct *tty, int break_state)
{ {
struct r_port * info = (struct r_port *)tty->driver_data; struct r_port * info = (struct r_port *)tty->driver_data;
...@@ -1245,7 +1156,6 @@ static void rp_break(struct tty_struct *tty, int break_state) ...@@ -1245,7 +1156,6 @@ static void rp_break(struct tty_struct *tty, int break_state)
} }
restore_flags(flags); restore_flags(flags);
} }
#endif
static int get_modem_info(struct r_port * info, unsigned int *value) static int get_modem_info(struct r_port * info, unsigned int *value)
{ {
...@@ -1348,7 +1258,6 @@ static int set_config(struct r_port * info, struct rocket_config * new_info) ...@@ -1348,7 +1258,6 @@ static int set_config(struct r_port * info, struct rocket_config * new_info)
info->close_delay = new_serial.close_delay; info->close_delay = new_serial.close_delay;
info->closing_wait = new_serial.closing_wait; info->closing_wait = new_serial.closing_wait;
#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */
if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_HI) if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_HI)
info->tty->alt_speed = 57600; info->tty->alt_speed = 57600;
if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_VHI) if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_VHI)
...@@ -1357,7 +1266,6 @@ static int set_config(struct r_port * info, struct rocket_config * new_info) ...@@ -1357,7 +1266,6 @@ static int set_config(struct r_port * info, struct rocket_config * new_info)
info->tty->alt_speed = 230400; info->tty->alt_speed = 230400;
if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_WARP) if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_WARP)
info->tty->alt_speed = 460800; info->tty->alt_speed = 460800;
#endif
configure_r_port(info); configure_r_port(info);
return 0; return 0;
...@@ -1389,54 +1297,13 @@ static int rp_ioctl(struct tty_struct *tty, struct file * file, ...@@ -1389,54 +1297,13 @@ static int rp_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct r_port * info = (struct r_port *)tty->driver_data; struct r_port * info = (struct r_port *)tty->driver_data;
#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */
int retval, tmp;
#endif
if (cmd != RCKP_GET_PORTS && if (cmd != RCKP_GET_PORTS &&
rocket_paranoia_check(info, tty->device, "rp_ioctl")) rocket_paranoia_check(info, tty->device, "rp_ioctl"))
return -ENODEV; return -ENODEV;
switch (cmd) { switch (cmd) {
#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */
case TCSBRK: /* SVID version: non-zero arg --> no break */
retval = tty_check_change(tty);
if (retval)
return retval;
tty_wait_until_sent(tty, 0);
if (signal_pending(current))
return -EINTR;
if (!arg) {
send_break(info, HZ/4); /* 1/4 second */
if (signal_pending(current))
return -EINTR;
}
return 0;
case TCSBRKP: /* support for POSIX tcsendbreak() */
retval = tty_check_change(tty);
if (retval)
return retval;
tty_wait_until_sent(tty, 0);
if (signal_pending(current))
return -EINTR;
send_break(info, arg ? arg*(HZ/10) : HZ/4);
if (signal_pending(current))
return -EINTR;
return 0;
case TIOCGSOFTCAR:
tmp = C_CLOCAL(tty) ? 1 : 0;
if (copy_to_user((void *)arg, &tmp, sizeof(int)))
return -EFAULT;
return 0;
case TIOCSSOFTCAR:
if (copy_from_user(&tmp, (void *)arg, sizeof(int)))
return -EFAULT;
tty->termios->c_cflag =
((tty->termios->c_cflag & ~CLOCAL) |
(tmp ? CLOCAL : 0));
return 0;
#endif
case TIOCMGET: case TIOCMGET:
return get_modem_info(info, (unsigned int *) arg); return get_modem_info(info, (unsigned int *) arg);
case TIOCMBIS: case TIOCMBIS:
...@@ -1877,36 +1744,7 @@ static void rp_flush_buffer(struct tty_struct *tty) ...@@ -1877,36 +1744,7 @@ static void rp_flush_buffer(struct tty_struct *tty)
sFlushTxFIFO(cp); sFlushTxFIFO(cp);
} }
#ifdef ENABLE_PCI #ifdef CONFIG_PCI
#if (LINUX_VERSION_CODE < 0x020163) /* 2.1.99 */
/* For compatibility */
static struct pci_dev *pci_find_slot(unsigned char bus,
unsigned char device_fn)
{
unsigned short vendor_id, device_id;
int ret, error;
static struct pci_dev ret_struct;
error = pcibios_read_config_word(bus, device_fn, PCI_VENDOR_ID,
&vendor_id);
ret = pcibios_read_config_word(bus, device_fn, PCI_DEVICE_ID,
&device_id);
if (error == 0)
error = ret;
if (error) {
printk("PCI RocketPort error: %s not initializing due to error"
"reading configuration space\n",
pcibios_strerror(error));
return(0);
}
memset(&ret_struct, 0, sizeof(ret_struct));
ret_struct.device = device_id;
return &ret_struct;
}
#endif
int __init register_PCI(int i, unsigned int bus, unsigned int device_fn) int __init register_PCI(int i, unsigned int bus, unsigned int device_fn)
{ {
...@@ -1915,10 +1753,6 @@ int __init register_PCI(int i, unsigned int bus, unsigned int device_fn) ...@@ -1915,10 +1753,6 @@ int __init register_PCI(int i, unsigned int bus, unsigned int device_fn)
char *str; char *str;
CONTROLLER_t *ctlp; CONTROLLER_t *ctlp;
struct pci_dev *dev = pci_find_slot(bus, device_fn); struct pci_dev *dev = pci_find_slot(bus, device_fn);
#if (LINUX_VERSION_CODE < 0x020163) /* 2.1.99 */
int ret;
unsigned int port;
#endif
if (!dev) if (!dev)
return 0; return 0;
...@@ -2161,7 +1995,7 @@ int __init rp_init(void) ...@@ -2161,7 +1995,7 @@ int __init rp_init(void)
if(init_ISA(i, &reserved_controller)) if(init_ISA(i, &reserved_controller))
isa_boards_found++; isa_boards_found++;
} }
#ifdef ENABLE_PCI #ifdef CONFIG_PCI
if (pcibios_present()) { if (pcibios_present()) {
if(isa_boards_found < NUM_BOARDS) if(isa_boards_found < NUM_BOARDS)
pci_boards_found = init_PCI(isa_boards_found); pci_boards_found = init_PCI(isa_boards_found);
...@@ -2219,13 +2053,9 @@ int __init rp_init(void) ...@@ -2219,13 +2053,9 @@ int __init rp_init(void)
rocket_driver.stop = rp_stop; rocket_driver.stop = rp_stop;
rocket_driver.start = rp_start; rocket_driver.start = rp_start;
rocket_driver.hangup = rp_hangup; rocket_driver.hangup = rp_hangup;
#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */
rocket_driver.break_ctl = rp_break; rocket_driver.break_ctl = rp_break;
#endif
#if (LINUX_VERSION_CODE >= 131343)
rocket_driver.send_xchar = rp_send_xchar; rocket_driver.send_xchar = rp_send_xchar;
rocket_driver.wait_until_sent = rp_wait_until_sent; rocket_driver.wait_until_sent = rp_wait_until_sent;
#endif
/* /*
* The callout device is just like normal device except for * The callout device is just like normal device except for
......
...@@ -1397,15 +1397,6 @@ udelay(10000); ...@@ -1397,15 +1397,6 @@ udelay(10000);
return; return;
} }
void free_stuff(munich_board_t *board, struct comx_channel *ch)
{
/* Free CCB and the interrupt queues */
if (board->ccb) kfree((void *)board->ccb);
if (board->tiq) kfree((void *)board->tiq);
if (board->riq) kfree((void *)board->riq);
if (board->piq) kfree((void *)board->piq);
}
/* /*
* Hardware open routine. * Hardware open routine.
* Called by comx (upper) layer when the user wants to bring up the interface * Called by comx (upper) layer when the user wants to bring up the interface
...@@ -1488,7 +1479,6 @@ static int MUNICH_open(struct net_device *dev) ...@@ -1488,7 +1479,6 @@ static int MUNICH_open(struct net_device *dev)
if (board->tiq == NULL) if (board->tiq == NULL)
{ {
spin_unlock_irqrestore(&mister_lock, flags); spin_unlock_irqrestore(&mister_lock, flags);
free_stuff(board, ch);
return -ENOMEM; return -ENOMEM;
} }
memset((void *)board->tiq, 0, MUNICH_INTQSIZE); memset((void *)board->tiq, 0, MUNICH_INTQSIZE);
...@@ -1497,7 +1487,6 @@ static int MUNICH_open(struct net_device *dev) ...@@ -1497,7 +1487,6 @@ static int MUNICH_open(struct net_device *dev)
if (board->riq == NULL) if (board->riq == NULL)
{ {
spin_unlock_irqrestore(&mister_lock, flags); spin_unlock_irqrestore(&mister_lock, flags);
free_stuff(board, ch);
return -ENOMEM; return -ENOMEM;
} }
memset((void *)board->riq, 0, MUNICH_INTQSIZE); memset((void *)board->riq, 0, MUNICH_INTQSIZE);
...@@ -1506,7 +1495,6 @@ static int MUNICH_open(struct net_device *dev) ...@@ -1506,7 +1495,6 @@ static int MUNICH_open(struct net_device *dev)
if (board->piq == NULL) if (board->piq == NULL)
{ {
spin_unlock_irqrestore(&mister_lock, flags); spin_unlock_irqrestore(&mister_lock, flags);
free_stuff(board, ch);
return -ENOMEM; return -ENOMEM;
} }
memset((void *)board->piq, 0, MUNICH_PIQSIZE); memset((void *)board->piq, 0, MUNICH_PIQSIZE);
...@@ -1527,7 +1515,6 @@ static int MUNICH_open(struct net_device *dev) ...@@ -1527,7 +1515,6 @@ static int MUNICH_open(struct net_device *dev)
board->pci->irq); board->pci->irq);
/* TOD: free other resources (a sok malloc feljebb) */ /* TOD: free other resources (a sok malloc feljebb) */
spin_unlock_irqrestore(&mister_lock, flags); spin_unlock_irqrestore(&mister_lock, flags);
free_stuff(board, ch);
return -EAGAIN; return -EAGAIN;
} }
board->irq = board->pci->irq; /* csak akkor legyen != 0, ha tenyleg le van foglalva nekunk */ board->irq = board->pci->irq; /* csak akkor legyen != 0, ha tenyleg le van foglalva nekunk */
...@@ -1597,7 +1584,6 @@ static int MUNICH_open(struct net_device *dev) ...@@ -1597,7 +1584,6 @@ static int MUNICH_open(struct net_device *dev)
free_irq(board->irq, (void *)board); /* TOD: free other resources too *//* maybe shut down hw? */ free_irq(board->irq, (void *)board); /* TOD: free other resources too *//* maybe shut down hw? */
board->irq = 0; board->irq = 0;
spin_unlock_irqrestore(&mister_lock, flags); spin_unlock_irqrestore(&mister_lock, flags);
free_stuff(board, ch);
return -EAGAIN; return -EAGAIN;
} }
else if (!(stat & STAT_PCMA)) else if (!(stat & STAT_PCMA))
...@@ -1608,7 +1594,6 @@ static int MUNICH_open(struct net_device *dev) ...@@ -1608,7 +1594,6 @@ static int MUNICH_open(struct net_device *dev)
free_irq(board->irq, (void *)board); /* TOD: free other resources too *//* maybe shut off the hw? */ free_irq(board->irq, (void *)board); /* TOD: free other resources too *//* maybe shut off the hw? */
board->irq = 0; board->irq = 0;
spin_unlock_irqrestore(&mister_lock, flags); spin_unlock_irqrestore(&mister_lock, flags);
free_stuff(board, ch);
return -EIO; return -EIO;
} }
...@@ -1670,7 +1655,7 @@ static int MUNICH_open(struct net_device *dev) ...@@ -1670,7 +1655,7 @@ static int MUNICH_open(struct net_device *dev)
spin_unlock_irqrestore(&mister_lock, flags); spin_unlock_irqrestore(&mister_lock, flags);
dev->irq = board->irq; /* hogy szep legyen az ifconfig outputja */ dev->irq = board->irq; /* hogy szep legyen az ifconfig outputja */
ccb = board->ccb; /* TOD: ez igy csunya egy kicsit hogy benn is meg kinn is beletoltom :( */ ccb = board->ccb; /* TODO: ez igy csunya egy kicsit hogy benn is meg kinn is beletoltom :( */
spin_lock_irqsave(&mister_lock, flags); spin_lock_irqsave(&mister_lock, flags);
...@@ -1680,13 +1665,12 @@ static int MUNICH_open(struct net_device *dev) ...@@ -1680,13 +1665,12 @@ static int MUNICH_open(struct net_device *dev)
/* Check if the selected timeslots aren't used already */ /* Check if the selected timeslots aren't used already */
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
if (((1 << i) & timeslots) && ccb->timeslot_spec[i].tti == 0) if (((1 << i) & timeslots) && !ccb->timeslot_spec[i].tti)
{ {
printk("MUNICH_open: %s: timeslot %d already used by %s\n", printk("MUNICH_open: %s: timeslot %d already used by %s\n",
dev->name, i, board->twins[ccb->timeslot_spec[i].txchannel]->name); dev->name, i, board->twins[ccb->timeslot_spec[i].txchannel]->name);
spin_unlock_irqrestore(&mister_lock, flags); spin_unlock_irqrestore(&mister_lock, flags);
free_stuff(board, ch); return -EBUSY; /* TODO: lehet hogy valami mas errno kellene? */
return -EBUSY; /* TOD: lehet hogy valami mas errno kellene? */
} }
/* find a free channel: */ /* find a free channel: */
...@@ -1700,7 +1684,6 @@ static int MUNICH_open(struct net_device *dev) ...@@ -1700,7 +1684,6 @@ static int MUNICH_open(struct net_device *dev)
("MUNICH_open: %s: FATAL: can not find a free channel - this should not happen!\n", ("MUNICH_open: %s: FATAL: can not find a free channel - this should not happen!\n",
dev->name); dev->name);
spin_unlock_irqrestore(&mister_lock, flags); spin_unlock_irqrestore(&mister_lock, flags);
free_stuff(board, ch);
return -ENODEV; return -ENODEV;
} }
if (board->twins[channel] == NULL) if (board->twins[channel] == NULL)
...@@ -1998,7 +1981,7 @@ static int MUNICH_close(struct net_device *dev) ...@@ -1998,7 +1981,7 @@ static int MUNICH_close(struct net_device *dev)
spin_lock_irqsave(&mister_lock, flags); spin_lock_irqsave(&mister_lock, flags);
board->use_count--; if (board->use_count) board->use_count--;
if (!board->use_count) /* we were the last user of the board */ if (!board->use_count) /* we were the last user of the board */
{ {
...@@ -2020,7 +2003,12 @@ static int MUNICH_close(struct net_device *dev) ...@@ -2020,7 +2003,12 @@ static int MUNICH_close(struct net_device *dev)
free_irq(board->irq, (void *)board); /* Ha nem inicializalta magat, akkor meg nincs irq */ free_irq(board->irq, (void *)board); /* Ha nem inicializalta magat, akkor meg nincs irq */
board->irq = 0; board->irq = 0;
free_stuff(board, ch); /* Free CCB and the interrupt queues */
if (board->ccb) kfree((void *)board->ccb);
if (board->tiq) kfree((void *)board->tiq);
if (board->riq) kfree((void *)board->riq);
if (board->piq) kfree((void *)board->piq);
board->ccb = board->tiq = board->riq = board->piq = NULL;
} }
/* Enable setting of hw parameters */ /* Enable setting of hw parameters */
......
...@@ -105,7 +105,9 @@ static const struct { ...@@ -105,7 +105,9 @@ static const struct {
{0x41445340, "Analog Devices AD1881", &null_ops}, {0x41445340, "Analog Devices AD1881", &null_ops},
{0x41445348, "Analog Devices AD1881A", &null_ops}, {0x41445348, "Analog Devices AD1881A", &null_ops},
{0x41445360, "Analog Devices AD1885", &default_ops}, {0x41445360, "Analog Devices AD1885", &default_ops},
{0x41445361, "Analog Devices AD1886", &default_ops},
{0x41445460, "Analog Devices AD1885", &default_ops}, {0x41445460, "Analog Devices AD1885", &default_ops},
{0x41445461, "Analog Devices AD1886", &default_ops},
{0x414B4D00, "Asahi Kasei AK4540", &null_ops}, {0x414B4D00, "Asahi Kasei AK4540", &null_ops},
{0x414B4D01, "Asahi Kasei AK4542", &null_ops}, {0x414B4D01, "Asahi Kasei AK4542", &null_ops},
{0x414B4D02, "Asahi Kasei AK4543", &null_ops}, {0x414B4D02, "Asahi Kasei AK4543", &null_ops},
......
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