Commit 0bf36f29 authored by Andy Grover's avatar Andy Grover

Merge groveronline.com:/root/bk/linux-2.5

into groveronline.com:/root/bk/linux-acpi
parents 7d155a9a 2005ca71
......@@ -323,16 +323,12 @@ Create a pci_pool like this:
struct pci_pool *pool;
pool = pci_pool_create(name, dev, size, align, alloc, flags);
pool = pci_pool_create(name, dev, size, align, alloc);
The "name" is for diagnostics (like a kmem_cache name); dev and size
are as above. The device's hardware alignment requirement for this
type of data is "align" (which is expressed in bytes, and must be a
power of two). The flags are SLAB_ flags as you'd pass to
kmem_cache_create. Not all flags are understood, but SLAB_POISON may
help you find driver bugs. If you call this in a non- sleeping
context (f.e. in_interrupt is true or while holding SMP locks), pass
SLAB_ATOMIC. If your device has no boundary crossing restrictions,
power of two). If your device has no boundary crossing restrictions,
pass 0 for alloc; passing 4096 says memory allocated from this pool
must not cross 4KByte boundaries (but at that time it may be better to
go for pci_alloc_consistent directly instead).
......
VERSION = 2
PATCHLEVEL = 5
SUBLEVEL = 40
SUBLEVEL = 41
EXTRAVERSION =
# *DOCUMENTATION*
......@@ -81,7 +81,7 @@ ifneq ($(filter all,$(MAKECMDGOALS)),)
KBUILD_MODULES := 1
endif
export KBUILD_MODULES KBUILD_BUILTIN
export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE
# Beautify output
# ---------------------------------------------------------------------------
......
......@@ -1095,18 +1095,9 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
sigset_t *mask = &current->blocked;
unsigned long signr = 0;
local_irq_disable();
if (current->sig->shared_pending.head) {
spin_lock(&current->sig->siglock);
signr = dequeue_signal(&current->sig->shared_pending, mask, &info);
spin_unlock(&current->sig->siglock);
}
if (!signr) {
spin_lock(&current->sig->siglock);
signr = dequeue_signal(&current->pending, mask, &info);
spin_unlock(&current->sig->siglock);
}
local_irq_enable();
spin_lock_irq(&current->sig->siglock);
signr = dequeue_signal(mask, &info);
spin_unlock_irq(&current->sig->siglock);
if (!signr)
break;
......
......@@ -23,6 +23,9 @@
#include <linux/pci.h>
#endif
#include <linux/pm.h>
#ifdef CONFIG_HIGHMEM
#include <linux/highmem.h>
#endif
#include <asm/oplib.h>
#include <asm/delay.h>
......@@ -199,6 +202,12 @@ EXPORT_SYMBOL(ioremap);
EXPORT_SYMBOL(iounmap);
#endif
/* in arch/sparc/mm/highmem.c */
#ifdef CONFIG_HIGHMEM
EXPORT_SYMBOL(kmap_atomic);
EXPORT_SYMBOL(kunmap_atomic);
#endif
/* Solaris/SunOS binary compatibility */
EXPORT_SYMBOL(svr4_setcontext);
EXPORT_SYMBOL(svr4_getcontext);
......
......@@ -547,7 +547,7 @@ void __init sun4d_init_IRQ(void)
BTFIXUPSET_CALL(clear_profile_irq, sun4d_clear_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(load_profile_irq, sun4d_load_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__irq_itoa, sun4d_irq_itoa, BTFIXUPCALL_NORM);
init_timers = sun4d_init_timers;
sparc_init_timers = sun4d_init_timers;
#ifdef CONFIG_SMP
BTFIXUPSET_CALL(set_cpu_int, sun4d_set_cpu_int, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_cpu_int, sun4d_clear_ipi, BTFIXUPCALL_NOP);
......
......@@ -12,6 +12,10 @@ else
obj-y += srmmu.o iommu.o io-unit.o hypersparc.o viking.o tsunami.o swift.o
endif
ifdef CONFIG_HIGHMEM
obj-y += highmem.o
endif
ifdef CONFIG_SMP
obj-y += nosun4c.o
else
......
......@@ -13,6 +13,8 @@
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
static inline void forget_pte(pte_t page)
{
......
/*
* highmem.c: virtual kernel memory mappings for high memory
*
* Provides kernel-static versions of atomic kmap functions originally
* found as inlines in include/asm-sparc/highmem.h. These became
* needed as kmap_atomic() and kunmap_atomic() started getting
* called from within modules.
* -- Tomas Szepe <szepe@pinerecords.com>, September 2002
*
* But kmap_atomic() and kunmap_atomic() cannot be inlined in
* modules because they are loaded with btfixup-ped functions.
*/
/*
* The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap
* gives a more generic (and caching) interface. But kmap_atomic can
* be used in IRQ contexts, so in some (very limited) cases we need it.
*
* XXX This is an old text. Actually, it's good to use atomic kmaps,
* provided you remember that they are atomic and not try to sleep
* with a kmap taken, much like a spinlock. Non-atomic kmaps are
* shared by CPUs, and so precious, and establishing them requires IPI.
* Atomic kmaps are lightweight and we may have NCPUS more of them.
*/
#include <linux/mm.h>
#include <linux/highmem.h>
#include <asm/pgalloc.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
void *kmap_atomic(struct page *page, enum km_type type)
{
unsigned long idx;
unsigned long vaddr;
inc_preempt_count();
if (page < highmem_start_page)
return page_address(page);
idx = type + KM_TYPE_NR*smp_processor_id();
vaddr = FIX_KMAP_BEGIN + idx * PAGE_SIZE;
/* XXX Fix - Anton */
#if 0
__flush_cache_one(vaddr);
#else
flush_cache_all();
#endif
#if HIGHMEM_DEBUG
if (!pte_none(*(kmap_pte+idx)))
BUG();
#endif
set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
/* XXX Fix - Anton */
#if 0
__flush_tlb_one(vaddr);
#else
flush_tlb_all();
#endif
return (void*) vaddr;
}
void kunmap_atomic(void *kvaddr, enum km_type type)
{
unsigned long vaddr = (unsigned long) kvaddr;
unsigned long idx = type + KM_TYPE_NR*smp_processor_id();
if (vaddr < FIX_KMAP_BEGIN) { // FIXME
dec_preempt_count();
return;
}
if (vaddr != FIX_KMAP_BEGIN + idx * PAGE_SIZE)
BUG();
/* XXX Fix - Anton */
#if 0
__flush_cache_one(vaddr);
#else
flush_cache_all();
#endif
#ifdef HIGHMEM_DEBUG
/*
* force other mappings to Oops if they'll try to access
* this pte without first remap it
*/
pte_clear(kmap_pte+idx);
/* XXX Fix - Anton */
#if 0
__flush_tlb_one(vaddr);
#else
flush_tlb_all();
#endif
#endif
dec_preempt_count();
}
......@@ -38,6 +38,8 @@
#include <asm/a.out.h>
#include <asm/mmu_context.h>
#include <asm/io-unit.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
/* Now the cpu specific definitions. */
#include <asm/viking.h>
......
......@@ -29,7 +29,7 @@ CONFIG_BBC_I2C=m
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_HUGETLB_PAGE=y
# CONFIG_HUGETLB_PAGE is not set
CONFIG_SMP=y
# CONFIG_PREEMPT is not set
CONFIG_SPARC64=y
......@@ -157,7 +157,7 @@ CONFIG_SUN_MOSTEK_RTC=y
CONFIG_OBP_FLASH=m
# CONFIG_SUN_BPP is not set
# CONFIG_SUN_VIDEOPIX is not set
CONFIG_SUN_AURORA=m
# CONFIG_SUN_AURORA is not set
#
# Memory Technology Devices (MTD)
......@@ -335,26 +335,7 @@ CONFIG_NET_FC=y
#
# IEEE 1394 (FireWire) support (EXPERIMENTAL)
#
CONFIG_IEEE1394=m
#
# Device Drivers
#
# CONFIG_IEEE1394_PCILYNX is not set
CONFIG_IEEE1394_OHCI1394=m
#
# Protocol Drivers
#
# CONFIG_IEEE1394_VIDEO1394 is not set
CONFIG_IEEE1394_SBP2=m
# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
CONFIG_IEEE1394_ETH1394=m
CONFIG_IEEE1394_DV1394=m
CONFIG_IEEE1394_RAWIO=m
CONFIG_IEEE1394_CMP=m
CONFIG_IEEE1394_AMDTP=m
# CONFIG_IEEE1394_VERBOSEDEBUG is not set
# CONFIG_IEEE1394 is not set
#
# Networking options
......@@ -465,6 +446,18 @@ CONFIG_VORTEX=m
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_VENDOR_RACAL is not set
#
# Tulip family network device support
#
CONFIG_NET_TULIP=y
CONFIG_DE2104X=m
CONFIG_TULIP=m
# CONFIG_TULIP_MWI is not set
# CONFIG_TULIP_MMIO is not set
CONFIG_DE4X5=m
CONFIG_WINBOND_840=m
# CONFIG_DM9102 is not set
# CONFIG_HP100 is not set
# CONFIG_NET_ISA is not set
CONFIG_NET_PCI=y
......@@ -547,18 +540,6 @@ CONFIG_SHAPER=m
#
# CONFIG_WAN is not set
#
# Tulip family network device support
#
CONFIG_NET_TULIP=y
CONFIG_DE2104X=m
CONFIG_TULIP=m
# CONFIG_TULIP_MWI is not set
# CONFIG_TULIP_MMIO is not set
CONFIG_DE4X5=m
CONFIG_WINBOND_840=m
# CONFIG_DM9102 is not set
#
# Amateur Radio support
#
......@@ -864,7 +845,7 @@ CONFIG_SND_VIRMIDI=m
#
CONFIG_SND_ALI5451=m
CONFIG_SND_CS46XX=m
CONFIG_SND_CS46XX_ACCEPT_VALID=y
# CONFIG_SND_CS46XX_NEW_DSP is not set
CONFIG_SND_CS4281=m
CONFIG_SND_EMU10K1=m
CONFIG_SND_KORG1212=m
......@@ -886,8 +867,12 @@ CONFIG_SND_FM801=m
CONFIG_SND_ICE1712=m
CONFIG_SND_INTEL8X0=m
CONFIG_SND_SONICVIBES=m
CONFIG_SND_VIA686=m
CONFIG_SND_VIA8233=m
# CONFIG_SND_VIA82XX is not set
#
# ALSA USB devices
#
# CONFIG_SND_USB_AUDIO is not set
#
# ALSA Sparc devices
......@@ -1031,6 +1016,7 @@ CONFIG_USB_RIO500=m
# CONFIG_USB_BRLVGER is not set
CONFIG_USB_LCD=m
# CONFIG_USB_SPEEDTOUCH is not set
CONFIG_USB_TEST=m
#
# Bluetooth support
......
......@@ -645,18 +645,9 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs,
sigset_t *mask = &current->blocked;
unsigned long signr = 0;
local_irq_disable();
if (current->sig->shared_pending.head) {
spin_lock(&current->sig->siglock);
signr = dequeue_signal(&current->sig->shared_pending, mask, &info);
spin_unlock(&current->sig->siglock);
}
if (!signr) {
spin_lock(&current->sig->siglock);
signr = dequeue_signal(&current->pending, mask, &info);
spin_unlock(&current->sig->siglock);
}
local_irq_enable();
spin_lock_irq(&current->sig->siglock);
signr = dequeue_signal(mask, &info);
spin_unlock_irq(&current->sig->siglock);
if (!signr)
break;
......
......@@ -1284,18 +1284,9 @@ int do_signal32(sigset_t *oldset, struct pt_regs * regs,
sigset_t *mask = &current->blocked;
unsigned long signr = 0;
local_irq_disable();
if (current->sig->shared_pending.head) {
spin_lock(&current->sig->siglock);
signr = dequeue_signal(&current->sig->shared_pending, mask, &info);
spin_unlock(&current->sig->siglock);
}
if (!signr) {
spin_lock(&current->sig->siglock);
signr = dequeue_signal(&current->pending, mask, &info);
spin_unlock(&current->sig->siglock);
}
local_irq_enable();
spin_lock_irq(&current->sig->siglock);
signr = dequeue_signal(mask, &info);
spin_unlock_irq(&current->sig->siglock);
if (!signr)
break;
......
......@@ -1972,10 +1972,7 @@ sys32_rt_sigtimedwait(sigset_t32 *uthese, siginfo_t32 *uinfo,
}
spin_lock_irq(&current->sig->siglock);
spin_lock(&current->sig->siglock);
sig = dequeue_signal(&current->sig->shared_pending, &these, &info);
if (!sig)
sig = dequeue_signal(&current->pending, &these, &info);
sig = dequeue_signal(&these, &info);
if (!sig) {
timeout = MAX_SCHEDULE_TIMEOUT;
if (uts)
......@@ -1989,23 +1986,18 @@ sys32_rt_sigtimedwait(sigset_t32 *uthese, siginfo_t32 *uinfo,
current->real_blocked = current->blocked;
sigandsets(&current->blocked, &current->blocked, &these);
recalc_sigpending();
spin_unlock(&current->sig->siglock);
spin_unlock_irq(&current->sig->siglock);
current->state = TASK_INTERRUPTIBLE;
timeout = schedule_timeout(timeout);
spin_lock_irq(&current->sig->siglock);
spin_lock(&current->sig->siglock);
sig = dequeue_signal(&current->sig->shared_pending, &these, &info);
if (!sig)
sig = dequeue_signal(&current->pending, &these, &info);
sig = dequeue_signal(&these, &info);
current->blocked = current->real_blocked;
siginitset(&current->real_blocked, 0);
recalc_sigpending();
}
}
spin_unlock(&current->sig->siglock);
spin_unlock_irq(&current->sig->siglock);
if (sig) {
......
......@@ -1366,6 +1366,8 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
}
#endif
/* Initialize the boot-time allocator. */
max_pfn = max_low_pfn = end_pfn;
min_low_pfn = pfn_base;
bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap_pfn, pfn_base, end_pfn);
/* Now register the available physical memory with the
......
......@@ -222,7 +222,7 @@ rw_raw_dev(int rw, struct file *filp, const struct iovec *iov, unsigned long nr_
count = inode->i_size - *offp;
nr_segs = iov_shorten((struct iovec *)iov, nr_segs, count);
}
ret = generic_file_direct_IO(rw, inode, iov, *offp, nr_segs);
ret = generic_file_direct_IO(rw, filp, iov, *offp, nr_segs);
if (ret > 0)
*offp += ret;
......
......@@ -1500,7 +1500,7 @@ static int idedisk_suspend(struct device *dev, u32 state, u32 level)
{
ide_drive_t *drive = dev->driver_data;
printk("Suspending device %lx\n", dev->driver_data);
printk("Suspending device %p\n", dev->driver_data);
/* I hope that every freeze operation from the upper levels have
* already been done...
......
......@@ -32,52 +32,52 @@
#include <asm/bitops.h>
static u8 ide_inb (u32 port)
static u8 ide_inb (ide_ioreg_t port)
{
return (u8) inb(port);
}
static u16 ide_inw (u32 port)
static u16 ide_inw (ide_ioreg_t port)
{
return (u16) inw(port);
}
static void ide_insw (u32 port, void *addr, u32 count)
static void ide_insw (ide_ioreg_t port, void *addr, u32 count)
{
return insw(port, addr, count);
}
static u32 ide_inl (u32 port)
static u32 ide_inl (ide_ioreg_t port)
{
return (u32) inl(port);
}
static void ide_insl (u32 port, void *addr, u32 count)
static void ide_insl (ide_ioreg_t port, void *addr, u32 count)
{
insl(port, addr, count);
}
static void ide_outb (u8 addr, u32 port)
static void ide_outb (u8 addr, ide_ioreg_t port)
{
outb(addr, port);
}
static void ide_outw (u16 addr, u32 port)
static void ide_outw (u16 addr, ide_ioreg_t port)
{
outw(addr, port);
}
static void ide_outsw (u32 port, void *addr, u32 count)
static void ide_outsw (ide_ioreg_t port, void *addr, u32 count)
{
outsw(port, addr, count);
}
static void ide_outl (u32 addr, u32 port)
static void ide_outl (u32 addr, ide_ioreg_t port)
{
outl(addr, port);
}
static void ide_outsl (u32 port, void *addr, u32 count)
static void ide_outsl (ide_ioreg_t port, void *addr, u32 count)
{
return outsl(port, addr, count);
}
......@@ -98,17 +98,17 @@ void default_hwif_iops (ide_hwif_t *hwif)
EXPORT_SYMBOL(default_hwif_iops);
static u8 ide_mm_inb (u32 port)
static u8 ide_mm_inb (ide_ioreg_t port)
{
return (u8) readb(port);
}
static u16 ide_mm_inw (u32 port)
static u16 ide_mm_inw (ide_ioreg_t port)
{
return (u16) readw(port);
}
static void ide_mm_insw (u32 port, void *addr, u32 count)
static void ide_mm_insw (ide_ioreg_t port, void *addr, u32 count)
{
#ifdef CONFIG_PPC
/* Can we move the barrier out of the loop ? */
......@@ -118,12 +118,12 @@ static void ide_mm_insw (u32 port, void *addr, u32 count)
#endif
}
static u32 ide_mm_inl (u32 port)
static u32 ide_mm_inl (ide_ioreg_t port)
{
return (u32) readl(port);
}
static void ide_mm_insl (u32 port, void *addr, u32 count)
static void ide_mm_insl (ide_ioreg_t port, void *addr, u32 count)
{
#ifdef CONFIG_PPC
/* Can we move the barrier out of the loop ? */
......@@ -133,17 +133,17 @@ static void ide_mm_insl (u32 port, void *addr, u32 count)
#endif
}
static void ide_mm_outb (u8 value, u32 port)
static void ide_mm_outb (u8 value, ide_ioreg_t port)
{
writeb(value, port);
}
static void ide_mm_outw (u16 value, u32 port)
static void ide_mm_outw (u16 value, ide_ioreg_t port)
{
writew(value, port);
}
static void ide_mm_outsw (u32 port, void *addr, u32 count)
static void ide_mm_outsw (ide_ioreg_t port, void *addr, u32 count)
{
#ifdef CONFIG_PPC
/* Can we move the barrier out of the loop ? */
......@@ -153,12 +153,12 @@ static void ide_mm_outsw (u32 port, void *addr, u32 count)
#endif
}
static void ide_mm_outl (u32 value, u32 port)
static void ide_mm_outl (u32 value, ide_ioreg_t port)
{
writel(value, port);
}
static void ide_mm_outsl (u32 port, void *addr, u32 count)
static void ide_mm_outsl (ide_ioreg_t port, void *addr, u32 count)
{
#ifdef CONFIG_PPC
while (count--) { __raw_writel(*(u32 *)addr, port); iobarrier_w(); addr += 4; }
......
......@@ -834,7 +834,7 @@ static int stream_alloc_packet_lists(struct stream *s)
max_packet_size = max_nevents * s->dimension * 4 + 8;
s->packet_pool = pci_pool_create("packet pool", s->host->ohci->dev,
max_packet_size, 0, 0, SLAB_KERNEL);
max_packet_size, 0, 0);
if (s->packet_pool == NULL)
return -1;
......@@ -1020,7 +1020,7 @@ struct stream *stream_alloc(struct amdtp_host *host)
s->descriptor_pool = pci_pool_create("descriptor pool", host->ohci->dev,
sizeof(struct descriptor_block),
16, 0, SLAB_KERNEL);
16, 0);
if (s->descriptor_pool == NULL) {
kfree(s->input);
kfree(s);
......
......@@ -10,7 +10,7 @@
#undef N_DATA
#include <linux/kernel.h>
#include <linux/tqueue.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/ioport.h>
......@@ -25,6 +25,8 @@ MODULE_DESCRIPTION("ISDN4Linux: Driver for Eicon Diva Server cards");
MODULE_AUTHOR("Armin Schindler");
MODULE_LICENSE("GPL");
void DivasInitDpc(void);
#ifdef MODULE
#include "idi.h"
void DIVA_DIDD_Write(DESCRIPTOR *, int);
......@@ -47,6 +49,8 @@ divas_init(void)
return -ENODEV;
#endif
DivasInitDpc();
if (pci_present())
{
if (DivasCardsDiscover() < 0)
......
......@@ -176,8 +176,7 @@ extern void DivasLogAdd(void *buffer, int length);
/*------------------------------------------------------------------*/
int DivasDpcSchedule(void);
void DivasDoDpc(void *);
void DivasDoRequestDpc(void *pData);
void DivasDoDpc(unsigned long);
int DivasScheduleRequestDpc(void);
/* table of IDI request functions */
......
......@@ -801,7 +801,7 @@ void DivaDoCardDpc(card_t *card)
}
void DivasDoDpc(void *pData)
void DivasDoDpc(unsigned long dummy)
{
card_t *card = DivasCards;
int i = DivasCardNext;
......@@ -814,11 +814,6 @@ void DivasDoDpc(void *pData)
}
}
void DivasDoRequestDpc(void *pData)
{
DivasDoDpc(pData);
}
/*
* DivasGetNum
* Returns the number of active adapters
......
/* $Id: eicon.h,v 1.23.6.5 2001/09/23 22:24:37 kai Exp $
/* $Id: eicon.h,v 1.1.4.1.2.3 2002/10/01 11:29:13 armin Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
*
......@@ -321,9 +321,9 @@ typedef struct eicon_card {
struct sk_buff_head sackq; /* Data-Ack-Message queue */
struct sk_buff_head statq; /* Status-Message queue */
int statq_entries;
struct work_struct snd_tq; /* Task struct for xmit bh */
struct work_struct rcv_tq; /* Task struct for rcv bh */
struct work_struct ack_tq; /* Task struct for ack bh */
struct tasklet_struct snd_tq; /* Task struct for xmit bh */
struct tasklet_struct rcv_tq; /* Task struct for rcv bh */
struct tasklet_struct ack_tq; /* Task struct for ack bh */
eicon_chan* IdTable[256]; /* Table to find entity */
__u16 ref_in;
__u16 ref_out;
......@@ -349,17 +349,17 @@ extern char *eicon_ctype_name[];
extern __inline__ void eicon_schedule_tx(eicon_card *card)
{
schedule_work(&card->snd_tq);
tasklet_schedule(&card->snd_tq);
}
extern __inline__ void eicon_schedule_rx(eicon_card *card)
{
schedule_work(&card->rcv_tq);
tasklet_schedule(&card->rcv_tq);
}
extern __inline__ void eicon_schedule_ack(eicon_card *card)
{
schedule_work(&card->ack_tq);
tasklet_schedule(&card->ack_tq);
}
extern int eicon_addcard(int, int, int, char *, int);
......
/* $Id: eicon_dsp.h,v 1.7.6.1 2001/09/23 22:24:37 kai Exp $
/* $Id: eicon_dsp.h,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
*
* ISDN lowlevel-module for Eicon active cards.
* DSP definitions
......
/* $Id: eicon_idi.c,v 1.41.6.4 2001/11/06 20:58:29 kai Exp $
/* $Id: eicon_idi.c,v 1.1.4.1.2.4 2002/10/01 11:29:13 armin Exp $
*
* ISDN lowlevel-module for Eicon active cards.
* IDI interface
......@@ -24,7 +24,7 @@
#undef EICON_FULL_SERVICE_OKTETT
char *eicon_idi_revision = "$Revision: 1.41.6.4 $";
char *eicon_idi_revision = "$Revision: 1.1.4.1.2.4 $";
eicon_manifbuf *manbuf;
......
/* $Id: eicon_idi.h,v 1.11.6.1 2001/09/23 22:24:37 kai Exp $
/* $Id: eicon_idi.h,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
*
* ISDN lowlevel-module for the Eicon active cards.
* IDI-Interface
......
/* $Id: eicon_io.c,v 1.13.6.2 2001/09/23 22:24:37 kai Exp $
/* $Id: eicon_io.c,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
* Code for communicating with hardware.
......
/* $Id: eicon_isa.c,v 1.16.6.2 2001/11/06 20:58:29 kai Exp $
/* $Id: eicon_isa.c,v 1.1.4.1.2.3 2002/10/01 11:29:13 armin Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
* Hardware-specific code for old ISA cards.
......@@ -20,7 +20,7 @@
#define release_shmem release_region
#define request_shmem request_region
char *eicon_isa_revision = "$Revision: 1.16.6.2 $";
char *eicon_isa_revision = "$Revision: 1.1.4.1.2.3 $";
#undef EICON_MCA_DEBUG
......
/* $Id: eicon_isa.h,v 1.10.6.1 2001/09/23 22:24:37 kai Exp $
/* $Id: eicon_isa.h,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
*
......
/* $Id: eicon_mod.c,v 1.37.6.6 2001/09/23 22:24:37 kai Exp $
/* $Id: eicon_mod.c,v 1.1.4.1.2.4 2002/10/01 11:29:13 armin Exp $
*
* ISDN lowlevel-module for Eicon active cards.
*
......@@ -44,7 +44,7 @@
static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains
start of card-list */
static char *eicon_revision = "$Revision: 1.37.6.6 $";
static char *eicon_revision = "$Revision: 1.1.4.1.2.4 $";
extern char *eicon_pci_revision;
extern char *eicon_isa_revision;
......@@ -142,8 +142,10 @@ eicon_findnpcicard(int driverid)
#endif /* CONFIG_PCI */
static void
eicon_rcv_dispatch(struct eicon_card *card)
eicon_rcv_dispatch(unsigned long context)
{
struct eicon_card *card = (struct eicon_card *)context;
switch (card->bus) {
case EICON_BUS_ISA:
case EICON_BUS_MCA:
......@@ -152,13 +154,15 @@ eicon_rcv_dispatch(struct eicon_card *card)
break;
default:
eicon_log(card, 1,
"eicon_ack_dispatch: Illegal bustype %d\n", card->bus);
"eicon_rcv_dispatch: Illegal bustype %d\n", card->bus);
}
}
static void
eicon_ack_dispatch(struct eicon_card *card)
eicon_ack_dispatch(unsigned long context)
{
struct eicon_card *card = (struct eicon_card *)context;
switch (card->bus) {
case EICON_BUS_ISA:
case EICON_BUS_MCA:
......@@ -172,8 +176,10 @@ eicon_ack_dispatch(struct eicon_card *card)
}
static void
eicon_transmit(struct eicon_card *card)
eicon_transmit(unsigned long context)
{
struct eicon_card *card = (struct eicon_card *)context;
switch (card->bus) {
case EICON_BUS_ISA:
case EICON_BUS_MCA:
......@@ -868,12 +874,9 @@ eicon_alloccard(int Type, int membase, int irq, char *id, int card_id)
skb_queue_head_init(&card->sackq);
skb_queue_head_init(&card->statq);
card->statq_entries = 0;
card->snd_tq.routine = (void *) (void *) eicon_transmit;
card->snd_tq.data = card;
card->rcv_tq.routine = (void *) (void *) eicon_rcv_dispatch;
card->rcv_tq.data = card;
card->ack_tq.routine = (void *) (void *) eicon_ack_dispatch;
card->ack_tq.data = card;
tasklet_init(&card->snd_tq, eicon_transmit, (unsigned long)card);
tasklet_init(&card->rcv_tq, eicon_rcv_dispatch, (unsigned long)card);
tasklet_init(&card->ack_tq, eicon_ack_dispatch, (unsigned long)card);
card->interface.maxbufsize = 4000;
card->interface.command = if_command;
card->interface.writebuf_skb = if_sendbuf;
......
/* $Id: eicon_pci.c,v 1.15.6.3 2001/09/23 22:24:37 kai Exp $
/* $Id: eicon_pci.c,v 1.1.4.1.2.3 2002/10/01 11:29:13 armin Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards.
* Hardware-specific code for PCI cards.
......@@ -24,7 +24,7 @@
#include "adapter.h"
#include "uxio.h"
char *eicon_pci_revision = "$Revision: 1.15.6.3 $";
char *eicon_pci_revision = "$Revision: 1.1.4.1.2.3 $";
#if CONFIG_PCI /* intire stuff is only for PCI */
#ifdef CONFIG_ISDN_DRV_EICON_PCI
......
/* $Id: eicon_pci.h,v 1.6.6.1 2001/09/23 22:24:37 kai Exp $
/* $Id: eicon_pci.h,v 1.1.4.1.2.2 2002/10/01 11:29:13 armin Exp $
*
* ISDN low-level module for Eicon active ISDN-Cards (PCI part).
*
......
......@@ -10,6 +10,10 @@
#define N_DATA
#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/smp_lock.h>
#include <asm/io.h>
#include <asm/system.h>
#include <linux/slab.h>
......@@ -24,7 +28,7 @@ int log_on=0;
int Divasdevflag = 0;
//spinlock_t diva_lock = SPIN_LOCK_UNLOCKED;
spinlock_t diva_lock = SPIN_LOCK_UNLOCKED;
static
ux_diva_card_t card_pool[MAX_CARDS];
......@@ -673,20 +677,14 @@ long UxCardLock(ux_diva_card_t *card)
{
unsigned long flags;
//spin_lock_irqsave(&diva_lock, flags);
spin_lock_irqsave(&diva_lock, flags);
save_flags(flags);
cli();
return flags;
}
void UxCardUnlock(ux_diva_card_t *card, long ipl)
{
//spin_unlock_irqrestore(&diva_lock, ipl);
restore_flags(ipl);
spin_unlock_irqrestore(&diva_lock, ipl);
}
dword UxTimeGet(void)
......
......@@ -24,6 +24,8 @@ struct pt_regs;
#include "uxio.h"
static struct tasklet_struct DivasTask;
int Divas4BRIInitPCI(card_t *card, dia_card_t *cfg)
{
/* Use UxPciConfigWrite routines to initialise PCI config space */
......@@ -79,24 +81,23 @@ int DivasBRIInitPCI(card_t *card, dia_card_t *cfg)
int DivasDpcSchedule(void)
{
static struct work_struct DivasTask;
INIT_WORK(&DivasTask, DivasDoDpc, NULL);
schedule_work(&DivasTask);
tasklet_schedule(&DivasTask);
return 0;
}
int DivasScheduleRequestDpc(void)
{
static struct work_struct DivasTask;
INIT_WORK(&DivasTask, DivasDoRequestDpc, NULL);
schedule_work(&DivasTask);
tasklet_schedule(&DivasTask);
return 0;
}
void DivasInitDpc(void)
{
tasklet_init(&DivasTask, DivasDoDpc, 0);
}
void DivasLogAdd(void *buffer, int length)
{
static
......
......@@ -11,9 +11,11 @@ obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o
# Multipart objects.
isdn-objs := isdn_net.o isdn_tty.o \
isdn_v110.o isdn_common.o \
isdn_ciscohdlck.o
isdn-objs := isdn_net.o isdn_net_lib.o \
isdn_fsm.o \
isdn_ciscohdlck.o \
isdn_tty.o isdn_v110.o \
isdn_common.o \
# Optional parts of multipart objects.
......
This diff is collapsed.
......@@ -46,8 +46,7 @@ struct isdn_slot {
unsigned long obytes; /* Statistics outgoing bytes */
struct isdn_v110 iv110; /* For V.110 */
int m_idx; /* Index for mdm.... */
isdn_net_dev *rx_netdev; /* rx netdev-pointers */
isdn_net_dev *st_netdev; /* stat netdev-pointers */
isdn_net_dev *idev; /* pointer to isdn_net_dev */
};
static struct isdn_slot slot[ISDN_MAX_CHANNELS];
......@@ -508,7 +507,7 @@ isdn_status_callback(isdn_ctrl * c)
list_for_each(l, &isdn_net_devs) {
isdn_net_dev *p = list_entry(l, isdn_net_dev, global_list);
if (p->isdn_slot == i) {
strcpy(cmd.parm.setup.eazmsn, p->local.msn);
strcpy(cmd.parm.setup.eazmsn, p->mlp->msn);
isdn_slot_command(i, ISDN_CMD_ACCEPTD, &cmd);
retval = 1;
break;
......@@ -1010,19 +1009,6 @@ static int
isdn_status_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
{
int ret;
union iocpar {
char name[10];
char bname[22];
isdn_ioctl_struct iocts;
isdn_net_ioctl_phone phone;
isdn_net_ioctl_cfg cfg;
} iocpar;
#define name iocpar.name
#define bname iocpar.bname
#define iocts iocpar.iocts
#define phone iocpar.phone
#define cfg iocpar.cfg
switch (cmd) {
case IIOCGETDVR:
......@@ -1044,26 +1030,11 @@ isdn_status_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
} else
return -EINVAL;
break;
#ifdef CONFIG_NETDEVICES
case IIOCNETGPN:
/* Get peer phone number of a connected
* isdn network interface */
if (arg) {
if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
return -EFAULT;
return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
} else
return -EINVAL;
#endif
return isdn_net_ioctl(inode, file, cmd, arg);
default:
return -EINVAL;
}
#undef name
#undef bname
#undef iocts
#undef phone
#undef cfg
}
static struct file_operations isdn_status_fops =
......@@ -1221,19 +1192,15 @@ isdn_ctrl_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
int ret;
int i;
char *p;
union iocpar {
char name[10];
/* save stack space */
union {
char bname[20];
isdn_ioctl_struct iocts;
isdn_net_ioctl_phone phone;
isdn_net_ioctl_cfg cfg;
} iocpar;
#define name iocpar.name
#define bname iocpar.bname
#define iocts iocpar.iocts
#define phone iocpar.phone
#define cfg iocpar.cfg
#define bname iocpar.bname
/*
* isdn net devices manage lots of configuration variables as linked lists.
* Those lists must only be manipulated from user space. Some of the ioctl's
......@@ -1242,134 +1209,19 @@ isdn_ctrl_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
* are serialized by means of a semaphore.
*/
switch (cmd) {
case IIOCNETDWRSET:
printk(KERN_INFO "INFO: ISDN_DW_ABC_EXTENSION not enabled\n");
return(-EINVAL);
case IIOCNETLCR:
printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n");
return -ENODEV;
#ifdef CONFIG_NETDEVICES
case IIOCNETAIF:
/* Add a network-interface */
if (copy_from_user(name, (char *) arg, sizeof(name) - 1))
return -EFAULT;
name[sizeof(name)-1] = 0;
ret = down_interruptible(&dev->sem);
if (ret)
return ret;
ret = isdn_net_new(name, NULL);
up(&dev->sem);
return ret;
case IIOCNETASL:
/* Add a slave to a network-interface */
if (copy_from_user(bname, (char *) arg, sizeof(bname) - 1))
return -EFAULT;
bname[sizeof(bname)-1] = 0;
ret = down_interruptible(&dev->sem);
if (ret)
return ret;
ret = isdn_net_newslave(bname);
up(&dev->sem);
return ret;
case IIOCNETDIF:
/* Delete a network-interface */
if (arg) {
if (copy_from_user(name, (char *) arg, sizeof(name)))
return -EFAULT;
ret = down_interruptible(&dev->sem);
if( ret ) return ret;
ret = isdn_net_rm(name);
up(&dev->sem);
return ret;
} else
return -EINVAL;
case IIOCNETSCF:
/* Set configurable parameters of a network-interface */
if (arg) {
if (copy_from_user((char *) &cfg, (char *) arg, sizeof(cfg)))
return -EFAULT;
return isdn_net_setcfg(&cfg);
} else
return -EINVAL;
case IIOCNETGCF:
/* Get configurable parameters of a network-interface */
if (arg) {
if (copy_from_user((char *) &cfg, (char *) arg, sizeof(cfg)))
return -EFAULT;
if (!(ret = isdn_net_getcfg(&cfg))) {
if (copy_to_user((char *) arg, (char *) &cfg, sizeof(cfg)))
return -EFAULT;
}
return ret;
} else
return -EINVAL;
case IIOCNETANM:
/* Add a phone-number to a network-interface */
if (arg) {
if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
return -EFAULT;
ret = down_interruptible(&dev->sem);
if( ret ) return ret;
ret = isdn_net_addphone(&phone);
up(&dev->sem);
return ret;
} else
return -EINVAL;
case IIOCNETGNM:
/* Get list of phone-numbers of a network-interface */
if (arg) {
if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
return -EFAULT;
ret = down_interruptible(&dev->sem);
if( ret ) return ret;
ret = isdn_net_getphones(&phone, (char *) arg);
up(&dev->sem);
return ret;
} else
return -EINVAL;
case IIOCNETDNM:
/* Delete a phone-number of a network-interface */
if (arg) {
if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
return -EFAULT;
ret = down_interruptible(&dev->sem);
if( ret ) return ret;
ret = isdn_net_delphone(&phone);
up(&dev->sem);
return ret;
} else
return -EINVAL;
case IIOCNETDIL:
/* Force dialing of a network-interface */
if (arg) {
if (copy_from_user(name, (char *) arg, sizeof(name)))
return -EFAULT;
return isdn_net_force_dial(name);
} else
return -EINVAL;
#ifdef CONFIG_ISDN_PPP
case IIOCNETALN:
if (!arg)
return -EINVAL;
if (copy_from_user(name, (char *) arg, sizeof(name)))
return -EFAULT;
return isdn_ppp_dial_slave(name);
case IIOCNETDLN:
if (!arg)
return -EINVAL;
if (copy_from_user(name, (char *) arg, sizeof(name)))
return -EFAULT;
return isdn_ppp_hangup_slave(name);
#endif
case IIOCNETHUP:
/* Force hangup of a network-interface */
if (!arg)
return -EINVAL;
if (copy_from_user(name, (char *) arg, sizeof(name)))
return -EFAULT;
return isdn_net_force_hangup(name);
break;
#endif /* CONFIG_NETDEVICES */
return isdn_net_ioctl(inode, file, cmd, arg);
case IIOCSETVER:
dev->net_verbose = arg;
printk(KERN_INFO "isdn: Verbose-Level is %d\n", dev->net_verbose);
......@@ -1577,12 +1429,8 @@ isdn_ctrl_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
} else
return -EINVAL;
}
#undef name
#undef bname
#undef iocts
#undef phone
#undef cfg
#undef bname
}
static struct file_operations isdn_ctrl_fops =
......@@ -2218,35 +2066,19 @@ isdn_slot_num(int sl)
}
void
isdn_slot_set_rx_netdev(int sl, isdn_net_dev *nd)
isdn_slot_set_idev(int sl, isdn_net_dev *idev)
{
BUG_ON(sl < 0);
slot[sl].rx_netdev = nd;
slot[sl].idev = idev;
}
isdn_net_dev *
isdn_slot_rx_netdev(int sl)
isdn_slot_idev(int sl)
{
BUG_ON(sl < 0);
return slot[sl].rx_netdev;
}
void
isdn_slot_set_st_netdev(int sl, isdn_net_dev *nd)
{
BUG_ON(sl < 0);
slot[sl].st_netdev = nd;
}
isdn_net_dev *
isdn_slot_st_netdev(int sl)
{
BUG_ON(sl < 0);
return slot[sl].st_netdev;
return slot[sl].idev;
}
int
......@@ -2430,7 +2262,7 @@ static int __init isdn_init(void)
printk("\n");
#endif
isdn_info_update();
isdn_net_init_module();
isdn_net_init();
return 0;
err_tty_modem:
......@@ -2456,8 +2288,7 @@ static void __exit isdn_exit(void)
#endif
save_flags(flags);
cli();
if (isdn_net_rmall() < 0)
BUG();
isdn_net_exit();
isdn_tty_exit();
if (unregister_chrdev(ISDN_MAJOR, "isdn"))
......
......@@ -22,11 +22,11 @@
#undef ISDN_DEBUG_MODEM_DUMP
#undef ISDN_DEBUG_MODEM_VOICE
#undef ISDN_DEBUG_AT
#undef ISDN_DEBUG_NET_DUMP
#undef ISDN_DEBUG_NET_DIAL
#undef ISDN_DEBUG_NET_ICALL
#undef ISDN_DEBUG_STATCALLB
#undef ISDN_DEBUG_COMMAND
#define ISDN_DEBUG_NET_DUMP
#define ISDN_DEBUG_NET_DIAL
#define ISDN_DEBUG_NET_ICALL
#define ISDN_DEBUG_STATCALLB
#define ISDN_DEBUG_COMMAND
#ifdef ISDN_DEBUG_NET_DIAL
#define dbg_net_dial(arg...) printk(KERN_DEBUG arg)
......@@ -52,6 +52,8 @@ do { printk(KERN_WARNING "ISDN Bug at %s:%d\n", __FILE__, __LINE__); \
#define HERE printk("%s:%d (%s)\n", __FILE__, __LINE__, __FUNCTION__)
extern struct list_head isdn_net_devs;
/* Prototypes */
extern void isdn_MOD_INC_USE_COUNT(void);
extern void isdn_MOD_DEC_USE_COUNT(void);
......@@ -82,8 +84,6 @@ struct dial_info {
unsigned char *phone;
};
extern struct list_head isdn_net_devs;
extern int isdn_get_free_slot(int, int, int, int, int, char *);
extern void isdn_slot_free(int slot, int usage);
extern void isdn_slot_all_eaz(int slot);
......@@ -100,8 +100,6 @@ extern void isdn_slot_set_usage(int slot, int usage);
extern char *isdn_slot_num(int slot);
extern int isdn_slot_m_idx(int slot);
extern void isdn_slot_set_m_idx(int slot, int midx);
extern void isdn_slot_set_rx_netdev(int sl, isdn_net_dev *nd);
extern void isdn_slot_set_st_netdev(int sl, isdn_net_dev *nd);
extern isdn_net_dev *isdn_slot_rx_netdev(int sl);
extern isdn_net_dev *isdn_slot_st_netdev(int sl);
extern void isdn_slot_set_idev(int sl, isdn_net_dev *);
extern isdn_net_dev *isdn_slot_idev(int sl);
extern int isdn_hard_header_len(void);
......@@ -39,7 +39,8 @@
*/
int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
static int
isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
{
struct net_device *ndev = concap -> net_dev;
isdn_net_dev *nd = ((isdn_net_local *) ndev->priv)->netdev;
......@@ -58,7 +59,8 @@ int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
}
int isdn_concap_dl_connect_req(struct concap_proto *concap)
static int
isdn_concap_dl_connect_req(struct concap_proto *concap)
{
struct net_device *ndev = concap -> net_dev;
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
......@@ -71,7 +73,8 @@ int isdn_concap_dl_connect_req(struct concap_proto *concap)
return ret;
}
int isdn_concap_dl_disconn_req(struct concap_proto *concap)
static int
isdn_concap_dl_disconn_req(struct concap_proto *concap)
{
IX25DEBUG( "isdn_concap_dl_disconn_req: %s \n", concap -> net_dev -> name);
......@@ -98,7 +101,8 @@ struct concap_device_ops isdn_concap_demand_dial_dops = {
this sourcefile does not need to include any protocol specific header
files. For now:
*/
struct concap_proto * isdn_concap_new( int encap )
struct concap_proto *
isdn_concap_new( int encap )
{
switch ( encap ) {
case ISDN_NET_ENCAP_X25IFACE:
......@@ -158,7 +162,7 @@ isdn_x25_disconnected(isdn_net_local *lp)
pops -> disconn_ind(cprot);
}
int
static int
isdn_x25_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
/* At this point hard_start_xmit() passes control to the encapsulation
......@@ -237,13 +241,8 @@ isdn_x25_cleanup(isdn_net_dev *p)
restore_flags(flags);
}
void isdn_x25_realrm(isdn_net_dev *p)
{
if( p -> cprot && p -> cprot -> pops )
p -> cprot -> pops -> proto_del ( p -> cprot );
}
struct isdn_netif_ops isdn_x25_ops = {
.hard_start_xmit = isdn_x25_start_xmit,
.flags = IFF_NOARP | IFF_POINTOPOINT,
.type = ARPHRD_X25,
.receive = isdn_x25_receive,
......
......@@ -12,18 +12,4 @@ extern struct concap_device_ops isdn_concap_demand_dial_dops;
struct concap_proto *isdn_concap_new(int);
#ifdef CONFIG_ISDN_X25
extern struct isdn_netif_ops isdn_x25_ops;
int isdn_x25_start_xmit(struct sk_buff *skb, struct net_device *dev);
#else
static inline int
isdn_x25_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
return 0;
}
#endif
/* $Id: fsm.c,v 1.14.6.4 2001/09/23 22:24:47 kai Exp $
*
* Finite state machine
*
* Author Karsten Keil
* Copyright by Karsten Keil <keil@isdn4linux.de>
* by Kai Germaschewski <kai.germaschewski@gmx.de>
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
* Thanks to Jan den Ouden
* Fritz Elfert
*
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/string.h>
#include "isdn_fsm.h"
int
fsm_new(struct fsm *fsm)
{
int i;
int size = sizeof(fsm_fn) * fsm->st_cnt * fsm->ev_cnt;
fsm->jumpmatrix = kmalloc(size, GFP_KERNEL);
if (!fsm->jumpmatrix)
return -ENOMEM;
memset(fsm->jumpmatrix, 0, size);
for (i = 0; i < fsm->fn_cnt; i++) {
if (fsm->fn_tbl[i].st >= fsm->st_cnt ||
fsm->fn_tbl[i].ev >= fsm->ev_cnt) {
printk(KERN_ERR "FsmNew Error line %d st(%d/%d) ev(%d/%d)\n", i,
fsm->fn_tbl[i].st, fsm->st_cnt,
fsm->fn_tbl[i].ev, fsm->ev_cnt);
continue;
}
fsm->jumpmatrix[fsm->st_cnt * fsm->fn_tbl[i].ev + fsm->fn_tbl[i].st] = fsm->fn_tbl[i].fn;
}
return 0;
}
void
fsm_free(struct fsm *fsm)
{
kfree(fsm->jumpmatrix);
}
int
fsm_event(struct fsm_inst *fi, int event, void *arg)
{
fsm_fn fn;
if (fi->state >= fi->fsm->st_cnt ||
event >= fi->fsm->ev_cnt) {
printk(KERN_ERR "FsmEvent Error st(%d/%d) ev(%d/%d)\n",
fi->state, fi->fsm->st_cnt,event,
fi->fsm->ev_cnt);
return -EINVAL;
}
fn = fi->fsm->jumpmatrix[fi->fsm->st_cnt * event + fi->state];
if (!fn) {
if (fi->debug)
fi->printdebug(fi, "State %s Event %s no routine",
fi->fsm->st_str[fi->state],
fi->fsm->ev_str[event]);
return -ESRCH;
}
if (fi->debug)
fi->printdebug(fi, "State %s Event %s",
fi->fsm->st_str[fi->state],
fi->fsm->ev_str[event]);
return fn(fi, event, arg);
}
void
fsm_change_state(struct fsm_inst *fi, int newstate)
{
fi->state = newstate;
if (fi->debug)
fi->printdebug(fi, "ChangeState %s",
fi->fsm->st_str[newstate]);
}
#if 0
static void
FsmExpireTimer(struct FsmTimer *ft)
{
#if FSM_TIMER_DEBUG
if (ft->fi->debug)
ft->fi->printdebug(ft->fi, "FsmExpireTimer %lx", (long) ft);
#endif
FsmEvent(ft->fi, ft->event, ft->arg);
}
void
FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft)
{
ft->fi = fi;
ft->tl.function = (void *) FsmExpireTimer;
ft->tl.data = (long) ft;
#if FSM_TIMER_DEBUG
if (ft->fi->debug)
ft->fi->printdebug(ft->fi, "FsmInitTimer %lx", (long) ft);
#endif
init_timer(&ft->tl);
}
void
FsmDelTimer(struct FsmTimer *ft, int where)
{
#if FSM_TIMER_DEBUG
if (ft->fi->debug)
ft->fi->printdebug(ft->fi, "FsmDelTimer %lx %d", (long) ft, where);
#endif
del_timer(&ft->tl);
}
int
FsmAddTimer(struct FsmTimer *ft,
int millisec, int event, void *arg, int where)
{
#if FSM_TIMER_DEBUG
if (ft->fi->debug)
ft->fi->printdebug(ft->fi, "FsmAddTimer %lx %d %d",
(long) ft, millisec, where);
#endif
if (timer_pending(&ft->tl)) {
printk(KERN_WARNING "FsmAddTimer: timer already active!\n");
ft->fi->printdebug(ft->fi, "FsmAddTimer already active!");
return -1;
}
init_timer(&ft->tl);
ft->event = event;
ft->arg = arg;
ft->tl.expires = jiffies + (millisec * HZ) / 1000;
add_timer(&ft->tl);
return 0;
}
void
FsmRestartTimer(struct FsmTimer *ft,
int millisec, int event, void *arg, int where)
{
#if FSM_TIMER_DEBUG
if (ft->fi->debug)
ft->fi->printdebug(ft->fi, "FsmRestartTimer %lx %d %d",
(long) ft, millisec, where);
#endif
if (timer_pending(&ft->tl))
del_timer(&ft->tl);
init_timer(&ft->tl);
ft->event = event;
ft->arg = arg;
ft->tl.expires = jiffies + (millisec * HZ) / 1000;
add_timer(&ft->tl);
}
#endif
/* $Id: fsm.h,v 1.3.2.2 2001/09/23 22:24:47 kai Exp $
*
* Finite state machine
*
* Author Karsten Keil
* Copyright by Karsten Keil <keil@isdn4linux.de>
* by Kai Germaschewski <kai.germaschewski@gmx.de>
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*/
#ifndef __ISDN_FSM_H__
#define __ISDN_FSM_H__
#include <linux/kernel.h>
#include <linux/timer.h>
struct fsm_inst;
typedef int (*fsm_fn)(struct fsm_inst *, int, void *);
struct fsm {
fsm_fn *jumpmatrix;
int st_cnt, ev_cnt, fn_cnt;
char **st_str, **ev_str;
struct fsm_node *fn_tbl;
};
struct fsm_inst {
struct fsm *fsm;
int state;
int debug;
void *userdata;
int userint;
void (*printdebug) (struct fsm_inst *, char *, ...);
};
struct fsm_node {
int st, ev;
fsm_fn fn;
};
struct fsm_timer {
struct fsm_inst *fi;
struct timer_list tl;
int ev;
void *arg;
};
int fsm_new(struct fsm *fsm);
void fsm_free(struct fsm *fsm);
int fsm_event(struct fsm_inst *fi, int event, void *arg);
void fsm_change_state(struct fsm_inst *fi, int newstate);
void fsm_init_timer(struct fsm_inst *fi, struct fsm_timer *ft);
int fsm_add_timer(struct fsm_timer *ft, int timeout, int event);
void fsm_mod_timer(struct fsm_timer *ft, int timeout, int event);
void fsm_del_timer(struct fsm_timer *ft);
#endif
This diff is collapsed.
......@@ -32,46 +32,49 @@
#define CISCO_SLARP_REPLY 1
#define CISCO_SLARP_KEEPALIVE 2
extern void isdn_net_init_module(void);
extern void isdn_net_init(void);
extern void isdn_net_exit(void);
extern void isdn_net_lib_init(void);
extern void isdn_net_lib_exit(void);
extern void isdn_net_hangup_all(void);
extern int isdn_net_ioctl(struct inode *, struct file *, uint, ulong);
extern int register_isdn_netif(int encap, struct isdn_netif_ops *ops);
extern int isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev);
extern int isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev);
extern int isdn_net_bind_channel(isdn_net_dev *idev, int slot);
extern void isdn_net_unbind_channel(isdn_net_dev *idev);
extern int isdn_net_dial(isdn_net_dev *idev);
extern void isdn_net_accept(isdn_net_dev *idev, int slot, char *nr);
extern int isdn_net_do_callback(isdn_net_dev *idev);
extern int isdn_net_bsent(isdn_net_dev *idev, isdn_ctrl *c);
extern int isdn_net_new(char *, struct net_device *);
extern int isdn_net_newslave(char *);
extern int isdn_net_rm(char *);
extern int isdn_net_rmall(void);
extern int isdn_net_stat_callback(int, isdn_ctrl *);
extern int isdn_net_setcfg(isdn_net_ioctl_cfg *);
extern int isdn_net_getcfg(isdn_net_ioctl_cfg *);
extern int isdn_net_addphone(isdn_net_ioctl_phone *);
extern int isdn_net_getphones(isdn_net_ioctl_phone *, char *);
extern int isdn_net_getpeer(isdn_net_ioctl_phone *, isdn_net_ioctl_phone *);
extern int isdn_net_delphone(isdn_net_ioctl_phone *);
extern int isdn_net_find_icall(int, int, int, setup_parm *);
extern void isdn_net_hangup(isdn_net_dev *);
extern void isdn_net_hangup_all(void);
extern int isdn_net_force_hangup(char *);
extern int isdn_net_force_dial(char *);
extern isdn_net_dev *isdn_net_findif(char *);
extern int isdn_net_hangup(isdn_net_dev *);
extern int isdn_net_rcv_skb(int, struct sk_buff *);
extern int isdn_net_dial_req(isdn_net_local *);
extern void isdn_net_writebuf_skb(isdn_net_local *lp, struct sk_buff *skb);
extern void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb);
extern int isdn_net_online(isdn_net_dev *idev);
extern int isdn_net_dial_req(isdn_net_dev *);
extern void isdn_net_writebuf_skb(isdn_net_dev *, struct sk_buff *skb);
extern void isdn_net_write_super(isdn_net_dev *, struct sk_buff *skb);
extern int isdn_net_online(isdn_net_dev *);
static inline void
isdn_net_reset_huptimer(isdn_net_dev *idev, isdn_net_dev *idev2)
{
idev->huptimer = 0;
idev2->huptimer = 0;
}
enum {
ST_CHARGE_NULL,
ST_CHARGE_GOT_CINF, /* got a first charge info */
ST_CHARGE_HAVE_CINT, /* got a second chare info and thus the timing */
};
#define ISDN_NET_MAX_QUEUE_LENGTH 2
/*
* is this particular channel busy?
*/
static __inline__ int isdn_net_lp_busy(isdn_net_local *lp)
static inline int
isdn_net_dev_busy(isdn_net_dev *idev)
{
if (atomic_read(&lp->frame_cnt) < ISDN_NET_MAX_QUEUE_LENGTH)
if (atomic_read(&idev->frame_cnt) < ISDN_NET_MAX_QUEUE_LENGTH)
return 0;
else
return 1;
......@@ -81,86 +84,69 @@ static __inline__ int isdn_net_lp_busy(isdn_net_local *lp)
* For the given net device, this will get a non-busy channel out of the
* corresponding bundle. The returned channel is locked.
*/
static __inline__ isdn_net_local * isdn_net_get_locked_lp(isdn_net_dev *nd)
static inline isdn_net_dev *
isdn_net_get_locked_dev(isdn_net_local *mlp)
{
unsigned long flags;
isdn_net_local *lp;
spin_lock_irqsave(&nd->queue_lock, flags);
lp = nd->queue; /* get lp on top of queue */
spin_lock_bh(&nd->queue->xmit_lock);
while (isdn_net_lp_busy(nd->queue)) {
spin_unlock_bh(&nd->queue->xmit_lock);
nd->queue = nd->queue->next;
if (nd->queue == lp) { /* not found -- should never happen */
lp = NULL;
goto errout;
isdn_net_dev *idev;
spin_lock_irqsave(&mlp->online_lock, flags);
list_for_each_entry(idev, &mlp->online, online) {
spin_lock_bh(&idev->xmit_lock);
if (!isdn_net_dev_busy(idev)) {
/* point the head to next online channel */
list_del(&mlp->online);
list_add(&mlp->online, &idev->online);
goto found;
}
spin_lock_bh(&nd->queue->xmit_lock);
spin_unlock_bh(&idev->xmit_lock);
}
lp = nd->queue;
nd->queue = nd->queue->next;
errout:
spin_unlock_irqrestore(&nd->queue_lock, flags);
return lp;
idev = NULL;
found:
spin_unlock_irqrestore(&mlp->online_lock, flags);
return idev;
}
/*
* add a channel to a bundle
*/
static __inline__ void isdn_net_add_to_bundle(isdn_net_dev *nd, isdn_net_local *nlp)
static inline void
isdn_net_add_to_bundle(isdn_net_local *mlp, isdn_net_dev *idev)
{
isdn_net_local *lp;
unsigned long flags;
spin_lock_irqsave(&nd->queue_lock, flags);
lp = nd->queue;
nlp->last = lp->last;
lp->last->next = nlp;
lp->last = nlp;
nlp->next = lp;
nd->queue = nlp;
spin_unlock_irqrestore(&nd->queue_lock, flags);
spin_lock_irqsave(&mlp->online_lock, flags);
list_add(&idev->online, &mlp->online);
spin_unlock_irqrestore(&mlp->online_lock, flags);
}
/*
* remove a channel from the bundle it belongs to
*/
static __inline__ void isdn_net_rm_from_bundle(isdn_net_local *lp)
static inline void
isdn_net_rm_from_bundle(isdn_net_dev *idev)
{
isdn_net_local *master_lp = lp;
isdn_net_local *mlp = idev->mlp;
unsigned long flags;
if (lp->master)
master_lp = (isdn_net_local *) lp->master->priv;
spin_lock_irqsave(&master_lp->netdev->queue_lock, flags);
lp->last->next = lp->next;
lp->next->last = lp->last;
if (master_lp->netdev->queue == lp) {
master_lp->netdev->queue = lp->next;
if (lp->next == lp) { /* last in queue */
master_lp->netdev->queue = &master_lp->netdev->local;
}
}
lp->next = lp->last = lp; /* (re)set own pointers */
spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags);
spin_lock_irqsave(&mlp->online_lock, flags);
// list_del(&idev->online); FIXME
spin_unlock_irqrestore(&mlp->online_lock, flags);
}
/*
* wake up the network -> net_device queue.
* For slaves, wake the corresponding master interface.
*/
static inline void isdn_net_device_wake_queue(isdn_net_local *lp)
static inline void
isdn_net_dev_wake_queue(isdn_net_dev *idev)
{
if (lp->master)
netif_wake_queue(lp->master);
else
netif_wake_queue(&lp->netdev->dev);
netif_wake_queue(&idev->mlp->dev);
}
static inline int isdn_net_bound(isdn_net_dev *idev)
static inline int
isdn_net_bound(isdn_net_dev *idev)
{
return idev->isdn_slot >= 0;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -20,20 +20,6 @@ extern void isdn_ppp_cleanup(void);
extern int isdn_ppp_dial_slave(char *);
extern int isdn_ppp_hangup_slave(char *);
#ifdef CONFIG_ISDN_PPP
int isdn_ppp_xmit(struct sk_buff *, struct net_device *);
#else
static inline int
isdn_ppp_xmit(struct sk_buff *, struct net_device *)
{
return 0;
}
#endif
#define IPPP_OPEN 0x01
#define IPPP_CONNECT 0x02
#define IPPP_CLOSEWAIT 0x04
......
......@@ -31,13 +31,12 @@ struct pci_page { /* cacheable header for 'allocation' bytes */
#define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000)
#define POOL_POISON_BYTE 0xa7
static spinlock_t pools_lock = SPIN_LOCK_UNLOCKED;
DECLARE_MUTEX (pools_lock);
static ssize_t
show_pools (struct device *dev, char *buf, size_t count, loff_t off)
{
struct pci_dev *pdev;
unsigned long flags;
unsigned temp, size;
char *next;
struct list_head *i, *j;
......@@ -53,7 +52,7 @@ show_pools (struct device *dev, char *buf, size_t count, loff_t off)
size -= temp;
next += temp;
spin_lock_irqsave (&pools_lock, flags);
down (&pools_lock);
list_for_each (i, &pdev->pools) {
struct pci_pool *pool;
unsigned pages = 0, blocks = 0;
......@@ -76,7 +75,7 @@ show_pools (struct device *dev, char *buf, size_t count, loff_t off)
size -= temp;
next += temp;
}
spin_unlock_irqrestore (&pools_lock, flags);
up (&pools_lock);
return count - size;
}
......@@ -89,7 +88,7 @@ static DEVICE_ATTR (pools, S_IRUGO, show_pools, NULL);
* @size: size of the blocks in this pool.
* @align: alignment requirement for blocks; must be a power of two
* @allocation: returned blocks won't cross this boundary (or zero)
* @mem_flags: SLAB_* flags.
* Context: !in_interrupt()
*
* Returns a pci allocation pool with the requested characteristics, or
* null if one can't be created. Given one of these pools, pci_pool_alloc()
......@@ -105,10 +104,9 @@ static DEVICE_ATTR (pools, S_IRUGO, show_pools, NULL);
*/
struct pci_pool *
pci_pool_create (const char *name, struct pci_dev *pdev,
size_t size, size_t align, size_t allocation, int mem_flags)
size_t size, size_t align, size_t allocation)
{
struct pci_pool *retval;
unsigned long flags;
if (align == 0)
align = 1;
......@@ -130,7 +128,7 @@ pci_pool_create (const char *name, struct pci_dev *pdev,
} else if (allocation < size)
return 0;
if (!(retval = kmalloc (sizeof *retval, mem_flags)))
if (!(retval = kmalloc (sizeof *retval, SLAB_KERNEL)))
return retval;
strncpy (retval->name, name, sizeof retval->name);
......@@ -138,18 +136,6 @@ pci_pool_create (const char *name, struct pci_dev *pdev,
retval->dev = pdev;
if (pdev) {
int do_add;
spin_lock_irqsave (&pools_lock, flags);
do_add = list_empty (&pdev->pools);
/* note: not currently insisting "name" be unique */
list_add (&retval->pools, &pdev->pools);
spin_unlock_irqrestore (&pools_lock, flags);
if (do_add)
device_create_file (&pdev->dev, &dev_attr_pools);
} else
INIT_LIST_HEAD (&retval->pools);
INIT_LIST_HEAD (&retval->page_list);
spin_lock_init (&retval->lock);
retval->size = size;
......@@ -157,6 +143,16 @@ pci_pool_create (const char *name, struct pci_dev *pdev,
retval->blocks_per_page = allocation / size;
init_waitqueue_head (&retval->waitq);
if (pdev) {
down (&pools_lock);
if (list_empty (&pdev->pools))
device_create_file (&pdev->dev, &dev_attr_pools);
/* note: not currently insisting "name" be unique */
list_add (&retval->pools, &pdev->pools);
up (&pools_lock);
} else
INIT_LIST_HEAD (&retval->pools);
return retval;
}
......@@ -220,6 +216,7 @@ pool_free_page (struct pci_pool *pool, struct pci_page *page)
/**
* pci_pool_destroy - destroys a pool of pci memory blocks.
* @pool: pci pool that will be destroyed
* Context: !in_interrupt()
*
* Caller guarantees that no more memory from the pool is in use,
* and that nothing will try to use the pool after this call.
......@@ -227,9 +224,12 @@ pool_free_page (struct pci_pool *pool, struct pci_page *page)
void
pci_pool_destroy (struct pci_pool *pool)
{
unsigned long flags;
down (&pools_lock);
list_del (&pool->pools);
if (pool->dev && list_empty (&pool->dev->pools))
device_remove_file (&pool->dev->dev, &dev_attr_pools);
up (&pools_lock);
spin_lock_irqsave (&pool->lock, flags);
while (!list_empty (&pool->page_list)) {
struct pci_page *page;
page = list_entry (pool->page_list.next,
......@@ -245,13 +245,6 @@ pci_pool_destroy (struct pci_pool *pool)
pool_free_page (pool, page);
}
spin_lock (&pools_lock);
list_del (&pool->pools);
if (pool->dev && list_empty (&pool->dev->pools))
device_remove_file (&pool->dev->dev, &dev_attr_pools);
spin_unlock (&pools_lock);
spin_unlock_irqrestore (&pool->lock, flags);
kfree (pool);
}
......@@ -296,7 +289,7 @@ pci_pool_alloc (struct pci_pool *pool, int mem_flags, dma_addr_t *handle)
}
}
}
if (!(page = pool_alloc_page (pool, mem_flags))) {
if (!(page = pool_alloc_page (pool, SLAB_ATOMIC))) {
if (mem_flags == SLAB_KERNEL) {
DECLARE_WAITQUEUE (wait, current);
......
......@@ -236,7 +236,7 @@ dasd_alloc_device(dasd_devmap_t *devmap)
}
/* Allocate gendisk structure for device. */
gdp = dasd_gendisk_alloc(device->name, devmap->devindex);
gdp = dasd_gendisk_alloc(devmap->devindex);
if (IS_ERR(gdp)) {
free_page((unsigned long) device->erp_mem);
free_pages((unsigned long) device->ccw_mem, 1);
......@@ -294,10 +294,6 @@ dasd_state_new_to_known(dasd_device_t *device)
return -ENODEV;
minor = devmap->devindex % DASD_PER_MAJOR;
/* Set bdev and the device name. */
device->bdev = bdget(MKDEV(major, minor << DASD_PARTN_BITS));
strcpy(device->name, device->gdp->disk_name);
/* Find a discipline for the device. */
rc = dasd_find_disc(device);
if (rc)
......@@ -341,8 +337,8 @@ dasd_state_known_to_new(dasd_device_t * device)
device->state = DASD_STATE_NEW;
/* Forget the block device */
bdev = device->bdev;
device->bdev = NULL;
bdev = bdget(MKDEV(device->gdp->major, device->gdp->first_minor));
bdput(bdev);
bdput(bdev);
}
......@@ -355,7 +351,7 @@ dasd_state_known_to_basic(dasd_device_t * device)
int rc;
/* register 'device' debug area, used for all DBF_DEV_XXX calls */
device->debug_area = debug_register(device->name, 0, 2,
device->debug_area = debug_register(device->gdp->disk_name, 0, 2,
8 * sizeof (long));
debug_register_view(device->debug_area, &debug_sprintf_view);
debug_set_level(device->debug_area, DBF_ERR);
......@@ -436,7 +432,7 @@ dasd_state_accept_to_basic(dasd_device_t * device)
static inline kdev_t
dasd_partition_to_kdev_t(dasd_device_t *device, unsigned int partition)
{
return to_kdev_t(device->bdev->bd_dev+partition);
return mk_kdev(device->gdp->major, device->gdp->first_minor+partition);
}
......@@ -453,6 +449,7 @@ dasd_state_accept_to_ready(dasd_device_t * device)
if (devmap->features & DASD_FEATURE_READONLY) {
for (i = 0; i < (1 << DASD_PARTN_BITS); i++)
set_device_ro(dasd_partition_to_kdev_t(device, i), 1);
device->ro_flag = 1;
DEV_MESSAGE (KERN_WARNING, device, "%s",
"setting read-only mode ");
}
......@@ -1582,17 +1579,12 @@ dasd_end_request_cb(dasd_ccw_req_t * cqr, void *data)
static inline void
__dasd_process_blk_queue(dasd_device_t * device)
{
struct block_device *bdev;
request_queue_t *queue;
struct list_head *l;
struct request *req;
dasd_ccw_req_t *cqr;
int nr_queued;
/* No bdev, no queue. */
bdev = device->bdev;
if (!bdev)
return;
queue = device->request_queue;
/* No queue ? Then there is nothing to do. */
if (queue == NULL)
......@@ -1619,7 +1611,7 @@ __dasd_process_blk_queue(dasd_device_t * device)
!blk_queue_empty(queue) &&
nr_queued < DASD_CHANQ_MAX_SIZE) {
req = elv_next_request(queue);
if (bdev_read_only(bdev) && rq_data_dir(req) == WRITE) {
if (device->ro_flag && rq_data_dir(req) == WRITE) {
DBF_EVENT(DBF_ERR,
"(%04x) Rejecting write request %p",
device->devinfo.devno, req);
......
......@@ -162,7 +162,7 @@ dasd_device_name(char *str, int index, int partition)
* Allocate gendisk structure for devindex.
*/
struct gendisk *
dasd_gendisk_alloc(char *device_name, int devindex)
dasd_gendisk_alloc(int devindex)
{
struct list_head *l;
struct major_info *mi;
......@@ -195,7 +195,7 @@ dasd_gendisk_alloc(char *device_name, int devindex)
return ERR_PTR(-ENOMEM);
/* Initialize gendisk structure. */
memcpy(gdp->disk_name, device_name, 16); /* huh? -- AV */
memset(gdp, 0, sizeof(struct gendisk));
gdp->major = mi->major;
gdp->first_minor = index << DASD_PARTN_BITS;
gdp->minor_shift = DASD_PARTN_BITS;
......@@ -207,15 +207,16 @@ dasd_gendisk_alloc(char *device_name, int devindex)
* dasdaa - dasdzz : 676 devices, added up = 702
* dasdaaa - dasdzzz : 17576 devices, added up = 18278
*/
len = sprintf(device_name, "dasd");
len = sprintf(gdp->disk_name, "dasd");
if (devindex > 25) {
if (devindex > 701)
len += sprintf(device_name + len, "%c",
len += sprintf(gdp->disk_name + len, "%c",
'a' + (((devindex - 702) / 676) % 26));
len += sprintf(device_name + len, "%c",
len += sprintf(gdp->disk_name + len, "%c",
'a' + (((devindex - 26) / 26) % 26));
}
len += sprintf(device_name + len, "%c", 'a' + (devindex % 26));
len += sprintf(gdp->disk_name + len, "%c", 'a' + (devindex % 26));
return gdp;
}
......
......@@ -140,7 +140,7 @@ do { \
#define DEV_MESSAGE(d_loglevel,d_device,d_string,d_args...)\
do { \
printk(d_loglevel PRINTK_HEADER " %s,%04x@%02x: " \
d_string "\n", bdevname(d_device->bdev), \
d_string "\n", d_device->gdp->disk_name, \
d_device->devinfo.devno, d_device->devinfo.irq, \
d_args); \
DBF_DEV_EVENT(DBF_ALERT, d_device, d_string, d_args); \
......@@ -258,8 +258,6 @@ typedef struct dasd_discipline_t {
typedef struct dasd_device_t {
/* Block device stuff. */
char name[16]; /* The device name in /dev. */
struct block_device *bdev;
struct gendisk *gdp;
devfs_handle_t devfs_entry;
request_queue_t *request_queue;
......@@ -267,6 +265,7 @@ typedef struct dasd_device_t {
unsigned long blocks; /* size of volume in blocks */
unsigned int bp_block; /* bytes per block */
unsigned int s2b_shift; /* log2 (bp_block/512) */
int ro_flag; /* read-only flag */
/* Device discipline stuff. */
dasd_discipline_t *discipline;
......@@ -479,7 +478,7 @@ int dasd_gendisk_init(void);
void dasd_gendisk_exit(void);
int dasd_gendisk_major_index(int);
int dasd_gendisk_index_major(int);
struct gendisk *dasd_gendisk_alloc(char *, int);
struct gendisk *dasd_gendisk_alloc(int);
void dasd_setup_partitions(dasd_device_t *);
void dasd_destroy_partitions(dasd_device_t *);
......
......@@ -464,6 +464,7 @@ dasd_ioctl_set_ro(struct block_device *bdev, int no, long args)
devmap->features &= ~DASD_FEATURE_READONLY;
for (i = 0; i < (1 << DASD_PARTN_BITS); i++)
set_device_ro(to_kdev_t(bdev->bd_dev + i), intval);
device->ro_flag = intval;
dasd_put_device(devmap);
return 0;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2149,14 +2149,14 @@ static int __devinit uhci_start(struct usb_hcd *hcd)
uhci->fl->dma_handle = dma_handle;
uhci->td_pool = pci_pool_create("uhci_td", hcd->pdev,
sizeof(struct uhci_td), 16, 0, GFP_ATOMIC);
sizeof(struct uhci_td), 16, 0);
if (!uhci->td_pool) {
err("unable to create td pci_pool");
goto err_create_td_pool;
}
uhci->qh_pool = pci_pool_create("uhci_qh", hcd->pdev,
sizeof(struct uhci_qh), 16, 0, GFP_ATOMIC);
sizeof(struct uhci_qh), 16, 0);
if (!uhci->qh_pool) {
err("unable to create qh pci_pool");
goto err_create_qh_pool;
......
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.
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.
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.
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.
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.
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