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