Commit 142543df authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/linux-2.5_work
parents 4cedf231 c2480c85
......@@ -566,7 +566,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
struct_cpy(childregs, regs);
childregs->eax = 0;
childregs->esp = esp;
p->user_vm_lock = NULL;
p->user_tid = NULL;
p->thread.esp = (unsigned long) childregs;
p->thread.esp0 = (unsigned long) (childregs+1);
......@@ -591,7 +591,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
/*
* The common fastpath:
*/
if (!(clone_flags & (CLONE_SETTLS | CLONE_SETTID | CLONE_RELEASE_VM)))
if (!(clone_flags & (CLONE_SETTLS | CLONE_SETTID | CLONE_CLEARTID)))
return 0;
/*
* Set a new TLS for the child thread?
......@@ -623,10 +623,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
return -EFAULT;
/*
* Does the userspace VM want any unlock on mm_release()?
* Does the userspace VM want the TID cleared on mm_release()?
*/
if (clone_flags & CLONE_RELEASE_VM)
p->user_vm_lock = (long *) childregs->edi;
if (clone_flags & CLONE_CLEARTID)
p->user_tid = (long *) childregs->edx;
return 0;
}
......
......@@ -22,8 +22,9 @@ if [ "$CONFIG_NET" != "n" ]; then
tristate 'CAPI2.0 support' CONFIG_ISDN_CAPI
if [ "$CONFIG_ISDN_CAPI" != "n" ]; then
source drivers/isdn/capi/Config.in
source drivers/isdn/hardware/Config.in
fi
source drivers/isdn/hardware/Config.in
fi
fi
endmenu
......
......@@ -957,14 +957,14 @@ capi_release(struct inode *inode, struct file *file)
static struct file_operations capi_fops =
{
owner: THIS_MODULE,
llseek: no_llseek,
read: capi_read,
write: capi_write,
poll: capi_poll,
ioctl: capi_ioctl,
open: capi_open,
release: capi_release,
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = capi_read,
.write = capi_write,
.poll = capi_poll,
.ioctl = capi_ioctl,
.open = capi_open,
.release = capi_release,
};
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
......
......@@ -72,16 +72,16 @@ static int capifs_revalidate(struct dentry *, int);
static struct inode *capifs_new_inode(struct super_block *sb);
static struct file_operations capifs_root_operations = {
read: generic_read_dir,
readdir: capifs_root_readdir,
.read = generic_read_dir,
.readdir = capifs_root_readdir,
};
struct inode_operations capifs_root_inode_operations = {
lookup: capifs_root_lookup,
.lookup = capifs_root_lookup,
};
static struct dentry_operations capifs_dentry_operations = {
d_revalidate: capifs_revalidate,
.d_revalidate = capifs_revalidate,
};
/*
......@@ -222,8 +222,8 @@ static void capifs_put_super(struct super_block *sb)
}
static struct super_operations capifs_sops = {
put_super: capifs_put_super,
statfs: simple_statfs,
.put_super = capifs_put_super,
.statfs = simple_statfs,
};
static int capifs_parse_options(char *options, struct capifs_sb_info *sbi)
......@@ -371,10 +371,10 @@ static struct super_block *capifs_get_sb(struct file_system_type *fs_type,
}
static struct file_system_type capifs_fs_type = {
owner: THIS_MODULE,
name: "capifs",
get_sb: capifs_get_sb,
kill_sb: kill_anon_super,
.owner = THIS_MODULE,
.name = "capifs",
.get_sb = capifs_get_sb,
.kill_sb = kill_anon_super,
};
void capifs_new_ncci(char type, unsigned int num, kdev_t device)
......
......@@ -4,7 +4,7 @@
#include <linux/isdn/capilli.h>
#define DBG(format, arg...) do { \
printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg); \
printk(KERN_DEBUG "%s: " format "\n" , __FUNCTION__ , ## arg); \
} while (0)
struct capilib_msgidqueue {
......
......@@ -16,7 +16,7 @@
#include <linux/isdn/capilli.h>
#define DBG(format, arg...) do { \
printk(KERN_INFO __FUNCTION__ ": " format "\n" , ## arg); \
printk(KERN_DEBUG "%s: " format "\n" , __FUNCTION__ , ## arg); \
} while (0)
......
......@@ -90,17 +90,17 @@ static int contrstats_show(struct seq_file *seq, void *v)
}
struct seq_operations seq_controller_ops = {
start: controller_start,
next: controller_next,
stop: controller_stop,
show: controller_show,
.start = controller_start,
.next = controller_next,
.stop = controller_stop,
.show = controller_show,
};
struct seq_operations seq_contrstats_ops = {
start: controller_start,
next: controller_next,
stop: controller_stop,
show: contrstats_show,
.start = controller_start,
.next = controller_next,
.stop = controller_stop,
.show = contrstats_show,
};
static int seq_controller_open(struct inode *inode, struct file *file)
......@@ -114,17 +114,17 @@ static int seq_contrstats_open(struct inode *inode, struct file *file)
}
static struct file_operations proc_controller_ops = {
open: seq_controller_open,
read: seq_read,
llseek: seq_lseek,
release: seq_release,
.open = seq_controller_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
static struct file_operations proc_contrstats_ops = {
open: seq_contrstats_open,
read: seq_read,
llseek: seq_lseek,
release: seq_release,
.open = seq_contrstats_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
// /proc/capi/applications:
......@@ -193,17 +193,17 @@ applstats_show(struct seq_file *seq, void *v)
}
struct seq_operations seq_applications_ops = {
start: applications_start,
next: applications_next,
stop: applications_stop,
show: applications_show,
.start = applications_start,
.next = applications_next,
.stop = applications_stop,
.show = applications_show,
};
struct seq_operations seq_applstats_ops = {
start: applications_start,
next: applications_next,
stop: applications_stop,
show: applstats_show,
.start = applications_start,
.next = applications_next,
.stop = applications_stop,
.show = applstats_show,
};
static int
......@@ -219,17 +219,17 @@ seq_applstats_open(struct inode *inode, struct file *file)
}
static struct file_operations proc_applications_ops = {
open: seq_applications_open,
read: seq_read,
llseek: seq_lseek,
release: seq_release,
.open = seq_applications_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
static struct file_operations proc_applstats_ops = {
open: seq_applstats_open,
read: seq_read,
llseek: seq_lseek,
release: seq_release,
.open = seq_applstats_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
static void
......
......@@ -261,14 +261,14 @@ isdn_divert_ioctl(struct inode *inode, struct file *file,
#ifdef CONFIG_PROC_FS
static struct file_operations isdn_fops =
{
owner: THIS_MODULE,
llseek: no_llseek,
read: isdn_divert_read,
write: isdn_divert_write,
poll: isdn_divert_poll,
ioctl: isdn_divert_ioctl,
open: isdn_divert_open,
release: isdn_divert_close,
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = isdn_divert_read,
.write = isdn_divert_write,
.poll = isdn_divert_poll,
.ioctl = isdn_divert_ioctl,
.open = isdn_divert_open,
.release = isdn_divert_close,
};
/****************************/
......
......@@ -2,4 +2,26 @@
# ISDN hardware drivers
#
source drivers/isdn/hardware/avm/Config.in
if [ "$CONFIG_ISDN_CAPI" != "n" ]; then
comment 'CAPI hardware drivers'
source drivers/isdn/hardware/avm/Config.in
fi
if [ "$CONFIG_ISDN" != "n" ]; then
comment 'ISDN4Linux hardware drivers'
source drivers/isdn/hisax/Config.in
mainmenu_option next_comment
comment 'Active cards'
source drivers/isdn/icn/Config.in
source drivers/isdn/pcbit/Config.in
source drivers/isdn/sc/Config.in
source drivers/isdn/act2000/Config.in
source drivers/isdn/eicon/Config.in
source drivers/isdn/tpam/Config.in
source drivers/isdn/hysdn/Config.in
endmenu
fi
......@@ -3,7 +3,7 @@
#
mainmenu_option next_comment
comment 'Drivers for active AVM cards'
comment 'Active AVM cards'
bool 'Support AVM cards' CONFIG_CAPI_AVM
......
......@@ -352,10 +352,10 @@ static void __devexit b1pci_pci_remove(struct pci_dev *pdev)
}
static struct pci_driver b1pci_pci_driver = {
name: "b1pci",
id_table: b1pci_pci_tbl,
probe: b1pci_pci_probe,
remove: __devexit_p(b1pci_pci_remove),
.name = "b1pci",
.id_table = b1pci_pci_tbl,
.probe = b1pci_pci_probe,
.remove = __devexit_p(b1pci_pci_remove),
};
static int __init b1pci_init(void)
......
......@@ -1232,10 +1232,10 @@ static int __devinit c4_probe(struct pci_dev *dev,
}
static struct pci_driver c4_pci_driver = {
name: "c4",
id_table: c4_pci_tbl,
probe: c4_probe,
remove: c4_remove,
.name = "c4",
.id_table = c4_pci_tbl,
.probe = c4_probe,
.remove = c4_remove,
};
static int __init c4_init(void)
......
......@@ -215,10 +215,10 @@ static int __devinit t1pci_probe(struct pci_dev *dev,
}
static struct pci_driver t1pci_pci_driver = {
name: "t1pci",
id_table: t1pci_pci_tbl,
probe: t1pci_probe,
remove: t1pci_remove,
.name = "t1pci",
.id_table = t1pci_pci_tbl,
.probe = t1pci_probe,
.remove = t1pci_remove,
};
static int __init t1pci_init(void)
......
mainmenu_option next_comment
comment 'Passive ISDN cards'
comment 'Passive cards'
dep_tristate 'HiSax SiemensChipSet driver support' CONFIG_ISDN_DRV_HISAX $CONFIG_ISDN
if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then
comment ' D-channel protocol features'
......
......@@ -1919,6 +1919,8 @@ static void hisax_b_l1l2(struct hisax_if *ifc, int pr, void *arg)
break;
case PH_DEACTIVATE | INDICATION:
L1L2(st, pr, NULL);
clear_bit(BC_FLG_BUSY, &bcs->Flag);
skb_queue_purge(&bcs->squeue);
bcs->hw.b_if = NULL;
break;
case PH_DATA | INDICATION:
......@@ -2006,6 +2008,9 @@ static void hisax_b_l2l1(struct PStack *st, int pr, void *arg)
else
set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
break;
case PH_DEACTIVATE | REQUEST:
test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
skb_queue_purge(&bcs->squeue);
default:
B_L2L1(b_if, pr, arg);
break;
......
......@@ -28,7 +28,7 @@
#define DBG(level, format, arg...) do { \
if (level & __debug_variable) \
printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg); \
printk(KERN_DEBUG "%s: " format "\n" , __FUNCTION__ , ## arg); \
} while (0)
#define DBG_PACKET(level,data,count) \
......
......@@ -944,17 +944,17 @@ static void __devexit fcpnp_remove(struct pci_dev *pdev)
}
static struct pci_driver fcpci_driver = {
name: "fcpci",
probe: fcpci_probe,
remove: __devexit_p(fcpci_remove),
id_table: fcpci_ids,
.name = "fcpci",
.probe = fcpci_probe,
.remove = __devexit_p(fcpci_remove),
.id_table = fcpci_ids,
};
static struct isapnp_driver fcpnp_driver = {
name: "fcpnp",
probe: fcpnp_probe,
remove: __devexit_p(fcpnp_remove),
id_table: fcpnp_ids,
.name = "fcpnp",
.probe = fcpnp_probe,
.remove = __devexit_p(fcpnp_remove),
.id_table = fcpnp_ids,
};
static int __init hisax_fcpcipnp_init(void)
......
......@@ -40,12 +40,12 @@ MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>/Werner Cornelius <we
MODULE_DESCRIPTION("HFC PCI ISDN driver");
#define ID(ven, dev, name) \
{ vendor: PCI_VENDOR_ID_##ven, \
device: PCI_DEVICE_ID_##dev, \
subvendor: PCI_ANY_ID, \
subdevice: PCI_ANY_ID, \
class: 0, \
class_mask: 0, \
{ .vendor = PCI_VENDOR_ID_##ven, \
.device = PCI_DEVICE_ID_##dev, \
.subvendor = PCI_ANY_ID, \
.subdevice = PCI_ANY_ID, \
.class = 0, \
.class_mask = 0, \
driver_data: (unsigned long) name }
static struct pci_device_id hfcpci_ids[] __devinitdata = {
......@@ -1604,10 +1604,10 @@ static void __devexit hfcpci_remove(struct pci_dev *pdev)
}
static struct pci_driver hfcpci_driver = {
name: "hfcpci",
probe: hfcpci_probe,
remove: hfcpci_remove,
id_table: hfcpci_ids,
.name = "hfcpci",
.probe = hfcpci_probe,
.remove = hfcpci_remove,
.id_table = hfcpci_ids,
};
static int __init hisax_hfcpci_init(void)
......
......@@ -66,9 +66,6 @@ ph_command(struct IsdnCardState *cs, unsigned int command)
if (cs->debug &L1_DEB_ISAC)
debugl1(cs, "ph_command (%#x) in (%#x)", command,
cs->dc.isac.ph_state);
//###################################
// printk(KERN_INFO "ph_command (%#x)\n", command);
//###################################
cs->writeisac(cs, IPACX_CIX0, (command << 4) | 0x0E);
}
......@@ -82,9 +79,6 @@ cic_int(struct IsdnCardState *cs)
event = cs->readisac(cs, IPACX_CIR0) >> 4;
if (cs->debug &L1_DEB_ISAC) debugl1(cs, "cic_int(event=%#x)", event);
//#########################################
// printk(KERN_INFO "cic_int(%x)\n", event);
//#########################################
cs->dc.isac.ph_state = event;
dch_sched_event(cs, D_L1STATECHANGE);
}
......@@ -417,9 +411,6 @@ dch_int(struct IsdnCardState *cs)
int count;
istad = cs->readisac(cs, IPACX_ISTAD);
//##############################################
// printk(KERN_WARNING "dch_int(istad=%02x)\n", istad);
//##############################################
if (istad &0x80) { // RME
rstad = cs->readisac(cs, IPACX_RSTAD);
......@@ -714,9 +705,6 @@ bch_int(struct IsdnCardState *cs, u_char hscx)
bcs = cs->bcs + hscx;
istab = cs->BC_Read_Reg(cs, hscx, IPACX_ISTAB);
//##############################################
// printk(KERN_WARNING "bch_int(istab=%02x)\n", istab);
//##############################################
if (!test_bit(BC_FLG_INIT, &bcs->Flag)) return;
if (istab &0x80) { // RME
......@@ -963,12 +951,8 @@ interrupt_ipacx(struct IsdnCardState *cs)
u_char ista;
while ((ista = cs->readisac(cs, IPACX_ISTA))) {
//#################################################
// printk(KERN_WARNING "interrupt_ipacx(ista=%02x)\n", ista);
//#################################################
if (ista &0x80) bch_int(cs, 0); // B channel interrupts
if (ista &0x40) bch_int(cs, 1);
if (ista &0x01) dch_int(cs); // D channel
if (ista &0x10) cic_int(cs); // Layer 1 state
}
......@@ -1003,9 +987,6 @@ void __init
init_ipacx(struct IsdnCardState *cs, int part)
{
if (part &1) { // initialise chip
//##################################################
// printk(KERN_INFO "init_ipacx(%x)\n", part);
//##################################################
clear_pending_ints(cs);
bch_init(cs, 0);
bch_init(cs, 1);
......
......@@ -219,13 +219,13 @@ enum {
#define L1_EVENT_COUNT (EV_TIMER3 + 1)
#define ERR(format, arg...) \
printk(KERN_ERR __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
printk(KERN_ERR __FILE__ ": %s: " format "\n" , __FUNCTION__ , ## arg)
#define WARN(format, arg...) \
printk(KERN_WARNING __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
printk(KERN_WARNING __FILE__ ": %s: " format "\n" , __FUNCTION__ , ## arg)
#define INFO(format, arg...) \
printk(KERN_INFO __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
printk(KERN_INFO __FILE__ ": %s: " format "\n" , __FUNCTION__ , ## arg)
#include "st5481_hdlc.h"
#include "fsm.h"
......
......@@ -176,10 +176,10 @@ static struct usb_device_id st5481_ids[] = {
MODULE_DEVICE_TABLE (usb, st5481_ids);
static struct usb_driver st5481_usb_driver = {
name: "st5481_usb",
probe: probe_st5481,
disconnect: __devexit_p(disconnect_st5481),
id_table: st5481_ids,
.name = "st5481_usb",
.probe = probe_st5481,
.disconnect = __devexit_p(disconnect_st5481),
.id_table = st5481_ids,
};
static int __init st5481_usb_init(void)
......
......@@ -377,11 +377,11 @@ hysdn_conf_close(struct inode *ino, struct file *filep)
/******************************************************/
static struct file_operations conf_fops =
{
llseek: no_llseek,
read: hysdn_conf_read,
write: hysdn_conf_write,
open: hysdn_conf_open,
release: hysdn_conf_close,
.llseek = no_llseek,
.read = hysdn_conf_read,
.write = hysdn_conf_write,
.open = hysdn_conf_open,
.release = hysdn_conf_close,
};
/*****************************/
......
......@@ -389,12 +389,12 @@ hysdn_log_poll(struct file *file, poll_table * wait)
/**************************************************/
static struct file_operations log_fops =
{
llseek: no_llseek,
read: hysdn_log_read,
write: hysdn_log_write,
poll: hysdn_log_poll,
open: hysdn_log_open,
release: hysdn_log_close,
.llseek = no_llseek,
.read = hysdn_log_read,
.write = hysdn_log_write,
.poll = hysdn_log_poll,
.open = hysdn_log_open,
.release = hysdn_log_close,
};
......
......@@ -24,22 +24,3 @@ comment 'ISDN feature submodules'
dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN
endmenu
comment 'low-level hardware drivers'
source drivers/isdn/hisax/Config.in
### Active ISDN cards
mainmenu_option next_comment
comment 'Active ISDN cards'
source drivers/isdn/icn/Config.in
source drivers/isdn/pcbit/Config.in
source drivers/isdn/sc/Config.in
source drivers/isdn/act2000/Config.in
source drivers/isdn/eicon/Config.in
source drivers/isdn/tpam/Config.in
source drivers/isdn/hysdn/Config.in
endmenu
/* $Id: isdn_audio.c,v 1.21.6.2 2001/09/23 22:24:31 kai Exp $
/* $Id: isdn_audio.c,v 1.21.6.3 2002/08/13 09:45:33 keil Exp $
*
* Linux ISDN subsystem, audio conversion and compression (linklevel).
*
* Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
* DTMF code (c) 1996 by Christian Mock (cm@kukuruz.ping.at)
* DTMF code (c) 1996 by Christian Mock (cm@tahina.priv.at)
* Silence detection (c) 1998 by Armin Schindler (mac@gismo.telekom.de)
*
* This software may be used and distributed according to the terms
......@@ -15,7 +15,7 @@
#include "isdn_audio.h"
#include "isdn_common.h"
char *isdn_audio_revision = "$Revision: 1.21.6.2 $";
char *isdn_audio_revision = "$Revision: 1.21.6.3 $";
/*
* Misc. lookup-tables.
......
......@@ -1090,14 +1090,14 @@ isdn_status_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
static struct file_operations isdn_status_fops =
{
owner: THIS_MODULE,
llseek: no_llseek,
read: isdn_status_read,
write: isdn_status_write,
poll: isdn_status_poll,
ioctl: isdn_status_ioctl,
open: isdn_status_open,
release: isdn_status_release,
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = isdn_status_read,
.write = isdn_status_write,
.poll = isdn_status_poll,
.ioctl = isdn_status_ioctl,
.open = isdn_status_open,
.release = isdn_status_release,
};
/*
......@@ -1609,14 +1609,14 @@ isdn_ctrl_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
static struct file_operations isdn_ctrl_fops =
{
owner: THIS_MODULE,
llseek: no_llseek,
read: isdn_ctrl_read,
write: isdn_ctrl_write,
poll: isdn_ctrl_poll,
ioctl: isdn_ctrl_ioctl,
open: isdn_ctrl_open,
release: isdn_ctrl_release,
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = isdn_ctrl_read,
.write = isdn_ctrl_write,
.poll = isdn_ctrl_poll,
.ioctl = isdn_ctrl_ioctl,
.open = isdn_ctrl_open,
.release = isdn_ctrl_release,
};
/*
......@@ -1661,8 +1661,8 @@ isdn_open(struct inode * inode, struct file * file)
static struct file_operations isdn_fops =
{
owner: THIS_MODULE,
open: isdn_open,
.owner = THIS_MODULE,
.open = isdn_open,
};
char *
......
......@@ -48,6 +48,12 @@ enum {
ST_WAIT_BEFORE_CB,
};
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 */
};
/* keep clear of ISDN_CMD_* and ISDN_STAT_* */
enum {
EV_NET_DIAL = 0x200,
......@@ -349,12 +355,7 @@ isdn_net_unbind_channel(isdn_net_local * lp)
* outgoing packet), if counter exceeds configured limit either do a
* hangup immediately or - if configured - wait until just before the next
* charge-info.
*
* cps-calculation (needed for dynamic channel-bundling):
* Since this function is called every second, simply reset the
* byte-counter of the interface after copying it to the cps-variable.
*/
unsigned long last_jiffies = -HZ;
void
isdn_net_autohup()
......@@ -366,59 +367,54 @@ isdn_net_autohup()
list_for_each(l, &isdn_net_devs) {
isdn_net_dev *p = list_entry(l, isdn_net_dev, global_list);
isdn_net_local *l = &p->local;
if (jiffies == last_jiffies)
l->cps = l->transcount;
else
l->cps = (l->transcount * HZ) / (jiffies - last_jiffies);
l->transcount = 0;
if (dev->net_verbose > 3)
printk(KERN_DEBUG "%s: %d bogocps\n", l->name, l->cps);
if ((l->flags & ISDN_NET_CONNECTED) && (l->dialstate == ST_ACTIVE)) {
if (!(l->flags & ISDN_NET_CONNECTED) || l->dialstate != ST_ACTIVE)
continue;
if(dev->global_flags & ISDN_GLOBAL_STOPPED ||
ISDN_NET_DIALMODE(*l) == ISDN_NET_DM_OFF) {
isdn_net_hangup(&p->dev);
continue;
}
dbg_net_dial("%s: huptimer %d, onhtime %d, chargetime %ld, chargeint %d\n",
l->name, l->huptimer, l->onhtime, l->chargetime, l->chargeint);
if (!(l->onhtime))
continue;
if (l->huptimer++ <= l->onhtime) {
anymore = 1;
l->huptimer++;
printk("huptimer %d, onhtime %d, chargetime %d, chargeint %d\n", l->huptimer, l->onhtime, l->chargetime, l->chargeint);
/*
* if there is some dialmode where timeout-hangup
* should _not_ be done, check for that here
*/
if ((l->onhtime) &&
(l->huptimer > l->onhtime))
{
if (l->hupflags & ISDN_MANCHARGE &&
l->hupflags & ISDN_CHARGEHUP) {
continue;
}
if (l->hupflags & ISDN_MANCHARGE && l->hupflags & ISDN_CHARGEHUP) {
while (time_after(jiffies, l->chargetime + l->chargeint))
l->chargetime += l->chargeint;
if (time_after(jiffies, l->chargetime + l->chargeint - 2 * HZ))
if (time_after(jiffies, l->chargetime + l->chargeint - 2 * HZ)) {
if (l->outgoing || l->hupflags & ISDN_INHUP) {
HERE;
isdn_net_hangup(&p->dev);
continue;
}
}
} else if (l->outgoing) {
if (l->hupflags & ISDN_CHARGEHUP) {
if (l->hupflags & ISDN_WAITCHARGE) {
printk(KERN_DEBUG "isdn_net: Hupflags of %s are %X\n",
l->name, l->hupflags);
if (l->charge_state != ST_CHARGE_HAVE_CINT) {
dbg_net_dial("%s: did not get CINT\n", l->name);
isdn_net_hangup(&p->dev);
continue;
} else if (time_after(jiffies, l->chargetime + l->chargeint)) {
printk(KERN_DEBUG
"isdn_net: %s: chtime = %lu, chint = %d\n",
dbg_net_dial("%s: chtime = %lu, chint = %d\n",
l->name, l->chargetime, l->chargeint);
isdn_net_hangup(&p->dev);
continue;
}
}
} else if (l->hupflags & ISDN_INHUP) {
HERE;
isdn_net_hangup(&p->dev);
}
}
if(dev->global_flags & ISDN_GLOBAL_STOPPED || (ISDN_NET_DIALMODE(*l) == ISDN_NET_DM_OFF)) {
isdn_net_hangup(&p->dev);
break;
}
continue;
}
anymore = 1;
}
last_jiffies = jiffies;
isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, anymore);
}
......@@ -453,6 +449,10 @@ static void isdn_net_connected(isdn_net_local *lp)
lp->dialstarted = 0;
lp->dialwait_timer = 0;
lp->transcount = 0;
lp->cps = 0;
lp->last_jiffies = jiffies;
#ifdef CONFIG_ISDN_PPP
if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP)
isdn_ppp_wakeup_daemon(lp);
......@@ -499,7 +499,7 @@ isdn_net_dial_timer(unsigned long data)
isdn_BUG();
return;
}
printk("%s: %s %#x\n", __FUNCTION__, lp->name, lp->dial_event);
printk("%s: %s %#x\n", __FUNCTION__ , lp->name, lp->dial_event);
isdn_net_handle_event(lp, lp->dial_event, NULL);
}
......@@ -608,13 +608,11 @@ do_dialout(isdn_net_local *lp)
}
lp->huptimer = 0;
lp->outgoing = 1;
if (lp->chargeint) {
lp->hupflags |= ISDN_HAVECHARGE;
lp->hupflags &= ~ISDN_WAITCHARGE;
} else {
lp->hupflags |= ISDN_WAITCHARGE;
lp->hupflags &= ~ISDN_HAVECHARGE;
}
if (lp->chargeint)
lp->charge_state = ST_CHARGE_HAVE_CINT;
else
lp->charge_state = ST_CHARGE_NULL;
if (lp->cbdelay && (lp->flags & ISDN_NET_CBOUT)) {
lp->dial_timer.expires = jiffies + lp->cbdelay;
lp->dial_event = EV_NET_TIMER_CB;
......@@ -701,15 +699,19 @@ isdn_net_handle_event(isdn_net_local *lp, int pr, void *arg)
* usage by isdn_net_autohup()
*/
lp->charge++;
if (lp->hupflags & ISDN_HAVECHARGE) {
lp->hupflags &= ~ISDN_WAITCHARGE;
lp->chargeint = jiffies - lp->chargetime - (2 * HZ);
switch (lp->charge_state) {
case ST_CHARGE_NULL:
lp->charge_state = ST_CHARGE_GOT_CINF;
break;
case ST_CHARGE_GOT_CINF:
lp->charge_state = ST_CHARGE_HAVE_CINT;
/* fall through */
case ST_CHARGE_HAVE_CINT:
lp->chargeint = jiffies - lp->chargetime - 2 * HZ;
break;
}
if (lp->hupflags & ISDN_WAITCHARGE)
lp->hupflags |= ISDN_HAVECHARGE;
lp->chargetime = jiffies;
printk(KERN_DEBUG "isdn_net: Got CINF chargetime of %s now %lu\n",
lp->name, lp->chargetime);
dbg_net_dial("%s: got CINF\n", lp->name);
return 1;
}
break;
......@@ -1054,7 +1056,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
int retv = 0;
if (((isdn_net_local *) (ndev->priv))->master) {
printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__);
isdn_BUG();
dev_kfree_skb(skb);
return 0;
}
......@@ -1083,6 +1085,14 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
* should move to userspace and get based on an overall cps
* calculation
*/
if (jiffies != lp->last_jiffies) {
lp->cps = lp->transcount * HZ / (jiffies - lp->last_jiffies);
lp->last_jiffies = jiffies;
lp->transcount = 0;
}
if (dev->net_verbose > 3)
printk(KERN_DEBUG "%s: %d bogocps\n", lp->name, lp->cps);
if (lp->cps > lp->triggercps) {
if (lp->slave) {
if (!lp->sqfull) {
......@@ -2381,8 +2391,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
lp->outgoing = 0;
lp->huptimer = 0;
lp->hupflags |= ISDN_WAITCHARGE;
lp->hupflags &= ~ISDN_HAVECHARGE;
lp->charge_state = ST_CHARGE_NULL;
/* Got incoming Call, setup L2 and L3 protocols,
* then wait for D-Channel-connect
*/
......@@ -2837,8 +2846,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
else
lp->hupflags &= ~ISDN_INHUP;
if (cfg->chargeint > 10) {
lp->hupflags |= ISDN_HAVECHARGE | ISDN_MANCHARGE;
lp->chargeint = cfg->chargeint * HZ;
lp->charge_state = ST_CHARGE_HAVE_CINT;
lp->hupflags |= ISDN_MANCHARGE;
}
if (cfg->p_encap != lp->p_encap) {
if (cfg->p_encap == ISDN_NET_ENCAP_RAWIP) {
......
......@@ -12,8 +12,6 @@
*/
/* Definitions for hupflags: */
#define ISDN_WAITCHARGE 1 /* did not get a charge info yet */
#define ISDN_HAVECHARGE 2 /* We know a charge info */
#define ISDN_CHARGEHUP 4 /* We want to use the charge mechanism */
#define ISDN_INHUP 8 /* Even if incoming, close after huptimeout */
#define ISDN_MANCHARGE 16 /* Charge Interval manually set */
......
......@@ -852,14 +852,14 @@ isdn_ppp_write(struct file *file, const char *buf, size_t count, loff_t *off)
struct file_operations isdn_ppp_fops =
{
owner: THIS_MODULE,
llseek: no_llseek,
read: isdn_ppp_read,
write: isdn_ppp_write,
poll: isdn_ppp_poll,
ioctl: isdn_ppp_ioctl,
open: isdn_ppp_open,
release: isdn_ppp_release,
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = isdn_ppp_read,
.write = isdn_ppp_write,
.poll = isdn_ppp_poll,
.ioctl = isdn_ppp_ioctl,
.open = isdn_ppp_open,
.release = isdn_ppp_release,
};
/*
......
......@@ -251,10 +251,10 @@ static struct pci_device_id tpam_pci_tbl[] __devinitdata = {
MODULE_DEVICE_TABLE(pci, tpam_pci_tbl);
static struct pci_driver tpam_driver = {
name: "tpam",
id_table: tpam_pci_tbl,
probe: tpam_probe,
remove: __devexit_p(tpam_remove),
.name = "tpam",
.id_table = tpam_pci_tbl,
.probe = tpam_probe,
.remove = __devexit_p(tpam_remove),
};
static int __init tpam_init(void) {
......
......@@ -317,6 +317,7 @@ typedef struct isdn_net_local_s {
/* 0 = Transparent */
int huptimer; /* Timeout-counter for auto-hangup */
int charge; /* Counter for charging units */
int charge_state; /* ChargeInfo state machine */
ulong chargetime; /* Timer for Charging info */
int hupflags; /* Flags for charge-unit-hangup: */
/* bit0: chargeint is invalid */
......@@ -329,6 +330,7 @@ typedef struct isdn_net_local_s {
int onum; /* Flag: at least 1 outgoing number */
int cps; /* current speed of this interface */
int transcount; /* byte-counter for cps-calculation */
int last_jiffies; /* when transcount was reset */
int sqfull; /* Flag: netdev-queue overloaded */
ulong sqfull_stamp; /* Start-Time of overload */
ulong slavedelay; /* Dynamic bundling delaytime */
......
......@@ -201,9 +201,10 @@ struct page {
extern void FASTCALL(__page_cache_release(struct page *));
#define put_page(p) \
do { \
if (put_page_testzero(p)) \
if (!PageReserved(p) && put_page_testzero(p)) \
__page_cache_release(p); \
} while (0)
void FASTCALL(__free_pages_ok(struct page *page, unsigned int order));
/*
* Multiple processes may "see" the same page. E.g. for untouched
......
......@@ -47,8 +47,8 @@ struct exec_domain;
#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
#define CLONE_SETTID 0x00100000 /* write the TID back to userspace */
#define CLONE_DETACHED 0x00200000 /* parent wants no child-exit signal */
#define CLONE_RELEASE_VM 0x00400000 /* release the userspace VM */
#define CLONE_CLEARTID 0x00200000 /* clear the userspace TID */
#define CLONE_DETACHED 0x00400000 /* parent wants no child-exit signal */
#define CLONE_SIGNAL (CLONE_SIGHAND | CLONE_THREAD)
......@@ -307,7 +307,7 @@ struct task_struct {
wait_queue_head_t wait_chldexit; /* for wait4() */
struct completion *vfork_done; /* for vfork() */
long *user_vm_lock; /* for CLONE_RELEASE_VM */
long *user_tid; /* for CLONE_CLEARTID */
unsigned long rt_priority;
unsigned long it_real_value, it_prof_value, it_virt_value;
......
......@@ -82,6 +82,12 @@ extern void tc_init(void);
extern void ipc_init(void);
#endif
/*
* Are we up and running (ie do we have all the infrastructure
* set up)
*/
int system_running = 0;
/*
* Boot command-line arguments
*/
......@@ -559,6 +565,7 @@ static int init(void * unused)
*/
free_initmem();
unlock_kernel();
system_running = 1;
kstat.pgfree = 0;
......
......@@ -186,6 +186,8 @@ static int get_pid(unsigned long flags)
next_safe = p->pid;
if(p->pgrp > last_pid && next_safe > p->pgrp)
next_safe = p->pgrp;
if(p->tgid > last_pid && next_safe > p->tgid)
next_safe = p->tgid;
if(p->session > last_pid && next_safe > p->session)
next_safe = p->session;
}
......@@ -368,12 +370,12 @@ void mm_release(void)
tsk->vfork_done = NULL;
complete(vfork_done);
}
if (tsk->user_vm_lock)
if (tsk->user_tid)
/*
* We dont check the error code - if userspace has
* not set up a proper pointer then tough luck.
*/
put_user(0UL, tsk->user_vm_lock);
put_user(0UL, tsk->user_tid);
}
static int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
......
......@@ -32,7 +32,7 @@
#include <asm/uaccess.h>
extern int max_threads;
extern int max_threads, system_running;
static inline void
use_init_fs_context(void)
......@@ -158,6 +158,9 @@ static int exec_modprobe(void * module_name)
char *argv[] = { modprobe_path, "-s", "-k", "--", (char*)module_name, NULL };
int ret;
if (!system_running)
return -EBUSY;
ret = exec_usermodehelper(modprobe_path, argv, envp);
if (ret) {
static unsigned long last;
......@@ -197,10 +200,9 @@ int request_module(const char * module_name)
unsigned long saved_policy = current->policy;
current->policy = SCHED_NORMAL;
/* Don't allow request_module() before the root fs is mounted! */
if ( ! current->fs->root ) {
printk(KERN_ERR "request_module[%s]: Root fs not mounted\n",
module_name);
/* Don't allow request_module() when the system isn't set up */
if ( ! system_running ) {
printk(KERN_ERR "request_module[%s]: not ready\n", module_name);
ret = -EPERM;
goto out;
}
......@@ -357,6 +359,9 @@ int call_usermodehelper(char *path, char **argv, char **envp)
.data = &sub_info,
};
if (!system_running)
return -EBUSY;
if (path[0] == '\0')
goto out;
......
......@@ -214,8 +214,7 @@ static inline runqueue_t *this_rq_lock(void)
static inline void rq_unlock(runqueue_t *rq)
{
spin_unlock(&rq->lock);
local_irq_enable();
spin_unlock_irq(&rq->lock);
}
/*
......
......@@ -67,6 +67,7 @@ int fs_overflowgid = DEFAULT_FS_OVERFLOWUID;
int C_A_D = 1;
int cad_pid = 1;
extern int system_running;
/*
* Notifier list for kernel code which wants to be called
......@@ -323,6 +324,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg)
switch (cmd) {
case LINUX_REBOOT_CMD_RESTART:
notifier_call_chain(&reboot_notifier_list, SYS_RESTART, NULL);
system_running = 0;
device_shutdown();
printk(KERN_EMERG "Restarting system.\n");
machine_restart(NULL);
......@@ -338,6 +340,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg)
case LINUX_REBOOT_CMD_HALT:
notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL);
system_running = 0;
device_shutdown();
printk(KERN_EMERG "System halted.\n");
machine_halt();
......@@ -346,6 +349,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg)
case LINUX_REBOOT_CMD_POWER_OFF:
notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL);
system_running = 0;
device_shutdown();
printk(KERN_EMERG "Power down.\n");
machine_power_off();
......@@ -360,6 +364,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg)
buffer[sizeof(buffer) - 1] = '\0';
notifier_call_chain(&reboot_notifier_list, SYS_RESTART, buffer);
system_running = 0;
device_shutdown();
printk(KERN_EMERG "Restarting system with command '%s'.\n", buffer);
machine_restart(buffer);
......
......@@ -80,8 +80,7 @@ static inline int bad_range(zone_t *zone, struct page *page)
* -- wli
*/
static void FASTCALL(__free_pages_ok (struct page *page, unsigned int order));
static void __free_pages_ok (struct page *page, unsigned int order)
void __free_pages_ok (struct page *page, unsigned int order)
{
unsigned long index, page_idx, mask, flags;
free_area_t *area;
......
......@@ -89,7 +89,7 @@ void __page_cache_release(struct page *page)
del_page_from_inactive_list(page);
spin_unlock_irqrestore(&_pagemap_lru_lock, flags);
}
__free_page(page);
__free_pages_ok(page, 0);
}
/*
......
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