VERSION = 2
PATCHLEVEL = 1
-SUBLEVEL = 12
+SUBLEVEL = 13
ARCH = i386
#
# Networking options
#
+# CONFIG_NETLINK is not set
# CONFIG_FIREWALL is not set
# CONFIG_NET_ALIAS is not set
CONFIG_INET=y
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_AX25 is not set
-# CONFIG_NETLINK is not set
#
# SCSI support
# Network device support
#
CONFIG_NETDEVICES=y
+# CONFIG_ARCNET is not set
CONFIG_DUMMY=m
# CONFIG_EQUALIZER is not set
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-# CONFIG_NET_RADIO is not set
CONFIG_NET_ETHERNET=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_LANCE is not set
# CONFIG_DEC_ELCP is not set
# CONFIG_DGRS is not set
# CONFIG_NET_POCKET is not set
+# CONFIG_FDDI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_NET_RADIO is not set
+# CONFIG_SLIP is not set
# CONFIG_TR is not set
-# CONFIG_ARCNET is not set
#
# ISDN subsystem
int pcibios_present(void)
{
- return 0;
+ return 0;
}
asmlinkage int sys_pciconfig_read()
{
- return 0;
+ return 0;
}
asmlinkage int sys_pciconfig_write()
{
- return 0;
+ return 0;
}
#else /* CONFIG_PCI */
#include <asm/hwrpb.h>
#include <asm/io.h>
-#include <asm/segment.h>
+#include <asm/uaccess.h>
#define KB 1024
* HACK: the PCI-to-EISA bridge does not seem to identify
* itself as a bridge... :-(
*/
- if (dev->vendor == 0x8086 && dev->device == 0x0482) {
- DBG_DEVS(("disable_dev: ignoring PCEB...\n"));
- return;
- }
+ if (dev->vendor == 0x8086 && dev->device == 0x0482) {
+ DBG_DEVS(("disable_dev: ignoring PCEB...\n"));
+ return;
+ }
#endif
bus = dev->bus;
* HACK: the PCI-to-EISA bridge does not seem to identify
* itself as a bridge... :-(
*/
- if (dev->vendor == 0x8086 && dev->device == 0x0482) {
- DBG_DEVS(("layout_dev: ignoring PCEB...\n"));
- return;
- }
+ if (dev->vendor == 0x8086 && dev->device == 0x0482) {
+ DBG_DEVS(("layout_dev: ignoring PCEB...\n"));
+ return;
+ }
#endif
bus = dev->bus;
pcibios_write_config_dword(bus->number, dev->devfn,
reg, base);
}
- }
+ }
/* enable device: */
if (dev->class >> 8 == PCI_CLASS_NOT_DEFINED ||
dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA ||
*/
for (dev = bus->devices; dev; dev = dev->sibling) {
if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) {
- disable_dev(dev) ;
+ disable_dev(dev) ;
}
}
for (child = bus->children; child; child = child->next) {
layout_bus(child);
- }
+ }
/*
* Align the current bases on 4K and 1MB boundaries:
*/
unsigned short index, unsigned char *bus,
unsigned char *devfn)
{
- unsigned int curr = 0;
+ unsigned int curr = 0;
struct pci_dev *dev;
for (dev = pci_devices; dev; dev = dev->next) {
int pcibios_find_class (unsigned int class_code, unsigned short index,
unsigned char *bus, unsigned char *devfn)
{
- unsigned int curr = 0;
+ unsigned int curr = 0;
struct pci_dev *dev;
for (dev = pci_devices; dev; dev = dev->next) {
int pcibios_present(void)
{
- return 1;
+ return 1;
}
*/
static inline unsigned char bridge_swizzle(unsigned char pin, unsigned int slot)
{
- /* swizzle */
- return (((pin-1) + slot) % 4) + 1 ;
+ /* swizzle */
+ return (((pin-1) + slot) % 4) + 1 ;
}
/*
* Go through all devices, fixing up irqs as we see fit:
*/
for (dev = pci_devices; dev; dev = dev->next) {
- if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE
+ if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE
#if defined(CONFIG_ALPHA_MIKASA) || defined(CONFIG_ALPHA_ALCOR)
/* PCEB (PCI to EISA bridge) does not identify
itself as a bridge... :-( */
&& !((dev->vendor==0x8086) && (dev->device==0x482))
#endif
) {
- dev->irq = 0;
+ dev->irq = 0;
/*
* This device is not on the primary bus, we need to figure out which
* interrupt pin it will come in on. We know which slot it will come
* (see the inline static routine above).
*/
if (dev->bus->number != 0) {
- struct pci_dev *curr = dev ;
+ struct pci_dev *curr = dev ;
/* read the pin and do the PCI-PCI bridge interrupt pin swizzle */
pcibios_read_config_byte(dev->bus->number, dev->devfn,
PCI_INTERRUPT_PIN, &pin);
if (pin == 0) pin = 1 ;
/* follow the chain of bridges, swizzling as we go */
do {
- /* swizzle */
- pin = bridge_swizzle(pin, PCI_SLOT(curr->devfn)) ;
+ /* swizzle */
+ pin = bridge_swizzle(pin, PCI_SLOT(curr->devfn)) ;
/* move up the chain of bridges */
curr = curr->bus->self ;
} while (curr->bus->self) ;
/* The slot is the slot of the last bridge. */
slot = PCI_SLOT(curr->devfn) ;
} else {
- /* work out the slot */
- slot = PCI_SLOT(dev->devfn) ;
+ /* work out the slot */
+ slot = PCI_SLOT(dev->devfn) ;
/* read the pin */
pcibios_read_config_byte(dev->bus->number,
dev->devfn,
&pin);
}
if (irq_tab[slot - min_idsel][pin] != -1)
- dev->irq = irq_tab[slot - min_idsel][pin];
+ dev->irq = irq_tab[slot - min_idsel][pin];
#if PCI_MODIFY
/* tell the device: */
pcibios_write_config_byte(dev->bus->number, dev->devfn,
*/
level_bits = 0;
for (dev = pci_devices; dev; dev = dev->next) {
- if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE)
+ if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE)
continue;
dev->irq = 0;
if (dev->bus->number != 0) {
#endif
#ifdef CONFIG_TGA_CONSOLE
- tga_console_init();
+ tga_console_init();
#endif /* CONFIG_TGA_CONSOLE */
return mem_start;
const char *pcibios_strerror (int error)
{
- static char buf[80];
+ static char buf[80];
- switch (error) {
- case PCIBIOS_SUCCESSFUL:
- return "SUCCESSFUL";
+ switch (error) {
+ case PCIBIOS_SUCCESSFUL:
+ return "SUCCESSFUL";
- case PCIBIOS_FUNC_NOT_SUPPORTED:
- return "FUNC_NOT_SUPPORTED";
+ case PCIBIOS_FUNC_NOT_SUPPORTED:
+ return "FUNC_NOT_SUPPORTED";
- case PCIBIOS_BAD_VENDOR_ID:
- return "SUCCESSFUL";
+ case PCIBIOS_BAD_VENDOR_ID:
+ return "SUCCESSFUL";
- case PCIBIOS_DEVICE_NOT_FOUND:
- return "DEVICE_NOT_FOUND";
+ case PCIBIOS_DEVICE_NOT_FOUND:
+ return "DEVICE_NOT_FOUND";
- case PCIBIOS_BAD_REGISTER_NUMBER:
- return "BAD_REGISTER_NUMBER";
+ case PCIBIOS_BAD_REGISTER_NUMBER:
+ return "BAD_REGISTER_NUMBER";
- default:
- sprintf (buf, "UNKNOWN RETURN 0x%x", error);
- return buf;
- }
+ default:
+ sprintf (buf, "UNKNOWN RETURN 0x%x", error);
+ return buf;
+ }
}
asmlinkage int sys_pciconfig_read(
unsigned long len,
unsigned char *buf)
{
- unsigned char ubyte;
- unsigned short ushort;
- unsigned int uint;
+ unsigned char ubyte;
+ unsigned short ushort;
+ unsigned int uint;
long err = 0;
switch (len) {
case 1:
- err = pcibios_read_config_byte(bus, dfn, off, &ubyte);
+ err = pcibios_read_config_byte(bus, dfn, off, &ubyte);
if (err != PCIBIOS_SUCCESSFUL)
ubyte = 0xff;
put_user(ubyte, buf);
break;
case 2:
- err = pcibios_read_config_word(bus, dfn, off, &ushort);
+ err = pcibios_read_config_word(bus, dfn, off, &ushort);
if (err != PCIBIOS_SUCCESSFUL)
ushort = 0xffff;
put_user(ushort, (unsigned short *)buf);
break;
case 4:
- err = pcibios_read_config_dword(bus, dfn, off, &uint);
+ err = pcibios_read_config_dword(bus, dfn, off, &uint);
if (err != PCIBIOS_SUCCESSFUL)
uint = 0xffffffff;
put_user(uint, (unsigned int *)buf);
break;
default:
- err = -EINVAL;
- break;
+ err = -EINVAL;
+ break;
}
- return err;
+ return err;
}
asmlinkage int sys_pciconfig_write(
unsigned long bus,
unsigned long len,
unsigned char *buf)
{
- unsigned char ubyte;
- unsigned short ushort;
- unsigned int uint;
- long err = 0;
+ unsigned char ubyte;
+ unsigned short ushort;
+ unsigned int uint;
+ long err = 0;
switch (len) {
case 1:
- ubyte = get_user(buf);
- err = pcibios_write_config_byte(bus, dfn, off, ubyte);
- if (err != PCIBIOS_SUCCESSFUL) {
+ err = get_user(ubyte, buf);
+ if (err)
+ break;
+ err = pcibios_write_config_byte(bus, dfn, off, ubyte);
+ if (err != PCIBIOS_SUCCESSFUL) {
err = -EFAULT;
}
break;
case 2:
- ushort = get_user((unsigned short *)buf);
- err = pcibios_write_config_word(bus, dfn, off, ushort);
- if (err != PCIBIOS_SUCCESSFUL) {
+ err = get_user(ushort, (unsigned short *)buf);
+ if (err)
+ break;
+ err = pcibios_write_config_word(bus, dfn, off, ushort);
+ if (err != PCIBIOS_SUCCESSFUL) {
err = -EFAULT;
}
break;
case 4:
- uint = get_user((unsigned int *)buf);
- err = pcibios_write_config_dword(bus, dfn, off, uint);
- if (err != PCIBIOS_SUCCESSFUL) {
+ err = get_user(uint, (unsigned int *)buf);
+ if (err)
+ break;
+ err = pcibios_write_config_dword(bus, dfn, off, uint);
+ if (err != PCIBIOS_SUCCESSFUL) {
err = -EFAULT;
}
break;
default:
- err = -EINVAL;
- break;
+ err = -EINVAL;
+ break;
}
- return err;
+ return err;
}
#endif /* CONFIG_PCI */
* inner loop could be unrolled a bit further, and there are better
* ways to do the carry, but this is reasonable.
*/
-static inline unsigned long do_csum(unsigned char * buff, int len)
+static inline unsigned long do_csum(const unsigned char * buff, int len)
{
int odd, count;
unsigned long result = 0;
*
* it's best to have buff aligned on a 32-bit boundary
*/
-unsigned int csum_partial(unsigned char * buff, int len, unsigned int sum)
+unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
{
unsigned long result = do_csum(buff, len);
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/in.h>
-#include <asm/io.h>
-#include <asm/system.h>
-#include <asm/bitops.h>
#include <linux/ioport.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/trdevice.h>
-#include <stddef.h>
+#include <linux/stddef.h>
+
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/bitops.h>
+
#include "ibmtr.h"
#include <linux/interrupt.h>
#include <linux/config.h>
#include <asm/system.h>
+#include <asm/io.h>
#define MAJOR_NR SCSI_CDROM_MAJOR
#include <linux/blk.h>
if (count+1 != SCpnt->use_sg) panic("Bad sr request list");
break;
};
- if (((long) sgpnt[count].address) + sgpnt[count].length - 1 >
+ if (virt_to_phys(sgpnt[count].address) + sgpnt[count].length - 1 >
ISA_DMA_THRESHOLD && SCpnt->host->unchecked_isa_dma) {
sgpnt[count].alt_address = sgpnt[count].address;
/* We try to avoid exhausting the DMA pool, since it is easier
{
this_count -= this_count % 4;
buffer = (unsigned char *) SCpnt->request.buffer;
- if (((long) buffer) + (this_count << 9) > ISA_DMA_THRESHOLD &&
+ if (virt_to_phys(buffer) + (this_count << 9) > ISA_DMA_THRESHOLD &&
SCpnt->host->unchecked_isa_dma)
buffer = (unsigned char *) scsi_malloc(this_count << 9);
}
*********************************************************
* Readme.cards (this directory) contains some card *
* specific instructions. *
-* See http://www.4front-tech.com/usslite for most up *
+* See http://www.4front-tech.com/ossfree for most up *
* to date info. *
* (European mirror http://personal.eunet.fi/pp/voxware) *
* *
-* DON'T USE PROGRAMS FROM SND_UTIL PACKAGE EARLIER THAN *
+* DON'T USE PROGRAMS FROM snd-util PACKAGE EARLIER THAN *
* snd-util-3.5 WITH THIS SOUND DRIVER VERSION. *
*********************************************************
OBJS := $(OBJS) pas2_card.o pas2_midi.o pas2_mixer.o pas2_pcm.o
endif
-ifdef CONFIG_SEQUENCER
- OBJS := $(OBJS) patmgr.o
-endif
-
ifdef CONFIG_PSS
OBJS := $(OBJS) pss.o
endif
OBJS := $(OBJS) sequencer.o
endif
+
ifdef CONFIG_SEQUENCER
OBJS := $(OBJS) sound_timer.o
endif
-3.7-beta6
-0x030701
+3.7-beta12
+0x030707
-Changelog for version 3.7-beta5
--------------------------------
+Changelog for version 3.7-beta10
+--------------------------------
+
+Since 3.5-beta5
+- Disabled MIDI input with GUS PnP (Interwave). There seems to be constant
+stream of received 0x00 bytes when the MIDI receiver is enabled.
Since 3.5
- Changes almost everywhere.
lowlevel/lowlevel.o: dummy
- cd lowlevel;make
+ cd lowlevel;make CC="$(CC)" CFLAGS="$(CFLAGS)"
contrib:
- cd lowlevel;make clean;make module CFLAGS="$(CFLAGS)"
+ cd lowlevel;make clean;make module "CC=$(CC)" CFLAGS="$(CFLAGS)"
ifdef USE_DEPEND
#
--- /dev/null
+# Makefile for the Linux sound card driver
+#
+# Note 2! The CFLAGS definitions are now inherited from the
+# parent makes. (hopefully)
+#
+#
+
+.PHONY: dummy
+SUB_DIRS = lowlevel
+VERSION = `head -1 .version`
+TARGET_OS = linux
+USRINCDIR = /usr/include
+MODULEDIR = /lib/modules/misc
+
+FIXEDOBJS = soundcard.o dev_table.o sound_switch.o
+
+ifndef NO_LOWLEVEL
+ FIXEDOBJS := $(FIXEDOBJS) lowlevel/lowlevel.o
+endif
+
+ifeq (.defines,$(wildcard .defines))
+include .defines
+include .objects
+endif
+
+ifndef TOPDIR
+TOPDIR=/usr/src/linux
+endif
+
+
+ifndef HOSTCC
+build:
+ @echo Compiling modularized sound driver
+ @make sound.o
+ @echo Sound module compiled.
+
+install: sound.o
+ cp sound.o $(MODULEDIR)
+endif
+
+.c.o:
+ $(CC) $(CFLAGS) -c $<
+
+ifeq ($(CONFIG_SOUND),y)
+
+all: local.h sound.a
+
+OBJS += $(FIXEDOBJS)
+
+else
+all:
+endif
+
+ifndef HOSTCC
+#
+# Running outside the kernel build.
+#
+CC = gcc
+HOSTCC = gcc
+CFLAGS = -O2 -D__KERNEL__ -DMODULE -I/usr/src/linux/include -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe -m486
+USE_DEPEND=y
+else
+include $(TOPDIR)/Rules.make
+endif
+
+sound.a: $(OBJS)
+ -rm -f sound.a
+ $(AR) rcs sound.a $(OBJS)
+ sync
+
+clean:
+ rm -f core core.* *.o *.a tmp_make *~ x y z *%
+ rm -f configure
+ cd lowlevel;make clean
+ cd vivo;make clean
+
+indent:
+ for n in *.c;do echo indent $$n;indent $$n;done
+
+local.h:
+ $(MAKE) clean
+ $(MAKE) setup
+ $(MAKE) oldconfig
+ $(MAKE) dep
+ @echo
+ @echo
+ @echo
+ @echo NOTE! Object file dependencies may not be up to date. Run
+ @echo make again if kernel/driver doesn''t link properly. Restarting
+ @echo it now may save some time.
+ @echo
+ @echo
+
+config: configure
+ @$(MAKE) setup
+ @./configure > local.h
+ @echo \#define SOUND_CONFIG_DATE \"`date`\" >> local.h
+ @echo \#define SOUND_CONFIG_BY \"`whoami`\" >> local.h
+# @echo \#define SOUND_CONFIG_HOST \"`hostname`\" >> local.h 2>/dev/null
+# @echo \#define SOUND_CONFIG_DOMAIN \"`hostname -d`\" >> local.h 2>/dev/null
+ @echo \#define SOUND_UNAME_A \"`uname -a`\" >> local.h
+
+oldconfig: setup configure
+ @./configure -o > local.h
+ @echo \#define SOUND_CONFIG_DATE \"`date`\" >> local.h
+ @echo \#define SOUND_CONFIG_BY \"`whoami`\" >> local.h
+# @echo \#define SOUND_CONFIG_HOST \"`hostname`\" >> local.h 2>/dev/null
+# @echo \#define SOUND_CONFIG_DOMAIN \"`hostname -d`\" >> local.h 2>/dev/null
+ @echo \#define SOUND_UNAME_A \"`uname -a`\" >> local.h
+
+kernelconfig: setup
+ rm -f configure
+ $(HOSTCC) -o configure configure.c
+ ./configure fixedlocal > local.h
+ ./configure fixeddefines > .defines
+ @echo \#define SOUND_CONFIG_DATE \"`date`\" >> local.h
+ @echo \#define SOUND_CONFIG_BY \"`whoami`\" >> local.h
+# @echo \#define SOUND_CONFIG_HOST \"`hostname`\" >> local.h 2>/dev/null
+# @echo \#define SOUND_CONFIG_DOMAIN \"`hostname -d`\" >> local.h 2>/dev/null
+ @echo \#define SOUND_UNAME_A \"`uname -a`\" >> local.h
+
+mkscript: setup
+ rm -f configure
+ $(HOSTCC) -o configure configure.c
+ ./configure script > Config.in
+ cat lowlevel/Config.tmpl >> Config.in
+ ./configure fixedlocal > local.h
+ ./configure fixeddefines > .defines
+
+clrconf:
+ rm -f local.h .depend synth-ld.h trix_boot.h smw-midi0001.h maui_boot.h .defines
+
+configure: configure.c
+ $(HOSTCC) -o configure configure.c
+ @cat .blurb
+
+dep:
+ $(CPP) -M $(CFLAGS) -I. *.c > .depend
+
+setup:
+ @echo Compiling Sound Driver v $(VERSION) for Linux
+
+sound.o: local.h $(FIXEDOBJS) sound.a
+ -rm -f sound.o
+ $(LD) -r -o sound.o $(FIXEDOBJS) sound.a
+
+modules: local.h sound.o
+ ln -fs `pwd`/sound.o $(TOPDIR)/modules/sound.o
+
+
+lowlevel/lowlevel.o: dummy
+ cd lowlevel;make CC="$(CC)" CFLAGS="$(CFLAGS)"
+
+contrib:
+ cd lowlevel;make clean;make module "CC=$(CC)" CFLAGS="$(CFLAGS)"
+
+ifdef USE_DEPEND
+#
+# include a dependency file if one exists
+#
+ifeq (.depend,$(wildcard .depend))
+include .depend
+endif
+endif
- THIS VERSION ____REQUIRES____ Linux 2.1.5 OR LATER.
====================================================
-Packages "snd-util-3.5.tar.gz" and "snd-data-0.1.tar.Z"
+Packages "snd-util-3.7.tar.gz" and "snd-data-0.1.tar.Z"
contain useful utilities to be used with this driver.
See http://www.4front-tech.com/ossfree/getting.html for
download instructions.
versions of isapnptools so at least version 1.6 is required with soundcards.
Yet another way to use PnP cards is to use (commercial) OSS/Linux drivers.
-See http://www.4front-tech.com/linux.html for more info.
+See http://www.4front-tech.com/linux.html for more info. This is the way
+you propably like to do it if you don't waste hours of time in recompiling
+kernel and the required tools.
Read this before trying to configure the driver
-----------------------------------------------
int timer_running;
int irq_ok;
mixer_ents *mix_devices;
+ int mixer_output_port;
}
ad1848_info;
if (devc->supported_devices & (1 << i))
ad1848_mixer_set (devc, i, devc->levels[i]);
ad1848_set_recmask (devc, SOUND_MASK_MIC);
+ devc->mixer_output_port = devc->levels[31] | AUDIO_HEADPHONE | AUDIO_LINE_OUT;
+ if (devc->mixer_output_port & AUDIO_SPEAKER)
+ ad_write (devc, 26, ad_read (devc, 26) & ~0x40); /* Unmute mono out */
+ else
+ ad_write (devc, 26, ad_read (devc, 26) | 0x40); /* Mute mono out */
}
static int
{
ad1848_info *devc = mixer_devs[dev]->devc;
+ if (cmd == SOUND_MIXER_PRIVATE1)
+ {
+ int val;
+
+ get_user (val, (int *) arg);
+
+ if (val == 0xffff)
+ return ioctl_out (arg, devc->mixer_output_port);
+
+ val &= (AUDIO_SPEAKER | AUDIO_HEADPHONE | AUDIO_LINE_OUT);
+
+ devc->mixer_output_port = val;
+ val |= AUDIO_HEADPHONE | AUDIO_LINE_OUT; /* Always on */
+ devc->mixer_output_port = val;
+
+ if (val & AUDIO_SPEAKER)
+ ad_write (devc, 26, ad_read (devc, 26) & ~0x40); /* Unmute mono out */
+ else
+ ad_write (devc, 26, ad_read (devc, 26) | 0x40); /* Mute mono out */
+
+ return ioctl_out (arg, devc->mixer_output_port);
+ }
+
if (((cmd >> 8) & 0xff) == 'M')
{
int val;
ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc;
ad_mute (devc);
- {
+ if (devc->model != MD_4232)
+ {
/*
* This code fragment ensures that the playback FIFO is empty before
* setting the codec for playback. Enabling playback for a moment should
* be enough to do that.
*/
- int tmout;
+ int tmout;
- ad_write (devc, 9, ad_read (devc, 9) | 0x01); /* Enable playback */
- disable_dma (audio_devs[dev]->dmachan1);
- for (tmout = 0; tmout < 1000000; tmout++)
- if (ad_read (devc, 11) & 0x10) /* DRQ active */
- if (tmout > 10000)
- break;
- ad_write (devc, 9, ad_read (devc, 9) & ~0x01); /* Stop playback */
+ ad_write (devc, 9, ad_read (devc, 9) | 0x01); /* Enable playback */
+ disable_dma (audio_devs[dev]->dmachan1);
+ for (tmout = 0; tmout < 1000000; tmout++)
+ if (ad_read (devc, 11) & 0x10) /* DRQ active */
+ if (tmout > 10000)
+ break;
+ ad_write (devc, 9, ad_read (devc, 9) & ~0x01); /* Stop playback */
- enable_dma (audio_devs[dev]->dmachan1);
- devc->audio_mode &= ~PCM_ENABLE_OUTPUT;
- }
+ enable_dma (audio_devs[dev]->dmachan1);
+ devc->audio_mode &= ~PCM_ENABLE_OUTPUT;
+ }
return ad1848_prepare_for_IO (dev, bsize, bcount);
}
for (i = 0; i < 16; i++)
if ((tmp1 = ad_read (devc, i)) != (tmp2 = ad_read (devc, i + 16)))
{
- DDB (printk ("ad1848 detect step F(%d/%x/%x) - OPTi chip?\n", i, tmp1, tmp2));
+ DDB (printk ("ad1848 detect step F(%d/%x/%x) - OPTi chip???\n", i, tmp1, tmp2));
if (!ad1847_flag)
optiC930 = 1;
break;
devc->model = MD_4232;
break;
+ case 0x03:
+ case 0x83:
+ devc->chip_name = "CS4236";
+ devc->model = MD_4232;
+ break;
+
case 0x80:
{
/*
break;
default: /* Assume CS4231 or OPTi 82C930 */
+ DDB (printk ("ad1848: I25 = %02x\n", ad_read (devc, 25)));
if (optiC930)
{
devc->chip_name = "82C930";
#define LEFT_CHN 0
#define RIGHT_CHN 1
+
+/*
+ * Channel enable bits for ioctl(SOUND_MIXER_PRIVATE1)
+ */
+
+#ifndef AUDIO_SPEAKER
+#define AUDIO_SPEAKER 0x01 /* Enable mono output */
+#define AUDIO_HEADPHONE 0x02 /* Sparc only */
+#define AUDIO_LINE_OUT 0x04 /* Sparc only */
+#endif
void (*controller) (int dev, int voice, int ctrl_num, int value);
void (*panning) (int dev, int voice, int value);
void (*volume_method) (int dev, int mode);
- int (*pmgr_interface) (int dev, struct patmgr_info *info);
void (*bender) (int dev, int chn, int value);
int (*alloc_voice) (int dev, int chn, int note, struct voice_alloc_info *alloc);
void (*setup_voice) (int dev, int voice, int chn);
}
if (dmap->raw_buf == NULL)
- return -ENOSPC; /* Memory allocation failed during boot */
+ {
+ printk ("Sound: DMA buffers not available\n");
+ return -ENOSPC; /* Memory allocation failed during boot */
+ }
if (sound_open_dma (chan, audio_devs[dev]->name))
{
dmap->dma_mode |= DMODE_OUTPUT;
+ if (dmap->counts[dmap->qhead] == 0)
+ dmap->counts[dmap->qhead] = dmap->fragment_size;
+
audio_devs[dev]->d->output_block (dev, dmap->raw_buf_phys +
dmap->qhead * dmap->fragment_size,
dmap->counts[dmap->qhead], 0,
pos = get_dma_residue (chan);
if (chan > 3) /* Word count */
pos *= 2;
- pos = dmap->bytes_in_use - pos;
+ pos = dmap->bytes_in_use - pos - 1;
if (pos < 0)
pos = 0;
if (pos > dmap->bytes_in_use)
if (!(audio_devs[dev]->flags & DMA_AUTOMODE))
{
+ if (dmap->counts[dmap->qhead] == 0)
+ dmap->counts[dmap->qhead] = dmap->fragment_size;
+
audio_devs[dev]->d->output_block (dev, dmap->raw_buf_phys +
dmap->qhead * dmap->fragment_size,
dmap->counts[dmap->qhead], 1,
static void (*midi_input_intr) (int dev, unsigned char data);
static unsigned char tmp_queue[256];
+extern int gus_pnp_flag;
static volatile int qlen;
static volatile unsigned char qhead, qtail;
extern int gus_base, gus_irq, gus_dma;
input_opened = 0;
if (mode == OPEN_READ || mode == OPEN_READWRITE)
- {
- gus_midi_control |= MIDI_ENABLE_RCV;
- input_opened = 1;
- }
+ if (!gus_pnp_flag)
+ {
+ gus_midi_control |= MIDI_ENABLE_RCV;
+ input_opened = 1;
+ }
outb ((gus_midi_control), u_MidiControl); /* Enable */
count -= sizeof_patch;
- if (gus_mem_size == 0)
- return -ENOSPC;
-
if (free_sample >= MAX_SAMPLE)
{
printk ("GUS: Sample table full\n");
copy_from_user (&((char *) &patch)[offs], &(addr)[offs], sizeof_patch - offs);
+ if (patch.mode & WAVE_ROM)
+ return -EINVAL;
+ if (gus_mem_size == 0)
+
+ return -ENOSPC;
+
instr = patch.instr_no;
if (instr < 0 || instr > MAX_PATCH)
free_mem_ptr += patch.len;
- if (!pmgr_flag)
- pmgr_inform (dev, PM_E_PATCH_LOADED, instr, free_sample, 0, 0);
free_sample++;
return 0;
}
return ioctl_out (arg, -EINVAL);
break;
-/* This is just a temporary hack used for reading the ROM patch set. */
-
- case SNDCTL_PMGR_ACCESS:
- {
- copr_msg *buf;
- int i, pos;
-
- buf = (copr_msg *) vmalloc (sizeof (copr_msg));
- if (buf == NULL)
- return -ENOSPC;
-
- copy_from_user ((char *) buf, &((char *) arg)[0], sizeof (*buf));
-
- pos = buf->len;
-
- gus_write8 (0x53, gus_look8 (0x53) | 0x02); /* Select ROM I/O access */
-
- for (i = 0; i < 2048; i++)
- {
- buf->data[i] = gus_peek (pos + i);
- }
- gus_write8 (0x53, gus_look8 (0x53) & ~0x02); /* Select DRAM I/O access */
- buf->len = 2048; /* feed back number of WORDs sent */
- {
- char *fixit = (char *) buf;
-
- copy_to_user (&((char *) arg)[0], fixit, sizeof (*buf));
- };
- vfree (buf);
-
- return 0;
- }
- break;
-
}
return -EINVAL;
}
restore_flags (flags);
}
-static int
-guswave_patchmgr (int dev, struct patmgr_info *rec)
-{
- int i, n;
-
- switch (rec->command)
- {
- case PM_GET_DEVTYPE:
- rec->parm1 = PMTYPE_WAVE;
- return 0;
- break;
-
- case PM_GET_NRPGM:
- rec->parm1 = MAX_PATCH;
- return 0;
- break;
-
- case PM_GET_PGMMAP:
- rec->parm1 = MAX_PATCH;
-
- for (i = 0; i < MAX_PATCH; i++)
- {
- int ptr = patch_table[i];
-
- rec->data.data8[i] = 0;
-
- while (ptr >= 0 && ptr < free_sample && ptr != NOT_SAMPLE)
- {
- rec->data.data8[i]++;
- ptr = samples[ptr].key; /* Follow link */
- }
- }
- return 0;
- break;
-
- case PM_GET_PGM_PATCHES:
- {
- int ptr = patch_table[rec->parm1];
-
- n = 0;
-
- while (ptr >= 0 && ptr < free_sample && ptr != NOT_SAMPLE)
- {
- rec->data.data32[n++] = ptr;
- ptr = samples[ptr].key; /* Follow link */
- }
- }
- rec->parm1 = n;
- return 0;
- break;
-
- case PM_GET_PATCH:
- {
- int ptr = rec->parm1;
- struct patch_info *pat;
-
- if (ptr < 0 || ptr >= free_sample)
- return -EINVAL;
-
- memcpy (rec->data.data8, (char *) &samples[ptr],
- sizeof (struct patch_info));
-
- pat = (struct patch_info *) rec->data.data8;
-
- pat->key = GUS_PATCH; /* Restore patch type */
- rec->parm1 = sample_ptrs[ptr]; /* DRAM location */
- rec->parm2 = sizeof (struct patch_info);
- }
- return 0;
- break;
-
- case PM_SET_PATCH:
- {
- int ptr = rec->parm1;
- struct patch_info *pat;
-
- if (ptr < 0 || ptr >= free_sample)
- return -EINVAL;
-
- pat = (struct patch_info *) rec->data.data8;
-
- if (pat->len > samples[ptr].len) /* Cannot expand sample */
- return -EINVAL;
-
- pat->key = samples[ptr].key; /* Ensure the link is correct */
-
- memcpy ((char *) &samples[ptr], rec->data.data8,
- sizeof (struct patch_info));
-
- pat->key = GUS_PATCH;
- }
- return 0;
- break;
-
- case PM_READ_PATCH: /* Returns a block of wave data from the DRAM */
- {
- int sample = rec->parm1;
- int n;
- long offs = rec->parm2;
- int l = rec->parm3;
-
- if (sample < 0 || sample >= free_sample)
- return -EINVAL;
-
- if (offs < 0 || offs >= samples[sample].len)
- return -EINVAL; /* Invalid offset */
-
- n = samples[sample].len - offs; /* Num of bytes left */
-
- if (l > n)
- l = n;
-
- if (l > sizeof (rec->data.data8))
- l = sizeof (rec->data.data8);
-
- if (l <= 0)
- return -EINVAL; /*
- * Was there a bug?
- */
-
- offs += sample_ptrs[sample]; /*
- * Begin offset + offset to DRAM
- */
-
- for (n = 0; n < l; n++)
- rec->data.data8[n] = gus_peek (offs++);
- rec->parm1 = n; /*
- * Nr of bytes copied
- */
- }
- return 0;
- break;
-
- case PM_WRITE_PATCH: /*
- * Writes a block of wave data to the DRAM
- */
- {
- int sample = rec->parm1;
- int n;
- long offs = rec->parm2;
- int l = rec->parm3;
-
- if (sample < 0 || sample >= free_sample)
- return -EINVAL;
-
- if (offs < 0 || offs >= samples[sample].len)
- return -EINVAL; /*
- * Invalid offset
- */
-
- n = samples[sample].len - offs; /*
- * Nr of bytes left
- */
-
- if (l > n)
- l = n;
-
- if (l > sizeof (rec->data.data8))
- l = sizeof (rec->data.data8);
-
- if (l <= 0)
- return -EINVAL; /*
- * Was there a bug?
- */
-
- offs += sample_ptrs[sample]; /*
- * Begin offsets + offset to DRAM
- */
-
- for (n = 0; n < l; n++)
- gus_poke (offs++, rec->data.data8[n]);
- rec->parm1 = n; /*
- * Nr of bytes copied
- */
- }
- return 0;
- break;
-
- default:
- return -EINVAL;
- }
-}
-
static int
guswave_alloc (int dev, int chn, int note, struct voice_alloc_info *alloc)
{
guswave_controller,
guswave_panning,
guswave_volume_method,
- guswave_patchmgr,
guswave_bender,
guswave_alloc,
guswave_setup_voice
}
conf_printf (tmp2, hw_config);
- strncpy (gus_info.name, tmp2, sizeof (tmp2));
- gus_info.name[sizeof (tmp2) - 1] = 0;
+ tmp2[sizeof (gus_info.name) - 1] = 0;
+ strncpy (gus_info.name, tmp2, strlen (tmp2));
if (num_synths >= MAX_SYNTH_DEV)
printk ("GUS Error: Too many synthesizers\n");
if (((cmd >> 8) & 0xff) == 'M')
{
if (_IOC_DIR (cmd) & _IOC_WRITE)
- switch (cmd & 0xff)
- {
- case SOUND_MIXER_RECSRC:
- return gus_default_mixer_ioctl (dev, cmd, arg);
- break;
+ {
+ int val;
- case SOUND_MIXER_MIC:
- return ioctl_out (arg, set_volumes (DEV_MIC, ioctl_in (arg)));
- break;
+ get_user (val, (int *) arg);
- case SOUND_MIXER_CD:
- return ioctl_out (arg, set_volumes (DEV_CD, ioctl_in (arg)));
- break;
+ switch (cmd & 0xff)
+ {
+ case SOUND_MIXER_RECSRC:
+ return gus_default_mixer_ioctl (dev, cmd, arg);
+ break;
- case SOUND_MIXER_LINE:
- return ioctl_out (arg, set_volumes (DEV_LINE, ioctl_in (arg)));
- break;
+ case SOUND_MIXER_MIC:
+ return ioctl_out (arg, set_volumes (DEV_MIC, val));
+ break;
- case SOUND_MIXER_SYNTH:
- return ioctl_out (arg, set_volumes (DEV_GF1, ioctl_in (arg)));
- break;
+ case SOUND_MIXER_CD:
+ return ioctl_out (arg, set_volumes (DEV_CD, val));
+ break;
- case SOUND_MIXER_VOLUME:
- return ioctl_out (arg, set_volumes (DEV_VOL, ioctl_in (arg)));
- break;
+ case SOUND_MIXER_LINE:
+ return ioctl_out (arg, set_volumes (DEV_LINE, val));
+ break;
- default:
- return -EINVAL;
- }
+ case SOUND_MIXER_SYNTH:
+ return ioctl_out (arg, set_volumes (DEV_GF1, val));
+ break;
+
+ case SOUND_MIXER_VOLUME:
+ return ioctl_out (arg, set_volumes (DEV_VOL, val));
+ break;
+
+ default:
+ return -EINVAL;
+ }
+ }
else
switch (cmd & 0xff) /*
* Return parameters
static void awe_controller(int dev, int voice, int ctrl_num, int value);
static void awe_panning(int dev, int voice, int value);
static void awe_volume_method(int dev, int mode);
-static int awe_patchmgr(int dev, struct patmgr_info *rec);
static void awe_bender(int dev, int voice, int value);
static int awe_alloc(int dev, int chn, int note, struct voice_alloc_info *alloc);
static void awe_setup_voice(int dev, int voice, int chn);
awe_controller,
awe_panning,
awe_volume_method,
- awe_patchmgr,
awe_bender,
awe_alloc,
awe_setup_voice
}
-/* patch manager */
-static int
-awe_patchmgr(int dev, struct patmgr_info *rec)
-{
- FATALERR(printk("AWE32 Warning: patch manager control not supported\n"));
- return 0;
-}
-
-
/* pitch wheel change: 0-16384 */
static void
awe_bender(int dev, int voice, int value)
midi_outc (orig_dev, value & 0x7f);
}
-int
-midi_synth_patchmgr (int dev, struct patmgr_info *rec)
-{
- return -EINVAL;
-}
-
void
midi_synth_bender (int dev, int channel, int value)
{
void midi_synth_panning (int dev, int channel, int pressure);
void midi_synth_aftertouch (int dev, int channel, int pressure);
void midi_synth_controller (int dev, int channel, int ctrl_num, int value);
-int midi_synth_patchmgr (int dev, struct patmgr_info *rec);
void midi_synth_bender (int dev, int chn, int value);
void midi_synth_setup_voice (int dev, int voice, int chn);
int midi_synth_send_sysex(int dev, unsigned char *bytes,int len);
midi_synth_controller,
midi_synth_panning,
NULL,
- midi_synth_patchmgr,
midi_synth_bender,
NULL, /* alloc_voice */
midi_synth_setup_voice,
#if (defined(CONFIG_MPU401) || defined(CONFIG_MPU_EMU)) && defined(CONFIG_MIDI)
#include "coproc.h"
-static int init_sequence[20]; /* NOTE! pos 0 = len, start pos 1. */
-
#ifdef CONFIG_SEQUENCER
static int timer_mode = TMR_INTERNAL, timer_caps = TMR_INTERNAL;
mpu401_ioctl (int dev, unsigned cmd, caddr_t arg)
{
struct mpu_config *devc;
+ int val;
devc = &dev_conf[dev];
switch (cmd)
{
- case 1:
- copy_from_user ((char *) init_sequence, &((char *) arg)[0], sizeof (init_sequence));
- return 0;
- break;
-
case SNDCTL_MIDI_MPUMODE:
if (!(devc->capabilities & MPU_CAP_INTLG)) /* No intelligent mode */
{
printk ("MPU-401: Intelligent mode not supported by the HW\n");
return -EINVAL;
}
- set_uart_mode (dev, devc, !ioctl_in (arg));
+ get_user (val, (int *) arg);
+ set_uart_mode (dev, devc, !val);
return 0;
break;
midi_synth_controller,
midi_synth_panning,
NULL,
- midi_synth_patchmgr,
midi_synth_bender,
NULL, /* alloc */
midi_synth_setup_voice,
case SNDCTL_TMR_TIMEBASE:
{
- int val = (int) ioctl_in (arg);
+ int val;
+ get_user (val, (int *) arg);
if (val)
set_timebase (midi_dev, val);
case SNDCTL_TMR_TEMPO:
{
- int val = (int) ioctl_in (arg);
+ int val;
int ret;
+ get_user (val, (int *) arg);
+
if (val)
{
if (val < 8)
break;
case SNDCTL_SEQ_CTRLRATE:
- if (ioctl_in (arg) != 0) /* Can't change */
- return -EINVAL;
+ {
+ int val;
+
+ get_user (val, (int *) arg);
+ if (val != 0) /* Can't change */
+ return -EINVAL;
- return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
+ return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
+ }
break;
case SNDCTL_SEQ_GETTIME:
break;
case SNDCTL_TMR_METRONOME:
- metronome_mode = (int) ioctl_in (arg);
+ get_user (metronome_mode, (int *) arg);
setup_metronome (midi_dev);
return 0;
break;
return -EINVAL;
}
- pmgr_inform (dev, PM_E_PATCH_LOADED, ins.channel, 0, 0, 0);
return store_instr (ins.channel, &ins);
}
break;
}
}
-static int
-opl3_patchmgr (int dev, struct patmgr_info *rec)
-{
- return -EINVAL;
-}
-
static void
opl3_bender (int dev, int voice, int value)
{
opl3_controller,
opl3_panning,
opl3_volume_method,
- opl3_patchmgr,
opl3_bender,
opl3_alloc_voice,
opl3_setup_voice
+
+#define ALLOW_SELECT
+#undef NO_INLINE_ASM
+#define SHORT_BANNERS
+#define MANUAL_PNP
+
#ifdef MODULE
#define __NO_VERSION__
#include <linux/module.h>
#include <linux/modversions.h>
#endif
#endif
+#if LINUX_VERSION_CODE > 131328
+#define LINUX21X
+#endif
#include <linux/param.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/ctype.h>
#include <asm/io.h>
-#include <asm/uaccess.h>
+#include <asm/segment.h>
#include <asm/system.h>
#include <asm/dma.h>
#include <linux/wait.h>
#include <linux/malloc.h>
#include <linux/vmalloc.h>
+#include <asm/uaccess.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/utsname.h>
#define FALSE 0
#define TRUE 1
+
+
struct snd_wait {
int opts;
};
extern void sound_free_dma(int chn);
extern void sound_close_dma(int chn);
+#define RUNTIME_DMA_ALLOC
+
extern caddr_t sound_mem_blocks[1024];
extern int sound_nblocks;
+
+#undef PSEUDO_DMA_AUTOINIT
+#define ALLOW_BUFFER_MAPPING
+
*
* The low level driver for the PAS Midi Interface.
*/
+/*
+ * Copyright (C) by Hannu Savolainen 1993-1996
+ *
+ * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
+ * Version 2 (June 1991). See the "COPYING" file distributed with this software
+ * for more info.
+ */
+#include <linux/config.h>
+
#include "sound_config.h"
-#include <linux/config.h>
#if defined(CONFIG_PAS) && defined(CONFIG_MIDI)
* Mixer routines for the Pro Audio Spectrum cards.
*/
+/*
+ * Copyright (C) by Hannu Savolainen 1993-1996
+ *
+ * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
+ * Version 2 (June 1991). See the "COPYING" file distributed with this software
+ * for more info.
+ */
#include <linux/config.h>
+
#include "sound_config.h"
#if defined(CONFIG_PAS)
if (((cmd >> 8) & 0xff) == 'M')
{
+ int v;
+
+ get_user (v, (int *) arg);
+
if (_IOC_DIR (cmd) & _IOC_WRITE)
- return ioctl_out (arg, pas_mixer_set (cmd & 0xff, ioctl_in (arg)));
+ return ioctl_out (arg, pas_mixer_set (cmd & 0xff, v));
else
{ /*
* Read parameters
static int
pas_audio_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
{
+ int val;
+
DEB (printk ("pas2_pcm.c: static int pas_audio_ioctl(unsigned int cmd = %X, unsigned int arg = %X)\n", cmd, arg));
switch (cmd)
case SOUND_PCM_WRITE_RATE:
if (local)
return pcm_set_speed ((int) arg);
- return ioctl_out (arg, pcm_set_speed (ioctl_in (arg)));
+ get_user (val, (int *) arg);
+ return ioctl_out (arg, pcm_set_speed (val));
break;
case SOUND_PCM_READ_RATE:
case SNDCTL_DSP_STEREO:
if (local)
return pcm_set_channels ((int) arg + 1) - 1;
- return ioctl_out (arg, pcm_set_channels (ioctl_in (arg) + 1) - 1);
+ get_user (val, (int *) arg);
+ return ioctl_out (arg, pcm_set_channels (val + 1) - 1);
break;
case SOUND_PCM_WRITE_CHANNELS:
if (local)
return pcm_set_channels ((int) arg);
- return ioctl_out (arg, pcm_set_channels (ioctl_in (arg)));
+ get_user (val, (int *) arg);
+ return ioctl_out (arg, pcm_set_channels (val));
break;
case SOUND_PCM_READ_CHANNELS:
case SNDCTL_DSP_SETFMT:
if (local)
return pcm_set_bits ((int) arg);
- return ioctl_out (arg, pcm_set_bits (ioctl_in (arg)));
+ get_user (val, (int *) arg);
+ return ioctl_out (arg, pcm_set_bits (val));
break;
case SOUND_PCM_READ_BITS:
case SOUND_PCM_WRITE_FILTER: /*
* NOT YET IMPLEMENTED
*/
- if (ioctl_in (arg) > 1)
+ get_user (val, (int *) arg);
+ if (val > 1)
return -EINVAL;
- pcm_filter = ioctl_in (arg);
+ pcm_filter = val;
break;
case SOUND_PCM_READ_FILTER:
+++ /dev/null
-/*
- * sound/patmgr.c
- *
- * The patch manager interface for the /dev/sequencer
- */
-/*
- * Copyright (C) by Hannu Savolainen 1993-1996
- *
- * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
- * Version 2 (June 1991). See the "COPYING" file distributed with this software
- * for more info.
- */
-#include <linux/config.h>
-
-
-#define PATMGR_C
-#include "sound_config.h"
-
-#if defined(CONFIG_SEQUENCER)
-
-static struct wait_queue *server_procs[MAX_SYNTH_DEV] =
-{NULL};
-static volatile struct snd_wait server_wait_flag[MAX_SYNTH_DEV] =
-{
- {0}};
-
-static struct patmgr_info *mbox[MAX_SYNTH_DEV] =
-{NULL};
-static volatile int msg_direction[MAX_SYNTH_DEV] =
-{0};
-
-static int pmgr_opened[MAX_SYNTH_DEV] =
-{0};
-
-#define A_TO_S 1
-#define S_TO_A 2
-
-static struct wait_queue *appl_proc = NULL;
-static volatile struct snd_wait appl_wait_flag =
-{0};
-
-int
-pmgr_open (int dev)
-{
- if (dev < 0 || dev >= num_synths)
- return -ENXIO;
-
- if (pmgr_opened[dev])
- return -EBUSY;
- pmgr_opened[dev] = 1;
-
- server_wait_flag[dev].opts = WK_NONE;
-
- return 0;
-}
-
-void
-pmgr_release (int dev)
-{
-
- if (mbox[dev]) /*
- * Killed in action. Inform the client
- */
- {
-
- mbox[dev]->key = PM_ERROR;
- mbox[dev]->parm1 = -EIO;
-
- if ((appl_wait_flag.opts & WK_SLEEP))
- {
- appl_wait_flag.opts = WK_WAKEUP;
- wake_up (&appl_proc);
- };
- }
-
- pmgr_opened[dev] = 0;
-}
-
-int
-pmgr_read (int dev, struct fileinfo *file, char *buf, int count)
-{
- unsigned long flags;
- int ok = 0;
-
- if (count != sizeof (struct patmgr_info))
- {
- printk ("PATMGR%d: Invalid read count\n", dev);
- return -EIO;
- }
-
- while (!ok && !(current->signal & ~current->blocked))
- {
- save_flags (flags);
- cli ();
-
- while (!(mbox[dev] && msg_direction[dev] == A_TO_S) &&
- !(current->signal & ~current->blocked))
- {
-
- server_wait_flag[dev].opts = WK_SLEEP;
- interruptible_sleep_on (&server_procs[dev]);
- server_wait_flag[dev].opts &= ~WK_SLEEP;;
- }
-
- if (mbox[dev] && msg_direction[dev] == A_TO_S)
- {
- {
- char *fixit = (char *) mbox[dev];
-
- copy_to_user (&(buf)[0], fixit, count);
- };
- msg_direction[dev] = 0;
- ok = 1;
- }
-
- restore_flags (flags);
-
- }
-
- if (!ok)
- return -EINTR;
- return count;
-}
-
-int
-pmgr_write (int dev, struct fileinfo *file, const char *buf, int count)
-{
- unsigned long flags;
-
- if (count < 4)
- {
- printk ("PATMGR%d: Write count < 4\n", dev);
- return -EIO;
- }
-
- copy_from_user ((char *) mbox[dev], &(buf)[0], 4);
-
- if (*(unsigned char *) mbox[dev] == SEQ_FULLSIZE)
- {
- int tmp_dev;
-
- tmp_dev = ((unsigned short *) mbox[dev])[2];
- if (tmp_dev != dev)
- return -ENXIO;
-
- return synth_devs[dev]->load_patch (dev, *(unsigned short *) mbox[dev],
- buf, 4, count, 1);
- }
-
- if (count != sizeof (struct patmgr_info))
- {
- printk ("PATMGR%d: Invalid write count\n", dev);
- return -EIO;
- }
-
- /*
- * If everything went OK, there should be a preallocated buffer in the
- * mailbox and a client waiting.
- */
-
- save_flags (flags);
- cli ();
-
- if (mbox[dev] && !msg_direction[dev])
- {
- copy_from_user (&((char *) mbox[dev])[4], &(buf)[4], count - 4);
- msg_direction[dev] = S_TO_A;
-
- if ((appl_wait_flag.opts & WK_SLEEP))
- {
- {
- appl_wait_flag.opts = WK_WAKEUP;
- wake_up (&appl_proc);
- };
- }
- }
-
- restore_flags (flags);
-
- return count;
-}
-
-int
-pmgr_access (int dev, struct patmgr_info *rec)
-{
- unsigned long flags;
- int err = 0;
-
- save_flags (flags);
- cli ();
-
- if (mbox[dev])
- printk (" PATMGR: Server %d mbox full. Why?\n", dev);
- else
- {
- rec->key = PM_K_COMMAND;
- mbox[dev] = rec;
- msg_direction[dev] = A_TO_S;
-
- if ((server_wait_flag[dev].opts & WK_SLEEP))
- {
- {
- server_wait_flag[dev].opts = WK_WAKEUP;
- wake_up (&server_procs[dev]);
- };
- }
-
-
- appl_wait_flag.opts = WK_SLEEP;
- interruptible_sleep_on (&appl_proc);
- appl_wait_flag.opts &= ~WK_SLEEP;;
-
- if (msg_direction[dev] != S_TO_A)
- {
- rec->key = PM_ERROR;
- rec->parm1 = -EIO;
- }
- else if (rec->key == PM_ERROR)
- {
- err = rec->parm1;
- if (err > 0)
- err = -err;
- }
-
- mbox[dev] = NULL;
- msg_direction[dev] = 0;
- }
-
- restore_flags (flags);
-
- return err;
-}
-
-int
-pmgr_inform (int dev, int event, unsigned long p1, unsigned long p2,
- unsigned long p3, unsigned long p4)
-{
- unsigned long flags;
- int err = 0;
-
- struct patmgr_info *tmp_mbox;
-
- if (!pmgr_opened[dev])
- return 0;
-
- tmp_mbox = (struct patmgr_info *) vmalloc (sizeof (struct patmgr_info));
-
- if (tmp_mbox == NULL)
- {
- printk ("pmgr: Couldn't allocate memory for a message\n");
- return 0;
- }
-
- save_flags (flags);
- cli ();
-
- if (mbox[dev])
- printk (" PATMGR: Server %d mbox full. Why?\n", dev);
- else
- {
-
- mbox[dev] = tmp_mbox;
- mbox[dev]->key = PM_K_EVENT;
- mbox[dev]->command = event;
- mbox[dev]->parm1 = p1;
- mbox[dev]->parm2 = p2;
- mbox[dev]->parm3 = p3;
- msg_direction[dev] = A_TO_S;
-
- if ((server_wait_flag[dev].opts & WK_SLEEP))
- {
- {
- server_wait_flag[dev].opts = WK_WAKEUP;
- wake_up (&server_procs[dev]);
- };
- }
-
-
- appl_wait_flag.opts = WK_SLEEP;
- interruptible_sleep_on (&appl_proc);
- appl_wait_flag.opts &= ~WK_SLEEP;;
- mbox[dev] = NULL;
- msg_direction[dev] = 0;
- }
-
- restore_flags (flags);
- vfree (tmp_mbox);
-
- return err;
-}
-
-#endif
{
int loopc;
+ DDB (printk ("Entered sb_dsp_reset()\n"));
+
if (devc->model == MDL_ESS)
outb ((3), DSP_RESET); /* Reset FIFO too */
else
for (loopc = 0; loopc < 1000 && !(inb (DSP_DATA_AVAIL) & 0x80); loopc++);
if (inb (DSP_READ) != 0xAA)
- return 0; /* Sorry */
+ {
+ DDB (printk ("sb: No response to RESET\n"));
+ return 0; /* Sorry */
+ }
if (devc->model == MDL_ESS)
sb_dsp_command (devc, 0xc6); /* Enable extended mode */
+ DDB (printk ("sb_dsp_reset() OK\n"));
return 1;
}
unsigned long flags;
+ DDB (printk ("Entered dsp_get_vers()\n"));
save_flags (flags);
cli ();
devc->major = devc->minor = 0;
}
}
}
+ DDB (printk ("DSP version %d.%d\n", devc->major, devc->minor));
restore_flags (flags);
}
tenmicrosec (devc->osp);
val = inb (MIXER_DATA);
tenmicrosec (devc->osp);
+ tenmicrosec (devc->osp);
restore_flags (flags);
return val;
sb_devc *devc = mixer_devs[dev]->devc;
int val;
+/*
+ * Use ioctl(fd, SOUND_MIXER_PRIVATE1, &mode) to turn AGC off (0) or on (1).
+ */
+ if (cmd == SOUND_MIXER_PRIVATE1 && devc->model == MDL_SB16)
+ {
+ int tmp;
+
+ get_user (tmp, (int *) arg);
+
+ sb_setmixer (devc, 0x43, (~tmp) & 0x01);
+ return 0;
+ }
+
if (((cmd >> 8) & 0xff) == 'M')
{
if (_IOC_DIR (cmd) & _IOC_WRITE)
static void seq_startplay (void);
static int seq_sync (void);
static void seq_reset (void);
-static int pmgr_present[MAX_SYNTH_DEV] =
-{0};
#if MAX_SYNTH_DEV > 15
#error Too many synthesizer devices enabled.
ev_len = seq_mode == SEQ_1 ? 4 : 8;
- if (dev) /*
- * Patch manager device
- */
- return pmgr_read (dev - 1, file, buf, count);
-
save_flags (flags);
cli ();
if (!iqlen)
if (mode == OPEN_READ)
return -EIO;
- if (dev)
- return pmgr_write (dev - 1, file, buf, count);
-
c = count;
while (c >= 4)
return -ENXIO;
}
- if (dev) /* Patch manager device */
+ if (dev) /* Patch manager device (obsolete) */
{
- printk ("Patch manager interface is currently broken. Sorry\n");
return -ENXIO;
}
midi_sleep_flag.opts = WK_NONE;
output_threshold = SEQ_MAX_QUEUE / 2;
- for (i = 0; i < num_synths; i++)
- if (pmgr_present[i])
- pmgr_inform (i, PM_E_OPENED, 0, 0, 0, 0);
-
return 0;
}
DEB (printk ("sequencer_release(dev=%d)\n", dev));
- if (dev) /*
- * Patch manager device
- */
- {
- dev--;
- pmgr_release (dev);
- pmgr_present[dev] = 0;
- return;
- }
-
/*
* * Wait until the queue is empty (if we don't have nonblock)
*/
}
}
- for (i = 0; i < num_synths; i++)
- if (pmgr_present[i])
- pmgr_inform (i, PM_E_CLOSED, 0, 0, 0, 0);
-
for (i = 0; i < max_mididev; i++)
{
if (midi_opened[i])
sequencer_ioctl (int dev, struct fileinfo *file,
unsigned int cmd, caddr_t arg)
{
- int midi_dev, orig_dev;
+ int midi_dev, orig_dev, val;
int mode = file->mode & O_ACCMODE;
orig_dev = dev = dev >> 4;
case SNDCTL_TMR_CONTINUE:
case SNDCTL_TMR_METRONOME:
case SNDCTL_TMR_SOURCE:
- if (dev) /* Patch manager */
- return -EIO;
if (seq_mode != SEQ_2)
return -EINVAL;
break;
case SNDCTL_TMR_SELECT:
- if (dev) /* Patch manager */
- return -EIO;
if (seq_mode != SEQ_2)
return -EINVAL;
break;
case SNDCTL_SEQ_SYNC:
- if (dev) /*
- * Patch manager
- */
- return -EIO;
if (mode == OPEN_READ)
return 0;
break;
case SNDCTL_SEQ_RESET:
- if (dev) /*
- * Patch manager
- */
- return -EIO;
seq_reset ();
return 0;
break;
case SNDCTL_SEQ_TESTMIDI:
- if (dev) /*
- * Patch manager
- */
- return -EIO;
-
get_user (midi_dev, (int *) arg);
- if (midi_dev >= max_mididev)
+ if (midi_dev < 0 || midi_dev >= max_mididev)
return -ENXIO;
if (!midi_opened[midi_dev])
break;
case SNDCTL_SEQ_GETINCOUNT:
- if (dev) /*
- * Patch manager
- */
- return -EIO;
-
if (mode == OPEN_WRITE)
return 0;
return ioctl_out (arg, iqlen);
break;
case SNDCTL_SEQ_CTRLRATE:
- if (dev) /* Patch manager */
- return -EIO;
-
/*
* If *arg == 0, just return the current rate
*/
if (seq_mode == SEQ_2)
return tmr->ioctl (tmr_no, cmd, arg);
- if (ioctl_in (arg) != 0)
+ get_user (val, (int *) arg);
+ if (val != 0)
return -EINVAL;
return ioctl_out (arg, HZ);
return -EBUSY;
}
- if (!orig_dev && pmgr_present[dev])
- pmgr_inform (dev, PM_E_PATCH_RESET, 0, 0, 0, 0);
-
err = synth_devs[dev]->ioctl (dev, cmd, arg);
return err;
}
case SNDCTL_FM_4OP_ENABLE:
{
- int dev = ioctl_in (arg);
+ int dev;
+
+ get_user (dev, (int *) arg);
if (dev < 0 || dev >= num_synths)
return -ENXIO;
}
break;
- case SNDCTL_PMGR_IFACE:
- {
- struct patmgr_info *inf;
- int dev, err;
-
- if ((inf = (struct patmgr_info *) vmalloc (sizeof (*inf))) == NULL)
- {
- printk ("patmgr: Can't allocate memory for a message\n");
- return -EIO;
- }
-
- copy_from_user ((char *) inf, &((char *) arg)[0], sizeof (*inf));
- dev = inf->device;
-
- if (dev < 0 || dev >= num_synths)
- {
- vfree (inf);
- return -ENXIO;
- }
-
- if (!synth_devs[dev]->pmgr_interface)
- {
- vfree (inf);
- return -ENXIO;
- }
-
- if ((err = synth_devs[dev]->pmgr_interface (dev, inf)) == -1)
- {
- vfree (inf);
- return err;
- }
-
- {
- char *fixit = (char *) inf;
-
- copy_to_user (&((char *) arg)[0], fixit, sizeof (*inf));
- };
- vfree (inf);
- return 0;
- }
- break;
-
- case SNDCTL_PMGR_ACCESS:
- {
- struct patmgr_info *inf;
- int dev, err;
-
- if ((inf = (struct patmgr_info *) vmalloc (sizeof (*inf))) == NULL)
- {
- printk ("patmgr: Can't allocate memory for a message\n");
- return -EIO;
- }
-
- copy_from_user ((char *) inf, &((char *) arg)[0], sizeof (*inf));
- dev = inf->device;
-
- if (dev < 0 || dev >= num_synths)
- {
- vfree (inf);
- return -ENXIO;
- }
-
- if (!pmgr_present[dev])
- {
- vfree (inf);
- return -ESRCH;
- }
-
- if ((err = pmgr_access (dev, inf)) < 0)
- {
- vfree (inf);
- return err;
- }
-
- {
- char *fixit = (char *) inf;
-
- copy_to_user (&((char *) arg)[0], fixit, sizeof (*inf));
- };
- vfree (inf);
- return 0;
- }
- break;
-
case SNDCTL_SEQ_THRESHOLD:
{
- int tmp = ioctl_in (arg);
+ int tmp;
- if (dev) /*
- * Patch manager
- */
- return -EIO;
+ get_user (tmp, (int *) arg);
if (tmp < 1)
tmp = 1;
case SNDCTL_MIDI_PRETIME:
{
- int val = ioctl_in (arg);
+ int val;
+
+ get_user (val, (int *) arg);
if (val < 0)
val = 0;
break;
default:
- if (dev) /*
- * Patch manager
- */
- return -EIO;
-
if (mode == OPEN_READ)
return -EIO;
/* From opl3.c */
void enable_opl3_mode(int left, int right, int both);
-/* From patmgr.c */
-int pmgr_open(int dev);
-void pmgr_release(int dev);
-int pmgr_read (int dev, struct fileinfo *file, char * buf, int count);
-int pmgr_write (int dev, struct fileinfo *file, const char * buf, int count);
-int pmgr_access(int dev, struct patmgr_info *rec);
-int pmgr_inform(int dev, int event, unsigned long parm1, unsigned long parm2,
- unsigned long parm3, unsigned long parm4);
-
/* From ics2101.c */
void ics2101_mixer_init(void);
timer_ioctl (int dev,
unsigned int cmd, caddr_t arg)
{
+ int val;
+
switch (cmd)
{
case SNDCTL_TMR_SOURCE:
break;
case SNDCTL_TMR_TIMEBASE:
- {
- int val;
-
- get_user (val, (int *) arg);
-
- if (val)
- {
- if (val < 1)
- val = 1;
- if (val > 1000)
- val = 1000;
- curr_timebase = val;
- }
-
- return ioctl_out (arg, curr_timebase);
- }
+ get_user (val, (int *) arg);
+
+ if (val)
+ {
+ if (val < 1)
+ val = 1;
+ if (val > 1000)
+ val = 1000;
+ curr_timebase = val;
+ }
+
+ return ioctl_out (arg, curr_timebase);
break;
case SNDCTL_TMR_TEMPO:
- {
- int val;
-
- get_user (val, (int *) arg);
-
- if (val)
- {
- if (val < 8)
- val = 8;
- if (val > 250)
- val = 250;
- tmr_offs = tmr_ctr;
- ticks_offs += tmr2ticks (tmr_ctr);
- tmr_ctr = 0;
- curr_tempo = val;
- reprogram_timer ();
- }
-
- return ioctl_out (arg, curr_tempo);
- }
+ get_user (val, (int *) arg);
+
+ if (val)
+ {
+ if (val < 8)
+ val = 8;
+ if (val > 250)
+ val = 250;
+ tmr_offs = tmr_ctr;
+ ticks_offs += tmr2ticks (tmr_ctr);
+ tmr_ctr = 0;
+ curr_tempo = val;
+ reprogram_timer ();
+ }
+
+ return ioctl_out (arg, curr_tempo);
break;
case SNDCTL_SEQ_CTRLRATE:
- if (ioctl_in (arg) != 0) /* Can't change */
+ get_user (val, (int *) arg);
+
+ if (val != 0) /* Can't change */
return -EINVAL;
return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
-#define SOUND_VERSION_STRING "3.7-beta6-961029"
-#define SOUND_INTERNAL_VERSION 0x030701
+#define SOUND_VERSION_STRING "3.7-beta12-961115"
+#define SOUND_INTERNAL_VERSION 0x030707
devc->failed = 0;
}
-int
-probe_sscape (struct address_info *hw_config)
+static int
+detect_ga (sscape_info * devc)
{
unsigned char save;
- devc->base = hw_config->io_base;
- devc->irq = hw_config->irq;
- devc->dma = hw_config->dma;
-
- devc->failed = 1;
+ DDB (printk ("Entered Soundscape detect_ga(%x)\n", devc->base));
- if (sscape_detected != 0 && sscape_detected != hw_config->io_base)
+ if (check_region (devc->base, 8))
return 0;
/*
return 0;
}
+ return 1;
+}
+
+int
+probe_sscape (struct address_info *hw_config)
+{
+
+ devc->base = hw_config->io_base;
+ devc->irq = hw_config->irq;
+ devc->dma = hw_config->dma;
+
+ if (sscape_detected != 0 && sscape_detected != hw_config->io_base)
+ return 0;
+
+ devc->failed = 1;
+
+ if (!detect_ga (devc))
+ return 0;
+
#ifdef SSCAPE_DEBUG1
/*
* Temporary debugging aid. Print contents of the registers before
break;
case SNDCTL_SEQ_CTRLRATE:
- if (ioctl_in (arg) != 0) /* Can't change */
- return -EINVAL;
+ {
+ int val;
- return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
+ get_user (val, (int *) arg);
+ if (val != 0) /* Can't change */
+ return -EINVAL;
+
+ return ioctl_out (arg, ((curr_tempo * curr_timebase) + 30) / 60);
+ }
break;
case SNDCTL_SEQ_GETTIME:
* added 6850 support, used with COVOX SoundMaster II and custom cards.
*/
+#include <linux/config.h>
#include "sound_config.h"
#if defined(CONFIG_UART6850) && defined(CONFIG_MIDI)
--- /dev/null
+
+/*
+ * sound/vivo.c
+ *
+ * Support routines for Ensoniq Soundscape VIVO. The actual driver is
+ * in the vivo subdirectory.
+ */
+/*
+ * Copyright (C) by Hannu Savolainen 1993-1996
+ *
+ * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
+ * Version 2 (June 1991). See the "COPYING" file distributed with this software
+ * for more info.
+ */
+
+#include "sound_config.h"
+
+extern void otto_init (int options);
+extern void synth_init (void);
* here even more important to align src and dst on a 32-bit (or even
* better 64-bit) boundary
*/
-unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
+unsigned int csum_partial_copy(const char *src, char *dst, int len, unsigned int sum);
/*
* the same as csum_partial, but copies from user space (but on the alpha
#define SO_ERROR 0x1007
#define SO_SNDBUF 0x1001
#define SO_RCVBUF 0x1002
+#define SO_RCVLOWAT 0x1010
+#define SO_SNDLOWAT 0x1011
+#define SO_RCVTIMEO 0x1012
+#define SO_SNDTIMEO 0x1013
/* linux-specific, might as well be the same as on i386 */
#define SO_NO_CHECK 11
#ifndef _LINUX_CTYPE_H
#define _LINUX_CTYPE_H
+/*
+ * NOTE! This ctype does not handle EOF like the standarc C
+ * library is required to.
+ */
+
#define _U 0x01 /* upper */
#define _L 0x02 /* lower */
#define _D 0x04 /* digit */
#define _SP 0x80 /* hard space (0x20) */
extern unsigned char _ctype[];
-extern char _ctmp;
-
-#define isalnum(c) ((_ctype+1)[c]&(_U|_L|_D))
-#define isalpha(c) ((_ctype+1)[c]&(_U|_L))
-#define iscntrl(c) ((_ctype+1)[c]&(_C))
-#define isdigit(c) ((_ctype+1)[c]&(_D))
-#define isgraph(c) ((_ctype+1)[c]&(_P|_U|_L|_D))
-#define islower(c) ((_ctype+1)[c]&(_L))
-#define isprint(c) ((_ctype+1)[c]&(_P|_U|_L|_D|_SP))
-#define ispunct(c) ((_ctype+1)[c]&(_P))
-#define isspace(c) ((_ctype+1)[c]&(_S))
-#define isupper(c) ((_ctype+1)[c]&(_U))
-#define isxdigit(c) ((_ctype+1)[c]&(_D|_X))
-
-#define isascii(c) (((unsigned) c)<=0x7f)
-#define toascii(c) (((unsigned) c)&0x7f)
-
-#define tolower(c) (_ctmp=c,isupper(_ctmp)?_ctmp-('A'-'a'):_ctmp)
-#define toupper(c) (_ctmp=c,islower(_ctmp)?_ctmp-('a'-'A'):_ctmp)
+
+#define __ismask(x) (_ctype[(int)(unsigned char)(x)])
+
+#define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0)
+#define isalpha(c) ((__ismask(c)&(_U|_L)) != 0)
+#define iscntrl(c) ((__ismask(c)&(_C)) != 0)
+#define isdigit(c) ((__ismask(c)&(_D)) != 0)
+#define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0)
+#define islower(c) ((__ismask(c)&(_L)) != 0)
+#define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
+#define ispunct(c) ((__ismask(c)&(_P)) != 0)
+#define isspace(c) ((__ismask(c)&(_S)) != 0)
+#define isupper(c) ((__ismask(c)&(_U)) != 0)
+#define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0)
+
+#define isascii(c) (((unsigned char)(c))<=0x7f)
+#define toascii(c) (((unsigned char)(c))&0x7f)
+
+static inline unsigned char __tolower(unsigned char c)
+{
+ if (isupper(c))
+ c -= 'A'-'a';
+ return c;
+}
+
+static inline unsigned char __toupper(unsigned char c)
+{
+ if (islower(c))
+ c -= 'a'-'A';
+ return c;
+}
+
+#define tolower(c) __tolower(c)
+#define toupper(c) __toupper(c)
#endif
However, everything runs fine with an arbitrary kdev_t type. */
#define MINORBITS 8
-#define MINORMASK ((1<<MINORBITS) - 1)
+#define MINORMASK ((1U << MINORBITS) - 1)
typedef unsigned short kdev_t;
-#define MAJOR(dev) ((dev) >> MINORBITS)
-#define MINOR(dev) ((dev) & MINORMASK)
-#define HASHDEV(dev) (dev)
+#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS))
+#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK))
+#define HASHDEV(dev) ((unsigned int) (dev))
#define NODEV 0
#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
#define B_FREE 0xffff /* yuk */
int (*dup) (struct socket *newsock, struct socket *oldsock);
int (*release) (struct socket *sock, struct socket *peer);
int (*bind) (struct socket *sock, struct sockaddr *umyaddr,
- size_t sockaddr_len);
+ int sockaddr_len);
int (*connect) (struct socket *sock, struct sockaddr *uservaddr,
- size_t sockaddr_len, int flags);
+ int sockaddr_len, int flags);
int (*socketpair) (struct socket *sock1, struct socket *sock2);
int (*accept) (struct socket *sock, struct socket *newsock,
int flags);
int (*getname) (struct socket *sock, struct sockaddr *uaddr,
- size_t *usockaddr_len, int peer);
+ int *usockaddr_len, int peer);
int (*select) (struct socket *sock, int sel_type,
select_table *wait);
int (*ioctl) (struct socket *sock, unsigned int cmd,
struct neighbour *nexthop;
#endif
- unsigned long len; /* Length of actual data */
- unsigned long csum; /* Checksum */
+ unsigned int len; /* Length of actual data */
+ unsigned int csum; /* Checksum */
__u32 saddr; /* IP source address */
__u32 daddr; /* IP target address */
__u32 raddr; /* IP next hop address */
extern void skb_device_unlock(struct sk_buff *skb);
extern void dev_kfree_skb(struct sk_buff *skb, int mode);
extern int skb_device_locked(struct sk_buff *skb);
-extern unsigned char * skb_put(struct sk_buff *skb, int len);
-extern unsigned char * skb_push(struct sk_buff *skb, int len);
-extern unsigned char * skb_pull(struct sk_buff *skb, int len);
+extern unsigned char * skb_put(struct sk_buff *skb, unsigned int len);
+extern unsigned char * skb_push(struct sk_buff *skb, unsigned int len);
+extern unsigned char * skb_pull(struct sk_buff *skb, unsigned int len);
extern int skb_headroom(struct sk_buff *skb);
extern int skb_tailroom(struct sk_buff *skb);
-extern void skb_reserve(struct sk_buff *skb, int len);
-extern void skb_trim(struct sk_buff *skb, int len);
+extern void skb_reserve(struct sk_buff *skb, unsigned int len);
+extern void skb_trim(struct sk_buff *skb, unsigned int len);
extern __inline__ int skb_queue_empty(struct sk_buff_head *list)
{
* Add data to an sk_buff
*/
-extern __inline__ unsigned char *skb_put(struct sk_buff *skb, int len)
+extern __inline__ unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
{
extern char *skb_put_errstr;
unsigned char *tmp=skb->tail;
return tmp;
}
-extern __inline__ unsigned char *skb_push(struct sk_buff *skb, int len)
+extern __inline__ unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
{
extern char *skb_push_errstr;
skb->data-=len;
return skb->data;
}
-extern __inline__ unsigned char * skb_pull(struct sk_buff *skb, int len)
+extern __inline__ unsigned char * skb_pull(struct sk_buff *skb, unsigned int len)
{
- if(len > skb->len)
+ if (len > skb->len)
return NULL;
skb->data+=len;
skb->len-=len;
return skb->end-skb->tail;
}
-extern __inline__ void skb_reserve(struct sk_buff *skb, int len)
+extern __inline__ void skb_reserve(struct sk_buff *skb, unsigned int len)
{
skb->data+=len;
skb->tail+=len;
}
-extern __inline__ void skb_trim(struct sk_buff *skb, int len)
+extern __inline__ void skb_trim(struct sk_buff *skb, unsigned int len)
{
- if(skb->len>len)
- {
- skb->len=len;
- skb->tail=skb->data+len;
+ if (skb->len > len) {
+ skb->len = len;
+ skb->tail = skb->data+len;
}
}
struct msghdr
{
void * msg_name; /* Socket name */
- size_t msg_namelen; /* Length of name */
+ int msg_namelen; /* Length of name */
struct iovec * msg_iov; /* Data blocks */
size_t msg_iovlen; /* Number of blocks */
void * msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
#define SNDCTL_SEQ_GETOUTCOUNT _SIOR ('Q', 4, int)
#define SNDCTL_SEQ_GETINCOUNT _SIOR ('Q', 5, int)
#define SNDCTL_SEQ_PERCMODE _SIOW ('Q', 6, int)
-#define SNDCTL_FM_LOAD_INSTR _SIOW ('Q', 7, struct sbi_instrument) /* Valid for FM only */
+#define SNDCTL_FM_LOAD_INSTR _SIOW ('Q', 7, struct sbi_instrument) /* Obsolete */
#define SNDCTL_SEQ_TESTMIDI _SIOW ('Q', 8, int)
#define SNDCTL_SEQ_RESETSAMPLES _SIOW ('Q', 9, int)
#define SNDCTL_SEQ_NRSYNTHS _SIOR ('Q',10, int)
#define SNDCTL_SEQ_NRMIDIS _SIOR ('Q',11, int)
#define SNDCTL_MIDI_INFO _SIOWR('Q',12, struct midi_info)
#define SNDCTL_SEQ_THRESHOLD _SIOW ('Q',13, int)
-#define SNDCTL_SEQ_TRESHOLD SNDCTL_SEQ_THRESHOLD /* there was once a typo */
#define SNDCTL_SYNTH_MEMAVL _SIOWR('Q',14, int) /* in=dev#, out=memsize */
#define SNDCTL_FM_4OP_ENABLE _SIOW ('Q',15, int) /* in=dev# */
-#define SNDCTL_PMGR_ACCESS _SIOWR('Q',16, struct patmgr_info)
#define SNDCTL_SEQ_PANIC _SIO ('Q',17)
#define SNDCTL_SEQ_OUTOFBAND _SIOW ('Q',18, struct seq_event_rec)
#define SNDCTL_SEQ_GETTIME _SIOR ('Q',19, int)
#define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */
#define WAVE_SCALE 0x00040000 /* The scaling info is valid */
#define WAVE_FRACTIONS 0x00080000 /* Fraction information is valid */
+/* Reserved bits */
+#define WAVE_ROM 0x40000000 /* For future use */
+#define WAVE_MULAW 0x20000000 /* For future use */
/* Other bits must be zeroed */
int len; /* Size of the wave data in bytes */
int volume;
int fractions;
- int spare[3];
+ int reserved1;
+ int spare[2];
char data[1]; /* The waveform data starts here */
};
unsigned char data[1]; /* Sysex data starts here */
};
-/*
- * Patch management interface (/dev/sequencer, /dev/patmgr#)
- * Don't use these calls if you want to maintain compatibility with
- * the future versions of the driver.
- */
-
-#define PS_NO_PATCHES 0 /* No patch support on device */
-#define PS_MGR_NOT_OK 1 /* Plain patch support (no mgr) */
-#define PS_MGR_OK 2 /* Patch manager supported */
-#define PS_MANAGED 3 /* Patch manager running */
-
-#define SNDCTL_PMGR_IFACE _SIOWR('P', 1, struct patmgr_info)
-
-/*
- * The patmgr_info is a fixed size structure which is used for two
- * different purposes. The intended use is for communication between
- * the application using /dev/sequencer and the patch manager daemon
- * associated with a synthesizer device (ioctl(SNDCTL_PMGR_ACCESS)).
- *
- * This structure is also used with ioctl(SNDCTL_PGMR_IFACE) which allows
- * a patch manager daemon to read and write device parameters. This
- * ioctl available through /dev/sequencer also. Avoid using it since it's
- * extremely hardware dependent. In addition access trough /dev/sequencer
- * may confuse the patch manager daemon.
- */
-
-struct patmgr_info {
- unsigned int key; /* Don't worry. Reserved for communication
- between the patch manager and the driver. */
-#define PM_K_EVENT 1 /* Event from the /dev/sequencer driver */
-#define PM_K_COMMAND 2 /* Request from an application */
-#define PM_K_RESPONSE 3 /* From patmgr to application */
-#define PM_ERROR 4 /* Error returned by the patmgr */
- int device;
- int command;
-
-/*
- * Commands 0x000 to 0xfff reserved for patch manager programs
- */
-#define PM_GET_DEVTYPE 1 /* Returns type of the patch mgr interface of dev */
-#define PMTYPE_FM2 1 /* 2 OP fm */
-#define PMTYPE_FM4 2 /* Mixed 4 or 2 op FM (OPL-3) */
-#define PMTYPE_WAVE 3 /* Wave table synthesizer (GUS) */
-#define PM_GET_NRPGM 2 /* Returns max # of midi programs in parm1 */
-#define PM_GET_PGMMAP 3 /* Returns map of loaded midi programs in data8 */
-#define PM_GET_PGM_PATCHES 4 /* Return list of patches of a program (parm1) */
-#define PM_GET_PATCH 5 /* Return patch header of patch parm1 */
-#define PM_SET_PATCH 6 /* Set patch header of patch parm1 */
-#define PM_READ_PATCH 7 /* Read patch (wave) data */
-#define PM_WRITE_PATCH 8 /* Write patch (wave) data */
-
-/*
- * Commands 0x1000 to 0xffff are for communication between the patch manager
- * and the client
- */
-#define _PM_LOAD_PATCH 0x100
-
-/*
- * Commands above 0xffff reserved for device specific use
- */
-
- int parm1;
- int parm2;
- int parm3;
-
- union {
- unsigned char data8[4000];
- unsigned short data16[2000];
- unsigned int data32[1000];
- struct patch_info patch;
- } data;
- };
-
-/*
- * When a patch manager daemon is present, it will be informed by the
- * driver when something important happens. For example when the
- * /dev/sequencer is opened or closed. A record with key == PM_K_EVENT is
- * returned. The command field contains the event type:
- */
-#define PM_E_OPENED 1 /* /dev/sequencer opened */
-#define PM_E_CLOSED 2 /* /dev/sequencer closed */
-#define PM_E_PATCH_RESET 3 /* SNDCTL_RESETSAMPLES called */
-#define PM_E_PATCH_LOADED 4 /* A patch has been loaded by appl */
-
/*
* /dev/sequencer input events.
*
#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
#define SEQ_USE_EXTBUF() extern unsigned char _seqbuf[]; extern int _seqbuflen;extern int _seqbufptr
#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
-#define SEQ_PM_DEFINES struct patmgr_info _pm_info
#define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
#define _SEQ_ADVBUF(len) _seqbufptr += len
#define SEQ_DUMPBUF seqbuf_dump
#define _SEQ_NEEDBUF(len) /* empty */
#endif
-#define PM_LOAD_PATCH(dev, bank, pgm) (SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \
- _pm_info.device=dev, _pm_info.data.data8[0]=pgm, \
- _pm_info.parm1 = bank, _pm_info.parm2 = 1, \
- ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info))
-#define PM_LOAD_PATCHES(dev, bank, pgm) (SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \
- _pm_info.device=dev, memcpy(_pm_info.data.data8, pgm, 128), \
- _pm_info.parm1 = bank, _pm_info.parm2 = 128, \
- ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info))
-
#define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\
_seqbuf[_seqbufptr] = SEQ_EXTENDED;\
_seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
#ifndef _LINUX_STDDEF_H
#define _LINUX_STDDEF_H
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
#undef NULL
#define NULL ((void *)0)
struct inode * swap_file;
unsigned char * swap_map;
unsigned char * swap_lockmap;
- int lowest_bit;
- int highest_bit;
- int cluster_next;
- int cluster_nr;
+ unsigned int lowest_bit;
+ unsigned int highest_bit;
+ unsigned int cluster_next;
+ unsigned int cluster_nr;
int prio; /* swap priority */
int pages;
unsigned long max;
extern void swap_duplicate(unsigned long);
/* linux/mm/swapfile.c */
-extern int nr_swapfiles;
+extern unsigned int nr_swapfiles;
extern struct swap_info_struct swap_info[];
void si_swapinfo(struct sysinfo *);
unsigned long get_swap_page(void);
typedef struct swap_control_v5
{
- int sc_max_page_age;
- int sc_page_advance;
- int sc_page_decline;
- int sc_page_initial_age;
- int sc_max_buff_age;
- int sc_buff_advance;
- int sc_buff_decline;
- int sc_buff_initial_age;
- int sc_age_cluster_fract;
- int sc_age_cluster_min;
- int sc_pageout_weight;
- int sc_bufferout_weight;
- int sc_buffer_grace;
- int sc_nr_buffs_to_free;
- int sc_nr_pages_to_free;
+ unsigned int sc_max_page_age;
+ unsigned int sc_page_advance;
+ unsigned int sc_page_decline;
+ unsigned int sc_page_initial_age;
+ unsigned int sc_max_buff_age;
+ unsigned int sc_buff_advance;
+ unsigned int sc_buff_decline;
+ unsigned int sc_buff_initial_age;
+ unsigned int sc_age_cluster_fract;
+ unsigned int sc_age_cluster_min;
+ unsigned int sc_pageout_weight;
+ unsigned int sc_bufferout_weight;
+ unsigned int sc_buffer_grace;
+ unsigned int sc_nr_buffs_to_free;
+ unsigned int sc_nr_pages_to_free;
enum RCL_POLICY sc_policy;
} swap_control_v5;
typedef struct swap_control_v5 swap_control_t;
typedef struct kswapd_control_v1
{
- int maxpages;
- int pages_buff;
- int pages_shm;
- int pages_mmap;
- int pages_swap;
+ unsigned int maxpages;
+ unsigned int pages_buff;
+ unsigned int pages_shm;
+ unsigned int pages_mmap;
+ unsigned int pages_swap;
} kswapd_control_v1;
typedef kswapd_control_v1 kswapd_control_t;
extern kswapd_control_t kswapd_ctl;
typedef struct swapstat_v1
{
- int wakeups;
- int pages_reclaimed;
- int pages_shm;
- int pages_mmap;
- int pages_swap;
+ unsigned int wakeups;
+ unsigned int pages_reclaimed;
+ unsigned int pages_shm;
+ unsigned int pages_mmap;
+ unsigned int pages_swap;
} swapstat_v1;
typedef swapstat_v1 swapstat_t;
extern swapstat_t swapstats;
* scan the resource list. */
static inline int AGE_CLUSTER_SIZE(int resources)
{
- int n = (resources * AGE_CLUSTER_FRACT) >> 10;
+ unsigned int n = (resources * AGE_CLUSTER_FRACT) >> 10;
if (n < AGE_CLUSTER_MIN)
return AGE_CLUSTER_MIN;
else
#ifdef __KERNEL__
+#include <asm/page.h>
+
struct wait_queue {
struct task_struct * task;
struct wait_queue * next;
};
typedef struct select_table_struct {
- int nr;
+ unsigned int nr;
struct select_table_entry * entry;
} select_table;
-#define __MAX_SELECT_TABLE_ENTRIES (4096 / sizeof (struct select_table_entry))
+#define __MAX_SELECT_TABLE_ENTRIES (PAGE_SIZE / sizeof (struct select_table_entry))
#endif /* __KERNEL__ */
struct socket *peer);
extern int inet_connect(struct socket *sock,
struct sockaddr * uaddr,
- size_t addr_len, int flags);
+ int addr_len, int flags);
extern int inet_accept(struct socket *sock,
struct socket *newsock, int flags);
extern int inet_recvmsg(struct socket *sock,
unsigned long timeout);
int (*connect)(struct sock *sk,
struct sockaddr *uaddr,
- size_t addr_len);
+ int addr_len);
struct sock * (*accept) (struct sock *sk, int flags);
void (*retransmit)(struct sock *sk, int all);
int len, int noblock, int flags,
int *addr_len);
int (*bind)(struct sock *sk,
- struct sockaddr *uaddr, size_t addr_len);
+ struct sockaddr *uaddr, int addr_len);
int (*backlog_rcv) (struct sock *sk,
struct sk_buff *skb);
struct sk_buff *skb);
extern int tcp_v4_connect(struct sock *sk,
struct sockaddr *uaddr,
- size_t addr_len);
+ int addr_len);
extern void tcp_read_wakeup(struct sock *);
extern int udpv6_connect(struct sock *sk,
struct sockaddr *uaddr,
- size_t addr_len);
+ int addr_len);
extern int datagram_recv_ctl(struct sock *sk,
struct msghdr *msg,
extern void udp_send_check(struct udphdr *uh, __u32 saddr,
__u32 daddr, int len, struct sock *sk);
extern int udp_connect(struct sock *sk,
- struct sockaddr *usin, size_t addr_len);
+ struct sockaddr *usin, int addr_len);
extern int udp_sendmsg(struct sock *sk, struct msghdr *msg,
int len, int noblock, int flags);
void calibrate_delay(void)
{
- int ticks;
- int loopbit;
+ unsigned long ticks, loopbit;
int lps_precision = LPS_PREC;
loops_per_sec = (1<<12);
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
-#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/malloc.h>
#include <linux/ctype.h>
-char _ctmp;
-unsigned char _ctype[] = {0x00, /* EOF */
+unsigned char _ctype[] = {
_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */
_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */
_C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */
int shrink_mmap(int priority, int dma)
{
- static int clock = 0;
+ static unsigned long clock = 0;
struct page * page;
unsigned long limit = max_mapnr;
struct buffer_head *tmp, *bh;
#include <asm/bitops.h>
#include <asm/pgtable.h>
-int nr_swapfiles = 0;
+unsigned int nr_swapfiles = 0;
+
static struct {
int head; /* head of priority-ordered swapfile list */
int next; /* swapfile to be used next */
static inline int scan_swap_map(struct swap_info_struct *si)
{
- int offset;
+ unsigned long offset;
/*
* We try to cluster swap pages by allocating them
* sequentially in swap. Once we've allocated
* Set the address 'our end' of the connection.
*/
-static int atalk_bind(struct socket *sock, struct sockaddr *uaddr,size_t addr_len)
+static int atalk_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
atalk_socket *sk;
struct sockaddr_at *addr=(struct sockaddr_at *)uaddr;
*/
static int atalk_connect(struct socket *sock, struct sockaddr *uaddr,
- size_t addr_len, int flags)
+ int addr_len, int flags)
{
atalk_socket *sk=(atalk_socket *)sock->data;
struct sockaddr_at *addr;
*/
static int atalk_getname(struct socket *sock, struct sockaddr *uaddr,
- size_t *uaddr_len, int peer)
+ int *uaddr_len, int peer)
{
struct sockaddr_at sat;
atalk_socket *sk;
* BSD 4.4 ADDIFADDR type support. It is however small and trivially backward
* compatible 8)
*/
-static int ax25_bind(struct socket *sock, struct sockaddr *uaddr,size_t addr_len)
+static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sock *sk;
struct full_sockaddr_ax25 *addr = (struct full_sockaddr_ax25 *)uaddr;
}
static int ax25_connect(struct socket *sock, struct sockaddr *uaddr,
- size_t addr_len, int flags)
+ int addr_len, int flags)
{
struct sock *sk = (struct sock *)sock->data;
struct sockaddr_ax25 *addr = (struct sockaddr_ax25 *)uaddr;
}
static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,
- size_t *uaddr_len, int peer)
+ int *uaddr_len, int peer)
{
struct full_sockaddr_ax25 *sax = (struct full_sockaddr_ax25 *)uaddr;
struct sock *sk;
* Add data to an sk_buff
*/
-unsigned char *skb_put(struct sk_buff *skb, int len)
+unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
{
unsigned char *tmp=skb->tail;
IS_SKB(skb);
return tmp;
}
-unsigned char *skb_push(struct sk_buff *skb, int len)
+unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
{
IS_SKB(skb);
skb->data-=len;
return skb->data;
}
-unsigned char * skb_pull(struct sk_buff *skb, int len)
+unsigned char * skb_pull(struct sk_buff *skb, unsigned int len)
{
IS_SKB(skb);
if(len>skb->len)
return skb->end-skb->tail;
}
-void skb_reserve(struct sk_buff *skb, int len)
+void skb_reserve(struct sk_buff *skb, unsigned int len)
{
IS_SKB(skb);
skb->data+=len;
IS_SKB(skb);
}
-void skb_trim(struct sk_buff *skb, int len)
+void skb_trim(struct sk_buff *skb, unsigned int len)
{
IS_SKB(skb);
if(skb->len>len)
static int inet_bind(struct socket *sock, struct sockaddr *uaddr,
- size_t addr_len)
+ int addr_len)
{
struct sockaddr_in *addr=(struct sockaddr_in *)uaddr;
struct sock *sk=(struct sock *)sock->data, *sk2;
*/
int inet_connect(struct socket *sock, struct sockaddr * uaddr,
- size_t addr_len, int flags)
+ int addr_len, int flags)
{
struct sock *sk=(struct sock *)sock->data;
int err;
*/
static int inet_getname(struct socket *sock, struct sockaddr *uaddr,
- size_t *uaddr_len, int peer)
+ int *uaddr_len, int peer)
{
struct sockaddr_in *sin=(struct sockaddr_in *)uaddr;
struct sock *sk;
* Bind a packet socket to a device
*/
-static int packet_bind(struct sock *sk, struct sockaddr *uaddr, size_t addr_len)
+static int packet_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{
char name[15];
struct device *dev;
* This will initiate an outgoing connection.
*/
-int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, size_t addr_len)
+int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{
struct sk_buff *buff;
struct sk_buff *skb1;
if (size < sizeof(struct tcphdr) || size > skb->len)
{
- printk("tcp_send_skb: bad skb (skb = %p, data = %p, th = %p, len = %lu)\n",
+ printk("tcp_send_skb: bad skb (skb = %p, data = %p, th = %p, len = %u)\n",
skb, skb->data, th, skb->len);
kfree_skb(skb, FREE_WRITE);
return 0;
return(copied);
}
-int udp_connect(struct sock *sk, struct sockaddr *uaddr, size_t addr_len)
+int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{
struct sockaddr_in *usin = (struct sockaddr_in *) uaddr;
struct rtable *rt;
*/
static int inet6_bind(struct socket *sock, struct sockaddr *uaddr,
- size_t addr_len)
+ int addr_len)
{
struct sockaddr_in6 *addr=(struct sockaddr_in6 *)uaddr;
struct sock *sk=(struct sock *)sock->data, *sk2;
*/
static int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
- size_t *uaddr_len, int peer)
+ int *uaddr_len, int peer)
{
struct sockaddr_in6 *sin=(struct sockaddr_in6 *)uaddr;
struct sock *sk;
}
static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
- size_t addr_len)
+ int addr_len)
{
struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr;
struct ipv6_pinfo *np = &sk->net_pinfo.af_inet6;
*
*/
-int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, size_t addr_len)
+int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{
struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr;
struct in6_addr *daddr;
return ntohs(socketNum);
}
-static int ipx_bind(struct socket *sock, struct sockaddr *uaddr,size_t addr_len)
+static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
ipx_socket *sk;
ipx_interface *intrfc;
}
static int ipx_connect(struct socket *sock, struct sockaddr *uaddr,
- size_t addr_len, int flags)
+ int addr_len, int flags)
{
ipx_socket *sk=(ipx_socket *)sock->data;
struct sockaddr_ipx *addr;
}
static int ipx_getname(struct socket *sock, struct sockaddr *uaddr,
- size_t *uaddr_len, int peer)
+ int *uaddr_len, int peer)
{
ipx_address *addr;
struct sockaddr_ipx sipx;
return 0;
}
-static int nr_bind(struct socket *sock, struct sockaddr *uaddr, size_t addr_len)
+static int nr_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sock *sk;
struct full_sockaddr_ax25 *addr = (struct full_sockaddr_ax25 *)uaddr;
}
static int nr_connect(struct socket *sock, struct sockaddr *uaddr,
- size_t addr_len, int flags)
+ int addr_len, int flags)
{
struct sock *sk = (struct sock *)sock->data;
struct sockaddr_ax25 *addr = (struct sockaddr_ax25 *)uaddr;
}
static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
- size_t *uaddr_len, int peer)
+ int *uaddr_len, int peer)
{
struct full_sockaddr_ax25 *sax = (struct full_sockaddr_ax25 *)uaddr;
struct sock *sk;
return 0;
}
-static int rose_bind(struct socket *sock, struct sockaddr *uaddr, size_t addr_len)
+static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sock *sk;
struct sockaddr_rose *addr = (struct sockaddr_rose *)uaddr;
return 0;
}
-static int rose_connect(struct socket *sock, struct sockaddr *uaddr, size_t addr_len, int flags)
+static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags)
{
struct sock *sk = (struct sock *)sock->data;
struct sockaddr_rose *addr = (struct sockaddr_rose *)uaddr;
}
static int rose_getname(struct socket *sock, struct sockaddr *uaddr,
- size_t *uaddr_len, int peer)
+ int *uaddr_len, int peer)
{
struct sockaddr_rose *srose = (struct sockaddr_rose *)uaddr;
struct sock *sk;
+++ /dev/null
-/*
- * Rose release 001
- *
- * This is ALPHA test software. This code may break your machine, randomly fail to work with new
- * releases, misbehave and/or generally screw up. It might even work.
- *
- * This code REQUIRES 2.1.0 or higher/ NET3.029
- *
- * This module:
- * This module is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * History
- * Rose 001 Jonathan(G4KLX) Cloned from nr_out.c
- */
-
-#include <linux/config.h>
-#if defined(CONFIG_ROSE) || defined(CONFIG_ROSE_MODULE)
-#include <linux/errno.h>
-#include <linux/types.h>
-#include <linux/socket.h>
-#include <linux/in.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/timer.h>
-#include <linux/string.h>
-#include <linux/sockios.h>
-#include <linux/net.h>
-#include <net/ax25.h>
-#include <linux/inet.h>
-#include <linux/netdevice.h>
-#include <linux/skbuff.h>
-#include <net/sock.h>
-#include <asm/segment.h>
-#include <asm/system.h>
-#include <linux/fcntl.h>
-#include <linux/mm.h>
-#include <linux/interrupt.h>
-#include <net/rose.h>
-
-/*
- * This is where all Rose frames pass;
- */
-void rose_output(struct sock *sk, struct sk_buff *skb)
-{
- struct sk_buff *skbn;
- unsigned char header[ROSE_MIN_LEN];
- int err, frontlen, len;
-
- if (skb->len - ROSE_MIN_LEN > ROSE_PACLEN) {
- /* Save a copy of the Header */
- memcpy(header, skb->data, ROSE_MIN_LEN);
- skb_pull(skb, ROSE_MIN_LEN);
-
- frontlen = skb_headroom(skb);
-
- while (skb->len > 0) {
- if ((skbn = sock_alloc_send_skb(sk, frontlen + ROSE_PACLEN, 0, 0, &err)) == NULL)
- return;
-
- skbn->sk = sk;
- skbn->free = 1;
- skbn->arp = 1;
-
- skb_reserve(skbn, frontlen);
-
- len = (ROSE_PACLEN > skb->len) ? skb->len : ROSE_PACLEN;
-
- /* Copy the user data */
- memcpy(skb_put(skbn, len), skb->data, len);
- skb_pull(skb, len);
-
- /* Duplicate the Header */
- skb_push(skbn, ROSE_MIN_LEN);
- memcpy(skbn->data, header, ROSE_MIN_LEN);
-
- if (skb->len > 0)
- skbn->data[2] |= M_BIT;
-
- skb_queue_tail(&sk->write_queue, skbn); /* Throw it on the queue */
- }
-
- skb->free = 1;
- kfree_skb(skb, FREE_WRITE);
- } else {
- skb_queue_tail(&sk->write_queue, skb); /* Throw it on the queue */
- }
-
- if (sk->protinfo.rose->state == ROSE_STATE_3)
- rose_kick(sk);
-}
-
-/*
- * This procedure is passed a buffer descriptor for an iframe. It builds
- * the rest of the control part of the frame and then writes it out.
- */
-static void rose_send_iframe(struct sock *sk, struct sk_buff *skb, int last)
-{
- if (skb == NULL)
- return;
-
- if (last)
- skb->data[0] |= D_BIT;
-
- skb->data[2] |= (sk->protinfo.rose->vr << 5) & 0xE0;
- skb->data[2] |= (sk->protinfo.rose->vs << 1) & 0x0E;
-
- rose_transmit_buffer(sk, skb);
-}
-
-void rose_send_nak_frame(struct sock *sk)
-{
- struct sk_buff *skb, *skbn;
-
- if ((skb = skb_peek(&sk->protinfo.rose->ack_queue)) == NULL)
- return;
-
- if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL)
- return;
-
- skbn->data[2] = sk->protinfo.rose->va;
- skbn->data[3] = sk->protinfo.rose->vr;
-
- if (sk->protinfo.rose->condition & OWN_RX_BUSY_CONDITION)
- skbn->data[4] |= NR_CHOKE_FLAG;
-
- rose_transmit_buffer(sk, skbn);
-
- sk->protinfo.rose->condition &= ~ACK_PENDING_CONDITION;
- sk->protinfo.rose->vl = sk->protinfo.rose->vr;
- sk->protinfo.rose->t1timer = 0;
-}
-
-void rose_kick(struct sock *sk)
-{
- struct sk_buff *skb, *skbn;
- int last = 1;
- unsigned short start, end, next;
-
- del_timer(&sk->timer);
-
- start = (skb_peek(&sk->protinfo.rose->ack_queue) == NULL) ? sk->protinfo.rose->va : sk->protinfo.rose->vs;
- end = (sk->protinfo.rose->va + sk->window) % ROSE_MODULUS;
-
- if (!(sk->protinfo.rose->condition & PEER_RX_BUSY_CONDITION) &&
- start != end &&
- skb_peek(&sk->write_queue) != NULL) {
-
- sk->protinfo.rose->vs = start;
-
- /*
- * Transmit data until either we're out of data to send or
- * the window is full.
- */
-
- /*
- * Dequeue the frame and copy it.
- */
- skb = skb_dequeue(&sk->write_queue);
-
- do {
- if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
- skb_queue_head(&sk->write_queue, skb);
- break;
- }
-
- next = (sk->protinfo.rose->vs + 1) % ROSE_MODULUS;
- last = (next == end);
-
- /*
- * Transmit the frame copy.
- */
- rose_send_iframe(sk, skbn, last);
-
- sk->protinfo.rose->vs = next;
-
- /*
- * Requeue the original data frame.
- */
- skb_queue_tail(&sk->protinfo.rose->ack_queue, skb);
-
- } while (!last && (skb = skb_dequeue(&sk->write_queue)) != NULL);
-
- sk->protinfo.rose->vl = sk->protinfo.rose->vr;
- sk->protinfo.rose->condition &= ~ACK_PENDING_CONDITION;
- }
-
- rose_set_timer(sk);
-}
-
-void rose_transmit_buffer(struct sock *sk, struct sk_buff *skb)
-{
- unsigned char *dptr;
-
- dptr = skb_push(skb, 1);
- *dptr = AX25_P_ROSE;
-
- skb->arp = 1;
-
- if (!ax25_send_frame(skb, (ax25_address *)sk->protinfo.rose->neighbour->dev->dev_addr, &sk->protinfo.rose->neighbour->callsign, sk->protinfo.rose->neighbour->digipeat, sk->protinfo.rose->neighbour->dev)) {
- kfree_skb(skb, FREE_WRITE);
-
- sk->state = TCP_CLOSE;
- sk->err = ENETUNREACH;
- if (!sk->dead)
- sk->state_change(sk);
- sk->dead = 1;
- }
-}
-
-/*
- * The following routines are taken from page 170 of the 7th ARRL Computer
- * Networking Conference paper, as is the whole state machine.
- */
-
-void rose_establish_data_link(struct sock *sk)
-{
- sk->protinfo.rose->condition = 0x00;
-
- rose_write_internal(sk, ROSE_CALL_REQUEST);
-
- sk->protinfo.rose->t1timer = sk->protinfo.rose->t1;
-}
-
-/*
- * Never send a NAK when we are CHOKEd.
- */
-void rose_enquiry_response(struct sock *sk)
-{
- int frametype = NR_INFOACK;
-
- if (sk->protinfo.rose->condition & OWN_RX_BUSY_CONDITION)
- frametype |= NR_CHOKE_FLAG;
-
- rose_write_internal(sk, frametype);
-
- sk->protinfo.rose->vl = sk->protinfo.rose->vr;
- sk->protinfo.rose->condition &= ~ACK_PENDING_CONDITION;
-}
-
-void rose_check_iframes_acked(struct sock *sk, unsigned short nr)
-{
- if (sk->protinfo.rose->vs == nr) {
- rose_frames_acked(sk, nr);
- } else {
- if (sk->protinfo.rose->va != nr) {
- rose_frames_acked(sk, nr);
- }
- }
-}
-
-#endif
* include the -EINPROGRESS status for such sockets.
*/
-asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, size_t addrlen)
+asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, int addrlen)
{
struct socket *sock;
struct file *file;
* name to user space.
*/
-asmlinkage int sys_getsockname(int fd, struct sockaddr *usockaddr, size_t *usockaddr_len)
+asmlinkage int sys_getsockname(int fd, struct sockaddr *usockaddr, int *usockaddr_len)
{
struct socket *sock;
char address[MAX_SOCK_ADDR];
* name to user space.
*/
-asmlinkage int sys_getpeername(int fd, struct sockaddr *usockaddr, size_t *usockaddr_len)
+asmlinkage int sys_getpeername(int fd, struct sockaddr *usockaddr, int *usockaddr_len)
{
struct socket *sock;
char address[MAX_SOCK_ADDR];
*/
asmlinkage int sys_sendto(int fd, void * buff, size_t len, unsigned flags,
- struct sockaddr *addr, size_t addr_len)
+ struct sockaddr *addr, int addr_len)
{
struct socket *sock;
struct file *file;
*/
asmlinkage int sys_recvfrom(int fd, void * ubuf, size_t size, unsigned flags,
- struct sockaddr *addr, size_t *addr_len)
+ struct sockaddr *addr, int *addr_len)
{
struct socket *sock;
struct file *file;
}
-static int unix_bind(struct socket *sock, struct sockaddr *uaddr, size_t addr_len)
+static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr;
unix_socket *sk=sock->data;
}
-static int unix_connect(struct socket *sock, struct sockaddr *uaddr, size_t addr_len, int flags)
+static int unix_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags)
{
unix_socket *sk=sock->data;
struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr;
return 0;
}
-static int unix_getname(struct socket *sock, struct sockaddr *uaddr, size_t *uaddr_len, int peer)
+static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer)
{
unix_socket *sk=sock->data;
struct sockaddr_un *sunaddr=(struct sockaddr_un *)uaddr;