Commit cb75bc5a authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.27pre6

parent 441b2211
......@@ -508,8 +508,8 @@ S: 4850 Moresnet
S: Belgium
N: Cort Dougan
E: cort@cs.nmt.edu
W: http://www.cs.nmt.edu/~cort/
E: cort@ppc.kernel.org
W: http://www.ppc.kernel.org/~cort/
D: PowerPC
S: Computer Science Department
S: New Mexico Tech
......
......@@ -522,10 +522,10 @@ M: eis@baty.hanse.de
L: linux-x25@vger.rutgers.edu
S: Maintained
LINUX FOR POWERPC (PREP)
LINUX FOR POWERPC
P: Cort Dougan
M: cort@cs.nmt.edu
W: http://linuxppc.cs.nmt.edu/
M: cort@ppc.kernel.org
W: http://www.ppc.kernel.org/
S: Maintained
LINUX FOR POWER MACINTOSH
......
......@@ -49,18 +49,13 @@ search_exception_table(unsigned long addr)
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
read_lock(&modlist_lock);
for (mp = module_list; mp ; mp = mp->next) {
if (!mp->ex_table_start)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end - 1, addr - mp->gp);
if (ret) {
read_unlock(&modlist_lock);
return ret;
}
if (ret) return ret;
}
read_unlock(&modlist_lock);
#endif
return 0;
......
......@@ -42,18 +42,13 @@ search_exception_table(unsigned long addr)
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
read_lock(&modlist_lock);
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end - 1, addr);
if (ret) {
read_unlock(&modlist_lock);
return ret;
}
if (ret) return ret;
}
read_unlock(&modlist_lock);
#endif
return 0;
......
......@@ -42,18 +42,13 @@ search_exception_table(unsigned long addr)
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
read_lock(&modlist_lock);
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end - 1, addr);
if (ret) {
read_unlock(&modlist_lock);
return ret;
}
if (ret) return ret;
}
read_unlock(&modlist_lock);
#endif
return 0;
......
......@@ -422,11 +422,16 @@ void __init paging_init(void)
#ifdef CONFIG_HIGHMEM
kmap_init(); /* run after fixmap_init */
#endif
#ifdef CONFIG_HIGHMEM
free_area_init(highend_pfn);
#else
free_area_init(max_low_pfn);
#endif
{
unsigned int zones_size[3];
zones_size[0] = virt_to_phys((char *)MAX_DMA_ADDRESS)
>> PAGE_SHIFT;
zones_size[1] = max_low_pfn - zones_size[0];
zones_size[2] = highend_pfn - zones_size[0] - zones_size[1];
free_area_init(zones_size);
}
return;
}
......@@ -541,7 +546,7 @@ void __init mem_init(void)
totalram_pages += totalhigh_pages;
#endif
printk("Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n",
(unsigned long) nr_free_pages << (PAGE_SHIFT-10),
(unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
max_mapnr << (PAGE_SHIFT-10),
codepages << (PAGE_SHIFT-10),
reservedpages << (PAGE_SHIFT-10),
......@@ -587,10 +592,10 @@ void si_meminfo(struct sysinfo *val)
{
val->totalram = totalram_pages;
val->sharedram = 0;
val->freeram = nr_free_pages;
val->freeram = nr_free_pages();
val->bufferram = atomic_read(&buffermem_pages);
val->totalhigh = totalhigh_pages;
val->freehigh = nr_free_highpages;
val->freehigh = nr_free_highpages();
val->mem_unit = PAGE_SIZE;
return;
}
......@@ -38,10 +38,11 @@
#ifndef _FP_EMU_H
#define _FP_EMU_H
#ifndef __ASSEMBLY__
#include "../kernel/m68k_defs.h"
#include <asm/math-emu.h>
#ifndef __ASSEMBLY__
#define IS_INF(a) ((a)->exp == 0x7fff)
#define IS_ZERO(a) ((a)->mant.m64 == 0)
......@@ -114,9 +115,6 @@ extern const struct fp_ext fp_Inf;
#else /* __ASSEMBLY__ */
#include "../kernel/m68k_defs.h"
#include <asm/math-emu.h>
/*
* set, reset or clear a bit in the fp status register
*/
......
......@@ -42,18 +42,13 @@ search_exception_table(unsigned long addr)
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
read_lock(&modlist_lock);
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end-1, addr);
if (ret) {
read_unlock(&modlist_lock);
return ret;
}
if (ret) return ret;
}
read_unlock(&modlist_lock);
#endif
return 0;
......
......@@ -41,18 +41,13 @@ search_exception_table(unsigned long addr)
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
read_lock(&modlist_lock);
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end - 1, addr);
if (ret) {
read_unlock(&modlist_lock);
return ret;
}
if (ret) return ret;
}
read_unlock(&modlist_lock);
#endif
return 0;
......
......@@ -32,7 +32,6 @@ void (*mach_kbd_reset_setup) (char *, int) __initdata = 0;
#include <asm/bootinfo.h>
#include <asm/setup.h>
#include <asm/system.h>
#include <asm/pgtable.h>
#include <asm/amigahw.h>
#include <asm/amigaints.h>
......
......@@ -34,7 +34,6 @@
#include <linux/openpic.h>
#include <linux/version.h>
#include <linux/adb.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/ide.h>
......@@ -576,9 +575,10 @@ void __init
ppc_md.calibrate_decr = chrp_calibrate_decr;
#ifdef CONFIG_VT
#ifdef CONFIG_MAC_KEYBOAD
#ifdef CONFIG_MAC_KEYBOARD
if (adb_driver == NULL)
{
#endif /* CONFIG_MAC_KEYBOAD */
ppc_md.kbd_setkeycode = pckbd_setkeycode;
ppc_md.kbd_getkeycode = pckbd_getkeycode;
ppc_md.kbd_translate = pckbd_translate;
......@@ -588,7 +588,8 @@ void __init
#ifdef CONFIG_MAGIC_SYSRQ
ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate;
SYSRQ_KEY = 0x54;
#endif
#endif /* CONFIG_MAGIC_SYSRQ */
#ifdef CONFIG_MAC_KEYBOARD
}
else
{
......@@ -601,24 +602,13 @@ void __init
#ifdef CONFIG_MAGIC_SYSRQ
ppc_md.ppc_kbd_sysrq_xlate = mackbd_sysrq_xlate;
SYSRQ_KEY = 0x69;
#endif
#endif /* CONFIG_MAGIC_SYSRQ */
}
#else
ppc_md.kbd_setkeycode = pckbd_setkeycode;
ppc_md.kbd_getkeycode = pckbd_getkeycode;
ppc_md.kbd_translate = pckbd_translate;
ppc_md.kbd_unexpected_up = pckbd_unexpected_up;
ppc_md.kbd_leds = pckbd_leds;
ppc_md.kbd_init_hw = pckbd_init_hw;
#ifdef CONFIG_MAGIC_SYSRQ
ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate;
SYSRQ_KEY = 0x54;
#endif
#endif /* CONFIG_MAC_KEYBOARD */
#endif /* CONFIG_VT */
if ( rtas_data )
ppc_md.progress = chrp_progress;
#endif
#endif
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.insw = chrp_ide_insw;
ppc_ide_md.outsw = chrp_ide_outsw;
......
......@@ -411,9 +411,9 @@ enter_rtas:
addis r7,r7,-KERNELBASE@h
lis r8,rtas_entry@ha
lwz r8,rtas_entry@l(r8)
addis r5,r8,-KERNELBASE@h
mfmsr r9
stw r9,8(r1)
li r0,0
ori r0,r0,MSR_EE|MSR_SE|MSR_BE
andc r0,r9,r0
andi. r9,r9,MSR_ME|MSR_RI
......
......@@ -42,7 +42,6 @@
#include <linux/ide.h>
#include <linux/vt_kern.h>
#include <linux/console.h>
#include <linux/ide.h>
#include <linux/pci.h>
#include <linux/adb.h>
#include <linux/cuda.h>
......
......@@ -585,8 +585,8 @@ void __init ll_puts(const char *s)
*/
extern void scheduling_functions_start_here(void);
extern void scheduling_functions_end_here(void);
#define first_sched ((unsigned long) scheduling_functions_start_here)
#define last_sched ((unsigned long) scheduling_functions_end_here)
#define first_sched ((unsigned long) scheduling_functions_start_here)
#define last_sched ((unsigned long) scheduling_functions_end_here)
unsigned long get_wchan(struct task_struct *p)
{
......
......@@ -389,12 +389,10 @@ identify_machine(unsigned long r3, unsigned long r4, unsigned long r5,
if ( have_of )
{
#ifdef CONFIG_MACH_SPECIFIC
/* prom_init has already been called from __start */
if (boot_infos)
relocate_nodes();
finish_device_tree();
#endif /* CONFIG_MACH_SPECIFIC */
/*
* If we were booted via quik, r3 points to the physical
* address of the command-line parameters.
......@@ -450,7 +448,7 @@ identify_machine(unsigned long r3, unsigned long r4, unsigned long r5,
int_control.int_cli = __no_use_cli;
int_control.int_save_flags = __no_use_save_flags;
int_control.int_restore_flags = __no_use_restore_flags;
switch (_machine)
{
case _MACH_Pmac:
......
......@@ -43,18 +43,13 @@ search_exception_table(unsigned long addr)
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
read_lock(&modlist_lock);
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end - 1, addr);
if (ret) {
read_unlock(&modlist_lock);
return ret;
}
if (ret) return ret;
}
read_unlock(&modlist_lock);
#endif
return 0;
......
......@@ -45,18 +45,13 @@ search_exception_table(unsigned long addr)
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
read_lock(&modlist_lock);
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end - 1, addr);
if (ret) {
read_unlock(&modlist_lock);
return ret;
}
if (ret) return ret;
}
read_unlock(&modlist_lock);
#endif
return 0;
......
......@@ -56,18 +56,13 @@ search_exception_table(unsigned long addr, unsigned long *g2)
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
read_lock(&modlist_lock);
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end-1, addr, g2);
if (ret) {
read_unlock(&modlist_lock);
return ret;
}
if (ret) return ret;
}
read_unlock(&modlist_lock);
#endif
return 0;
......
......@@ -2932,7 +2932,6 @@ put_mod_name(char *buf)
free_page((unsigned long)buf);
}
/* caller must hold modlist_lock at least in read mode */
static __inline__ struct module *find_module(const char *name)
{
struct module *mod;
......@@ -3162,7 +3161,7 @@ asmlinkage int sys32_query_module(char *name_user, int which, char *buf, __kerne
struct module *mod;
int err;
read_lock(&modlist_lock);
lock_kernel();
if (name_user == 0) {
/* This finds "kernel_module" which is not exported. */
for(mod = module_list; mod->next != NULL; mod = mod->next)
......@@ -3212,7 +3211,7 @@ asmlinkage int sys32_query_module(char *name_user, int which, char *buf, __kerne
break;
}
out:
read_unlock(&modlist_lock);
unlock_kernel();
return err;
}
......
......@@ -56,18 +56,13 @@ search_exception_table(unsigned long addr, unsigned long *g2)
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct module *mp;
read_lock(&modlist_lock);
for (mp = module_list; mp != NULL; mp = mp->next) {
if (mp->ex_table_start == NULL)
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end-1, addr, g2);
if (ret) {
read_unlock(&modlist_lock);
return ret;
}
if (ret) return ret;
}
read_unlock(&modlist_lock);
#endif
return 0;
......
......@@ -35,6 +35,7 @@
#include <linux/errno.h>
#include <linux/file.h>
#include <linux/ioctl.h>
#include <net/sock.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
......@@ -105,6 +106,7 @@ static int nbd_xmit(int send, struct socket *sock, char *buf, int size)
do {
sock->sk->allocation = GFP_ATOMIC;
iov.iov_base = buf;
iov.iov_len = size;
msg.msg_name = NULL;
......
......@@ -167,6 +167,9 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
dep_tristate ' SGI Vino Video For Linux (EXPERIMENTAL)' CONFIG_VIDEO_VINO $CONFIG_VIDEO_DEV
fi
fi
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
dep_tristate ' Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)' CONFIG_VIDEO_STRADIS $CONFIG_VIDEO_DEV
fi
dep_tristate ' TerraTec ActiveRadio ISA Standalone' CONFIG_RADIO_TERRATEC $CONFIG_VIDEO_DEV
if [ "$CONFIG_RADIO_TERRATEC" = "y" ]; then
hex ' Terratec i/o port (normally 0x590)' CONFIG_RADIO_TERRATEC_PORT 590
......
......@@ -450,6 +450,14 @@ else
endif
endif
ifeq ($(CONFIG_VIDEO_STRADIS),y)
O_OBJS += vino.o
else
ifeq ($(CONFIG_VIDEO_STRADIS),m)
M_OBJS += stradis.o
endif
endif
ifeq ($(CONFIG_RADIO_AZTECH),y)
O_OBJS += radio-aztech.o
else
......
/* cs8420.h - cs8420 initializations
Copyright (C) 1999 Nathan Laredo (laredo@gnu.org)
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __CS8420_H__
#define __CS8420_H__
/* Initialization Sequence */
static __u8 init8420[] = {
1, 0x01, 2, 0x02, 3, 0x00, 4, 0x46,
5, 0x24, 6, 0x84, 18, 0x18, 19, 0x13,
};
#define INIT8420LEN (sizeof(init8420)/2)
static __u8 mode8420pro[] = { /* professional output mode */
32, 0xa1, 33, 0x00, 34, 0x00, 35, 0x00,
36, 0x00, 37, 0x00, 38, 0x00, 39, 0x00,
40, 0x00, 41, 0x00, 42, 0x00, 43, 0x00,
44, 0x00, 45, 0x00, 46, 0x00, 47, 0x00,
48, 0x00, 49, 0x00, 50, 0x00, 51, 0x00,
52, 0x00, 53, 0x00, 54, 0x00, 55, 0x00,
};
#define MODE8420LEN (sizeof(mode8420pro)/2)
static __u8 mode8420con[] = { /* consumer output mode */
32, 0x20, 33, 0x00, 34, 0x00, 35, 0x48,
36, 0x00, 37, 0x00, 38, 0x00, 39, 0x00,
40, 0x00, 41, 0x00, 42, 0x00, 43, 0x00,
44, 0x00, 45, 0x00, 46, 0x00, 47, 0x00,
48, 0x00, 49, 0x00, 50, 0x00, 51, 0x00,
52, 0x00, 53, 0x00, 54, 0x00, 55, 0x00,
};
#endif
......@@ -35,7 +35,6 @@
# include "xf86.h"
# include "xf86drm.h"
# include "xf86_OSlib.h"
# include "xf86drm.h"
#else
# include <unistd.h>
# include <signal.h>
......
/* ibmmpeg2.h - IBM MPEGCD21 definitions */
#ifndef __IBM_MPEG2__
#define __IBM_MPEG2__
/* Define all MPEG Decoder registers */
/* Chip Control and Status */
#define IBM_MP2_CHIP_CONTROL 0x200*2
#define IBM_MP2_CHIP_MODE 0x201*2
/* Timer Control and Status */
#define IBM_MP2_SYNC_STC2 0x202*2
#define IBM_MP2_SYNC_STC1 0x203*2
#define IBM_MP2_SYNC_STC0 0x204*2
#define IBM_MP2_SYNC_PTS2 0x205*2
#define IBM_MP2_SYNC_PTS1 0x206*2
#define IBM_MP2_SYNC_PTS0 0x207*2
/* Video FIFO Control */
#define IBM_MP2_FIFO 0x208*2
#define IBM_MP2_FIFOW 0x100*2
#define IBM_MP2_FIFO_STAT 0x209*2
#define IBM_MP2_RB_THRESHOLD 0x22b*2
/* Command buffer */
#define IBM_MP2_COMMAND 0x20a*2
#define IBM_MP2_CMD_DATA 0x20b*2
#define IBM_MP2_CMD_STAT 0x20c*2
#define IBM_MP2_CMD_ADDR 0x20d*2
/* Internal Processor Control and Status */
#define IBM_MP2_PROC_IADDR 0x20e*2
#define IBM_MP2_PROC_IDATA 0x20f*2
#define IBM_MP2_WR_PROT 0x235*2
/* DRAM Access */
#define IBM_MP2_DRAM_ADDR 0x210*2
#define IBM_MP2_DRAM_DATA 0x212*2
#define IBM_MP2_DRAM_CMD_STAT 0x213*2
#define IBM_MP2_BLOCK_SIZE 0x23b*2
#define IBM_MP2_SRC_ADDR 0x23c*2
/* Onscreen Display */
#define IBM_MP2_OSD_ADDR 0x214*2
#define IBM_MP2_OSD_DATA 0x215*2
#define IBM_MP2_OSD_MODE 0x217*2
#define IBM_MP2_OSD_LINK_ADDR 0x229*2
#define IBM_MP2_OSD_SIZE 0x22a*2
/* Interrupt Control */
#define IBM_MP2_HOST_INT 0x218*2
#define IBM_MP2_MASK0 0x219*2
#define IBM_MP2_HOST_INT1 0x23e*2
#define IBM_MP2_MASK1 0x23f*2
/* Audio Control */
#define IBM_MP2_AUD_IADDR 0x21a*2
#define IBM_MP2_AUD_IDATA 0x21b*2
#define IBM_MP2_AUD_FIFO 0x21c*2
#define IBM_MP2_AUD_FIFOW 0x101*2
#define IBM_MP2_AUD_CTL 0x21d*2
#define IBM_MP2_BEEP_CTL 0x21e*2
#define IBM_MP2_FRNT_ATTEN 0x22d*2
/* Display Control */
#define IBM_MP2_DISP_MODE 0x220*2
#define IBM_MP2_DISP_DLY 0x221*2
#define IBM_MP2_VBI_CTL 0x222*2
#define IBM_MP2_DISP_LBOR 0x223*2
#define IBM_MP2_DISP_TBOR 0x224*2
/* Polarity Control */
#define IBM_MP2_INFC_CTL 0x22c*2
/* control commands */
#define IBM_MP2_PLAY 0
#define IBM_MP2_PAUSE 1
#define IBM_MP2_SINGLE_FRAME 2
#define IBM_MP2_FAST_FORWARD 3
#define IBM_MP2_SLOW_MOTION 4
#define IBM_MP2_IMED_NORM_PLAY 5
#define IBM_MP2_RESET_WINDOW 6
#define IBM_MP2_FREEZE_FRAME 7
#define IBM_MP2_RESET_VID_RATE 8
#define IBM_MP2_CONFIG_DECODER 9
#define IBM_MP2_CHANNEL_SWITCH 10
#define IBM_MP2_RESET_AUD_RATE 11
#define IBM_MP2_PRE_OP_CHN_SW 12
#define IBM_MP2_SET_STILL_MODE 14
/* Define Xilinx FPGA Internal Registers */
/* general control register 0 */
#define XILINX_CTL0 0x600
/* genlock delay resister 1 */
#define XILINX_GLDELAY 0x602
/* send 16 bits to CS3310 port */
#define XILINX_CS3310 0x604
/* send 16 bits to CS3310 and complete */
#define XILINX_CS3310_CMPLT 0x60c
/* pulse width modulator control */
#define XILINX_PWM 0x606
#endif
......@@ -32,7 +32,6 @@
#include <linux/string.h>
#include <linux/random.h>
#include <linux/init.h>
#include <linux/module.h>
#include <asm/keyboard.h>
#include <asm/bitops.h>
......
......@@ -56,6 +56,9 @@ extern void adbdev_init(void);
#ifdef CONFIG_USB
extern void usb_init(void);
#endif
#ifdef CONFIG_PPDEV
extern int pp_init(void);
#endif
static ssize_t do_write_mem(struct file * file, void *p, unsigned long realp,
const char * buf, size_t count, loff_t *ppos)
......@@ -672,6 +675,9 @@ int __init chr_dev_init(void)
#endif
#ifdef CONFIG_VIDEO_DEV
videodev_init();
#endif
#ifdef CONFIG_PPDEV
pp_init();
#endif
return 0;
}
......@@ -105,7 +105,6 @@
#include <linux/malloc.h>
#include <linux/tty.h>
#include <linux/errno.h>
#include <linux/sched.h> /* to get the struct task_struct */
#include <linux/string.h> /* used in new tty drivers */
#include <linux/signal.h> /* used in new tty drivers */
#include <asm/system.h>
......
......@@ -624,7 +624,7 @@ static int pms_capture(struct pms_device *dev, char *buf, int rgb555, int count)
{
int y;
int dw = 2*dev->width;
char *src = (char *)bus_to_virt(mem_base);
u32 src = mem_base;
char tmp[dw+32]; /* using a temp buffer is faster than direct */
int cnt = 0;
......@@ -639,8 +639,14 @@ static int pms_capture(struct pms_device *dev, char *buf, int rgb555, int count)
for (y = 0; y < dev->height; y++ )
{
*src = 0; /* synchronisiert neue Zeile */
memcpy(tmp, src, dw+32); /* discard 16 word */
isa_writeb(0, src); /* synchronisiert neue Zeile */
/*
* This is in truth a fifo, be very careful as if you
* forgot this odd things will occur 8)
*/
isa_memcpy_fromio(tmp, src, dw+32); /* discard 16 word */
cnt -= dev->height;
while (cnt <= 0)
{
......
/* saa7121.h - saa7121 initializations
Copyright (C) 1999 Nathan Laredo (laredo@gnu.org)
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __SAA7121_H__
#define __SAA7121_H__
#define NTSC_BURST_START 0x19 /* 28 */
#define NTSC_BURST_END 0x1d /* 29 */
#define NTSC_CHROMA_PHASE 0x67 /* 5a */
#define NTSC_GAINU 0x76 /* 5b */
#define NTSC_GAINV 0xa5 /* 5c */
#define NTSC_BLACK_LEVEL 0x2a /* 5d */
#define NTSC_BLANKING_LEVEL 0x2e /* 5e */
#define NTSC_VBI_BLANKING 0x2e /* 5f */
#define NTSC_DAC_CONTROL 0x11 /* 61 */
#define NTSC_BURST_AMP 0x3f /* 62 */
#define NTSC_SUBC3 0x1f /* 63 */
#define NTSC_SUBC2 0x7c /* 64 */
#define NTSC_SUBC1 0xf0 /* 65 */
#define NTSC_SUBC0 0x21 /* 66 */
#define NTSC_HTRIG 0x72 /* 6c */
#define NTSC_VTRIG 0x00 /* 6c */
#define NTSC_MULTI 0x30 /* 6e */
#define NTSC_CCTTX 0x11 /* 6f */
#define NTSC_FIRST_ACTIVE 0x12 /* 7a */
#define NTSC_LAST_ACTIVE 0x02 /* 7b */
#define NTSC_MSB_VERTICAL 0x40 /* 7c */
#define PAL_BURST_START 0x21 /* 28 */
#define PAL_BURST_END 0x1d /* 29 */
#define PAL_CHROMA_PHASE 0x3f /* 5a */
#define PAL_GAINU 0x7d /* 5b */
#define PAL_GAINV 0xaf /* 5c */
#define PAL_BLACK_LEVEL 0x23 /* 5d */
#define PAL_BLANKING_LEVEL 0x35 /* 5e */
#define PAL_VBI_BLANKING 0x35 /* 5f */
#define PAL_DAC_CONTROL 0x02 /* 61 */
#define PAL_BURST_AMP 0x2f /* 62 */
#define PAL_SUBC3 0xcb /* 63 */
#define PAL_SUBC2 0x8a /* 64 */
#define PAL_SUBC1 0x09 /* 65 */
#define PAL_SUBC0 0x2a /* 66 */
#define PAL_HTRIG 0x86 /* 6c */
#define PAL_VTRIG 0x04 /* 6d */
#define PAL_MULTI 0x20 /* 6e */
#define PAL_CCTTX 0x15 /* 6f */
#define PAL_FIRST_ACTIVE 0x16 /* 7a */
#define PAL_LAST_ACTIVE 0x36 /* 7b */
#define PAL_MSB_VERTICAL 0x40 /* 7c */
/* Initialization Sequence */
static __u8 init7121ntsc[] = {
0x26, 0x0, 0x27, 0x0,
0x28, NTSC_BURST_START, 0x29, NTSC_BURST_END,
0x2a, 0x0, 0x2b, 0x0, 0x2c, 0x0, 0x2d, 0x0,
0x2e, 0x0, 0x2f, 0x0, 0x30, 0x0, 0x31, 0x0,
0x32, 0x0, 0x33, 0x0, 0x34, 0x0, 0x35, 0x0,
0x36, 0x0, 0x37, 0x0, 0x38, 0x0, 0x39, 0x0,
0x3a, 0x03, 0x3b, 0x0, 0x3c, 0x0, 0x3d, 0x0,
0x3e, 0x0, 0x3f, 0x0, 0x40, 0x0, 0x41, 0x0,
0x42, 0x0, 0x43, 0x0, 0x44, 0x0, 0x45, 0x0,
0x46, 0x0, 0x47, 0x0, 0x48, 0x0, 0x49, 0x0,
0x4a, 0x0, 0x4b, 0x0, 0x4c, 0x0, 0x4d, 0x0,
0x4e, 0x0, 0x4f, 0x0, 0x50, 0x0, 0x51, 0x0,
0x52, 0x0, 0x53, 0x0, 0x54, 0x0, 0x55, 0x0,
0x56, 0x0, 0x57, 0x0, 0x58, 0x0, 0x59, 0x0,
0x5a, NTSC_CHROMA_PHASE, 0x5b, NTSC_GAINU,
0x5c, NTSC_GAINV, 0x5d, NTSC_BLACK_LEVEL,
0x5e, NTSC_BLANKING_LEVEL, 0x5f, NTSC_VBI_BLANKING,
0x60, 0x0, 0x61, NTSC_DAC_CONTROL,
0x62, NTSC_BURST_AMP, 0x63, NTSC_SUBC3,
0x64, NTSC_SUBC2, 0x65, NTSC_SUBC1,
0x66, NTSC_SUBC0, 0x67, 0x80, 0x68, 0x80,
0x69, 0x80, 0x6a, 0x80, 0x6b, 0x29,
0x6c, NTSC_HTRIG, 0x6d, NTSC_VTRIG,
0x6e, NTSC_MULTI, 0x6f, NTSC_CCTTX,
0x70, 0xc9, 0x71, 0x68, 0x72, 0x60, 0x73, 0x0,
0x74, 0x0, 0x75, 0x0, 0x76, 0x0, 0x77, 0x0,
0x78, 0x0, 0x79, 0x0, 0x7a, NTSC_FIRST_ACTIVE,
0x7b, NTSC_LAST_ACTIVE, 0x7c, NTSC_MSB_VERTICAL,
0x7d, 0x0, 0x7e, 0x0, 0x7f, 0x0
};
#define INIT7121LEN (sizeof(init7121ntsc)/2)
static __u8 init7121pal[] = {
0x26, 0x0, 0x27, 0x0,
0x28, PAL_BURST_START, 0x29, PAL_BURST_END,
0x2a, 0x0, 0x2b, 0x0, 0x2c, 0x0, 0x2d, 0x0,
0x2e, 0x0, 0x2f, 0x0, 0x30, 0x0, 0x31, 0x0,
0x32, 0x0, 0x33, 0x0, 0x34, 0x0, 0x35, 0x0,
0x36, 0x0, 0x37, 0x0, 0x38, 0x0, 0x39, 0x0,
0x3a, 0x03, 0x3b, 0x0, 0x3c, 0x0, 0x3d, 0x0,
0x3e, 0x0, 0x3f, 0x0, 0x40, 0x0, 0x41, 0x0,
0x42, 0x0, 0x43, 0x0, 0x44, 0x0, 0x45, 0x0,
0x46, 0x0, 0x47, 0x0, 0x48, 0x0, 0x49, 0x0,
0x4a, 0x0, 0x4b, 0x0, 0x4c, 0x0, 0x4d, 0x0,
0x4e, 0x0, 0x4f, 0x0, 0x50, 0x0, 0x51, 0x0,
0x52, 0x0, 0x53, 0x0, 0x54, 0x0, 0x55, 0x0,
0x56, 0x0, 0x57, 0x0, 0x58, 0x0, 0x59, 0x0,
0x5a, PAL_CHROMA_PHASE, 0x5b, PAL_GAINU,
0x5c, PAL_GAINV, 0x5d, PAL_BLACK_LEVEL,
0x5e, PAL_BLANKING_LEVEL, 0x5f, PAL_VBI_BLANKING,
0x60, 0x0, 0x61, PAL_DAC_CONTROL,
0x62, PAL_BURST_AMP, 0x63, PAL_SUBC3,
0x64, PAL_SUBC2, 0x65, PAL_SUBC1,
0x66, PAL_SUBC0, 0x67, 0x80, 0x68, 0x80,
0x69, 0x80, 0x6a, 0x80, 0x6b, 0x29,
0x6c, PAL_HTRIG, 0x6d, PAL_VTRIG,
0x6e, PAL_MULTI, 0x6f, PAL_CCTTX,
0x70, 0xc9, 0x71, 0x68, 0x72, 0x60, 0x73, 0x0,
0x74, 0x0, 0x75, 0x0, 0x76, 0x0, 0x77, 0x0,
0x78, 0x0, 0x79, 0x0, 0x7a, PAL_FIRST_ACTIVE,
0x7b, PAL_LAST_ACTIVE, 0x7c, PAL_MSB_VERTICAL,
0x7d, 0x0, 0x7e, 0x0, 0x7f, 0x0
};
#endif
/*
saa7146.h - definitions philips saa7146 based cards
Copyright (C) 1999 Nathan Laredo (laredo@gnu.org)
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __SAA7146__
#define __SAA7146__
#define SAA7146_VERSION_CODE 0x000101
#include <linux/types.h>
#include <linux/wait.h>
#include <linux/i2c.h>
#include <linux/videodev.h>
#ifndef O_NONCAP
#define O_NONCAP O_TRUNC
#endif
#define MAX_GBUFFERS 2
#define FBUF_SIZE 0x190000
#ifdef __KERNEL__
struct saa7146_window
{
int x, y;
ushort width, height;
ushort bpp, bpl;
ushort swidth, sheight;
short cropx, cropy;
ushort cropwidth, cropheight;
unsigned long vidadr;
int color_fmt;
ushort depth;
};
/* Per-open data for handling multiple opens on one device */
struct device_open
{
int isopen;
int noncapturing;
struct saa7146 *dev;
};
#define MAX_OPENS 3
struct saa7146
{
struct video_device video_dev;
struct video_picture picture;
struct video_audio audio_dev;
struct video_info vidinfo;
int user;
int cap;
int capuser;
int irqstate; /* irq routine is state driven */
int writemode;
int playmode;
unsigned int nr;
unsigned long irq; /* IRQ used by SAA7146 card */
unsigned short id;
struct i2c_bus i2c;
struct pci_dev *dev;
unsigned char revision;
unsigned char boardcfg[64]; /* 64 bytes of config from eeprom */
unsigned long saa7146_adr; /* bus address of IO mem from PCI BIOS */
struct saa7146_window win;
unsigned char *saa7146_mem; /* pointer to mapped IO memory */
struct device_open open_data[MAX_OPENS];
#define MAX_MARKS 16
/* for a/v sync */
int endmark[MAX_MARKS], endmarkhead, endmarktail;
u32 *dmaRPS1, *pageRPS1, *dmaRPS2, *pageRPS2, *dmavid1, *dmavid2,
*dmavid3, *dmaa1in, *dmaa1out, *dmaa2in, *dmaa2out,
*pagedebi, *pagevid1, *pagevid2, *pagevid3, *pagea1in,
*pagea1out, *pagea2in, *pagea2out;
wait_queue_head_t i2cq, debiq, audq, vidq;
u8 *vidbuf, *audbuf, *osdbuf, *dmadebi;
int audhead, vidhead, osdhead, audtail, vidtail, osdtail;
spinlock_t lock; /* the device lock */
};
#endif
#ifdef _ALPHA_SAA7146
#define saawrite(dat,adr) writel((dat),(char *) (saa->saa7146_adr+(adr)))
#define saaread(adr) readl(saa->saa7146_adr+(adr))
#else
#define saawrite(dat,adr) writel((dat), (char *) (saa->saa7146_mem+(adr)))
#define saaread(adr) readl(saa->saa7146_mem+(adr))
#endif
#define saaand(dat,adr) saawrite((dat) & saaread(adr), adr)
#define saaor(dat,adr) saawrite((dat) | saaread(adr), adr)
#define saaaor(dat,mask,adr) saawrite((dat) | ((mask) & saaread(adr)), adr)
/* bitmask of attached hardware found */
#define SAA7146_UNKNOWN 0x00000000
#define SAA7146_SAA7111 0x00000001
#define SAA7146_SAA7121 0x00000002
#define SAA7146_IBMMPEG 0x00000004
#endif
/*
saa7146.h - definitions philips saa7146 based cards
Copyright (C) 1999 Nathan Laredo (laredo@gnu.org)
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __SAA7146_REG__
#define __SAA7146_REG__
#define SAA7146_BASE_ODD1 0x00
#define SAA7146_BASE_EVEN1 0x04
#define SAA7146_PROT_ADDR1 0x08
#define SAA7146_PITCH1 0x0c
#define SAA7146_PAGE1 0x10
#define SAA7146_NUM_LINE_BYTE1 0x14
#define SAA7146_BASE_ODD2 0x18
#define SAA7146_BASE_EVEN2 0x1c
#define SAA7146_PROT_ADDR2 0x20
#define SAA7146_PITCH2 0x24
#define SAA7146_PAGE2 0x28
#define SAA7146_NUM_LINE_BYTE2 0x2c
#define SAA7146_BASE_ODD3 0x30
#define SAA7146_BASE_EVEN3 0x34
#define SAA7146_PROT_ADDR3 0x38
#define SAA7146_PITCH3 0x3c
#define SAA7146_PAGE3 0x40
#define SAA7146_NUM_LINE_BYTE3 0x44
#define SAA7146_PCI_BT_V1 0x48
#define SAA7146_PCI_BT_V2 0x49
#define SAA7146_PCI_BT_V3 0x4a
#define SAA7146_PCI_BT_DEBI 0x4b
#define SAA7146_PCI_BT_A 0x4c
#define SAA7146_DD1_INIT 0x50
#define SAA7146_DD1_STREAM_B 0x54
#define SAA7146_DD1_STREAM_A 0x56
#define SAA7146_BRS_CTRL 0x58
#define SAA7146_HPS_CTRL 0x5c
#define SAA7146_HPS_V_SCALE 0x60
#define SAA7146_HPS_V_GAIN 0x64
#define SAA7146_HPS_H_PRESCALE 0x68
#define SAA7146_HPS_H_SCALE 0x6c
#define SAA7146_BCS_CTRL 0x70
#define SAA7146_CHROMA_KEY_RANGE 0x74
#define SAA7146_CLIP_FORMAT_CTRL 0x78
#define SAA7146_DEBI_CONFIG 0x7c
#define SAA7146_DEBI_COMMAND 0x80
#define SAA7146_DEBI_PAGE 0x84
#define SAA7146_DEBI_AD 0x88
#define SAA7146_I2C_TRANSFER 0x8c
#define SAA7146_I2C_STATUS 0x90
#define SAA7146_BASE_A1_IN 0x94
#define SAA7146_PROT_A1_IN 0x98
#define SAA7146_PAGE_A1_IN 0x9C
#define SAA7146_BASE_A1_OUT 0xa0
#define SAA7146_PROT_A1_OUT 0xa4
#define SAA7146_PAGE_A1_OUT 0xa8
#define SAA7146_BASE_A2_IN 0xac
#define SAA7146_PROT_A2_IN 0xb0
#define SAA7146_PAGE_A2_IN 0xb4
#define SAA7146_BASE_A2_OUT 0xb8
#define SAA7146_PROT_A2_OUT 0xbc
#define SAA7146_PAGE_A2_OUT 0xc0
#define SAA7146_RPS_PAGE0 0xc4
#define SAA7146_RPS_PAGE1 0xc8
#define SAA7146_RPS_THRESH0 0xcc
#define SAA7146_RPS_THRESH1 0xd0
#define SAA7146_RPS_TOV0 0xd4
#define SAA7146_RPS_TOV1 0xd8
#define SAA7146_IER 0xdc
#define SAA7146_GPIO_CTRL 0xe0
#define SAA7146_EC1SSR 0xe4
#define SAA7146_EC2SSR 0xe8
#define SAA7146_ECT1R 0xec
#define SAA7146_ECT2R 0xf0
#define SAA7146_ACON1 0xf4
#define SAA7146_ACON2 0xf8
#define SAA7146_MC1 0xfc
#define SAA7146_MC2 0x100
#define SAA7146_RPS_ADDR0 0x104
#define SAA7146_RPS_ADDR1 0x108
#define SAA7146_ISR 0x10c
#define SAA7146_PSR 0x110
#define SAA7146_SSR 0x114
#define SAA7146_EC1R 0x118
#define SAA7146_EC2R 0x11c
#define SAA7146_VDP1 0x120
#define SAA7146_VDP2 0x124
#define SAA7146_VDP3 0x128
#define SAA7146_ADP1 0x12c
#define SAA7146_ADP2 0x130
#define SAA7146_ADP3 0x134
#define SAA7146_ADP4 0x138
#define SAA7146_DDP 0x13c
#define SAA7146_LEVEL_REP 0x140
#define SAA7146_FB_BUFFER1 0x144
#define SAA7146_FB_BUFFER2 0x148
#define SAA7146_A_TIME_SLOT1 0x180
#define SAA7146_A_TIME_SLOT2 0x1C0
/* bitfield defines */
#define MASK_31 0x80000000
#define MASK_30 0x40000000
#define MASK_29 0x20000000
#define MASK_28 0x10000000
#define MASK_27 0x08000000
#define MASK_26 0x04000000
#define MASK_25 0x02000000
#define MASK_24 0x01000000
#define MASK_23 0x00800000
#define MASK_22 0x00400000
#define MASK_21 0x00200000
#define MASK_20 0x00100000
#define MASK_19 0x00080000
#define MASK_18 0x00040000
#define MASK_17 0x00020000
#define MASK_16 0x00010000
#define MASK_15 0x00008000
#define MASK_14 0x00004000
#define MASK_13 0x00002000
#define MASK_12 0x00001000
#define MASK_11 0x00000800
#define MASK_10 0x00000400
#define MASK_09 0x00000200
#define MASK_08 0x00000100
#define MASK_07 0x00000080
#define MASK_06 0x00000040
#define MASK_05 0x00000020
#define MASK_04 0x00000010
#define MASK_03 0x00000008
#define MASK_02 0x00000004
#define MASK_01 0x00000002
#define MASK_00 0x00000001
#define MASK_B0 0x000000ff
#define MASK_B1 0x0000ff00
#define MASK_B2 0x00ff0000
#define MASK_B3 0xff000000
#define MASK_W0 0x0000ffff
#define MASK_W1 0xffff0000
#define MASK_PA 0xfffffffc
#define MASK_PR 0xfffffffe
#define MASK_ER 0xffffffff
#define MASK_NONE 0x00000000
#define SAA7146_PAGE_MAP_EN MASK_11
/* main control register 1 */
#define SAA7146_MC1_MRST_N MASK_15
#define SAA7146_MC1_ERPS1 MASK_13
#define SAA7146_MC1_ERPS0 MASK_12
#define SAA7146_MC1_EDP MASK_11
#define SAA7146_MC1_EVP MASK_10
#define SAA7146_MC1_EAP MASK_09
#define SAA7146_MC1_EI2C MASK_08
#define SAA7146_MC1_TR_E_DEBI MASK_07
#define SAA7146_MC1_TR_E_1 MASK_06
#define SAA7146_MC1_TR_E_2 MASK_05
#define SAA7146_MC1_TR_E_3 MASK_04
#define SAA7146_MC1_TR_E_A2_OUT MASK_03
#define SAA7146_MC1_TR_E_A2_IN MASK_02
#define SAA7146_MC1_TR_E_A1_OUT MASK_01
#define SAA7146_MC1_TR_E_A1_IN MASK_00
/* main control register 2 */
#define SAA7146_MC2_RPS_SIG4 MASK_15
#define SAA7146_MC2_RPS_SIG3 MASK_14
#define SAA7146_MC2_RPS_SIG2 MASK_13
#define SAA7146_MC2_RPS_SIG1 MASK_12
#define SAA7146_MC2_RPS_SIG0 MASK_11
#define SAA7146_MC2_UPLD_D1_B MASK_10
#define SAA7146_MC2_UPLD_D1_A MASK_09
#define SAA7146_MC2_UPLD_BRS MASK_08
#define SAA7146_MC2_UPLD_HPS_H MASK_06
#define SAA7146_MC2_UPLD_HPS_V MASK_05
#define SAA7146_MC2_UPLD_DMA3 MASK_04
#define SAA7146_MC2_UPLD_DMA2 MASK_03
#define SAA7146_MC2_UPLD_DMA1 MASK_02
#define SAA7146_MC2_UPLD_DEBI MASK_01
#define SAA7146_MC2_UPLD_I2C MASK_00
/* Primary Status Register and Interrupt Enable/Status Registers */
#define SAA7146_PSR_PPEF MASK_31
#define SAA7146_PSR_PABO MASK_30
#define SAA7146_PSR_PPED MASK_29
#define SAA7146_PSR_RPS_I1 MASK_28
#define SAA7146_PSR_RPS_I0 MASK_27
#define SAA7146_PSR_RPS_LATE1 MASK_26
#define SAA7146_PSR_RPS_LATE0 MASK_25
#define SAA7146_PSR_RPS_E1 MASK_24
#define SAA7146_PSR_RPS_E0 MASK_23
#define SAA7146_PSR_RPS_TO1 MASK_22
#define SAA7146_PSR_RPS_TO0 MASK_21
#define SAA7146_PSR_UPLD MASK_20
#define SAA7146_PSR_DEBI_S MASK_19
#define SAA7146_PSR_DEBI_E MASK_18
#define SAA7146_PSR_I2C_S MASK_17
#define SAA7146_PSR_I2C_E MASK_16
#define SAA7146_PSR_A2_IN MASK_15
#define SAA7146_PSR_A2_OUT MASK_14
#define SAA7146_PSR_A1_IN MASK_13
#define SAA7146_PSR_A1_OUT MASK_12
#define SAA7146_PSR_AFOU MASK_11
#define SAA7146_PSR_V_PE MASK_10
#define SAA7146_PSR_VFOU MASK_09
#define SAA7146_PSR_FIDA MASK_08
#define SAA7146_PSR_FIDB MASK_07
#define SAA7146_PSR_PIN3 MASK_06
#define SAA7146_PSR_PIN2 MASK_05
#define SAA7146_PSR_PIN1 MASK_04
#define SAA7146_PSR_PIN0 MASK_03
#define SAA7146_PSR_ECS MASK_02
#define SAA7146_PSR_EC3S MASK_01
#define SAA7146_PSR_EC0S MASK_00
/* Secondary Status Register */
#define SAA7146_SSR_PRQ MASK_31
#define SAA7146_SSR_PMA MASK_30
#define SAA7146_SSR_RPS_RE1 MASK_29
#define SAA7146_SSR_RPS_PE1 MASK_28
#define SAA7146_SSR_RPS_A1 MASK_27
#define SAA7146_SSR_RPS_RE0 MASK_26
#define SAA7146_SSR_RPS_PE0 MASK_25
#define SAA7146_SSR_RPS_A0 MASK_24
#define SAA7146_SSR_DEBI_TO MASK_23
#define SAA7146_SSR_DEBI_EF MASK_22
#define SAA7146_SSR_I2C_EA MASK_21
#define SAA7146_SSR_I2C_EW MASK_20
#define SAA7146_SSR_I2C_ER MASK_19
#define SAA7146_SSR_I2C_EL MASK_18
#define SAA7146_SSR_I2C_EF MASK_17
#define SAA7146_SSR_V3P MASK_16
#define SAA7146_SSR_V2P MASK_15
#define SAA7146_SSR_V1P MASK_14
#define SAA7146_SSR_VF3 MASK_13
#define SAA7146_SSR_VF2 MASK_12
#define SAA7146_SSR_VF1 MASK_11
#define SAA7146_SSR_AF2_IN MASK_10
#define SAA7146_SSR_AF2_OUT MASK_09
#define SAA7146_SSR_AF1_IN MASK_08
#define SAA7146_SSR_AF1_OUT MASK_07
#define SAA7146_SSR_VGT MASK_05
#define SAA7146_SSR_LNQG MASK_04
#define SAA7146_SSR_EC5S MASK_03
#define SAA7146_SSR_EC4S MASK_02
#define SAA7146_SSR_EC2S MASK_01
#define SAA7146_SSR_EC1S MASK_00
/* I2C status register */
#define SAA7146_I2C_ABORT MASK_07
#define SAA7146_I2C_SPERR MASK_06
#define SAA7146_I2C_APERR MASK_05
#define SAA7146_I2C_DTERR MASK_04
#define SAA7146_I2C_DRERR MASK_03
#define SAA7146_I2C_AL MASK_02
#define SAA7146_I2C_ERR MASK_01
#define SAA7146_I2C_BUSY MASK_00
/* output formats */
#define SAA7146_YUV422 0
#define SAA7146_RGB16 0
#define SAA7146_YUV444 1
#define SAA7146_RGB24 1
#define SAA7146_ARGB32 2
#define SAA7146_YUV411 3
#define SAA7146_ARGB15 3
#define SAA7146_YUV2 4
#define SAA7146_RGAB15 4
#define SAA7146_Y8 6
#define SAA7146_YUV8 7
#define SAA7146_RGB8 7
#define SAA7146_YUV444p 8
#define SAA7146_YUV422p 9
#define SAA7146_YUV420p 10
#define SAA7146_YUV1620 11
#define SAA7146_Y1 13
#define SAA7146_Y2 14
#define SAA7146_YUV1 15
#endif
This diff is collapsed.
......@@ -60,6 +60,9 @@ static struct video_init video_init_list[]={
{"i2c-tuner", i2c_tuner_init},
{"bttv", init_bttv_cards},
#endif
#ifdef CONFIG_VIDEO_STRADIS
{"stradis", init_stradis_cards},
#endif
#ifdef CONFIG_VIDEO_BWQCAM
{"bw-qcam", init_bw_qcams},
#endif
......
......@@ -9,13 +9,13 @@
AUTHORS (so far)
Alan Cox, Building Number Three Ltd.
Alan Cox, Building Number Three Ltd.
Core code, SCSI and Block OSMs
Steve Ralston, LSI Logic Corp.
Steve Ralston, LSI Logic Corp.
Debugging SCSI and Block OSM
Deepak Saxena, Intel Corp.
Deepak Saxena, Intel Corp.
/proc interface, bug fixes
Ioctl interfaces for control
Debugging LAN OSM
......@@ -23,18 +23,21 @@ Deepak Saxena, Intel Corp.
Philip Rumpf
Fixed assorted dumb SMP locking bugs
Juha Sievanen, University of Helsinki Finland
Juha Sievanen, University of Helsinki Finland
LAN OSM code
/proc interface to LAN class
Bug fixes
Core code extensions
Auvo Häkkinen, University of Helsinki Finland
Auvo Häkkinen, University of Helsinki Finland
LAN OSM code
/Proc interface to LAN class
Bug fixes
Core code extensions
Taneli Vähäkangas, University of Helsinki Finland
Fixes to i2o_config
CREDITS
This work was made possible by
......@@ -75,6 +78,7 @@ o Long term message flow control
o PCI IOP's without interrupts are not supported yet
o Push FAIL handling into the core
o DDM control interfaces for module load etc
o Event handling
Block:
o Real error handler
......@@ -87,7 +91,8 @@ SCSI:
o Find the right way to associate drives/luns/busses
Lan: Batch mode sends
Fix the "killing interrupt handler" in i2o_set_multicast_list
Performance tuning
Event handling
Tape:
o Anyone seen anything implementing this ?
......@@ -208,18 +208,16 @@ VIII. Downloading Software
DESCRIPTION
This function downloads the software pointed by sw->buf to the
iop identified by sw->iop. The DownloadFlags, SwID, SwType and SwSize
fields of the ExecSwDownload message are filled in with the values of
sw->flags, sw->sw_id, sw->sw_type and *(sw->swlen).
Once the ioctl() is called and software transfer begins, the
user can read the value *(sw->maxfrag) and *(sw->curfrag) to
determine the status of the software transfer. As the IOP
is very slow when it comes to SW transfers, this can be
used by a separate thread to report status to the user. The
user _should not_ write to this memory location until the ioctl()
has returned.
This function downloads a software fragment pointed by sw->buf
to the iop identified by sw->iop. The DownloadFlags, SwID, SwType
and SwSize fields of the ExecSwDownload message are filled in with
the values of sw->flags, sw->sw_id, sw->sw_type and *(sw->swlen).
The fragments _must_ be sent in order and be 8K in size. The last
fragment _may_ be shorter, however. The kernel will compute its
size based on information in the sw->swlen field.
Please note that SW transfers can take a long time.
RETURNS
......@@ -234,7 +232,7 @@ VIII. Downloading Software
IX. Uploading Software
SYNOPSIS
ioctl(fd, I2OSWUL, struct i2o_sw_xfer *sw);
struct i2o_sw_xfer
......@@ -251,19 +249,17 @@ IX. Uploading Software
DESCRIPTION
This function uploads software from the IOP identified by sw->iop
and places it in the buffer pointed to by sw->buf. The length of the
buffer is given in *(sw->swlen). The UploadFlags, SwID and SwType
fields of the ExecSwUpload message are filled in
with the values of sw->flags, sw->sw_id and sw->sw_type.
Once the ioctl() is called and software transfer begins, the
user can read the value *(sw->maxfrag) and *(sw->curfrag) to
determine the status of the software transfer. As the IOP
is very slow when it comes to SW transfers, this can be
used by a separate thread to report status to the user. The
user _should not_ write to this memory location until the ioctl()
has returned.
This function uploads a software fragment from the IOP identified
by sw->iop, sw->sw_type, sw->sw_id and optionally sw->swlen fields.
The UploadFlags, SwID, SwType and SwSize fields of the ExecSwUpload
message are filled in with the values of sw->flags, sw->sw_id,
sw->sw_type and *(sw->swlen).
The fragments _must_ be requested in order and be 8K in size. The
user is responsible for allocating memory pointed by sw->buf. The
last fragment _may_ be shorter.
Please note that SW transfers can take a long time.
RETURNS
......
......@@ -11,7 +11,11 @@
* - Added software download ioctl (still testing)
* Modified 09/10/1999 by Auvo Hkkinen
* - Changes to i2o_cfg_reply(), ioctl_parms()
* - Added ioct_validate() (not yet tested)
* - Added ioct_validate()
* Modified 09/30/1999 by Taneli Vhkangas
* - Fixed ioctl_swdl()
* Modified 10/04/1999 by Taneli Vhkangas
* - Changed ioctl_swdl(), implemented ioctl_swul() and ioctl_swdel()
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -33,8 +37,6 @@
#include <asm/uaccess.h>
#include <asm/io.h>
#include "i2o_proc.h"
static int i2o_cfg_token = 0;
static int i2o_cfg_context = -1;
static void *page_buf;
......@@ -196,7 +198,7 @@ int ioctl_gethrt(unsigned long arg)
struct i2o_controller *c;
struct i2o_cmd_hrtlct *cmd = (struct i2o_cmd_hrtlct*)arg;
struct i2o_cmd_hrtlct kcmd;
pi2o_hrt hrt;
i2o_hrt *hrt;
int len;
u32 reslen;
int ret = 0;
......@@ -214,7 +216,7 @@ int ioctl_gethrt(unsigned long arg)
if(!c)
return -ENXIO;
hrt = (pi2o_hrt)c->hrt;
hrt = (i2o_hrt *)c->hrt;
i2o_unlock_controller(c);
......@@ -235,7 +237,7 @@ int ioctl_getlct(unsigned long arg)
struct i2o_controller *c;
struct i2o_cmd_hrtlct *cmd = (struct i2o_cmd_hrtlct*)arg;
struct i2o_cmd_hrtlct kcmd;
pi2o_lct lct;
i2o_lct *lct;
int len;
int ret = 0;
u32 reslen;
......@@ -253,7 +255,7 @@ int ioctl_getlct(unsigned long arg)
if(!c)
return -ENXIO;
lct = (pi2o_lct)c->lct;
lct = (i2o_lct *)c->lct;
i2o_unlock_controller(c);
len = (unsigned int)lct->table_size << 2;
......@@ -317,14 +319,14 @@ static int ioctl_parms(unsigned long arg, unsigned int type)
return -ENOMEM;
}
len = i2o_issue_params(i2o_cmd, c, kcmd.tid,
ops, kcmd.oplen, res, 65536);
len = i2o_issue_params(i2o_cmd, c, kcmd.tid,
ops, kcmd.oplen, res, sizeof(res));
i2o_unlock_controller(c);
kfree(ops);
if (len) {
if (len < 0) {
kfree(res);
return len; /* -DetailedStatus || -ETIMEDOUT */
return len; /* -DetailedStatus */
}
put_user(len, kcmd.reslen);
......@@ -414,7 +416,7 @@ int ioctl_html(unsigned long arg)
}
token = i2o_post_wait(c, msg, 9*4, 10);
if(token)
if(token != I2O_POST_WAIT_OK)
{
i2o_unlock_controller(c);
kfree(res);
......@@ -437,139 +439,175 @@ int ioctl_html(unsigned long arg)
return ret;
}
int ioctl_swdl(unsigned long arg)
{
struct i2o_sw_xfer kxfer;
struct i2o_sw_xfer *pxfer = (struct i2o_sw_xfer *)arg;
unsigned char maxfrag = 0, curfrag = 0;
unsigned char buffer[8192];
unsigned char maxfrag = 0, curfrag = 1;
unsigned char *buffer;
u32 msg[9];
unsigned int token = 0, diff = 0, swlen = 0, swxfer = 0;
unsigned int status = 0, swlen = 0, fragsize = 8192;
struct i2o_controller *c;
int foo = 0;
printk("*** foo%d ***\n", foo++);
if(copy_from_user(&kxfer, pxfer, sizeof(struct i2o_sw_xfer)))
{
printk( "i2o_config: can't copy i2o_sw cmd @ %p\n", pxfer);
return -EFAULT;
}
printk("*** foo%d ***\n", foo++);
printk("Attempting to copy swlen from %p\n", kxfer.swlen);
if(get_user(swlen, kxfer.swlen) < 0)
{
printk( "i2o_config: can't copy swlen\n");
return -EFAULT;
}
printk("*** foo%d ***\n", foo++);
maxfrag = swlen >> 13; // Transfer in 8k fragments
printk("Attempting to write maxfrag @ %p\n", kxfer.maxfrag);
if(put_user(maxfrag, kxfer.maxfrag) < 0)
{
printk( "i2o_config: can't write maxfrag\n");
if(get_user(maxfrag, kxfer.maxfrag) < 0)
return -EFAULT;
}
printk("*** foo%d ***\n", foo++);
printk("Attempting to write curfrag @ %p\n", kxfer.curfrag);
if(put_user(curfrag, kxfer.curfrag) < 0)
{
printk( "i2o_config: can't write curfrag\n");
if(get_user(curfrag, kxfer.curfrag) < 0)
return -EFAULT;
}
printk("*** foo%d ***\n", foo++);
if(!kxfer.buf)
{
printk( "i2o_config: NULL software buffer\n");
if(curfrag==maxfrag) fragsize = swlen-(maxfrag-1)*8192;
if(!kxfer.buf || !access_ok(VERIFY_READ, kxfer.buf, fragsize))
return -EFAULT;
}
printk("*** foo%d ***\n", foo++);
// access_ok doesn't check for NULL...
if(!access_ok(VERIFY_READ, kxfer.buf, swlen))
{
printk( "i2o_config: Cannot read sw buffer\n");
return -EFAULT;
}
printk("*** foo%d ***\n", foo++);
c = i2o_find_controller(kxfer.iop);
if(!c)
return -ENXIO;
printk("*** foo%d ***\n", foo++);
buffer=kmalloc(fragsize, GFP_KERNEL);
if (buffer==NULL)
{
i2o_unlock_controller(c);
return -ENOMEM;
}
__copy_from_user(buffer, kxfer.buf, fragsize);
msg[0]= NINE_WORD_MSG_SIZE | SGL_OFFSET_7;
msg[1]= I2O_CMD_SW_DOWNLOAD<<24 | HOST_TID<<12 | ADAPTER_TID;
msg[2]= (u32)cfg_handler.context;
msg[3]= 0;
msg[4]= ((u32)kxfer.flags)<<24|((u32)kxfer.sw_type)<<16|((u32)maxfrag)<<8|((u32)curfrag);
msg[4]= (((u32)kxfer.flags)<<24) | (((u32)kxfer.sw_type)<<16) |
(((u32)maxfrag)<<8) | (((u32)curfrag));
msg[5]= swlen;
msg[6]= kxfer.sw_id;
msg[7]= (0xD0000000 | 8192);
msg[7]= (0xD0000000 | fragsize);
msg[8]= virt_to_phys(buffer);
printk("*** foo%d ***\n", foo++);
//
// Loop through all fragments but last and transfer them...
// We already checked memory, so from now we assume it's all good
//
for(curfrag = 0; curfrag < maxfrag-1; curfrag++)
{
printk("Transfering fragment %d\n", curfrag);
// printk("i2o_config: swdl frag %d/%d (size %d)\n", curfrag, maxfrag, fragsize);
status = i2o_post_wait(c, msg, sizeof(msg), 60);
msg[4] |= (u32)curfrag;
__copy_from_user(buffer, kxfer.buf, 8192);
swxfer += 8192;
// Yes...that's one minute, but the spec states that
// transfers take a long time, and I've seen just how
// long they can take.
token = i2o_post_wait(c, msg, sizeof(msg), 60);
if (token) // Something very wrong
{
i2o_unlock_controller(c);
printk("Timeout downloading software");
return -ETIMEDOUT;
}
__put_user(curfrag, kxfer.curfrag);
}
// Last frag is special case since it's not exactly 8K
diff = swlen - swxfer;
msg[4] |= (u32)maxfrag;
msg[7] = (0xD0000000 | diff);
__copy_from_user(buffer, kxfer.buf, 8192);
token = i2o_post_wait(c, msg, sizeof(msg), 60);
if(token) // Something very wrong
i2o_unlock_controller(c);
kfree(buffer);
if (status != I2O_POST_WAIT_OK)
{
i2o_unlock_controller(c);
printk("Timeout downloading software");
// it fails if you try and send frags out of order
// and for some yet unknown reasons too
printk("i2o_config: swdl failed, DetailedStatus = %d\n", status);
return -ETIMEDOUT;
}
__put_user(curfrag, kxfer.curfrag);
i2o_unlock_controller(c);
return 0;
}
/* To be written */
int ioctl_swul(unsigned long arg)
{
return -EINVAL;
struct i2o_sw_xfer kxfer;
struct i2o_sw_xfer *pxfer = (struct i2o_sw_xfer *)arg;
unsigned char maxfrag = 0, curfrag = 1;
unsigned char *buffer;
u32 msg[9];
unsigned int status = 0, swlen = 0, fragsize = 8192;
struct i2o_controller *c;
if(copy_from_user(&kxfer, pxfer, sizeof(struct i2o_sw_xfer)))
return -EFAULT;
if(get_user(swlen, kxfer.swlen) < 0)
return -EFAULT;
if(get_user(maxfrag, kxfer.maxfrag) < 0)
return -EFAULT;
if(get_user(curfrag, kxfer.curfrag) < 0)
return -EFAULT;
if(curfrag==maxfrag) fragsize = swlen-(maxfrag-1)*8192;
if(!kxfer.buf || !access_ok(VERIFY_WRITE, kxfer.buf, fragsize))
return -EFAULT;
c = i2o_find_controller(kxfer.iop);
if(!c)
return -ENXIO;
buffer=kmalloc(fragsize, GFP_KERNEL);
if (buffer==NULL)
{
i2o_unlock_controller(c);
return -ENOMEM;
}
msg[0]= NINE_WORD_MSG_SIZE | SGL_OFFSET_7;
msg[1]= I2O_CMD_SW_UPLOAD<<24 | HOST_TID<<12 | ADAPTER_TID;
msg[2]= (u32)cfg_handler.context;
msg[3]= 0;
msg[4]= (u32)kxfer.flags<<24|(u32)kxfer.sw_type<<16|(u32)maxfrag<<8|(u32)curfrag;
msg[5]= swlen;
msg[6]= kxfer.sw_id;
msg[7]= (0xD0000000 | fragsize);
msg[8]= virt_to_bus(buffer);
// printk("i2o_config: swul frag %d/%d (size %d)\n", curfrag, maxfrag, fragsize);
status = i2o_post_wait(c, msg, sizeof(msg), 60);
i2o_unlock_controller(c);
if (status != I2O_POST_WAIT_OK)
{
kfree(buffer);
printk("i2o_config: swul failed, DetailedStatus = %d\n", status);
return -ETIMEDOUT;
}
__copy_to_user(kxfer.buf, buffer, fragsize);
kfree(buffer);
return 0;
}
/* To be written */
int ioctl_swdel(unsigned long arg)
{
return -EINVAL;
struct i2o_controller *c;
struct i2o_sw_xfer kxfer, *pxfer = (struct i2o_sw_xfer *)arg;
u32 msg[7];
unsigned int swlen;
int token;
if (copy_from_user(&kxfer, pxfer, sizeof(struct i2o_sw_xfer)))
return -EFAULT;
if (get_user(swlen, kxfer.swlen) < 0)
return -EFAULT;
c = i2o_find_controller(kxfer.iop);
if (!c)
return -ENXIO;
msg[0] = SEVEN_WORD_MSG_SIZE | SGL_OFFSET_0;
msg[1] = I2O_CMD_SW_REMOVE<<24 | HOST_TID<<12 | ADAPTER_TID;
msg[2] = (u32)i2o_cfg_context;
msg[3] = 0;
msg[4] = (u32)kxfer.flags<<24 | (u32)kxfer.sw_type<<16;
msg[5] = swlen;
msg[6] = kxfer.sw_id;
token = i2o_post_wait(c, msg, sizeof(msg), 10);
i2o_unlock_controller(c);
if (token != I2O_POST_WAIT_OK)
{
printk("i2o_config: swdel failed, DetailedStatus = %d\n", token);
return -ETIMEDOUT;
}
return 0;
}
int ioctl_validate(unsigned long arg)
......@@ -591,7 +629,7 @@ int ioctl_validate(unsigned long arg)
token = i2o_post_wait(c, msg, sizeof(msg), 10);
i2o_unlock_controller(c);
if (token)
if (token != I2O_POST_WAIT_OK)
{
printk("Can't validate configuration, ErrorStatus = %d\n",
token);
......@@ -644,7 +682,7 @@ int init_module(void)
int __init i2o_config_init(void)
#endif
{
printk(KERN_INFO "i2o configuration manager v 0.02\n");
printk(KERN_INFO "i2o configuration manager v 0.03\n");
if((page_buf = kmalloc(4096, GFP_KERNEL))==NULL)
{
......
......@@ -35,6 +35,7 @@
#include <linux/bitops.h>
#include <linux/wait.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <asm/io.h>
......@@ -927,7 +928,7 @@ static int i2o_parse_lct(struct i2o_controller *c)
u32 *p;
struct i2o_device *d;
char str[22];
pi2o_lct lct = c->lct;
i2o_lct *lct = c->lct;
max = lct->table_size;
......@@ -1168,6 +1169,9 @@ static int i2o_reset_controller(struct i2o_controller *c)
/* Wait for a reply */
time=jiffies;
/* DPT driver claims they need this */
mdelay(5);
#ifdef DRIVERDEBUG
printk(KERN_INFO "Reset posted, waiting...\n");
......@@ -1192,7 +1196,7 @@ static int i2o_reset_controller(struct i2o_controller *c)
{
/*
* Once the reset is sent, the IOP goes into the INIT state
* which is inditerminate. We need to wait until the IOP
* which is indeterminate. We need to wait until the IOP
* has rebooted before we can let the system talk to
* it. We read the inbound Free_List until a message is
* available. If we can't read one in the given ammount of
......@@ -1230,6 +1234,7 @@ int i2o_status_get(struct i2o_controller *c)
u32 m;
u32 *msg;
u8 *status_block;
int i;
#ifdef DRIVERDEBUG
printk(KERN_INFO "Getting status block for iop%d\n", c->unit);
......@@ -1238,7 +1243,7 @@ int i2o_status_get(struct i2o_controller *c)
kfree(c->status_block);
c->status_block =
(pi2o_status_block)kmalloc(sizeof(i2o_status_block),GFP_KERNEL);
(i2o_status_block *)kmalloc(sizeof(i2o_status_block),GFP_KERNEL);
if(c->status_block == NULL)
{
#ifdef DRIVERDEBUG
......@@ -1248,45 +1253,53 @@ int i2o_status_get(struct i2o_controller *c)
}
status_block = (u8*)c->status_block;
for(i=0;i<5;i++)
{
m=i2o_wait_message(c, "StatusGet");
if(m==0xFFFFFFFF)
return -ETIMEDOUT;
memset(status_block, 0, sizeof(i2o_status_block));
msg=(u32 *)(c->mem_offset+m);
__raw_writel(NINE_WORD_MSG_SIZE|SGL_OFFSET_0, &msg[0]);
__raw_writel(I2O_CMD_STATUS_GET<<24|HOST_TID<<12|ADAPTER_TID, &msg[1]);
__raw_writel(0, &msg[2]);
__raw_writel(0, &msg[3]);
__raw_writel(0, &msg[4]);
__raw_writel(0, &msg[5]);
__raw_writel(virt_to_bus(c->status_block), &msg[6]);
__raw_writel(0, &msg[7]); /* 64bit host FIXME */
__raw_writel(sizeof(i2o_status_block), &msg[8]);
printk("SB is %d bytes.\n", sizeof(i2o_status_block));
m=i2o_wait_message(c, "StatusGet");
if(m==0xFFFFFFFF)
return -ETIMEDOUT;
msg=(u32 *)(c->mem_offset+m);
msg[0]=NINE_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1]=I2O_CMD_STATUS_GET<<24|HOST_TID<<12|ADAPTER_TID;
msg[2]=core_context;
msg[3]=0;
msg[4]=0;
msg[5]=0;
msg[6]=virt_to_phys(c->status_block);
msg[7]=0; /* 64bit host FIXME */
msg[8]=88;
i2o_post_message(c,m);
/* Wait for a reply */
time=jiffies;
i2o_post_message(c,m);
/* DPT work around */
mdelay(5);
while(status_block[87]!=0xFF)
{
if((jiffies-time)>=5*HZ)
/* Wait for a reply */
time=jiffies;
while((jiffies-time)<=HZ)
{
if(status_block[87]!=0)
{
/* Ok the reply has arrived. Fill in the important stuff */
c->inbound_size = (status_block[12]|(status_block[13]<<8))*4;
return 0;
}
schedule();
barrier();
}
#ifdef DRIVERDEBUG
printk(KERN_ERR "IOP get status timeout.\n");
printk(KERN_ERR "IOP get status timeout.\n");
#endif
return -ETIMEDOUT;
}
schedule();
barrier();
}
/* Ok the reply has arrived. Fill in the important stuff */
c->inbound_size = (status_block[12]|(status_block[13]<<8))*4;
return 0;
return 0;//-ETIMEDOUT;
}
......@@ -1354,7 +1367,7 @@ static int i2o_systab_send(struct i2o_controller* iop)
*/
static void __init i2o_sys_init()
{
struct i2o_controller *iop;
struct i2o_controller *iop, *niop;
int ret;
u32 m;
......@@ -1362,18 +1375,30 @@ static void __init i2o_sys_init()
printk(KERN_INFO "This may take a few minutes if there are many devices\n");
/* Get the status for each IOP */
for(iop = i2o_controller_chain; iop; iop = iop->next)
for(iop = i2o_controller_chain; iop; iop = niop)
{
niop = iop->next;
#ifdef DRIVERDEBUG
printk(KERN_INFO "Getting initial status for iop%d\n", iop->unit);
#endif
i2o_status_get(iop);
if(i2o_status_get(iop)<0)
{
printk("Unable to obtain status of IOP, attempting a reset.\n");
i2o_reset_controller(iop);
if(i2o_status_get(iop)<0)
{
printk("IOP not responding.\n");
i2o_delete_controller(iop);
continue;
}
}
if(iop->status_block->iop_state == ADAPTER_STATE_FAULTED)
{
printk(KERN_CRIT "i2o: iop%d has hardware fault\n",
iop->unit);
i2o_delete_controller(iop);
continue;
}
if(iop->status_block->iop_state == ADAPTER_STATE_HOLD ||
......@@ -1384,7 +1409,7 @@ static void __init i2o_sys_init()
int msg[256];
#ifdef DRIVERDEBUG
printk(KERN_INFO "iop%d already running...trying to reboot",
printk(KERN_INFO "iop%d already running...trying to reboot\n",
iop->unit);
#endif
i2o_init_outbound_q(iop);
......@@ -1396,6 +1421,7 @@ static void __init i2o_sys_init()
{
printk(KERN_CRIT "Failed to initialize iop%d\n", iop->unit);
i2o_delete_controller(iop);
continue;
}
}
}
......@@ -1403,9 +1429,11 @@ static void __init i2o_sys_init()
/*
* Now init the outbound queue for each one.
*/
for(iop = i2o_controller_chain; iop; iop = iop->next)
for(iop = i2o_controller_chain; iop; iop = niop)
{
int i;
niop = iop->next;
if((ret=i2o_init_outbound_q(iop)))
{
......@@ -1413,6 +1441,7 @@ static void __init i2o_sys_init()
"IOP%d initialization failed: Could not initialize outbound q\n",
iop->unit);
i2o_delete_controller(iop);
continue;
}
iop->page_frame = kmalloc(MSG_POOL_SIZE, GFP_KERNEL);
......@@ -1438,18 +1467,20 @@ static void __init i2o_sys_init()
/*
* OK..parse the HRT
*/
for(iop = i2o_controller_chain; iop; iop = iop->next)
for(iop = i2o_controller_chain; iop; iop = niop)
{
niop = iop->next;
if(i2o_hrt_get(iop))
{
printk(KERN_CRIT "iop%d: Could not get HRT!\n", iop->unit);
i2o_delete_controller(iop);
break;
continue;
}
if(i2o_parse_hrt(iop))
{
printk(KERN_CRIT "iop%d: Could not parse HRT!\n", iop->unit);
i2o_delete_controller(iop);
continue;
}
}
......@@ -1466,15 +1497,17 @@ static void __init i2o_sys_init()
return;
}
for(iop = i2o_controller_chain; iop; iop = iop->next)
for(iop = i2o_controller_chain; iop; iop = niop)
#ifdef DRIVERDEBUG
{
niop = iop->next;
printk(KERN_INFO "Sending system table to iop%d\n", iop->unit);
#endif
if(i2o_systab_send(iop))
{
printk(KERN_CRIT "iop%d: Error sending system table\n", iop->unit);
i2o_delete_controller(iop);
continue;
}
#ifdef DRIVERDEBUG
}
......@@ -1483,8 +1516,9 @@ static void __init i2o_sys_init()
/*
* Enable
*/
for(iop = i2o_controller_chain; iop; iop = iop->next)
for(iop = i2o_controller_chain; iop; iop = niop)
{
niop = iop->next;
#ifdef DRIVERDEBUG
printk(KERN_INFO "Enableing iop%d\n", iop->unit);
#endif
......@@ -1492,14 +1526,16 @@ static void __init i2o_sys_init()
{
printk(KERN_ERR "Could not enable iop%d\n", iop->unit);
i2o_delete_controller(iop);
continue;
}
}
/*
* OK..one last thing and we're ready to go!
*/
for(iop = i2o_controller_chain; iop; iop = iop->next)
for(iop = i2o_controller_chain; iop; iop = niop)
{
niop = iop->next;
#ifdef DRIVERDEBUG
printk(KERN_INFO "Getting LCT for iop%d\n", iop->unit);
#endif
......@@ -1507,6 +1543,7 @@ static void __init i2o_sys_init()
{
printk(KERN_ERR "Could not get LCT from iop%d\n", iop->unit);
i2o_delete_controller(iop);
continue;
}
else
i2o_parse_lct(iop);
......@@ -1667,7 +1704,7 @@ int i2o_init_outbound_q(struct i2o_controller *c)
msg[4]= 4096; /* Host page frame size */
msg[5]= MSG_FRAME_SIZE<<16|0x80; /* Outbound msg frame size and Initcode */
msg[6]= 0xD0000004; /* Simple SG LE, EOB */
msg[7]= virt_to_phys(workspace);
msg[7]= virt_to_bus(workspace);
*((u32 *)workspace)=0;
/*
......@@ -1685,7 +1722,6 @@ int i2o_init_outbound_q(struct i2o_controller *c)
{
printk(KERN_ERR "i2o/iop%d: IOP outbound initialise failed.\n",
c->unit);
kfree(workspace);
return -ETIMEDOUT;
}
schedule();
......@@ -2419,7 +2455,7 @@ static void i2o_report_util_cmd(u8 cmd)
case I2O_CMD_UTIL_DEVICE_RELEASE:
printk("UTIL_DEVICE_RELEASE, ");
break;
case I2O_CMD_UTIL_ACK:
case I2O_CMD_UTIL_EVT_ACK:
printk("UTIL_EVENT_ACKNOWLEDGE, ");
break;
case I2O_CMD_UTIL_EVT_REGISTER:
......
This diff is collapsed.
......@@ -18,7 +18,7 @@
/* Tunable parameters first */
#define I2O_BUCKET_COUNT 256
#define I2O_BUCKET_THRESH 16
#define I2O_BUCKET_THRESH 8
/* LAN types */
#define I2O_LAN_ETHERNET 0x0030
......@@ -108,5 +108,11 @@ struct i2o_bucket_descriptor {
u32 context; /* FIXME: 64bit support */
struct i2o_packet_info packet_info[1];
};
/* Event Indicator Mask Flags for LAN OSM */
#define I2O_LAN_EVT_LINK_DOWN 0x01
#define I2O_LAN_EVT_LINK_UP 0x02
#define I2O_LAN_EVT_MEDIA_CHANGE 0x04
#endif /* _I2O_LAN_H */
......@@ -5,11 +5,11 @@
* (C) Copyright 1999 Red Hat Software
*
* Written by Alan Cox, Building Number Three Ltd
* Modified by Deepak Saxena <deepak@plexity.net>
* Modified by Deepak Saxena <deepak@plexity.net>
*
* This program 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
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* TODO:
......@@ -120,7 +120,7 @@ int __init i2o_pci_install(struct pci_dev *dev)
if(c==NULL)
{
printk(KERN_ERR "i2o_pci: insufficient memory to add controller.\n");
printk(KERN_ERR "i2o: Insufficient memory to add controller.\n");
return -ENOMEM;
}
memset(c, 0, sizeof(*c));
......@@ -137,7 +137,7 @@ int __init i2o_pci_install(struct pci_dev *dev)
if(i==6)
{
printk(KERN_ERR "i2o_pci: I2O controller has no memory regions defined.\n");
printk(KERN_ERR "i2o: I2O controller has no memory regions defined.\n");
kfree(c);
return -EINVAL;
}
......@@ -145,11 +145,11 @@ int __init i2o_pci_install(struct pci_dev *dev)
size = dev->resource[i].end-dev->resource[i].start+1;
/* Map the I2O controller */
printk(KERN_INFO "PCI I2O controller at 0x%08X size=%d\n", memptr, size);
printk(KERN_INFO "i2o: PCI I2O controller at 0x%08X size=%d\n", memptr, size);
mem = ioremap(memptr, size);
if(mem==NULL)
{
printk(KERN_ERR "i2o_pci: Unable to map controller.\n");
printk(KERN_ERR "i2o: Unable to map controller.\n");
kfree(c);
return -EINVAL;
}
......@@ -189,7 +189,7 @@ int __init i2o_pci_install(struct pci_dev *dev)
if(i<0)
{
printk(KERN_ERR "i2o: unable to install controller.\n");
printk(KERN_ERR "i2o: Unable to install controller.\n");
kfree(c);
iounmap(mem);
return i;
......@@ -216,7 +216,7 @@ int __init i2o_pci_install(struct pci_dev *dev)
}
}
printk(KERN_INFO "Installed iop%d at IRQ%d\n", c->unit, dev->irq);
printk(KERN_INFO "%s: Installed at IRQ%d\n", c->name, dev->irq);
I2O_IRQ_WRITE32(c,0x0);
c->enabled = 1;
return 0;
......@@ -227,7 +227,7 @@ int __init i2o_pci_scan(void)
struct pci_dev *dev;
int count=0;
printk(KERN_INFO "Checking for PCI I2O controllers...\n");
printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n");
for(dev=pci_devices; dev!=NULL; dev=dev->next)
{
......@@ -235,17 +235,17 @@ int __init i2o_pci_scan(void)
continue;
if((dev->class&0xFF)>1)
{
printk(KERN_INFO "I2O controller found but does not support I2O 1.5 (skipping).\n");
printk(KERN_INFO "i2o: I2O Controller found but does not support I2O 1.5 (skipping).\n");
continue;
}
printk(KERN_INFO "I2O controller on bus %d at %d.\n",
printk(KERN_INFO "i2o: I2O controller on bus %d at %d.\n",
dev->bus->number, dev->devfn);
pci_set_master(dev);
if(i2o_pci_install(dev)==0)
count++;
}
if(count)
printk(KERN_INFO "%d I2O controller%s found and installed.\n", count,
printk(KERN_INFO "i2o: %d I2O controller%s found and installed.\n", count,
count==1?"":"s");
return count?count:-ENODEV;
}
......@@ -270,7 +270,7 @@ static void i2o_pci_activate(i2o_controller * c)
if(i2o_activate_controller(c))
#endif /* MODULE */
{
printk("I2O: Failed to initialize iop%d\n", c->unit);
printk("%s: Failed to initialize.\n", c->name);
#ifdef MODULE
core->unlock(c);
core->delete(c);
......
This diff is collapsed.
#ifndef i2oproc_h
#define i2oproc_h
/*
* Fixme: make this dependent on architecture
* The official header files to this already...but we can't use them
*/
#define I2O_64BIT_CONTEXT 0
typedef struct _i2o_msg {
u8 ver_offset;
u8 msg_flags;
u16 msg_size;
u32 target_addr:12;
u32 initiator_addr:12;
u32 function:8;
u32 init_context; /* FIXME: 64-bit support! */
} i2o_msg, *pi2o_msg;
typedef struct _i2o_reply_message {
i2o_msg msg_frame;
u32 tctx; /* FIXME: 64-bit */
u16 detailed_status_code;
u8 reserved;
u8 req_status;
} i2o_reply_msg, *pi2o_reply_msg;
typedef struct _i2o_mult_reply_message {
i2o_msg msg_frame;
u32 tctx; /* FIXME: 64-bit */
u16 detailed_status_code;
u8 reserved;
u8 req_status;
} i2o_mult_reply_msg, *pi2o_mult_reply_msg;
#endif /* i2oproc_h */
......@@ -587,7 +587,7 @@ int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
m = I2O_POST_READ32(c);
}
while(m==0xFFFFFFFF);
msg = c->mem_offset + m;
msg = (u32 *)(c->mem_offset + m);
/*
* Put together a scsi execscb message
......
......@@ -781,7 +781,7 @@ static void hardware_send_packet(struct net_device *dev, void *buf, short length
isa_memcpy_toio(write_ptr+2, buf, length);
/* Set the old command link pointing to this send packet. */
isa_isa_writew(tx_block,dev->mem_start + lp->tx_cmd_link);
isa_writew(tx_block,dev->mem_start + lp->tx_cmd_link);
lp->tx_cmd_link = tx_block + 20;
/* Set the next free tx region. */
......
This diff is collapsed.
......@@ -59,6 +59,7 @@
#include <linux/malloc.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/version.h>
#include <linux/delay.h>
......
......@@ -344,7 +344,7 @@ static void es_block_input(struct net_device *dev, int count, struct sk_buff *sk
isa_memcpy_fromio(skb->data + semi_count, dev->rmem_start, count);
} else {
/* Packet is in one chunk. */
isa_eth_io_copy_and_csum(skb, xfer_start, count, 0);
isa_eth_io_copy_and_sum(skb, xfer_start, count, 0);
}
}
......
......@@ -33,7 +33,6 @@ static const char *version =
#include <linux/malloc.h>
#include <linux/netdevice.h>
#include <linux/pci.h>
#include <linux/malloc.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/errno.h>
......
......@@ -2683,7 +2683,7 @@ static int __init init_ray_cs(void)
DEBUG(1, "raylink init_module register_pcmcia_driver returns 0x%x\n",rc);
#ifdef CONFIG_PROC_FS
/* [proc-namespace][fixme] It shouldn't be under root, damnit! */
create_proc_info_entry("ray_cs", 0, proc_root, ray_cs_proc_read);
create_proc_info_entry("ray_cs", 0, &proc_root, ray_cs_proc_read);
#endif
if (translate != 0) translate = 1;
return 0;
......@@ -2714,7 +2714,7 @@ static void __exit exit_ray_cs(void)
ray_detach(dev_list);
}
#ifdef CONFIG_PROC_FS
remove_proc_entry("ray_cs", proc_root);
remove_proc_entry("ray_cs", &proc_root);
#endif
} /* exit_ray_cs */
......
......@@ -71,7 +71,6 @@ paper sources:
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/errno.h>
......
......@@ -58,7 +58,7 @@ else
endif
ifeq ($(CONFIG_BLK_DEV_SD),y)
L_OBJS += sd.o sd_ioctl.o
L_OBJS += sd.o
else
ifeq ($(CONFIG_BLK_DEV_SD),m)
M_OBJS += sd_mod.o
......@@ -729,5 +729,5 @@ scsi_mod.o: $(MIX_OBJS) hosts.o scsi.o scsi_ioctl.o constants.o \
sr_mod.o: sr.o sr_ioctl.o sr_vendor.o
$(LD) $(LD_RFLAG) -r -o $@ sr.o sr_ioctl.o sr_vendor.o
sd_mod.o: sd.o sd_ioctl.o
$(LD) $(LD_RFLAG) -r -o $@ sd.o sd_ioctl.o
sd_mod.o: sd.o
$(LD) $(LD_RFLAG) -r -o $@ sd.o
......@@ -107,7 +107,7 @@
#include "atari_scsi.h"
#endif
#ifdef CONFIG_MAC_SCSI_OLD
#if defined(CONFIG_MAC_SCSI) || defined(CONFIG_MAC_SCSI_OLD)
#include "mac_scsi.h"
#endif
......@@ -115,10 +115,6 @@
#include "sun3_scsi.h"
#endif
#ifdef CONFIG_MAC_SCSI
#include "mac_scsi.h"
#endif
#ifdef CONFIG_SCSI_MAC_ESP
#include "mac_esp.h"
#endif
......
......@@ -73,19 +73,13 @@
#if LINUX_VERSION_CODE >= CVT_LINUX_VERSION(1,3,0)
#include <stdarg.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/sched.h>
#if LINUX_VERSION_CODE <= CVT_LINUX_VERSION(2,1,92)
#include <linux/bios32.h>
#endif
#include <linux/pci.h>
#include <linux/proc_fs.h>
#if LINUX_VERSION_CODE >= CVT_LINUX_VERSION(2,1,23)
#include <linux/init.h>
#endif
......@@ -93,34 +87,28 @@
#if LINUX_VERSION_CODE >= CVT_LINUX_VERSION(2,1,95)
#include <linux/spinlock.h>
#endif
#include "sd.h"
#include "scsi.h"
#include "hosts.h"
#include "inia100.h"
#include <linux/stat.h>
#include <linux/malloc.h>
#include <linux/config.h>
#else
#include <linux/kernel.h>
#include <linux/head.h>
#include <linux/types.h>
#include <asm/system.h>
#include "../block/blk.h"
#endif
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
#include <asm/system.h>
#include <asm/io.h>
#include "../block/blk.h"
#include "scsi.h"
#include "sd.h"
#include "hosts.h"
#include <linux/malloc.h>
#include "inia100.h"
#endif
#ifdef MODULE
Scsi_Host_Template driver_template = INIA100;
......
......@@ -36,21 +36,25 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/hdreg.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/smp.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/io.h>
#define MAJOR_NR SCSI_DISK0_MAJOR
#include <linux/blk.h>
#include <linux/blkpg.h>
#include "scsi.h"
#include "hosts.h"
#include "sd.h"
#include <scsi/scsi_ioctl.h>
#include "constants.h"
#include <scsi/scsicam.h> /* must follow "hosts.h" */
#include <linux/genhd.h>
......@@ -87,8 +91,6 @@ static int *sd_sizes;
static int *sd_blocksizes;
static int *sd_hardsizes; /* Hardware sector size */
extern int sd_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
static int check_scsidisk_media_change(kdev_t);
static int fop_revalidate_scsidisk(kdev_t);
......@@ -102,6 +104,83 @@ static int sd_attach(Scsi_Device *);
static int sd_detect(Scsi_Device *);
static void sd_detach(Scsi_Device *);
static int sd_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg)
{
kdev_t dev = inode->i_rdev;
int error;
struct Scsi_Host * host;
Scsi_Device * SDev;
int diskinfo[4];
struct hd_geometry *loc = (struct hd_geometry *) arg;
SDev = rscsi_disks[DEVICE_NR(dev)].device;
/*
* If we are in the middle of error recovery, don't let anyone
* else try and use this device. Also, if error recovery fails, it
* may try and take the device offline, in which case all further
* access to the device is prohibited.
*/
if( !scsi_block_when_processing_errors(SDev) )
{
return -ENODEV;
}
switch (cmd) {
case HDIO_GETGEO: /* Return BIOS disk parameters */
if (!loc) return -EINVAL;
error = verify_area(VERIFY_WRITE, loc, sizeof(*loc));
if (error)
return error;
host = rscsi_disks[DEVICE_NR(dev)].device->host;
/* default to most commonly used values */
diskinfo[0] = 0x40;
diskinfo[1] = 0x20;
diskinfo[2] = rscsi_disks[DEVICE_NR(dev)].capacity >> 11;
/* override with calculated, extended default, or driver values */
if(host->hostt->bios_param != NULL)
host->hostt->bios_param(&rscsi_disks[DEVICE_NR(dev)],
dev,
&diskinfo[0]);
else scsicam_bios_param(&rscsi_disks[DEVICE_NR(dev)],
dev, &diskinfo[0]);
put_user(diskinfo[0], &loc->heads);
put_user(diskinfo[1], &loc->sectors);
put_user(diskinfo[2], &loc->cylinders);
put_user(sd[SD_PARTITION(inode->i_rdev)].start_sect, &loc->start);
return 0;
case BLKGETSIZE: /* Return device size */
if (!arg) return -EINVAL;
error = verify_area(VERIFY_WRITE, (long *) arg, sizeof(long));
if (error)
return error;
put_user(sd[SD_PARTITION(inode->i_rdev)].nr_sects,
(long *) arg);
return 0;
case BLKROSET:
case BLKROGET:
case BLKRASET:
case BLKRAGET:
case BLKFLSBUF:
case BLKSSZGET:
case BLKPG:
return blk_ioctl(inode->i_rdev, cmd, arg);
case BLKRRPART: /* Re-read partition tables */
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
return revalidate_scsidisk(dev, 1);
default:
return scsi_ioctl(rscsi_disks[DEVICE_NR(dev)].device , cmd, (void *) arg);
}
}
static void sd_devname(unsigned int disknum, char *buffer)
{
if (disknum < 26)
......
/*
* drivers/scsi/sd_ioctl.c
*
* ioctl handling for SCSI disks
*/
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/hdreg.h>
#include <linux/errno.h>
#include <asm/uaccess.h>
#define MAJOR_NR SCSI_DISK0_MAJOR
#include <linux/blk.h>
#include <linux/blkpg.h>
#include "scsi.h"
#include <scsi/scsi_ioctl.h>
#include "hosts.h"
#include "sd.h"
#include <scsi/scsicam.h> /* must follow "hosts.h" */
int sd_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg)
{
kdev_t dev = inode->i_rdev;
int error;
struct Scsi_Host * host;
Scsi_Device * SDev;
int diskinfo[4];
struct hd_geometry *loc = (struct hd_geometry *) arg;
SDev = rscsi_disks[DEVICE_NR(dev)].device;
/*
* If we are in the middle of error recovery, don't let anyone
* else try and use this device. Also, if error recovery fails, it
* may try and take the device offline, in which case all further
* access to the device is prohibited.
*/
if( !scsi_block_when_processing_errors(SDev) )
{
return -ENODEV;
}
switch (cmd) {
case HDIO_GETGEO: /* Return BIOS disk parameters */
if (!loc) return -EINVAL;
error = verify_area(VERIFY_WRITE, loc, sizeof(*loc));
if (error)
return error;
host = rscsi_disks[DEVICE_NR(dev)].device->host;
/* default to most commonly used values */
diskinfo[0] = 0x40;
diskinfo[1] = 0x20;
diskinfo[2] = rscsi_disks[DEVICE_NR(dev)].capacity >> 11;
/* override with calculated, extended default, or driver values */
if(host->hostt->bios_param != NULL)
host->hostt->bios_param(&rscsi_disks[DEVICE_NR(dev)],
dev,
&diskinfo[0]);
else scsicam_bios_param(&rscsi_disks[DEVICE_NR(dev)],
dev, &diskinfo[0]);
put_user(diskinfo[0], &loc->heads);
put_user(diskinfo[1], &loc->sectors);
put_user(diskinfo[2], &loc->cylinders);
put_user(sd[SD_PARTITION(inode->i_rdev)].start_sect, &loc->start);
return 0;
case BLKGETSIZE: /* Return device size */
if (!arg) return -EINVAL;
error = verify_area(VERIFY_WRITE, (long *) arg, sizeof(long));
if (error)
return error;
put_user(sd[SD_PARTITION(inode->i_rdev)].nr_sects,
(long *) arg);
return 0;
case BLKROSET:
case BLKROGET:
case BLKRASET:
case BLKRAGET:
case BLKFLSBUF:
case BLKSSZGET:
case BLKPG:
return blk_ioctl(inode->i_rdev, cmd, arg);
case BLKRRPART: /* Re-read partition tables */
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
return revalidate_scsidisk(dev, 1);
default:
return scsi_ioctl(rscsi_disks[DEVICE_NR(dev)].device , cmd, (void *) arg);
}
}
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-indent-level: 4
* c-brace-imaginary-offset: 0
* c-brace-offset: -4
* c-argdecl-indent: 4
* c-label-offset: -4
* c-continued-statement-offset: 4
* c-continued-brace-offset: 0
* indent-tabs-mode: nil
* tab-width: 8
* End:
*/
......@@ -37,7 +37,7 @@ endif
ifeq ($(CONFIG_USB_UHCI),m)
M_OBJS += usb-uhci.o
MIX_OBJS += uhci.o uhci-debug.o
MI_OBJS += uhci.o uhci-debug.o
endif
ifeq ($(CONFIG_USB_OHCI),y)
......@@ -45,7 +45,7 @@ ifeq ($(CONFIG_USB_OHCI),y)
endif
ifeq ($(CONFIG_USB_OHCI),m)
M_OBJS += usb-ohci.o
MIX_OBJS += ohci.o ohci-debug.o
MI_OBJS += ohci.o ohci-debug.o
endif
ifeq ($(CONFIG_USB_OHCI_HCD),y)
......@@ -53,7 +53,7 @@ ifeq ($(CONFIG_USB_OHCI_HCD),y)
endif
ifeq ($(CONFIG_USB_OHCI_HCD),m)
M_OBJS += usb-ohci-hcd.o
MIX_OBJS += ohci-hcd.o ohci-root-hub.o
MI_OBJS += ohci-hcd.o ohci-root-hub.o
endif
ifeq ($(CONFIG_USB_MOUSE),y)
......@@ -61,7 +61,7 @@ ifeq ($(CONFIG_USB_MOUSE),y)
endif
ifeq ($(CONFIG_USB_MOUSE),m)
M_OBJS += mouse.o
MIX_OBJS += mouse.o
MI_OBJS += mouse.o
endif
ifeq ($(CONFIG_USB_HP_SCANNER),y)
......@@ -69,7 +69,7 @@ ifeq ($(CONFIG_USB_HP_SCANNER),y)
endif
ifeq ($(CONFIG_USB_HP_SCANNER),m)
M_OBJS +=hp_scanner.o
MIX_OBJS +=hp_scanner.o
MI_OBJS +=hp_scanner.o
endif
ifeq ($(CONFIG_USB_HUB),y)
......@@ -77,7 +77,7 @@ ifeq ($(CONFIG_USB_HUB),y)
endif
ifeq ($(CONFIG_USB_HUB),m)
M_OBJS += hub.o
MIX_OBJS += hub.o
MI_OBJS += hub.o
endif
ifeq ($(CONFIG_USB_ACM),y)
......@@ -85,7 +85,7 @@ ifeq ($(CONFIG_USB_ACM),y)
endif
ifeq ($(CONFIG_USB_ACM),m)
M_OBJS += acm.o
MIX_OBJS += acm.o
MI_OBJS += acm.o
endif
ifeq ($(CONFIG_USB_PRINTER),y)
......@@ -94,7 +94,7 @@ endif
ifeq ($(CONFIG_USB_PRINTER),m)
M_OBJS += printer.o
MIX_OBJS += printer.o
MI_OBJS += printer.o
endif
ifeq ($(CONFIG_USB_SERIAL),y)
......@@ -103,7 +103,7 @@ endif
ifeq ($(CONFIG_USB_SERIAL),m)
M_OBJS += usb-serial.o
MIX_OBJS += usb-serial.o
MI_OBJS += usb-serial.o
endif
ifneq ($(CONFIG_ADB_KEYBOARD),y)
......@@ -118,7 +118,7 @@ endif
ifeq ($(CONFIG_USB_KBD),m)
M_OBJS += usb-keyboard.o
MIX_OBJS += keyboard.o $(KEYMAP).o
MI_OBJS += keyboard.o $(KEYMAP).o
endif
ifeq ($(CONFIG_USB_AUDIO),y)
......@@ -127,7 +127,7 @@ endif
ifeq ($(CONFIG_USB_AUDIO),m)
M_OBJS += audio.o
MIX_OBJS += audio.o
MI_OBJS += audio.o
endif
ifeq ($(CONFIG_USB_CPIA),y)
......@@ -136,7 +136,7 @@ endif
ifeq ($(CONFIG_USB_CPIA),m)
M_OBJS += cpia.o
MIX_OBJS += cpia.o
MI_OBJS += cpia.o
endif
ifeq ($(CONFIG_USB_DC2XX),y)
......@@ -144,7 +144,7 @@ ifeq ($(CONFIG_USB_DC2XX),y)
endif
ifeq ($(CONFIG_USB_DC2XX),m)
M_OBJS += dc2xx.o
MIX_OBJS += dc2xx.o
MI_OBJS += dc2xx.o
endif
ifeq ($(CONFIG_USB_SCSI),y)
......@@ -156,9 +156,9 @@ endif
ifeq ($(CONFIG_USB_SCSI),m)
M_OBJS += usb-scsi.o
MIX_OBJS += usb_scsi.o
MI_OBJS += usb_scsi.o
ifeq ($(CONFIG_USB_SCSI_DEBUG),y)
MIX_OBJS += usb_scsi_debug.o
MI_OBJS += usb_scsi_debug.o
endif
endif
......@@ -168,7 +168,7 @@ endif
ifeq ($(CONFIG_USB_EZUSB),m)
M_OBJS += ezusb.o
MIX_OBJS += ezusb.o
MI_OBJS += ezusb.o
endif
ifeq ($(CONFIG_USB_USS720),y)
......@@ -177,7 +177,7 @@ endif
ifeq ($(CONFIG_USB_USS720),m)
M_OBJS += uss720.o
MIX_OBJS += uss720.o
MI_OBJS += uss720.o
endif
include $(TOPDIR)/Rules.make
......
......@@ -3,15 +3,24 @@ Serial devices. It should also work for the Etek converter, but I do
not know the vendor id, and device id of that device (if anyone does,
please let me know.)
If your device is not compatible with the above models, you can try
out the "generic" interface. This interface does not provide any type
of control messages sent to the device, and does not support any kind
of device flow control. All that is required of your device is that
it has at least one bulk in endpoint, or one bulk out endpoint.
To enable the driver to recognize your device, build the driver as
a module and load it by the following invocation:
insmod usb-serial.o vendor=0x#### product=0x####
where the #### is replaced with the hex representation of your device's
vendor id and product id.
The driver can handle enumerating the device, and sending and receiving
data from the converter. However, since I do not have a spec for this
device, and the raw dumps from the Win98 driver are confusing, no control
signals are handled, and the data will most likely come through on a baud
data from the converter. However, since I do not have a spec for the Belkin,
Peracom, and eTek devices, and the raw dumps from the Win98 driver are
confusing, and eTek keeps giving me the run around, no control signals are
currently handled, and the data will most likely come through on a baud
rate that you are not expecting.
But I am working on figuring the control settings out. This release is to
let others try it out, and give some feedback.
The major number that the driver uses is 240 (in the local/experimental
range.) It will stay there until some agreements are reached on how to
handle the configuration problem that USB provides.
......
This diff is collapsed.
......@@ -823,7 +823,7 @@ static int balance_dirty_state(kdev_t dev)
unsigned long dirty, tot, hard_dirty_limit, soft_dirty_limit;
dirty = size_buffers_type[BUF_DIRTY] >> PAGE_SHIFT;
tot = nr_lru_pages + nr_free_pages - nr_free_highpages;
tot = nr_free_buffer_pages();
hard_dirty_limit = tot * bdf_prm.b_un.nfract / 100;
soft_dirty_limit = hard_dirty_limit >> 1;
......
......@@ -225,14 +225,16 @@ int copy_strings(int argc,char ** argv, struct linux_binprm *bprm)
page = bprm->page[i];
new = 0;
if (!page) {
unsigned long pageaddr;
/*
* Cannot yet use highmem page because
* we cannot sleep with a kmap held.
*/
page = __get_pages(GFP_USER, 0);
bprm->page[i] = page;
if (!page)
pageaddr = __get_free_page(GFP_USER);
if (!pageaddr)
return -ENOMEM;
page = mem_map + MAP_NR(pageaddr);
bprm->page[i] = page;
new = 1;
}
kaddr = (char *)kmap(page, KM_WRITE);
......
......@@ -16,7 +16,8 @@
#include <linux/elf.h>
#include <linux/elfcore.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#ifdef CONFIG_KCORE_AOUT
......@@ -211,7 +212,7 @@ static void elf_kcore_store_hdr(char *bufp)
#ifdef CONFIG_MODULES
{
struct module *m;
read_lock(&modlist_lock);
lock_kernel();
for (m=module_list; m; m=m->next) {
dhdr = (struct elf_phdr *) bufp;
bufp += sizeof(struct elf_phdr);
......@@ -227,7 +228,7 @@ static void elf_kcore_store_hdr(char *bufp)
dhdr->p_align = 0;
elf->e_phnum++;
}
read_unlock(&modlist_lock);
lock_kernel();
}
#endif
......
......@@ -18,6 +18,8 @@ EXPORT_SYMBOL(proc_get_inode);
EXPORT_SYMBOL(proc_dir_inode_operations);
EXPORT_SYMBOL(proc_net);
EXPORT_SYMBOL(proc_bus);
EXPORT_SYMBOL(proc_lookup);
EXPORT_SYMBOL(proc_readdir);
#if defined(CONFIG_SUN_OPENPROMFS_MODULE)
EXPORT_SYMBOL(proc_openprom_register);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment