]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge with ../linux-2.6
authorTony Lindgren <tony@atomide.com>
Fri, 2 Dec 2005 00:45:40 +0000 (16:45 -0800)
committerTony Lindgren <tony@atomide.com>
Fri, 2 Dec 2005 00:45:40 +0000 (16:45 -0800)
80 files changed:
Documentation/usb/error-codes.txt
Makefile
arch/i386/kernel/io_apic.c
arch/i386/kernel/reboot.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/prom_init.c
arch/ppc/kernel/process.c
drivers/atm/Kconfig
drivers/atm/Makefile
drivers/atm/adummy.c [new file with mode: 0644]
drivers/atm/atmdev_init.c [deleted file]
drivers/atm/atmtcp.c
drivers/atm/lanai.c
drivers/char/drm/drm_context.c
drivers/hwmon/w83792d.c
drivers/usb/atm/cxacru.c
drivers/usb/atm/usbatm.c
drivers/usb/core/hcd-pci.c
drivers/usb/core/hcd.c
drivers/usb/core/hcd.h
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci-q.c
drivers/usb/host/ehci-sched.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-hub.c
drivers/usb/host/ohci-pci.c
drivers/usb/host/uhci-hcd.c
drivers/video/Kconfig
drivers/video/cirrusfb.c
fs/cifs/CHANGES
fs/cifs/README
fs/cifs/TODO
fs/cifs/cifsfs.c
fs/cifs/cifssmb.c
fs/cifs/dir.c
fs/cifs/inode.c
fs/cifs/misc.c
fs/cifs/netmisc.c
fs/cifs/transport.c
fs/hfsplus/hfsplus_fs.h
fs/hfsplus/hfsplus_raw.h
fs/hfsplus/options.c
fs/hfsplus/super.c
fs/reiserfs/journal.c
include/linux/atmdev.h
include/linux/cn_proc.h
include/linux/mm.h
kernel/power/main.c
kernel/ptrace.c
mm/memory.c
net/atm/atm_misc.c
net/atm/common.c
net/atm/common.h
net/atm/resources.c
net/atm/resources.h
net/ipv4/fib_hash.c
net/ipv4/fib_semantics.c
net/ipv4/icmp.c
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/ipvs/ip_vs_conn.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/ipvs/ip_vs_proto_tcp.c
net/ipv4/netfilter/ip_conntrack_amanda.c
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_ftp.c
net/ipv4/netfilter/ip_conntrack_irc.c
net/ipv4/netfilter/ip_conntrack_proto_icmp.c
net/ipv4/netfilter/ip_conntrack_proto_sctp.c
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
net/ipv4/netfilter/ip_nat_core.c
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ipt_LOG.c
net/ipv4/proc.c
net/ipv4/route.c
net/ipv4/tcp.c
net/ipv6/icmp.c
net/ipv6/ip6_output.c
net/ipv6/ipv6_sockglue.c
net/ipv6/netfilter/ip6_tables.c

index 1e36f1661cd0a6409a00defea1407162a9bdfa61..867f4c38f3564ae8fcfa8aa92df2b8eb41cfa31a 100644 (file)
@@ -46,8 +46,9 @@ USB-specific:
 
 -EMSGSIZE      (a) endpoint maxpacket size is zero; it is not usable
                    in the current interface altsetting.
-               (b) ISO packet is biger than endpoint maxpacket
-               (c) requested data transfer size is invalid (negative)
+               (b) ISO packet is larger than the endpoint maxpacket.
+               (c) requested data transfer length is invalid: negative
+                   or too large for the host controller.
 
 -ENOSPC                This request would overcommit the usb bandwidth reserved
                for periodic transfers (interrupt, isochronous).
index f6a56a1b4d6c05677bf4652c9f7ecddaa2d45de0..369ddb5a8cf18f33b8134b6e1e06c9a61897ae00 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 15
-EXTRAVERSION =-rc3
+EXTRAVERSION =-rc4
 NAME=Affluent Albatross
 
 # *DOCUMENTATION*
index cc5d7ac5b2e7dfa5a157bb0dffe57971bc037ed4..22c8675c79f4e5391dc1d72a3f1df1e0b7df974e 100644 (file)
@@ -2009,7 +2009,7 @@ static void ack_edge_ioapic_vector(unsigned int vector)
 {
        int irq = vector_to_irq(vector);
 
-       move_irq(vector);
+       move_native_irq(vector);
        ack_edge_ioapic_irq(irq);
 }
 
@@ -2024,7 +2024,7 @@ static void end_level_ioapic_vector (unsigned int vector)
 {
        int irq = vector_to_irq(vector);
 
-       move_irq(vector);
+       move_native_irq(vector);
        end_level_ioapic_irq(irq);
 }
 
index 350ea6680f63782dcfb237480f83c42b9229005a..2afe0f8d555adf4b67130421e1750449f7f1c92a 100644 (file)
@@ -111,6 +111,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
                },
        },
+       {       /* Handle problems with rebooting on HP nc6120 */
+               .callback = set_bios_reboot,
+               .ident = "HP Compaq nc6120",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nc6120"),
+               },
+       },
        { }
 };
 
index a5a7542a8ff348c27442ba3638a30740cc035e29..105d5609ff572dc63c2919808fffd2c89f019dbc 100644 (file)
@@ -201,6 +201,28 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
 }
 #endif /* CONFIG_SPE */
 
+/*
+ * If we are doing lazy switching of CPU state (FP, altivec or SPE),
+ * and the current task has some state, discard it.
+ */
+static inline void discard_lazy_cpu_state(void)
+{
+#ifndef CONFIG_SMP
+       preempt_disable();
+       if (last_task_used_math == current)
+               last_task_used_math = NULL;
+#ifdef CONFIG_ALTIVEC
+       if (last_task_used_altivec == current)
+               last_task_used_altivec = NULL;
+#endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+       if (last_task_used_spe == current)
+               last_task_used_spe = NULL;
+#endif
+       preempt_enable();
+#endif /* CONFIG_SMP */
+}
+
 int set_dabr(unsigned long dabr)
 {
        if (ppc_md.set_dabr)
@@ -434,19 +456,7 @@ void show_regs(struct pt_regs * regs)
 void exit_thread(void)
 {
        kprobe_flush_task(current);
-
-#ifndef CONFIG_SMP
-       if (last_task_used_math == current)
-               last_task_used_math = NULL;
-#ifdef CONFIG_ALTIVEC
-       if (last_task_used_altivec == current)
-               last_task_used_altivec = NULL;
-#endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_SPE
-       if (last_task_used_spe == current)
-               last_task_used_spe = NULL;
-#endif
-#endif /* CONFIG_SMP */
+       discard_lazy_cpu_state();
 }
 
 void flush_thread(void)
@@ -458,18 +468,7 @@ void flush_thread(void)
                t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);
 #endif
 
-#ifndef CONFIG_SMP
-       if (last_task_used_math == current)
-               last_task_used_math = NULL;
-#ifdef CONFIG_ALTIVEC
-       if (last_task_used_altivec == current)
-               last_task_used_altivec = NULL;
-#endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_SPE
-       if (last_task_used_spe == current)
-               last_task_used_spe = NULL;
-#endif
-#endif /* CONFIG_SMP */
+       discard_lazy_cpu_state();
 
 #ifdef CONFIG_PPC64    /* for now */
        if (current->thread.dabr) {
@@ -635,18 +634,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
        }
 #endif
 
-#ifndef CONFIG_SMP
-       if (last_task_used_math == current)
-               last_task_used_math = NULL;
-#ifdef CONFIG_ALTIVEC
-       if (last_task_used_altivec == current)
-               last_task_used_altivec = NULL;
-#endif
-#ifdef CONFIG_SPE
-       if (last_task_used_spe == current)
-               last_task_used_spe = NULL;
-#endif
-#endif /* CONFIG_SMP */
+       discard_lazy_cpu_state();
        memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
        current->thread.fpscr.val = 0;
 #ifdef CONFIG_ALTIVEC
index 4ce0105c308ea04b7be7fd88524b4c8b25fdef73..bcdc209dca8525b5337678a1fdb80ac09f58871f 100644 (file)
@@ -265,7 +265,7 @@ static int __init call_prom_ret(const char *service, int nargs, int nret,
        va_end(list);
 
        for (i = 0; i < nret; i++)
-               rets[nargs+i] = 0;
+               args.args[nargs+i] = 0;
 
        if (enter_prom(&args, RELOC(prom_entry)) < 0)
                return PROM_ERROR;
index cb1c7b92f8c60111e7c3b86607082372e4bd03c3..25cbdc8d2941a9ccd7c2e315889cabf4d2a8c0bd 100644 (file)
@@ -417,6 +417,7 @@ void show_regs(struct pt_regs * regs)
 
 void exit_thread(void)
 {
+       preempt_disable();
        if (last_task_used_math == current)
                last_task_used_math = NULL;
        if (last_task_used_altivec == current)
@@ -425,10 +426,12 @@ void exit_thread(void)
        if (last_task_used_spe == current)
                last_task_used_spe = NULL;
 #endif
+       preempt_enable();
 }
 
 void flush_thread(void)
 {
+       preempt_disable();
        if (last_task_used_math == current)
                last_task_used_math = NULL;
        if (last_task_used_altivec == current)
@@ -437,6 +440,7 @@ void flush_thread(void)
        if (last_task_used_spe == current)
                last_task_used_spe = NULL;
 #endif
+       preempt_enable();
 }
 
 void
@@ -535,6 +539,7 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
        regs->nip = nip;
        regs->gpr[1] = sp;
        regs->msr = MSR_USER;
+       preempt_disable();
        if (last_task_used_math == current)
                last_task_used_math = NULL;
        if (last_task_used_altivec == current)
@@ -543,6 +548,7 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
        if (last_task_used_spe == current)
                last_task_used_spe = NULL;
 #endif
+       preempt_enable();
        memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
        current->thread.fpscr.val = 0;
 #ifdef CONFIG_ALTIVEC
index 489de81ea6090814ade9c6746de975fe209ad073..01a9f1cb77438eeff822a5ac3a825179a72e8028 100644 (file)
@@ -5,6 +5,13 @@
 menu "ATM drivers"
        depends on NETDEVICES && ATM
 
+config ATM_DUMMY
+       tristate "Dummy ATM driver"
+       depends on ATM
+       help
+         Dummy ATM driver. Useful for proxy signalling, testing,
+         and development.  If unsure, say N.
+
 config ATM_TCP
        tristate "ATM over TCP"
        depends on INET && ATM
index 5b77188527a9ad91f8d3f70691ba9c2d4393f4a1..b5077ce8cb4007b901716c89208e6b94f5012bd5 100644 (file)
@@ -31,6 +31,7 @@ ifeq ($(CONFIG_ATM_IDT77252_USE_SUNI),y)
   obj-$(CONFIG_ATM_IDT77252)   += suni.o
 endif
 
+obj-$(CONFIG_ATM_DUMMY)                += adummy.o
 obj-$(CONFIG_ATM_TCP)          += atmtcp.o
 obj-$(CONFIG_ATM_FIRESTREAM)   += firestream.o
 obj-$(CONFIG_ATM_LANAI)                += lanai.o
diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
new file mode 100644 (file)
index 0000000..d15c194
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * adummy.c: a dummy ATM driver
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/kernel.h>
+#include <linux/skbuff.h>
+#include <linux/pci.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <asm/io.h>
+#include <asm/byteorder.h>
+#include <asm/uaccess.h>
+
+#include <linux/atmdev.h>
+#include <linux/atm.h>
+#include <linux/sonet.h>
+
+/* version definition */
+
+#define DRV_VERSION "1.0"
+
+#define DEV_LABEL "adummy"
+
+#define ADUMMY_DEV(dev) ((struct adummy_dev *) (dev)->dev_data)
+
+struct adummy_dev {
+       struct atm_dev *atm_dev;
+
+       struct list_head entry;
+};
+
+/* globals */
+
+static LIST_HEAD(adummy_devs);
+
+static int __init
+adummy_start(struct atm_dev *dev)
+{
+       dev->ci_range.vpi_bits = 4;
+       dev->ci_range.vci_bits = 12;
+
+       return 0;
+}
+
+static int
+adummy_open(struct atm_vcc *vcc)
+{
+       short vpi = vcc->vpi;
+       int vci = vcc->vci;
+
+       if (vci == ATM_VCI_UNSPEC || vpi == ATM_VPI_UNSPEC)
+               return 0;
+
+       set_bit(ATM_VF_ADDR, &vcc->flags);
+       set_bit(ATM_VF_READY, &vcc->flags);
+
+       return 0;
+}
+
+static void
+adummy_close(struct atm_vcc *vcc)
+{
+       clear_bit(ATM_VF_READY, &vcc->flags);
+       clear_bit(ATM_VF_ADDR, &vcc->flags);
+}
+
+static int
+adummy_send(struct atm_vcc *vcc, struct sk_buff *skb)
+{
+       if (vcc->pop)
+               vcc->pop(vcc, skb);
+       else
+               dev_kfree_skb_any(skb);
+       atomic_inc(&vcc->stats->tx);
+
+       return 0;
+}
+
+static int
+adummy_proc_read(struct atm_dev *dev, loff_t *pos, char *page)
+{
+       int left = *pos;
+
+       if (!left--)
+               return sprintf(page, "version %s\n", DRV_VERSION);
+
+       return 0;
+}
+
+static struct atmdev_ops adummy_ops =
+{
+       .open =         adummy_open,
+       .close =        adummy_close,   
+       .send =         adummy_send,
+       .proc_read =    adummy_proc_read,
+       .owner =        THIS_MODULE
+};
+
+static int __init adummy_init(void)
+{
+       struct atm_dev *atm_dev;
+       struct adummy_dev *adummy_dev;
+       int err = 0;
+
+       printk(KERN_ERR "adummy: version %s\n", DRV_VERSION);
+
+       adummy_dev = (struct adummy_dev *) kmalloc(sizeof(struct adummy_dev),
+                                                  GFP_KERNEL);
+       if (!adummy_dev) {
+               printk(KERN_ERR DEV_LABEL ": kmalloc() failed\n");
+               err = -ENOMEM;
+               goto out;
+       }
+       memset(adummy_dev, 0, sizeof(struct adummy_dev));
+
+       atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, 0);
+       if (!atm_dev) {
+               printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n");
+               err = -ENODEV;
+               goto out_kfree;
+       }
+
+       adummy_dev->atm_dev = atm_dev;
+       atm_dev->dev_data = adummy_dev;
+
+       if (adummy_start(atm_dev)) {
+               printk(KERN_ERR DEV_LABEL ": adummy_start() failed\n");
+               err = -ENODEV;
+               goto out_unregister;
+       }
+
+       list_add(&adummy_dev->entry, &adummy_devs);
+out:
+       return err;
+
+out_unregister:
+       atm_dev_deregister(atm_dev);
+out_kfree:
+       kfree(adummy_dev);
+       goto out;
+}
+
+static void __exit adummy_cleanup(void)
+{
+       struct adummy_dev *adummy_dev, *next;
+
+       list_for_each_entry_safe(adummy_dev, next, &adummy_devs, entry) {
+               atm_dev_deregister(adummy_dev->atm_dev);
+               kfree(adummy_dev);
+       }
+}
+
+module_init(adummy_init);
+module_exit(adummy_cleanup);
+
+MODULE_AUTHOR("chas williams <chas@cmf.nrl.navy.mil>");
+MODULE_DESCRIPTION("dummy ATM driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/atm/atmdev_init.c b/drivers/atm/atmdev_init.c
deleted file mode 100644 (file)
index 0e09e5c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* drivers/atm/atmdev_init.c - ATM device driver initialization */
-/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
-
-#include <linux/config.h>
-#include <linux/init.h>
-
-
-#ifdef CONFIG_ATM_ZATM
-extern int zatm_detect(void);
-#endif
-#ifdef CONFIG_ATM_AMBASSADOR
-extern int amb_detect(void);
-#endif
-#ifdef CONFIG_ATM_HORIZON
-extern int hrz_detect(void);
-#endif
-#ifdef CONFIG_ATM_FORE200E
-extern int fore200e_detect(void);
-#endif
-#ifdef CONFIG_ATM_LANAI
-extern int lanai_detect(void);
-#endif
-
-
-/*
- * For historical reasons, atmdev_init returns the number of devices found.
- * Note that some detections may not go via atmdev_init (e.g. eni.c), so this
- * number is meaningless.
- */
-
-int __init atmdev_init(void)
-{
-       int devs;
-
-       devs = 0;
-#ifdef CONFIG_ATM_ZATM
-       devs += zatm_detect();
-#endif
-#ifdef CONFIG_ATM_AMBASSADOR
-       devs += amb_detect();
-#endif
-#ifdef CONFIG_ATM_HORIZON
-       devs += hrz_detect();
-#endif
-#ifdef CONFIG_ATM_FORE200E
-       devs += fore200e_detect();
-#endif
-#ifdef CONFIG_ATM_LANAI
-       devs += lanai_detect();
-#endif
-       return devs;
-}
index 57f1810fdccd74df8f755d1aa1f935ccf68b482e..fc518d85543db88a83ba0dc31b95ae1c9af61d55 100644 (file)
@@ -246,10 +246,6 @@ static void atmtcp_c_close(struct atm_vcc *vcc)
 {
        struct atm_dev *atmtcp_dev;
        struct atmtcp_dev_data *dev_data;
-       struct sock *s;
-       struct hlist_node *node;
-       struct atm_vcc *walk;
-       int i;
 
        atmtcp_dev = (struct atm_dev *) vcc->dev_data;
        dev_data = PRIV(atmtcp_dev);
@@ -257,20 +253,8 @@ static void atmtcp_c_close(struct atm_vcc *vcc)
        if (dev_data->persist) return;
        atmtcp_dev->dev_data = NULL;
        kfree(dev_data);
-       shutdown_atm_dev(atmtcp_dev);
+       atm_dev_deregister(atmtcp_dev);
        vcc->dev_data = NULL;
-       read_lock(&vcc_sklist_lock);
-       for(i = 0; i < VCC_HTABLE_SIZE; ++i) {
-               struct hlist_head *head = &vcc_hash[i];
-
-               sk_for_each(s, node, head) {
-                       walk = atm_sk(s);
-                       if (walk->dev != atmtcp_dev)
-                               continue;
-                       wake_up(s->sk_sleep);
-               }
-       }
-       read_unlock(&vcc_sklist_lock);
        module_put(THIS_MODULE);
 }
 
@@ -450,7 +434,7 @@ static int atmtcp_remove_persistent(int itf)
        if (PRIV(dev)->vcc) return 0;
        kfree(dev_data);
        atm_dev_put(dev);
-       shutdown_atm_dev(dev);
+       atm_dev_deregister(dev);
        return 0;
 }
 
index 51ec147872934e902cb8c6ce4c99c6480cd2e0d5..69f4c7ce9a633b04dea5611402a06159c118daba 100644 (file)
@@ -39,7 +39,7 @@
  * o  lanai_change_qos() isn't written yet
  *
  * o  There aren't any ioctl's yet -- I'd like to eventually support
- *    setting loopback and LED modes that way.  (see lanai_ioctl)
+ *    setting loopback and LED modes that way.
  *
  * o  If the segmentation engine or DMA gets shut down we should restart
  *    card as per section 17.0i.  (see lanai_reset)
@@ -305,7 +305,7 @@ struct lanai_dev {
  * vci with their bit set
  */
 static void vci_bitfield_iterate(struct lanai_dev *lanai,
-       /*const*/ unsigned long *lp,
+       const unsigned long *lp,
        void (*func)(struct lanai_dev *,vci_t vci))
 {
        vci_t vci = find_first_bit(lp, NUM_VCI);
@@ -951,7 +951,7 @@ static int __devinit eeprom_read(struct lanai_dev *lanai)
 /* read a big-endian 4-byte value out of eeprom */
 static inline u32 eeprom_be4(const struct lanai_dev *lanai, int address)
 {
-       return be32_to_cpup((u32 *) (&lanai->eeprom[address]));
+       return be32_to_cpup((const u32 *) &lanai->eeprom[address]);
 }
 
 /* Checksum/validate EEPROM contents */
@@ -1160,7 +1160,7 @@ static inline int vcc_tx_space(const struct lanai_vcc *lvcc, int endptr)
 }
 
 /* test if VCC is currently backlogged */
-static inline int vcc_is_backlogged(/*const*/ struct lanai_vcc *lvcc)
+static inline int vcc_is_backlogged(const struct lanai_vcc *lvcc)
 {
        return !skb_queue_empty(&lvcc->tx.backlog);
 }
@@ -1395,7 +1395,8 @@ static void vcc_rx_aal5(struct lanai_vcc *lvcc, int endptr)
 {
        int size;
        struct sk_buff *skb;
-       /*const*/ u32 *x, *end = &lvcc->rx.buf.start[endptr * 4];
+       const u32 *x;
+       u32 *end = &lvcc->rx.buf.start[endptr * 4];
        int n = ((unsigned long) end) - ((unsigned long) lvcc->rx.buf.ptr);
        if (n < 0)
                n += lanai_buf_size(&lvcc->rx.buf);
@@ -2111,7 +2112,7 @@ static int lanai_normalize_ci(struct lanai_dev *lanai,
  * shifted by that much as we compute
  *
  */
-static int pcr_to_cbricg(/*const*/ struct atm_qos *qos)
+static int pcr_to_cbricg(const struct atm_qos *qos)
 {
        int rounddown = 0;      /* 1 = Round PCR down, i.e. round ICG _up_ */
        int x, icg, pcr = atm_pcr_goal(&qos->txtp);
@@ -2434,93 +2435,6 @@ static int lanai_open(struct atm_vcc *atmvcc)
        return result;
 }
 
-#if 0
-/* ioctl operations for card */
-/* NOTE: these are all DEBUGGING ONLY currently */
-static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void __user *arg)
-{
-       int result = 0;
-       struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
-       switch(cmd) {
-               case 2106275:
-                       shutdown_atm_dev(atmdev);
-                       return 0;
-               case 2200000: {
-                       unsigned long flags;
-                       spin_lock_irqsave(&lanai->servicelock, flags);
-                       run_service(lanai);
-                       spin_unlock_irqrestore(&lanai->servicelock, flags);
-                       return 0; }
-               case 2200002:
-                       get_statistics(lanai);
-                       return 0;
-               case 2200003: {
-                       unsigned int i;
-                       for (i = 0; i <= 0x5C ; i += 4) {
-                               if (i==0x48) /* Write-only butt reg */
-                                       continue;
-                               printk(KERN_CRIT DEV_LABEL "  0x%02X: "
-                                   "0x%08X\n", i,
-                                   (unsigned int) readl(lanai->base + i));
-                               barrier(); mb();
-                               pcistatus_check(lanai, 0);
-                               barrier(); mb();
-                       }
-                       return 0; }
-               case 2200004: {
-                       u8 b;
-                       u16 w;
-                       u32 dw;
-                       struct pci_dev *pci = lanai->pci;
-                       (void) pci_read_config_word(pci, PCI_VENDOR_ID, &w);
-                       DPRINTK("vendor = 0x%X\n", (unsigned int) w);
-                       (void) pci_read_config_word(pci, PCI_DEVICE_ID, &w);
-                       DPRINTK("device = 0x%X\n", (unsigned int) w);
-                       (void) pci_read_config_word(pci, PCI_COMMAND, &w);
-                       DPRINTK("command = 0x%X\n", (unsigned int) w);
-                       (void) pci_read_config_word(pci, PCI_STATUS, &w);
-                       DPRINTK("status = 0x%X\n", (unsigned int) w);
-                       (void) pci_read_config_dword(pci,
-                           PCI_CLASS_REVISION, &dw);
-                       DPRINTK("class/revision = 0x%X\n", (unsigned int) dw);
-                       (void) pci_read_config_byte(pci,
-                           PCI_CACHE_LINE_SIZE, &b);
-                       DPRINTK("cache line size = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_LATENCY_TIMER, &b);
-                       DPRINTK("latency = %d (0x%X)\n",
-                           (int) b, (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_HEADER_TYPE, &b);
-                       DPRINTK("header type = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_BIST, &b);
-                       DPRINTK("bist = 0x%X\n", (unsigned int) b);
-                       /* skipping a few here */
-                       (void) pci_read_config_byte(pci,
-                           PCI_INTERRUPT_LINE, &b);
-                       DPRINTK("pci_int_line = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci,
-                           PCI_INTERRUPT_PIN, &b);
-                       DPRINTK("pci_int_pin = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_MIN_GNT, &b);
-                       DPRINTK("min_gnt = 0x%X\n", (unsigned int) b);
-                       (void) pci_read_config_byte(pci, PCI_MAX_LAT, &b);
-                       DPRINTK("max_lat = 0x%X\n", (unsigned int) b); }
-                       return 0;
-#ifdef USE_POWERDOWN
-               case 2200005:
-                       DPRINTK("Coming out of powerdown\n");
-                       lanai->conf1 &= ~CONFIG1_POWERDOWN;
-                       conf1_write(lanai);
-                       return 0;
-#endif
-               default:
-                       result = -ENOIOCTLCMD;
-       }
-       return result;
-}
-#else /* !0 */
-#define lanai_ioctl NULL
-#endif /* 0 */
-
 static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb)
 {
        struct lanai_vcc *lvcc = (struct lanai_vcc *) atmvcc->dev_data;
@@ -2678,7 +2592,6 @@ static const struct atmdev_ops ops = {
        .dev_close      = lanai_dev_close,
        .open           = lanai_open,
        .close          = lanai_close,
-       .ioctl          = lanai_ioctl,
        .getsockopt     = NULL,
        .setsockopt     = NULL,
        .send           = lanai_send,
@@ -2760,6 +2673,7 @@ static void __exit lanai_module_exit(void)
         * gone, so there isn't much to do
         */
        DPRINTK("cleanup_module()\n");
+       pci_unregister_driver(&lanai_driver);
 }
 
 module_init(lanai_module_init);
index bdd168d88f49b0ab6a0103f6c32b20e4fde46105..bd958d69a2ac2aeccb166739c83de1cb674fa4cc 100644 (file)
@@ -432,7 +432,10 @@ int drm_addctx(struct inode *inode, struct file *filp,
 
        if (ctx.handle != DRM_KERNEL_CONTEXT) {
                if (dev->driver->context_ctor)
-                       dev->driver->context_ctor(dev, ctx.handle);
+                       if (!dev->driver->context_ctor(dev, ctx.handle)) {
+                               DRM_DEBUG( "Running out of ctxs or memory.\n");
+                               return -ENOMEM;
+                       }
        }
 
        ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST);
index 4be59dbb78c472467c507587e9cb47279a557572..1ba072630361959678ef87def072a43755464345 100644 (file)
@@ -193,6 +193,7 @@ static const u8 W83792D_REG_LEVELS[3][4] = {
          0xE2 }        /* (bit3-0) SmartFanII: Fan3 Level 3 */
 };
 
+#define W83792D_REG_GPIO_EN            0x1A
 #define W83792D_REG_CONFIG             0x40
 #define W83792D_REG_VID_FANDIV         0x47
 #define W83792D_REG_CHIPID             0x49
@@ -257,7 +258,7 @@ DIV_TO_REG(long val)
 {
        int i;
        val = SENSORS_LIMIT(val, 1, 128) >> 1;
-       for (i = 0; i < 6; i++) {
+       for (i = 0; i < 7; i++) {
                if (val == 0)
                        break;
                val >>= 1;
@@ -1282,8 +1283,8 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
        w83792d_init_client(new_client);
 
        /* A few vars need to be filled upon startup */
-       for (i = 1; i <= 7; i++) {
-               data->fan_min[i - 1] = w83792d_read_value(new_client,
+       for (i = 0; i < 7; i++) {
+               data->fan_min[i] = w83792d_read_value(new_client,
                                        W83792D_REG_FAN_MIN[i]);
        }
 
@@ -1306,10 +1307,20 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
        device_create_file_fan(new_client, 1);
        device_create_file_fan(new_client, 2);
        device_create_file_fan(new_client, 3);
-       device_create_file_fan(new_client, 4);
-       device_create_file_fan(new_client, 5);
-       device_create_file_fan(new_client, 6);
-       device_create_file_fan(new_client, 7);
+
+       /* Read GPIO enable register to check if pins for fan 4,5 are used as
+          GPIO */
+       val1 = w83792d_read_value(new_client, W83792D_REG_GPIO_EN);
+       if (!(val1 & 0x40))
+               device_create_file_fan(new_client, 4);
+       if (!(val1 & 0x20))
+               device_create_file_fan(new_client, 5);
+
+       val1 = w83792d_read_value(new_client, W83792D_REG_PIN);
+       if (val1 & 0x40)
+               device_create_file_fan(new_client, 6);
+       if (val1 & 0x04)
+               device_create_file_fan(new_client, 7);
 
        device_create_file_temp1(new_client);           /* Temp1 */
        device_create_file_temp_add(new_client, 2);     /* Temp2 */
index 79861ee12a29c44c9837ea72f2feaf8312428848..9d59dc62e6d2271c61773651c5163559bdb64a7b 100644 (file)
@@ -787,6 +787,9 @@ static const struct usb_device_id cxacru_usb_ids[] = {
        { /* V = Conexant                       P = ADSL modem (Hasbani project)        */
                USB_DEVICE(0x0572, 0xcb00),     .driver_info = (unsigned long) &cxacru_cb00
        },
+       { /* V = Conexant             P = ADSL modem (Well PTI-800 */
+               USB_DEVICE(0x0572, 0xcb02),     .driver_info = (unsigned long) &cxacru_cb00
+       },
        { /* V = Conexant                       P = ADSL modem                          */
                USB_DEVICE(0x0572, 0xcb01),     .driver_info = (unsigned long) &cxacru_cb00
        },
index c466739428b2c501eb99c809f02226f55c7c9a76..2e6593e6c1bd66223ef57293a013ae8be5962395 100644 (file)
@@ -879,7 +879,7 @@ static int usbatm_atm_init(struct usbatm_data *instance)
 
  fail:
        instance->atm_dev = NULL;
-       shutdown_atm_dev(atm_dev); /* usbatm_atm_dev_close will eventually be called */
+       atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */
        return ret;
 }
 
@@ -1164,7 +1164,7 @@ void usbatm_usb_disconnect(struct usb_interface *intf)
 
        /* ATM finalize */
        if (instance->atm_dev)
-               shutdown_atm_dev(instance->atm_dev);
+               atm_dev_deregister(instance->atm_dev);
 
        usbatm_put_instance(instance);  /* taken in usbatm_usb_probe */
 }
index 5131d88e8c5bd7c5b39b0e9b1f27d3a2c5a85eda..29b5b2a6e183e11aab66d4615d502869bfeb9812 100644 (file)
@@ -219,6 +219,7 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message)
                        goto done;
                }
        }
+       synchronize_irq(dev->irq);
 
        /* FIXME until the generic PM interfaces change a lot more, this
         * can't use PCI D1 and D2 states.  For example, the confusion
@@ -392,7 +393,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev)
 
        dev->dev.power.power_state = PMSG_ON;
 
-       hcd->saw_irq = 0;
+       clear_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
 
        if (hcd->driver->resume) {
                retval = hcd->driver->resume(hcd);
index 5e5f65a475ab95c2d50b372d70d4f5533ad98f6e..da24c31ee00d97138d5db16d8e575b013a5056ff 100644 (file)
@@ -1315,11 +1315,12 @@ static int hcd_unlink_urb (struct urb *urb, int status)
         * finish unlinking the initial failed usb_set_address()
         * or device descriptor fetch.
         */
-       if (!hcd->saw_irq && hcd->self.root_hub != urb->dev) {
+       if (!test_bit(HCD_FLAG_SAW_IRQ, &hcd->flags)
+           && hcd->self.root_hub != urb->dev) {
                dev_warn (hcd->self.controller, "Unlink after no-IRQ?  "
                        "Controller is probably using the wrong IRQ."
                        "\n");
-               hcd->saw_irq = 1;
+               set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
        }
 
        urb->status = status;
@@ -1649,13 +1650,15 @@ irqreturn_t usb_hcd_irq (int irq, void *__hcd, struct pt_regs * r)
        struct usb_hcd          *hcd = __hcd;
        int                     start = hcd->state;
 
-       if (start == HC_STATE_HALT)
+       if (unlikely(start == HC_STATE_HALT ||
+           !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
                return IRQ_NONE;
        if (hcd->driver->irq (hcd, r) == IRQ_NONE)
                return IRQ_NONE;
 
-       hcd->saw_irq = 1;
-       if (hcd->state == HC_STATE_HALT)
+       set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
+
+       if (unlikely(hcd->state == HC_STATE_HALT))
                usb_hc_died (hcd);
        return IRQ_HANDLED;
 }
@@ -1768,6 +1771,8 @@ int usb_add_hcd(struct usb_hcd *hcd,
 
        dev_info(hcd->self.controller, "%s\n", hcd->product_desc);
 
+       set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+
        /* till now HC has been in an indeterminate state ... */
        if (hcd->driver->reset && (retval = hcd->driver->reset(hcd)) < 0) {
                dev_err(hcd->self.controller, "can't reset\n");
index 24a62a2ff86dd38b11dd3494069b99a8bd9882b2..c8a1b350e2cf045ee71585d1b12a5ff8fe396186 100644 (file)
@@ -72,7 +72,12 @@ struct usb_hcd {     /* usb_bus.hcpriv points to this */
         * hardware info/state
         */
        const struct hc_driver  *driver;        /* hw-specific hooks */
-       unsigned                saw_irq : 1;
+
+       /* Flags that need to be manipulated atomically */
+       unsigned long           flags;
+#define HCD_FLAG_HW_ACCESSIBLE 0x00000001
+#define HCD_FLAG_SAW_IRQ       0x00000002
+
        unsigned                can_wakeup:1;   /* hw supports wakeup? */
        unsigned                remote_wakeup:1;/* sw should use wakeup? */
        unsigned                rh_registered:1;/* is root hub registered? */
index 441c26064b44b3266ac055e4c708548f465183ce..13f73a836e455033c002c49d6efea2219262ac3d 100644 (file)
@@ -121,8 +121,8 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
        return 0;
 }
 
-/* called by khubd or root hub (re)init threads; leaves HC in halt state */
-static int ehci_pci_reset(struct usb_hcd *hcd)
+/* called during probe() after chip reset completes */
+static int ehci_pci_setup(struct usb_hcd *hcd)
 {
        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
        struct pci_dev          *pdev = to_pci_dev(hcd->self.controller);
@@ -141,6 +141,11 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
        if (retval)
                return retval;
 
+       /* data structure init */
+       retval = ehci_init(hcd);
+       if (retval)
+               return retval;
+
        /* NOTE:  only the parts below this line are PCI-specific */
 
        switch (pdev->vendor) {
@@ -154,7 +159,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
                /* AMD8111 EHCI doesn't work, according to AMD errata */
                if (pdev->device == 0x7463) {
                        ehci_info(ehci, "ignoring AMD8111 (errata)\n");
-                       return -EIO;
+                       retval = -EIO;
+                       goto done;
                }
                break;
        case PCI_VENDOR_ID_NVIDIA:
@@ -207,9 +213,8 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
        /* REVISIT:  per-port wake capability (PCI 0x62) currently unused */
 
        retval = ehci_pci_reinit(ehci, pdev);
-
-       /* finish init */
-       return ehci_init(hcd);
+done:
+       return retval;
 }
 
 /*-------------------------------------------------------------------------*/
@@ -228,14 +233,36 @@ static int ehci_pci_reset(struct usb_hcd *hcd)
 static int ehci_pci_suspend(struct usb_hcd *hcd, pm_message_t message)
 {
        struct ehci_hcd         *ehci = hcd_to_ehci(hcd);
+       unsigned long           flags;
+       int                     rc = 0;
 
        if (time_before(jiffies, ehci->next_statechange))
                msleep(10);
 
+       /* Root hub was already suspended. Disable irq emission and
+        * mark HW unaccessible, bail out if RH has been resumed. Use
+        * the spinlock to properly synchronize with possible pending
+        * RH suspend or resume activity.
+        *
+        * This is still racy as hcd->state is manipulated outside of
+        * any locks =P But that will be a different fix.
+        */
+       spin_lock_irqsave (&ehci->lock, flags);
+       if (hcd->state != HC_STATE_SUSPENDED) {
+               rc = -EINVAL;
+               goto bail;
+       }
+       writel (0, &ehci->regs->intr_enable);
+       (void)readl(&ehci->regs->intr_enable);
+
+       clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+ bail:
+       spin_unlock_irqrestore (&ehci->lock, flags);
+
        // could save FLADJ in case of Vaux power loss
        // ... we'd only use it to handle clock skew
 
-       return 0;
+       return rc;
 }
 
 static int ehci_pci_resume(struct usb_hcd *hcd)
@@ -251,6 +278,9 @@ static int ehci_pci_resume(struct usb_hcd *hcd)
        if (time_before(jiffies, ehci->next_statechange))
                msleep(100);
 
+       /* Mark hardware accessible again as we are out of D3 state by now */
+       set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+
        /* If CF is clear, we lost PCI Vaux power and need to restart.  */
        if (readl(&ehci->regs->configured_flag) != FLAG_CF)
                goto restart;
@@ -319,7 +349,7 @@ static const struct hc_driver ehci_pci_hc_driver = {
        /*
         * basic lifecycle operations
         */
-       .reset =                ehci_pci_reset,
+       .reset =                ehci_pci_setup,
        .start =                ehci_run,
 #ifdef CONFIG_PM
        .suspend =              ehci_pci_suspend,
index 5bb872c3496d70c3767d1b4f40a8fdd2979ba354..bf03ec0d8ee2222038ee0d928ef61feac9ea94fd 100644 (file)
@@ -912,6 +912,7 @@ submit_async (
        int                     epnum;
        unsigned long           flags;
        struct ehci_qh          *qh = NULL;
+       int                     rc = 0;
 
        qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list);
        epnum = ep->desc.bEndpointAddress;
@@ -926,21 +927,28 @@ submit_async (
 #endif
 
        spin_lock_irqsave (&ehci->lock, flags);
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+                              &ehci_to_hcd(ehci)->flags))) {
+               rc = -ESHUTDOWN;
+               goto done;
+       }
+
        qh = qh_append_tds (ehci, urb, qtd_list, epnum, &ep->hcpriv);
+       if (unlikely(qh == NULL)) {
+               rc = -ENOMEM;
+               goto done;
+       }
 
        /* Control/bulk operations through TTs don't need scheduling,
         * the HC and TT handle it when the TT has a buffer ready.
         */
-       if (likely (qh != NULL)) {
-               if (likely (qh->qh_state == QH_STATE_IDLE))
-                       qh_link_async (ehci, qh_get (qh));
-       }
+       if (likely (qh->qh_state == QH_STATE_IDLE))
+               qh_link_async (ehci, qh_get (qh));
+ done:
        spin_unlock_irqrestore (&ehci->lock, flags);
-       if (unlikely (qh == NULL)) {
+       if (unlikely (qh == NULL))
                qtd_list_free (ehci, urb, qtd_list);
-               return -ENOMEM;
-       }
-       return 0;
+       return rc;
 }
 
 /*-------------------------------------------------------------------------*/
index f0c8aa1ccd5dc016aa8c61ea3b84944c99a25c1c..57e77374d228dd083053b78a26d331a44c4e20cd 100644 (file)
@@ -602,6 +602,12 @@ static int intr_submit (
 
        spin_lock_irqsave (&ehci->lock, flags);
 
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+                              &ehci_to_hcd(ehci)->flags))) {
+               status = -ESHUTDOWN;
+               goto done;
+       }
+
        /* get qh and force any scheduling errors */
        INIT_LIST_HEAD (&empty);
        qh = qh_append_tds (ehci, urb, &empty, epnum, &ep->hcpriv);
@@ -1456,7 +1462,11 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb,
 
        /* schedule ... need to lock */
        spin_lock_irqsave (&ehci->lock, flags);
-       status = iso_stream_schedule (ehci, urb, stream);
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+                              &ehci_to_hcd(ehci)->flags)))
+               status = -ESHUTDOWN;
+       else
+               status = iso_stream_schedule (ehci, urb, stream);
        if (likely (status == 0))
                itd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
        spin_unlock_irqrestore (&ehci->lock, flags);
@@ -1815,7 +1825,11 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb,
 
        /* schedule ... need to lock */
        spin_lock_irqsave (&ehci->lock, flags);
-       status = iso_stream_schedule (ehci, urb, stream);
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE,
+                              &ehci_to_hcd(ehci)->flags)))
+               status = -ESHUTDOWN;
+       else
+               status = iso_stream_schedule (ehci, urb, stream);
        if (status == 0)
                sitd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
        spin_unlock_irqrestore (&ehci->lock, flags);
index 5c0c6c8a7a82a65da4ce6b2a3f70ecef0c1f4746..bf1d9abc07ac37a87d18a3422aaeb23980e880e5 100644 (file)
 
 /*-------------------------------------------------------------------------*/
 
-// #define OHCI_VERBOSE_DEBUG  /* not always helpful */
+#undef OHCI_VERBOSE_DEBUG      /* not always helpful */
 
 /* For initializing controller (mask in an HCFS mode too) */
 #define        OHCI_CONTROL_INIT       OHCI_CTRL_CBSR
@@ -253,6 +253,10 @@ static int ohci_urb_enqueue (
        spin_lock_irqsave (&ohci->lock, flags);
 
        /* don't submit to a dead HC */
+       if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
+               retval = -ENODEV;
+               goto fail;
+       }
        if (!HC_IS_RUNNING(hcd->state)) {
                retval = -ENODEV;
                goto fail;
index e01e77bc324b190bdaf845a7606bed0b5e338c5f..72e3b12a19268c937434b933245d6ad7d014c518 100644 (file)
@@ -53,6 +53,11 @@ static int ohci_bus_suspend (struct usb_hcd *hcd)
 
        spin_lock_irqsave (&ohci->lock, flags);
 
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) {
+               spin_unlock_irqrestore (&ohci->lock, flags);
+               return -ESHUTDOWN;
+       }
+
        ohci->hc_control = ohci_readl (ohci, &ohci->regs->control);
        switch (ohci->hc_control & OHCI_CTRL_HCFS) {
        case OHCI_USB_RESUME:
@@ -140,11 +145,19 @@ static int ohci_bus_resume (struct usb_hcd *hcd)
        struct ohci_hcd         *ohci = hcd_to_ohci (hcd);
        u32                     temp, enables;
        int                     status = -EINPROGRESS;
+       unsigned long           flags;
 
        if (time_before (jiffies, ohci->next_statechange))
                msleep(5);
 
-       spin_lock_irq (&ohci->lock);
+       spin_lock_irqsave (&ohci->lock, flags);
+
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) {
+               spin_unlock_irqrestore (&ohci->lock, flags);
+               return -ESHUTDOWN;
+       }
+
+
        ohci->hc_control = ohci_readl (ohci, &ohci->regs->control);
 
        if (ohci->hc_control & (OHCI_CTRL_IR | OHCI_SCHED_ENABLES)) {
@@ -179,7 +192,7 @@ static int ohci_bus_resume (struct usb_hcd *hcd)
                ohci_dbg (ohci, "lost power\n");
                status = -EBUSY;
        }
-       spin_unlock_irq (&ohci->lock);
+       spin_unlock_irqrestore (&ohci->lock, flags);
        if (status == -EBUSY) {
                (void) ohci_init (ohci);
                return ohci_restart (ohci);
@@ -297,8 +310,8 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
        /* handle autosuspended root:  finish resuming before
         * letting khubd or root hub timer see state changes.
         */
-       if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER
-                       || !HC_IS_RUNNING(hcd->state)) {
+       if (unlikely((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER
+                    || !HC_IS_RUNNING(hcd->state))) {
                can_suspend = 0;
                goto done;
        }
@@ -508,6 +521,9 @@ static int ohci_hub_control (
        u32             temp;
        int             retval = 0;
 
+       if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
+               return -ESHUTDOWN;
+
        switch (typeReq) {
        case ClearHubFeature:
                switch (wValue) {
index 5f22e6590cd12b82141fe2724c21d9acaf15465a..1b09dde068e11085e08830edc0a38f29c733eeab 100644 (file)
@@ -105,13 +105,36 @@ ohci_pci_start (struct usb_hcd *hcd)
 
 static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
 {
-       /* root hub was already suspended */
-       return 0;
+       struct ohci_hcd *ohci = hcd_to_ohci (hcd);
+       unsigned long   flags;
+       int             rc = 0;
+
+       /* Root hub was already suspended. Disable irq emission and
+        * mark HW unaccessible, bail out if RH has been resumed. Use
+        * the spinlock to properly synchronize with possible pending
+        * RH suspend or resume activity.
+        *
+        * This is still racy as hcd->state is manipulated outside of
+        * any locks =P But that will be a different fix.
+        */
+       spin_lock_irqsave (&ohci->lock, flags);
+       if (hcd->state != HC_STATE_SUSPENDED) {
+               rc = -EINVAL;
+               goto bail;
+       }
+       ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
+       (void)ohci_readl(ohci, &ohci->regs->intrdisable);
+       clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+ bail:
+       spin_unlock_irqrestore (&ohci->lock, flags);
+
+       return rc;
 }
 
 
 static int ohci_pci_resume (struct usb_hcd *hcd)
 {
+       set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
        usb_hcd_resume_root_hub(hcd);
        return 0;
 }
index d33ce3982a5f0e08f249ebb00697f3de22907fdc..ed550132db0b1aedfac49a6f8fb7d8c10c98073c 100644 (file)
@@ -717,6 +717,7 @@ static int uhci_suspend(struct usb_hcd *hcd, pm_message_t message)
         * at the source, so we must turn off PIRQ.
         */
        pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP, 0);
+       clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
        uhci->hc_inaccessible = 1;
        hcd->poll_rh = 0;
 
@@ -733,6 +734,11 @@ static int uhci_resume(struct usb_hcd *hcd)
 
        dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__);
 
+       /* We aren't in D3 state anymore, we do that even if dead as I
+        * really don't want to keep a stale HCD_FLAG_HW_ACCESSIBLE=0
+        */
+       set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+
        if (uhci->rh_state == UHCI_RH_RESET)    /* Dead */
                return 0;
        spin_lock_irq(&uhci->lock);
index 8a488fd8b35499180f03216096294f4a4d91228c..4b573380d13587529db80da9edd36d6c5cb0536e 100644 (file)
@@ -534,6 +534,12 @@ config FB_SUN3
        bool "Sun3 framebuffer support"
        depends on (FB = y) && (SUN3 || SUN3X) && BROKEN
 
+config FB_SBUS
+       bool "SBUS and UPA framebuffers"
+       depends on (FB = y) && (SPARC32 || SPARC64)
+       help
+         Say Y if you want support for SBUS or UPA based frame buffer device.
+
 config FB_BW2
        bool "BWtwo support"
        depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3)
@@ -546,6 +552,7 @@ config FB_BW2
 config FB_CG3
        bool "CGthree support"
        depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3)
+       select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
        help
@@ -1210,12 +1217,6 @@ config FB_AU1100
 
 source "drivers/video/geode/Kconfig"
 
-config FB_SBUS
-       bool "SBUS and UPA framebuffers"
-       depends on (FB = y) && (SPARC32 || SPARC64)
-       help
-         Say Y if you want support for SBUS or UPA based frame buffer device.
-
 config FB_FFB
        bool "Creator/Creator3D/Elite3D support"
        depends on FB_SBUS && SPARC64
index 2858c5c8ba3c2fbca07c0cc4979f024d0853cd5a..e0dbdfc0c8b4289178d5dff1419992acd325cb78 100644 (file)
@@ -404,7 +404,7 @@ struct cirrusfb_info {
        struct cirrusfb_regs currentmode;
        int blank_mode;
 
-       u32     pseudo_palette[17];
+       u32     pseudo_palette[16];
        struct { u8 red, green, blue, pad; } palette[256];
 
 #ifdef CONFIG_ZORRO
@@ -1603,14 +1603,14 @@ static int cirrusfb_setcolreg (unsigned regno, unsigned red, unsigned green,
 
                switch (info->var.bits_per_pixel) {
                        case 8:
-                               ((u8*)(info->pseudo_palette))[regno] = v;
+                               cinfo->pseudo_palette[regno] = v;
                                break;
                        case 16:
-                               ((u16*)(info->pseudo_palette))[regno] = v;
+                               cinfo->pseudo_palette[regno] = v;
                                break;
                        case 24:
                        case 32:
-                               ((u32*)(info->pseudo_palette))[regno] = v;
+                               cinfo->pseudo_palette[regno] = v;
                                break;
                }
                return 0;
@@ -2020,18 +2020,21 @@ static void cirrusfb_prim_fillrect(struct cirrusfb_info *cinfo,
                                   const struct fb_fillrect *region)
 {
        int m; /* bytes per pixel */
+       u32 color = (cinfo->info->fix.visual == FB_VISUAL_TRUECOLOR) ?
+               cinfo->pseudo_palette[region->color] : region->color;
+
        if(cinfo->info->var.bits_per_pixel == 1) {
                cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel,
                                  region->dx / 8, region->dy,
                                  region->width / 8, region->height,
-                                 region->color,
+                                 color,
                                  cinfo->currentmode.line_length);
        } else {
                m = ( cinfo->info->var.bits_per_pixel + 7 ) / 8;
                cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel,
                                  region->dx * m, region->dy,
                                  region->width * m, region->height,
-                                 region->color,
+                                 color,
                                  cinfo->currentmode.line_length);
        }
        return;
index 6bded10c0d507c01ece3e758d162882398beafd7..943ef9b82244ef9b71a3211e24bb1a1899f51409 100644 (file)
@@ -1,10 +1,12 @@
 Version 1.39
 ------------
-Defer close of a file handle slightly if pending writes depend on that file handle
+Defer close of a file handle slightly if pending writes depend on that handle
 (this reduces the EBADF bad file handle errors that can be logged under heavy
 stress on writes). Modify cifs Kconfig options to expose CONFIG_CIFS_STATS2 
-Fix SFU style symlinks and mknod needed for servers which do not support the CIFS
-Unix Extensions.  Fix setfacl/getfacl on bigendian. 
+Fix SFU style symlinks and mknod needed for servers which do not support the
+CIFS Unix Extensions.  Fix setfacl/getfacl on bigendian. Timeout negative
+dentries so files that the client sees as deleted but that later get created
+on the server will be recognized.  Add client side permission check on setattr.
 
 Version 1.38
 ------------
index bb90941826adb4e60d662d930aa293055c42cd2b..e5d09a2fc7a5eccf7a7b8f15b56de07173a5d535 100644 (file)
@@ -278,7 +278,9 @@ A partial list of the supported mount options follows:
                (such as Windows), permissions can also be checked at the
                client, and a crude form of client side permission checking 
                can be enabled by specifying file_mode and dir_mode on 
-               the client
+               the client.  Note that the mount.cifs helper must be
+               at version 1.10 or higher to support specifying the uid
+               (or gid) in non-numberic form.
   gid          If CIFS Unix extensions are not supported by the server
                this overrides the default gid for inodes.
   file_mode     If CIFS Unix extensions are not supported by the server
@@ -345,7 +347,10 @@ A partial list of the supported mount options follows:
                client system. It is typically only needed when the server
                supports the CIFS Unix Extensions but the UIDs/GIDs on the
                client and server system do not match closely enough to allow
-               access by the user doing the mount.
+               access by the user doing the mount, but it may be useful with
+               non CIFS Unix Extension mounts for cases in which the default
+               mode is specified on the mount but is not to be enforced on the
+               client (e.g. perhaps when MultiUserMount is enabled)
                Note that this does not affect the normal ACL check on the
                target machine done by the server software (of the server
                ACL against the user name provided at mount time).
@@ -368,15 +373,21 @@ A partial list of the supported mount options follows:
   setuids       If the CIFS Unix extensions are negotiated with the server
                the client will attempt to set the effective uid and gid of
                the local process on newly created files, directories, and
-               devices (create, mkdir, mknod).
+               devices (create, mkdir, mknod).  If the CIFS Unix Extensions
+               are not negotiated, for newly created files and directories
+               instead of using the default uid and gid specified on the
+               the mount, cache the new file's uid and gid locally which means
+               that the uid for the file can change when the inode is
+               reloaded (or the user remounts the share).
   nosetuids     The client will not attempt to set the uid and gid on
                on newly created files, directories, and devices (create, 
                mkdir, mknod) which will result in the server setting the
                uid and gid to the default (usually the server uid of the
                user who mounted the share).  Letting the server (rather than
-               the client) set the uid and gid is the default. This
-               parameter has no effect if the CIFS Unix Extensions are not
-               negotiated.
+               the client) set the uid and gid is the default. If the CIFS
+               Unix Extensions are not negotiated then the uid and gid for
+               new files will appear to be the uid (gid) of the mounter or the
+               uid (gid) parameter specified on the mount.
   netbiosname   When mounting to servers via port 139, specifies the RFC1001
                source name to use to represent the client netbios machine 
                name when doing the RFC1001 netbios session initialize.
@@ -418,6 +429,13 @@ A partial list of the supported mount options follows:
                byte range locks).
  remount        remount the share (often used to change from ro to rw mounts
                or vice versa)
+ sfu            When the CIFS Unix Extensions are not negotiated, attempt to
+               create device files and fifos in a format compatible with
+               Services for Unix (SFU).  In addition retrieve bits 10-12
+               of the mode via the SETFILEBITS extended attribute (as
+               SFU does).  In the future the bottom 9 bits of the mode
+               mode also will be emulated using queries of the security
+               descriptor (ACL).
                
 The mount.cifs mount helper also accepts a few mount options before -o
 including:
index c909298d11ed60deba5809a8e3346130019e63bf..fc34c74ec4bef91ed0c686ebe451b8787db26375 100644 (file)
@@ -1,4 +1,4 @@
-version 1.37 October 9, 2005
+Version 1.39 November 30, 2005
 
 A Partial List of Missing Features
 ==================================
@@ -58,7 +58,7 @@ o) Improve performance of readpages by sending more than one read
 at a time when 8 pages or more are requested. In conjuntion
 add support for async_cifs_readpages.
 
-p) Add support for storing symlink and fifo info to Windows servers 
+p) Add support for storing symlink info to Windows servers 
 in the Extended Attribute format their SFU clients would recognize.
 
 q) Finish fcntl D_NOTIFY support so kde and gnome file list windows
index 51548ed2e9cce885869c1c66bd074c119c5abdf6..2a13a2bac8f18f9d957ac289c703d3e2e2904fe7 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/seq_file.h>
 #include <linux/vfs.h>
 #include <linux/mempool.h>
+#include <linux/delay.h>
 #include "cifsfs.h"
 #include "cifspdu.h"
 #define DECLARE_GLOBALS_HERE
@@ -429,6 +430,11 @@ static void cifs_umount_begin(struct super_block * sblock)
        {
                cFYI(1,("wake up tasks now - umount begin not complete"));
                wake_up_all(&tcon->ses->server->request_q);
+               wake_up_all(&tcon->ses->server->response_q);
+               msleep(1); /* yield */
+               /* we have to kick the requests once more */
+               wake_up_all(&tcon->ses->server->response_q);
+               msleep(1);
        }
 /* BB FIXME - finish add checks for tidStatus BB */
 
@@ -895,6 +901,9 @@ static int cifs_oplock_thread(void * dummyarg)
 
 static int cifs_dnotify_thread(void * dummyarg)
 {
+       struct list_head *tmp;
+       struct cifsSesInfo *ses;
+
        daemonize("cifsdnotifyd");
        allow_signal(SIGTERM);
 
@@ -903,7 +912,19 @@ static int cifs_dnotify_thread(void * dummyarg)
                if(try_to_freeze())
                        continue;
                set_current_state(TASK_INTERRUPTIBLE);
-               schedule_timeout(39*HZ);
+               schedule_timeout(15*HZ);
+               read_lock(&GlobalSMBSeslock);
+               /* check if any stuck requests that need
+                  to be woken up and wakeq so the
+                  thread can wake up and error out */
+               list_for_each(tmp, &GlobalSMBSessionList) {
+                       ses = list_entry(tmp, struct cifsSesInfo, 
+                               cifsSessionList);
+                       if(ses && ses->server && 
+                            atomic_read(&ses->server->inFlight))
+                               wake_up_all(&ses->server->response_q);
+               }
+               read_unlock(&GlobalSMBSeslock);
        } while(!signal_pending(current));
        complete_and_exit (&cifs_dnotify_exited, 0);
 }
index d179b0c3eee45e4bc01bd4c6e3242b38f5559a81..6867e556d37e51485a4e9d35fb7ea332fc971b6d 100644 (file)
@@ -90,6 +90,18 @@ small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
           check for tcp and smb session status done differently
           for those three - in the calling routine */
        if(tcon) {
+               if(tcon->tidStatus == CifsExiting) {
+                       /* only tree disconnect, open, and write,
+                       (and ulogoff which does not have tcon)
+                       are allowed as we start force umount */
+                       if((smb_command != SMB_COM_WRITE_ANDX) && 
+                          (smb_command != SMB_COM_OPEN_ANDX) && 
+                          (smb_command != SMB_COM_TREE_DISCONNECT)) {
+                               cFYI(1,("can not send cmd %d while umounting",
+                                       smb_command));
+                               return -ENODEV;
+                       }
+               }
                if((tcon->ses) && (tcon->ses->status != CifsExiting) &&
                                  (tcon->ses->server)){
                        struct nls_table *nls_codepage;
@@ -187,6 +199,19 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
           check for tcp and smb session status done differently
           for those three - in the calling routine */
        if(tcon) {
+               if(tcon->tidStatus == CifsExiting) {
+                       /* only tree disconnect, open, and write,
+                         (and ulogoff which does not have tcon)
+                         are allowed as we start force umount */
+                       if((smb_command != SMB_COM_WRITE_ANDX) &&
+                          (smb_command != SMB_COM_OPEN_ANDX) &&
+                          (smb_command != SMB_COM_TREE_DISCONNECT)) {
+                               cFYI(1,("can not send cmd %d while umounting",
+                                       smb_command));
+                               return -ENODEV;
+                       }
+               }
+
                if((tcon->ses) && (tcon->ses->status != CifsExiting) && 
                                  (tcon->ses->server)){
                        struct nls_table *nls_codepage;
index 16b21522e8fe1bbd06a97a7da2297e38cc8056d3..32cc96cafa3eb050d19871f85cf4e089c68b7562 100644 (file)
@@ -228,8 +228,15 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                else {
                        rc = cifs_get_inode_info(&newinode, full_path,
                                                 buf, inode->i_sb,xid);
-                       if(newinode)
+                       if(newinode) {
                                newinode->i_mode = mode;
+                               if((oplock & CIFS_CREATE_ACTION) &&
+                                 (cifs_sb->mnt_cifs_flags & 
+                                    CIFS_MOUNT_SET_UID)) {
+                                       newinode->i_uid = current->fsuid;
+                                       newinode->i_gid = current->fsgid;
+                               }
+                       }
                }
 
                if (rc != 0) {
@@ -465,12 +472,20 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
                        direntry->d_op = &cifs_dentry_ops;
                d_add(direntry, newInode);
 
-               /* since paths are not looked up by component - the parent directories are presumed to be good here */
+               /* since paths are not looked up by component - the parent 
+                  directories are presumed to be good here */
                renew_parental_timestamps(direntry);
 
        } else if (rc == -ENOENT) {
                rc = 0;
+               direntry->d_time = jiffies;
+               if (pTcon->nocase)
+                       direntry->d_op = &cifs_ci_dentry_ops;
+               else
+                       direntry->d_op = &cifs_dentry_ops;
                d_add(direntry, NULL);
+       /*      if it was once a directory (but how can we tell?) we could do  
+                       shrink_dcache_parent(direntry); */
        } else {
                cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s",
                           rc,full_path));
@@ -489,21 +504,20 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
 {
        int isValid = 1;
 
-/*     lock_kernel(); *//* surely we do not want to lock the kernel for a whole network round trip which could take seconds */
-
        if (direntry->d_inode) {
                if (cifs_revalidate(direntry)) {
-                       /* unlock_kernel(); */
                        return 0;
                }
        } else {
-               cFYI(1,
-                    ("In cifs_d_revalidate with no inode but name = %s and dentry 0x%p",
-                     direntry->d_name.name, direntry));
+               cFYI(1, ("neg dentry 0x%p name = %s",
+                        direntry, direntry->d_name.name));
+               if(time_after(jiffies, direntry->d_time + HZ) || 
+                       !lookupCacheEnabled) {
+                       d_drop(direntry);
+                       isValid = 0;
+               } 
        }
 
-/*    unlock_kernel(); */
-
        return isValid;
 }
 
index 05b525812adb5ba238a8f2bc1138eac7f108a43c..411c1f7f84da6074efd483e27df1221db4647df1 100644 (file)
@@ -710,7 +710,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
        char *full_path = NULL;
        struct inode *newinode = NULL;
 
-       cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p ", mode, inode));
+       cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode));
 
        xid = GetXid();
 
@@ -768,6 +768,17 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
                        /* BB to be implemented via Windows secrty descriptors
                           eg CIFSSMBWinSetPerms(xid, pTcon, full_path, mode,
                                                 -1, -1, local_nls); */
+                       if(direntry->d_inode) {
+                               direntry->d_inode->i_mode = mode;
+                               direntry->d_inode->i_mode |= S_IFDIR;
+                               if(cifs_sb->mnt_cifs_flags & 
+                                    CIFS_MOUNT_SET_UID) {
+                                       direntry->d_inode->i_uid = 
+                                               current->fsuid;
+                                       direntry->d_inode->i_gid = 
+                                               current->fsgid;
+                               }
+                       }
                }
        }
        kfree(full_path);
@@ -1039,14 +1050,20 @@ int cifs_revalidate(struct dentry *direntry)
                filemap_fdatawrite(direntry->d_inode->i_mapping);
        }
        if (invalidate_inode) {
-               if (direntry->d_inode->i_mapping)
-                       filemap_fdatawait(direntry->d_inode->i_mapping);
-               /* may eventually have to do this for open files too */
-               if (list_empty(&(cifsInode->openFileList))) {
-                       /* Has changed on server - flush read ahead pages */
-                       cFYI(1, ("Invalidating read ahead data on "
-                                "closed file"));
-                       invalidate_remote_inode(direntry->d_inode);
+       /* shrink_dcache not necessary now that cifs dentry ops
+       are exported for negative dentries */
+/*             if(S_ISDIR(direntry->d_inode->i_mode)) 
+                       shrink_dcache_parent(direntry); */
+               if (S_ISREG(direntry->d_inode->i_mode)) {
+                       if (direntry->d_inode->i_mapping)
+                               filemap_fdatawait(direntry->d_inode->i_mapping);
+                       /* may eventually have to do this for open files too */
+                       if (list_empty(&(cifsInode->openFileList))) {
+                               /* changed on server - flush read ahead pages */
+                               cFYI(1, ("Invalidating read ahead data on "
+                                        "closed file"));
+                               invalidate_remote_inode(direntry->d_inode);
+                       }
                }
        }
 /*     up(&direntry->d_inode->i_sem); */
@@ -1105,9 +1122,20 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
 
        cFYI(1, ("In cifs_setattr, name = %s attrs->iavalid 0x%x ",
                 direntry->d_name.name, attrs->ia_valid));
+
        cifs_sb = CIFS_SB(direntry->d_inode->i_sb);
        pTcon = cifs_sb->tcon;
 
+       if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) {
+               /* check if we have permission to change attrs */
+               rc = inode_change_ok(direntry->d_inode, attrs);
+               if(rc < 0) {
+                       FreeXid(xid);
+                       return rc;
+               } else
+                       rc = 0;
+       }
+               
        down(&direntry->d_sb->s_vfs_rename_sem);
        full_path = build_path_from_dentry(direntry);
        up(&direntry->d_sb->s_vfs_rename_sem);
@@ -1147,7 +1175,9 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                                                  1 /* 45 seconds */);
                                cFYI(1,("Wrt seteof rc %d", rc));
                        }
-               }
+               } else 
+                       rc = -EINVAL;
+
                if (rc != 0) {
                        /* Set file size by pathname rather than by handle
                           either because no valid, writeable file handle for
index ca27a82c54cdb60f4083b21ba427aa004c43ceb7..94baf6c8ecbda85946984cd2e4d524034cc94644 100644 (file)
@@ -397,12 +397,12 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid)
                        if(smb->Command == SMB_COM_LOCKING_ANDX)
                                return 0;
                        else
-                               cERROR(1, ("Rcvd Request not response "));         
+                               cERROR(1, ("Rcvd Request not response"));         
                }
        } else { /* bad signature or mid */
                if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff))
                        cERROR(1,
-                              ("Bad protocol string signature header %x ",
+                              ("Bad protocol string signature header %x",
                                *(unsigned int *) smb->Protocol));
                if (mid != smb->Mid)
                        cERROR(1, ("Mids do not match"));
@@ -417,7 +417,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
        __u32 len = smb->smb_buf_length;
        __u32 clc_len;  /* calculated length */
        cFYI(0,
-            ("Entering checkSMB with Length: %x, smb_buf_length: %x ",
+            ("Entering checkSMB with Length: %x, smb_buf_length: %x",
              length, len));
        if (((unsigned int)length < 2 + sizeof (struct smb_hdr)) ||
            (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4)) {
@@ -451,9 +451,16 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
                cERROR(1, ("bad smb size detected for Mid=%d", smb->Mid));
                /* Windows XP can return a few bytes too much, presumably
                an illegal pad, at the end of byte range lock responses 
-               so we allow for up to eight byte pad, as long as actual
+               so we allow for that three byte pad, as long as actual
                received length is as long or longer than calculated length */
-               if((4+len > clc_len) && (len <= clc_len + 3))
+               /* We have now had to extend this more, since there is a 
+               case in which it needs to be bigger still to handle a
+               malformed response to transact2 findfirst from WinXP when
+               access denied is returned and thus bcc and wct are zero
+               but server says length is 0x21 bytes too long as if the server
+               forget to reset the smb rfc1001 length when it reset the
+               wct and bcc to minimum size and drop the t2 parms and data */
+               if((4+len > clc_len) && (len <= clc_len + 512))
                        return 0;
                else
                        return 1;
index f7814689844b2f4440b374024f92d7899349b29b..5de74d216fdd75533f23e89ef465823ea63d5ffc 100644 (file)
@@ -330,7 +330,7 @@ static const struct {
        ERRHRD, ERRgeneral, NT_STATUS_ACCOUNT_RESTRICTION}, {
        ERRSRV, 2241, NT_STATUS_INVALID_LOGON_HOURS}, {
        ERRSRV, 2240, NT_STATUS_INVALID_WORKSTATION}, {
-       ERRSRV, 2242, NT_STATUS_PASSWORD_EXPIRED}, {
+       ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_EXPIRED}, {
        ERRSRV, 2239, NT_STATUS_ACCOUNT_DISABLED}, {
        ERRHRD, ERRgeneral, NT_STATUS_NONE_MAPPED}, {
        ERRHRD, ERRgeneral, NT_STATUS_TOO_MANY_LUIDS_REQUESTED}, {
@@ -676,7 +676,7 @@ static const struct {
        ERRDOS, 193, NT_STATUS_IMAGE_CHECKSUM_MISMATCH}, {
        ERRHRD, ERRgeneral, NT_STATUS_LOST_WRITEBEHIND_DATA}, {
        ERRHRD, ERRgeneral, NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID}, {
-       ERRSRV, 2242, NT_STATUS_PASSWORD_MUST_CHANGE}, {
+       ERRSRV, ERRpasswordExpired, NT_STATUS_PASSWORD_MUST_CHANGE}, {
        ERRHRD, ERRgeneral, NT_STATUS_NOT_FOUND}, {
        ERRHRD, ERRgeneral, NT_STATUS_NOT_TINY_STREAM}, {
        ERRHRD, ERRgeneral, NT_STATUS_RECOVERY_FAILURE}, {
index 41a9659c16bc691552374bc1c83ea8d0fcd8209f..f8871196098c9abe371a64a1df5d269cb407f503 100644 (file)
@@ -515,6 +515,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
                        *pbytes_returned = in_buf->smb_buf_length;
 
                        /* BB special case reconnect tid and uid here? */
+                       /* BB special case Errbadpassword and pwdexpired here */
                        rc = map_smb_to_linux_error(in_buf);
 
                        /* convert ByteCount if necessary */
index c60e5635498dd8936a2e6f43ba0a8b2557360f28..df16fcbff3fbd00a6ff8876187b651c085f9679c 100644 (file)
@@ -151,6 +151,7 @@ struct hfsplus_sb_info {
 
 #define HFSPLUS_SB_WRITEBACKUP 0x0001
 #define HFSPLUS_SB_NODECOMPOSE 0x0002
+#define HFSPLUS_SB_FORCE       0x0004
 
 
 struct hfsplus_inode_info {
index 5bad37cfdb29f41ce91825585560d0e724f85763..b4fbed63321944dac1ff47676845e808512d0efb 100644 (file)
@@ -123,11 +123,13 @@ struct hfsplus_vh {
 } __packed;
 
 /* HFS+ volume attributes */
-#define HFSPLUS_VOL_UNMNT     (1 << 8)
-#define HFSPLUS_VOL_SPARE_BLK (1 << 9)
-#define HFSPLUS_VOL_NOCACHE   (1 << 10)
-#define HFSPLUS_VOL_INCNSTNT  (1 << 11)
-#define HFSPLUS_VOL_SOFTLOCK  (1 << 15)
+#define HFSPLUS_VOL_UNMNT              (1 << 8)
+#define HFSPLUS_VOL_SPARE_BLK          (1 << 9)
+#define HFSPLUS_VOL_NOCACHE            (1 << 10)
+#define HFSPLUS_VOL_INCNSTNT           (1 << 11)
+#define HFSPLUS_VOL_NODEID_REUSED      (1 << 12)
+#define HFSPLUS_VOL_JOURNALED          (1 << 13)
+#define HFSPLUS_VOL_SOFTLOCK           (1 << 15)
 
 /* HFS+ BTree node descriptor */
 struct hfs_bnode_desc {
index cca0818aa4ca3dbd18fe842e802e38b558fa4d90..935dafba007855aadc16b42b0a5e0831a987afb8 100644 (file)
@@ -22,7 +22,7 @@ enum {
        opt_umask, opt_uid, opt_gid,
        opt_part, opt_session, opt_nls,
        opt_nodecompose, opt_decompose,
-       opt_err
+       opt_force, opt_err
 };
 
 static match_table_t tokens = {
@@ -36,6 +36,7 @@ static match_table_t tokens = {
        { opt_nls, "nls=%s" },
        { opt_decompose, "decompose" },
        { opt_nodecompose, "nodecompose" },
+       { opt_force, "force" },
        { opt_err, NULL }
 };
 
@@ -145,6 +146,9 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)
                case opt_nodecompose:
                        sbi->flags |= HFSPLUS_SB_NODECOMPOSE;
                        break;
+               case opt_force:
+                       sbi->flags |= HFSPLUS_SB_FORCE;
+                       break;
                default:
                        return 0;
                }
index 0ce1c455ae555f2d8f73262be6089063608e9ffd..8093351bd7c3b0a9cefcb73ce1879a0527655c6e 100644 (file)
@@ -251,16 +251,28 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
                return 0;
        if (!(*flags & MS_RDONLY)) {
                struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr;
+               struct hfsplus_sb_info sbi;
+
+               memset(&sbi, 0, sizeof(struct hfsplus_sb_info));
+               sbi.nls = HFSPLUS_SB(sb).nls;
+               if (!hfsplus_parse_options(data, &sbi))
+                       return -EINVAL;
 
                if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
                        printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "
                               "running fsck.hfsplus is recommended.  leaving read-only.\n");
                        sb->s_flags |= MS_RDONLY;
                        *flags |= MS_RDONLY;
+               } else if (sbi.flags & HFSPLUS_SB_FORCE) {
+                       /* nothing */
                } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
                        printk("HFS+-fs: Filesystem is marked locked, leaving read-only.\n");
                        sb->s_flags |= MS_RDONLY;
                        *flags |= MS_RDONLY;
+               } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
+                       printk("HFS+-fs: Filesystem is marked journaled, leaving read-only.\n");
+                       sb->s_flags |= MS_RDONLY;
+                       *flags |= MS_RDONLY;
                }
        }
        return 0;
@@ -352,11 +364,19 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
                        printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "
                               "running fsck.hfsplus is recommended.  mounting read-only.\n");
                sb->s_flags |= MS_RDONLY;
+       } else if (sbi->flags & HFSPLUS_SB_FORCE) {
+               /* nothing */
        } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
                if (!silent)
                        printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n");
                sb->s_flags |= MS_RDONLY;
+       } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
+               if (!silent)
+                       printk("HFS+-fs: write access to a jounaled filesystem is not supported, "
+                              "use the force option at your own risk, mounting read-only.\n");
+               sb->s_flags |= MS_RDONLY;
        }
+       sbi->flags &= ~HFSPLUS_SB_FORCE;
 
        /* Load metadata objects (B*Trees) */
        HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);
index 4b15761434bc7fac7c494703267995a9b49a6ff2..68b7b78638ff0e1bf050000f1c3e201a24584dd6 100644 (file)
@@ -2757,6 +2757,15 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
        journal->j_cnode_used = 0;
        journal->j_must_wait = 0;
 
+       if (journal->j_cnode_free == 0) {
+               reiserfs_warning(p_s_sb, "journal-2004: Journal cnode memory "
+                                "allocation failed (%ld bytes). Journal is "
+                                "too large for available memory. Usually "
+                                "this is due to a journal that is too large.",
+                                sizeof (struct reiserfs_journal_cnode) * num_cnodes);
+               goto free_and_return;
+       }
+
        init_journal_hash(p_s_sb);
        jl = journal->j_current_jl;
        jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl);
index e7d0593bb5766c908c906aa9528541512187b266..b203ea82a0a8b8db8e13613d15eca2d764b900bf 100644 (file)
@@ -7,7 +7,6 @@
 #define LINUX_ATMDEV_H
 
 
-#include <linux/config.h>
 #include <linux/atmapi.h>
 #include <linux/atm.h>
 #include <linux/atmioc.h>
@@ -210,6 +209,7 @@ struct atm_cirange {
 
 #ifdef __KERNEL__
 
+#include <linux/config.h>
 #include <linux/wait.h> /* wait_queue_head_t */
 #include <linux/time.h> /* struct timeval */
 #include <linux/net.h>
@@ -274,7 +274,7 @@ enum {
 
 
 enum {
-       ATM_DF_CLOSE,           /* close device when last VCC is closed */
+       ATM_DF_REMOVED,         /* device was removed from atm_devs list */
 };
 
 
@@ -415,7 +415,6 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops,
     int number,unsigned long *flags); /* number == -1: pick first available */
 struct atm_dev *atm_dev_lookup(int number);
 void atm_dev_deregister(struct atm_dev *dev);
-void shutdown_atm_dev(struct atm_dev *dev);
 void vcc_insert_socket(struct sock *sk);
 
 
@@ -457,18 +456,19 @@ static inline void atm_dev_hold(struct atm_dev *dev)
 
 static inline void atm_dev_put(struct atm_dev *dev)
 {
-       atomic_dec(&dev->refcnt);
-
-       if ((atomic_read(&dev->refcnt) == 1) &&
-           test_bit(ATM_DF_CLOSE,&dev->flags))
-               shutdown_atm_dev(dev);
+       if (atomic_dec_and_test(&dev->refcnt)) {
+               BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags));
+               if (dev->ops->dev_close)
+                       dev->ops->dev_close(dev);
+               kfree(dev);
+       }
 }
 
 
 int atm_charge(struct atm_vcc *vcc,int truesize);
 struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
     gfp_t gfp_flags);
-int atm_pcr_goal(struct atm_trafprm *tp);
+int atm_pcr_goal(const struct atm_trafprm *tp);
 
 void vcc_release_async(struct atm_vcc *vcc, int reply);
 
index 70ab5631738084935a1ef5cad40a2131f4d776c0..c948f678e04efd548c92c3eaa8b3a6412effd26a 100644 (file)
@@ -86,12 +86,12 @@ struct proc_event {
                        pid_t process_pid;
                        pid_t process_tgid;
                        union {
-                               uid_t ruid; /* current->uid */
-                               gid_t rgid; /* current->gid */
+                               __u32 ruid; /* task uid */
+                               __u32 rgid; /* task gid */
                        } r;
                        union {
-                               uid_t euid;
-                               gid_t egid;
+                               __u32 euid;
+                               __u32 egid;
                        } e;
                } id;
 
index 0e73f1539d08e26269ff6b0cea0f099a05f6068f..29f02d8513f649fc74c3fcd3be1ade57fd4cf466 100644 (file)
@@ -956,6 +956,7 @@ struct page *vmalloc_to_page(void *addr);
 unsigned long vmalloc_to_pfn(void *addr);
 int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
                        unsigned long pfn, unsigned long size, pgprot_t);
+int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
 
 struct page *follow_page(struct vm_area_struct *, unsigned long address,
                        unsigned int foll_flags);
index 6ee2cad530e8971f4ad69da2f94d96455039fc5e..d253f3ae2fa5743d9c003c38468f1c4c823193e0 100644 (file)
@@ -24,7 +24,7 @@
 
 DECLARE_MUTEX(pm_sem);
 
-struct pm_ops * pm_ops = NULL;
+struct pm_ops *pm_ops;
 suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN;
 
 /**
@@ -151,6 +151,18 @@ static char *pm_states[PM_SUSPEND_MAX] = {
 #endif
 };
 
+static inline int valid_state(suspend_state_t state)
+{
+       /* Suspend-to-disk does not really need low-level support.
+        * It can work with reboot if needed. */
+       if (state == PM_SUSPEND_DISK)
+               return 1;
+
+       if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
+               return 0;
+       return 1;
+}
+
 
 /**
  *     enter_state - Do common work of entering low-power state.
@@ -167,7 +179,7 @@ static int enter_state(suspend_state_t state)
 {
        int error;
 
-       if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
+       if (!valid_state(state))
                return -ENODEV;
        if (down_trylock(&pm_sem))
                return -EBUSY;
@@ -238,9 +250,8 @@ static ssize_t state_show(struct subsystem * subsys, char * buf)
        char * s = buf;
 
        for (i = 0; i < PM_SUSPEND_MAX; i++) {
-               if (pm_states[i] && pm_ops && (!pm_ops->valid
-                       ||(pm_ops->valid && pm_ops->valid(i))))
-                       s += sprintf(s,"%s ",pm_states[i]);
+               if (pm_states[i] && valid_state(i))
+                       s += sprintf(s,"%s ", pm_states[i]);
        }
        s += sprintf(s,"\n");
        return (s - buf);
index 17ee7e5a34516f7485250b7a7ef94546907f9b39..656476eedb1bfe9a4de0286d7dd35aad8023c8d1 100644 (file)
@@ -241,7 +241,8 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
                if (write) {
                        copy_to_user_page(vma, page, addr,
                                          maddr + offset, buf, bytes);
-                       set_page_dirty_lock(page);
+                       if (!PageCompound(page))
+                               set_page_dirty_lock(page);
                } else {
                        copy_from_user_page(vma, page, addr,
                                            buf, maddr + offset, bytes);
index 5bfa52a986305dc5af148537782ea375bbce19dc..4b4fc3a7ea4858a1bba7e2aa60f1ace8fdbd4e0c 100644 (file)
@@ -1146,12 +1146,12 @@ int zeromap_page_range(struct vm_area_struct *vma,
        return err;
 }
 
-pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)
+pte_t * fastcall get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)
 {
        pgd_t * pgd = pgd_offset(mm, addr);
        pud_t * pud = pud_alloc(mm, pgd, addr);
        if (pud) {
-               pmd_t * pmd = pmd_alloc(mm, pgd, addr);
+               pmd_t * pmd = pmd_alloc(mm, pud, addr);
                if (pmd)
                        return pte_alloc_map_lock(mm, pmd, addr, ptl);
        }
@@ -1172,7 +1172,7 @@ static int insert_page(struct mm_struct *mm, unsigned long addr, struct page *pa
        spinlock_t *ptl;  
 
        retval = -EINVAL;
-       if (PageAnon(page) || !PageReserved(page))
+       if (PageAnon(page))
                goto out;
        retval = -ENOMEM;
        flush_dcache_page(page);
@@ -1196,6 +1196,35 @@ out:
        return retval;
 }
 
+/*
+ * This allows drivers to insert individual pages they've allocated
+ * into a user vma.
+ *
+ * The page has to be a nice clean _individual_ kernel allocation.
+ * If you allocate a compound page, you need to have marked it as
+ * such (__GFP_COMP), or manually just split the page up yourself
+ * (which is mainly an issue of doing "set_page_count(page, 1)" for
+ * each sub-page, and then freeing them one by one when you free
+ * them rather than freeing it as a compound page).
+ *
+ * NOTE! Traditionally this was done with "remap_pfn_range()" which
+ * took an arbitrary page protection parameter. This doesn't allow
+ * that. Your vma protection will have to be set up correctly, which
+ * means that if you want a shared writable mapping, you'd better
+ * ask for a shared writable mapping!
+ *
+ * The page does not need to be reserved.
+ */
+int vm_insert_page(struct vm_area_struct *vma, unsigned long addr, struct page *page)
+{
+       if (addr < vma->vm_start || addr >= vma->vm_end)
+               return -EFAULT;
+       if (!page_count(page))
+               return -EINVAL;
+       return insert_page(vma->vm_mm, addr, page, vma->vm_page_prot);
+}
+EXPORT_SYMBOL_GPL(vm_insert_page);
+
 /*
  * Somebody does a pfn remapping that doesn't actually work as a vma.
  *
@@ -1225,8 +1254,11 @@ static int incomplete_pfn_remap(struct vm_area_struct *vma,
        if (!pfn_valid(pfn))
                return -EINVAL;
 
-       retval = 0;
        page = pfn_to_page(pfn);
+       if (!PageReserved(page))
+               return -EINVAL;
+
+       retval = 0;
        while (start < end) {
                retval = insert_page(vma->vm_mm, start, page, prot);
                if (retval < 0)
index 223c7ad5bd0f7a3d524e73667c11aa35edae6733..02cc7e71efea24e36fbe78a5e43ee6e7122f3b64 100644 (file)
@@ -74,11 +74,14 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
  */
 
 
-int atm_pcr_goal(struct atm_trafprm *tp)
+int atm_pcr_goal(const struct atm_trafprm *tp)
 {
-       if (tp->pcr && tp->pcr != ATM_MAX_PCR) return -tp->pcr;
-       if (tp->min_pcr && !tp->pcr) return tp->min_pcr;
-       if (tp->max_pcr != ATM_MAX_PCR) return -tp->max_pcr;
+       if (tp->pcr && tp->pcr != ATM_MAX_PCR)
+               return -tp->pcr;
+       if (tp->min_pcr && !tp->pcr)
+               return tp->min_pcr;
+       if (tp->max_pcr != ATM_MAX_PCR)
+               return -tp->max_pcr;
        return 0;
 }
 
index 63feea49fb139f6a0e96888c3f4f99c2325ac883..6656b111cc053de334c9885f0f6ccebe4cadd790 100644 (file)
@@ -221,6 +221,29 @@ void vcc_release_async(struct atm_vcc *vcc, int reply)
 EXPORT_SYMBOL(vcc_release_async);
 
 
+void atm_dev_release_vccs(struct atm_dev *dev)
+{
+       int i;
+
+       write_lock_irq(&vcc_sklist_lock);
+       for (i = 0; i < VCC_HTABLE_SIZE; i++) {
+               struct hlist_head *head = &vcc_hash[i];
+               struct hlist_node *node, *tmp;
+               struct sock *s;
+               struct atm_vcc *vcc;
+
+               sk_for_each_safe(s, node, tmp, head) {
+                       vcc = atm_sk(s);
+                       if (vcc->dev == dev) {
+                               vcc_release_async(vcc, -EPIPE);
+                               sk_del_node_init(s);
+                       }
+               }
+       }
+       write_unlock_irq(&vcc_sklist_lock);
+}
+
+
 static int adjust_tp(struct atm_trafprm *tp,unsigned char aal)
 {
        int max_sdu;
@@ -332,12 +355,13 @@ static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, short vpi,
                return -EINVAL;
        if (vci > 0 && vci < ATM_NOT_RSV_VCI && !capable(CAP_NET_BIND_SERVICE))
                return -EPERM;
-       error = 0;
+       error = -ENODEV;
        if (!try_module_get(dev->ops->owner))
-               return -ENODEV;
+               return error;
        vcc->dev = dev;
        write_lock_irq(&vcc_sklist_lock);
-       if ((error = find_ci(vcc, &vpi, &vci))) {
+       if (test_bit(ATM_DF_REMOVED, &dev->flags) || 
+           (error = find_ci(vcc, &vpi, &vci))) {
                write_unlock_irq(&vcc_sklist_lock);
                goto fail_module_put;
        }
@@ -423,33 +447,23 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci)
        if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS ||
            vcc->qos.rxtp.traffic_class == ATM_ANYCLASS)
                return -EINVAL;
-       if (itf != ATM_ITF_ANY) {
-               dev = atm_dev_lookup(itf);
-               if (!dev)
-                       return -ENODEV;
-               error = __vcc_connect(vcc, dev, vpi, vci);
-               if (error) {
-                       atm_dev_put(dev);
-                       return error;
-               }
+       if (likely(itf != ATM_ITF_ANY)) {
+               dev = try_then_request_module(atm_dev_lookup(itf), "atm-device-%d", itf);
        } else {
-               struct list_head *p, *next;
-
                dev = NULL;
-               spin_lock(&atm_dev_lock);
-               list_for_each_safe(p, next, &atm_devs) {
-                       dev = list_entry(p, struct atm_dev, dev_list);
+               down(&atm_dev_mutex);
+               if (!list_empty(&atm_devs)) {
+                       dev = list_entry(atm_devs.next, struct atm_dev, dev_list);
                        atm_dev_hold(dev);
-                       spin_unlock(&atm_dev_lock);
-                       if (!__vcc_connect(vcc, dev, vpi, vci))
-                               break;
-                       atm_dev_put(dev);
-                       dev = NULL;
-                       spin_lock(&atm_dev_lock);
                }
-               spin_unlock(&atm_dev_lock);
-               if (!dev)
-                       return -ENODEV;
+               up(&atm_dev_mutex);
+       }
+       if (!dev)
+               return -ENODEV;
+       error = __vcc_connect(vcc, dev, vpi, vci);
+       if (error) {
+               atm_dev_put(dev);
+               return error;
        }
        if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC)
                set_bit(ATM_VF_PARTIAL,&vcc->flags);
index e49ed41c0e337f4683ea0e58cb43b150e8248b29..4887c317cefe99365576c2812875dc730257aa13 100644 (file)
@@ -47,4 +47,6 @@ static inline void atm_proc_exit(void)
 /* SVC */
 int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos);
 
+void atm_dev_release_vccs(struct atm_dev *dev);
+
 #endif
index 415d2615d475fa3c284d4a11cf565408d8c5c385..c8c459fcb0386a0e597f8b2d811a08b3055a0ef8 100644 (file)
@@ -25,7 +25,7 @@
 
 
 LIST_HEAD(atm_devs);
-DEFINE_SPINLOCK(atm_dev_lock);
+DECLARE_MUTEX(atm_dev_mutex);
 
 static struct atm_dev *__alloc_atm_dev(const char *type)
 {
@@ -52,7 +52,7 @@ static struct atm_dev *__atm_dev_lookup(int number)
 
        list_for_each(p, &atm_devs) {
                dev = list_entry(p, struct atm_dev, dev_list);
-               if ((dev->ops) && (dev->number == number)) {
+               if (dev->number == number) {
                        atm_dev_hold(dev);
                        return dev;
                }
@@ -64,12 +64,13 @@ struct atm_dev *atm_dev_lookup(int number)
 {
        struct atm_dev *dev;
 
-       spin_lock(&atm_dev_lock);
+       down(&atm_dev_mutex);
        dev = __atm_dev_lookup(number);
-       spin_unlock(&atm_dev_lock);
+       up(&atm_dev_mutex);
        return dev;
 }
 
+
 struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
                                 int number, unsigned long *flags)
 {
@@ -81,11 +82,11 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
                    type);
                return NULL;
        }
-       spin_lock(&atm_dev_lock);
+       down(&atm_dev_mutex);
        if (number != -1) {
                if ((inuse = __atm_dev_lookup(number))) {
                        atm_dev_put(inuse);
-                       spin_unlock(&atm_dev_lock);
+                       up(&atm_dev_mutex);
                        kfree(dev);
                        return NULL;
                }
@@ -105,19 +106,17 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
                memset(&dev->flags, 0, sizeof(dev->flags));
        memset(&dev->stats, 0, sizeof(dev->stats));
        atomic_set(&dev->refcnt, 1);
-       list_add_tail(&dev->dev_list, &atm_devs);
-       spin_unlock(&atm_dev_lock);
 
        if (atm_proc_dev_register(dev) < 0) {
                printk(KERN_ERR "atm_dev_register: "
                       "atm_proc_dev_register failed for dev %s\n",
                       type);
-               spin_lock(&atm_dev_lock);
-               list_del(&dev->dev_list);
-               spin_unlock(&atm_dev_lock);
+               up(&atm_dev_mutex);
                kfree(dev);
                return NULL;
        }
+       list_add_tail(&dev->dev_list, &atm_devs);
+       up(&atm_dev_mutex);
 
        return dev;
 }
@@ -125,37 +124,22 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
 
 void atm_dev_deregister(struct atm_dev *dev)
 {
-       unsigned long warning_time;
+       BUG_ON(test_bit(ATM_DF_REMOVED, &dev->flags));
+       set_bit(ATM_DF_REMOVED, &dev->flags);
+
+       /*
+        * if we remove current device from atm_devs list, new device 
+        * with same number can appear, such we need deregister proc, 
+        * release async all vccs and remove them from vccs list too
+        */
+       down(&atm_dev_mutex);
+       list_del(&dev->dev_list);
+       up(&atm_dev_mutex);
 
+       atm_dev_release_vccs(dev);
        atm_proc_dev_deregister(dev);
 
-       spin_lock(&atm_dev_lock);
-       list_del(&dev->dev_list);
-       spin_unlock(&atm_dev_lock);
-
-        warning_time = jiffies;
-        while (atomic_read(&dev->refcnt) != 1) {
-                msleep(250);
-                if ((jiffies - warning_time) > 10 * HZ) {
-                        printk(KERN_EMERG "atm_dev_deregister: waiting for "
-                               "dev %d to become free. Usage count = %d\n",
-                               dev->number, atomic_read(&dev->refcnt));
-                        warning_time = jiffies;
-                }
-        }
-
-       kfree(dev);
-}
-
-void shutdown_atm_dev(struct atm_dev *dev)
-{
-       if (atomic_read(&dev->refcnt) > 1) {
-               set_bit(ATM_DF_CLOSE, &dev->flags);
-               return;
-       }
-       if (dev->ops->dev_close)
-               dev->ops->dev_close(dev);
-       atm_dev_deregister(dev);
+       atm_dev_put(dev);
 }
 
 
@@ -211,16 +195,16 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
                                return -EFAULT;
                        if (get_user(len, &iobuf->length))
                                return -EFAULT;
-                       spin_lock(&atm_dev_lock);
+                       down(&atm_dev_mutex);
                        list_for_each(p, &atm_devs)
                                size += sizeof(int);
                        if (size > len) {
-                               spin_unlock(&atm_dev_lock);
+                               up(&atm_dev_mutex);
                                return -E2BIG;
                        }
                        tmp_buf = kmalloc(size, GFP_ATOMIC);
                        if (!tmp_buf) {
-                               spin_unlock(&atm_dev_lock);
+                               up(&atm_dev_mutex);
                                return -ENOMEM;
                        }
                        tmp_p = tmp_buf;
@@ -228,7 +212,7 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
                                dev = list_entry(p, struct atm_dev, dev_list);
                                *tmp_p++ = dev->number;
                        }
-                       spin_unlock(&atm_dev_lock);
+                       up(&atm_dev_mutex);
                        error = ((copy_to_user(buf, tmp_buf, size)) ||
                                        put_user(size, &iobuf->length))
                                                ? -EFAULT : 0;
@@ -245,7 +229,8 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
        if (get_user(number, &sioc->number))
                return -EFAULT;
 
-       if (!(dev = atm_dev_lookup(number)))
+       if (!(dev = try_then_request_module(atm_dev_lookup(number),
+                                           "atm-device-%d", number)))
                return -ENODEV;
        
        switch (cmd) {
@@ -414,13 +399,13 @@ static __inline__ void *dev_get_idx(loff_t left)
 
 void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos)
 {
-       spin_lock(&atm_dev_lock);
+       down(&atm_dev_mutex);
        return *pos ? dev_get_idx(*pos) : (void *) 1;
 }
 
 void atm_dev_seq_stop(struct seq_file *seq, void *v)
 {
-       spin_unlock(&atm_dev_lock);
+       up(&atm_dev_mutex);
 }
  
 void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
@@ -434,4 +419,3 @@ void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 EXPORT_SYMBOL(atm_dev_register);
 EXPORT_SYMBOL(atm_dev_deregister);
 EXPORT_SYMBOL(atm_dev_lookup);
-EXPORT_SYMBOL(shutdown_atm_dev);
index 12910619dbb6cdfed3cb5b56268769263125ad63..b7fb82a93b42951870a1e327b99b1f8a0f954391 100644 (file)
@@ -11,8 +11,7 @@
 
 
 extern struct list_head atm_devs;
-extern spinlock_t atm_dev_lock;
-
+extern struct semaphore atm_dev_mutex;
 
 int atm_dev_ioctl(unsigned int cmd, void __user *arg);
 
index 2a8c9afc3695d88a673e2f35cba900d0aa63c409..7ea0209cb1697ddd50bbf5a98b4cf8f89a5d484a 100644 (file)
@@ -975,7 +975,7 @@ static void fib_seq_stop(struct seq_file *seq, void *v)
 
 static unsigned fib_flag_trans(int type, u32 mask, struct fib_info *fi)
 {
-       static unsigned type2flags[RTN_MAX + 1] = {
+       static const unsigned type2flags[RTN_MAX + 1] = {
                [7] = RTF_REJECT, [8] = RTF_REJECT,
        };
        unsigned flags = type2flags[type];
index 186f20c4a45e06a65cfaee8cbfba41ab00dfbf00..6d2a6ac070e35d035a7401ca89cc8f8b53449743 100644 (file)
@@ -83,7 +83,7 @@ for (nhsel=0; nhsel < 1; nhsel++)
 #define endfor_nexthops(fi) }
 
 
-static struct 
+static const struct 
 {
        int     error;
        u8      scope;
index e3eceecd0496eeb752964ee276bdc2e0c79e4de3..92e23b2ad4d211c810341bc74389bc9ce32381cb 100644 (file)
@@ -220,7 +220,7 @@ struct icmp_control {
        short   error;          /* This ICMP is classed as an error message */
 };
 
-static struct icmp_control icmp_pointers[NR_ICMP_TYPES+1];
+static const struct icmp_control icmp_pointers[NR_ICMP_TYPES+1];
 
 /*
  *     The ICMP socket(s). This is the most convenient way to flow control
@@ -994,7 +994,7 @@ error:
 /*
  *     This table is the definition of how we handle ICMP.
  */
-static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
+static const struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
        [ICMP_ECHOREPLY] = {
                .output_entry = ICMP_MIB_OUTECHOREPS,
                .input_entry = ICMP_MIB_INECHOREPS,
index 4e9c74b54b150b3cec895023b2489d104866c710..a4c347c3b8e3a169f9e1b37603ce02378cee1d55 100644 (file)
@@ -1217,7 +1217,7 @@ static int ipgre_tunnel_init(struct net_device *dev)
        return 0;
 }
 
-int __init ipgre_fb_tunnel_init(struct net_device *dev)
+static int __init ipgre_fb_tunnel_init(struct net_device *dev)
 {
        struct ip_tunnel *tunnel = (struct ip_tunnel*)dev->priv;
        struct iphdr *iph = &tunnel->parms.iph;
index 11c2f68254f0a8a04602222216a03578c0327d20..eba64e2bd397c2f219bb4c545a5704f5bf892630 100644 (file)
@@ -690,7 +690,7 @@ csum_page(struct page *page, int offset, int copy)
        return csum;
 }
 
-inline int ip_ufo_append_data(struct sock *sk,
+static inline int ip_ufo_append_data(struct sock *sk,
                        int getfrag(void *from, char *to, int offset, int len,
                               int odd, struct sk_buff *skb),
                        void *from, int length, int hh_len, int fragheaderlen,
index f828fa2eb7dea154ff534e342fc75cdf8217b1ba..2a3a8c59c6551f087e73d4007963055969fe8f7c 100644 (file)
@@ -771,7 +771,7 @@ static inline int todrop_entry(struct ip_vs_conn *cp)
         * The drop rate array needs tuning for real environments.
         * Called from timer bh only => no locking
         */
-       static char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
+       static const char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
        static char todrop_counter[9] = {0};
        int i;
 
index 2d66848e7aa06bb75df50aad715d6c45837535e7..9bdcf31b760eee5a35a0cba61c69f734b056f02c 100644 (file)
@@ -1909,7 +1909,7 @@ static int ip_vs_set_timeout(struct ip_vs_timeout_user *u)
 #define DAEMON_ARG_LEN         (sizeof(struct ip_vs_daemon_user))
 #define MAX_ARG_LEN            SVCDEST_ARG_LEN
 
-static unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = {
+static const unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = {
        [SET_CMDID(IP_VS_SO_SET_ADD)]           = SERVICE_ARG_LEN,
        [SET_CMDID(IP_VS_SO_SET_EDIT)]          = SERVICE_ARG_LEN,
        [SET_CMDID(IP_VS_SO_SET_DEL)]           = SERVICE_ARG_LEN,
@@ -2180,7 +2180,7 @@ __ip_vs_get_timeouts(struct ip_vs_timeout_user *u)
 #define GET_TIMEOUT_ARG_LEN    (sizeof(struct ip_vs_timeout_user))
 #define GET_DAEMON_ARG_LEN     (sizeof(struct ip_vs_daemon_user) * 2)
 
-static unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = {
+static const unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = {
        [GET_CMDID(IP_VS_SO_GET_VERSION)]       = 64,
        [GET_CMDID(IP_VS_SO_GET_INFO)]          = GET_INFO_ARG_LEN,
        [GET_CMDID(IP_VS_SO_GET_SERVICES)]      = GET_SERVICES_ARG_LEN,
index c19408973c091d12bb5d4e850c37af7aa3b64e37..0e878fd6215c16cd6b422c4e001d4dfefa7d0606 100644 (file)
@@ -251,7 +251,7 @@ tcp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
 #define TCP_DIR_OUTPUT         4
 #define TCP_DIR_INPUT_ONLY     8
 
-static int tcp_state_off[IP_VS_DIR_LAST] = {
+static const int tcp_state_off[IP_VS_DIR_LAST] = {
        [IP_VS_DIR_INPUT]               =       TCP_DIR_INPUT,
        [IP_VS_DIR_OUTPUT]              =       TCP_DIR_OUTPUT,
        [IP_VS_DIR_INPUT_ONLY]          =       TCP_DIR_INPUT_ONLY,
index fa3f914117ec20f66e18b27f92b2cc7e58e47d9a..e52847fa10f5d5ca61bf46107ae5212c25f541cc 100644 (file)
@@ -37,7 +37,7 @@ MODULE_LICENSE("GPL");
 module_param(master_timeout, int, 0600);
 MODULE_PARM_DESC(master_timeout, "timeout for the master connection");
 
-static char *conns[] = { "DATA ", "MESG ", "INDEX " };
+static const char *conns[] = { "DATA ", "MESG ", "INDEX " };
 
 /* This is slow, but it's simple. --RR */
 static char *amanda_buffer;
index 422ab68ee7fb62599cb410c0b8aac61bda4647d6..7a4ecddd597b4ea1760d7f936eb2a90fb0d3a2fb 100644 (file)
@@ -1354,7 +1354,7 @@ static void free_conntrack_hash(struct list_head *hash, int vmalloced,int size)
                           get_order(sizeof(struct list_head) * size));
 }
 
-void ip_conntrack_flush()
+void ip_conntrack_flush(void)
 {
        /* This makes sure all current packets have passed through
            netfilter framework.  Roll on, two-stage module
@@ -1408,7 +1408,7 @@ static struct list_head *alloc_hashtable(int size, int *vmalloced)
        return hash;
 }
 
-int set_hashsize(const char *val, struct kernel_param *kp)
+static int set_hashsize(const char *val, struct kernel_param *kp)
 {
        int i, bucket, hashsize, vmalloced;
        int old_vmalloced, old_size;
index 59e12b02b22ce82d31ae0c5769bdbce783ca5e24..68b173bcda602498a3b8572555e8a9638f33fd75 100644 (file)
@@ -55,7 +55,7 @@ static int try_rfc959(const char *, size_t, u_int32_t [], char);
 static int try_eprt(const char *, size_t, u_int32_t [], char);
 static int try_epsv_response(const char *, size_t, u_int32_t [], char);
 
-static struct ftp_search {
+static const struct ftp_search {
        enum ip_conntrack_dir dir;
        const char *pattern;
        size_t plen;
index 2dea1db14406a9a39b622dee4618b4401f4f86e6..d7c40421d0d17205fc1d6fcaba5eb0053f7c7477 100644 (file)
@@ -59,7 +59,7 @@ MODULE_PARM_DESC(max_dcc_channels, "max number of expected DCC channels per IRC
 module_param(dcc_timeout, int, 0400);
 MODULE_PARM_DESC(dcc_timeout, "timeout on for unestablished DCC channels");
 
-static char *dccprotos[] = { "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT " };
+static const char *dccprotos[] = { "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT " };
 #define MINMATCHLEN    5
 
 #if 0
index e4d6b268e8c4ec8abaaa68735839249a5668a590..5f9925db608ef3ab4255f266d0550aec421fc580 100644 (file)
@@ -51,7 +51,7 @@ static int icmp_invert_tuple(struct ip_conntrack_tuple *tuple,
                             const struct ip_conntrack_tuple *orig)
 {
        /* Add 1; spaces filled with 0. */
-       static u_int8_t invmap[]
+       static const u_int8_t invmap[]
                = { [ICMP_ECHO] = ICMP_ECHOREPLY + 1,
                    [ICMP_ECHOREPLY] = ICMP_ECHO + 1,
                    [ICMP_TIMESTAMP] = ICMP_TIMESTAMPREPLY + 1,
@@ -110,7 +110,7 @@ static int icmp_packet(struct ip_conntrack *ct,
        return NF_ACCEPT;
 }
 
-static u_int8_t valid_new[] = { 
+static const u_int8_t valid_new[] = { 
        [ICMP_ECHO] = 1,
        [ICMP_TIMESTAMP] = 1,
        [ICMP_INFO_REQUEST] = 1,
index 59a4a0111dd3fa9d91b2863a25069dbbfee56d8f..977fb59d4563361875826fec0817d92750af00da 100644 (file)
@@ -65,7 +65,7 @@ static unsigned long ip_ct_sctp_timeout_shutdown_sent     = 300 SECS / 1000;
 static unsigned long ip_ct_sctp_timeout_shutdown_recd     = 300 SECS / 1000;
 static unsigned long ip_ct_sctp_timeout_shutdown_ack_sent =   3 SECS;
 
-static unsigned long * sctp_timeouts[]
+static const unsigned long * sctp_timeouts[]
 = { NULL,                                  /* SCTP_CONNTRACK_NONE  */
     &ip_ct_sctp_timeout_closed,                   /* SCTP_CONNTRACK_CLOSED */
     &ip_ct_sctp_timeout_cookie_wait,       /* SCTP_CONNTRACK_COOKIE_WAIT */
@@ -118,7 +118,7 @@ cookie echoed to closed.
 */
 
 /* SCTP conntrack state transitions */
-static enum sctp_conntrack sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = {
+static const enum sctp_conntrack sctp_conntracks[2][9][SCTP_CONNTRACK_MAX] = {
        {
 /*     ORIGINAL        */
 /*                  sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA */
index ee3b7d6c4d2efbb5c76012b0ed1e6a7fda26ef92..625981676776deea3994337863841bf29f262b2f 100644 (file)
@@ -99,7 +99,7 @@ unsigned long ip_ct_tcp_timeout_close =        10 SECS;
    to ~13-30min depending on RTO. */
 unsigned long ip_ct_tcp_timeout_max_retrans =     5 MINS;
  
-static unsigned long * tcp_timeouts[]
+static const unsigned long * tcp_timeouts[]
 = { NULL,                              /*      TCP_CONNTRACK_NONE */
     &ip_ct_tcp_timeout_syn_sent,       /*      TCP_CONNTRACK_SYN_SENT, */
     &ip_ct_tcp_timeout_syn_recv,       /*      TCP_CONNTRACK_SYN_RECV, */
@@ -170,7 +170,7 @@ enum tcp_bit_set {
  *     if they are invalid
  *     or we do not support the request (simultaneous open)
  */
-static enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = {
+static const enum tcp_conntrack tcp_conntracks[2][6][TCP_CONNTRACK_MAX] = {
        {
 /* ORIGINAL */
 /*          sNO, sSS, sSR, sES, sFW, sCW, sLA, sTW, sCL, sLI   */
@@ -817,7 +817,7 @@ void ip_conntrack_tcp_update(struct sk_buff *skb,
 #define        TH_CWR  0x80
 
 /* table of valid flag combinations - ECE and CWR are always valid */
-static u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] =
+static const u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG) + 1] =
 {
        [TH_SYN]                        = 1,
        [TH_SYN|TH_ACK]                 = 1,
index 762f4d93936b93497a31c77415a77bc6b6b78568..c1a61462507fc5c5d38fd884b69a791d37a11ea7 100644 (file)
@@ -49,7 +49,7 @@ static unsigned int ip_nat_htable_size;
 static struct list_head *bysource;
 
 #define MAX_IP_NAT_PROTO 256
-struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO];
+static struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO];
 
 static inline struct ip_nat_protocol *
 __ip_nat_proto_find(u_int8_t protonum)
index 75c27e92f6abb521ac8f42ff28a2040177470503..45886c8475e84dbd25ab1da3eebb1a5562a20263 100644 (file)
@@ -1892,7 +1892,7 @@ static int ipt_get_matches(char *buffer, char **start, off_t offset, int length)
        return pos;
 }
 
-static struct { char *name; get_info_t *get_info; } ipt_proc_entry[] =
+static const struct { char *name; get_info_t *get_info; } ipt_proc_entry[] =
 { { "ip_tables_names", ipt_get_tables },
   { "ip_tables_targets", ipt_get_targets },
   { "ip_tables_matches", ipt_get_matches },
index 92ed050fac69bcce35424122c8a69c5d4ac5c48f..30be0f1dae370f6212de7955a972e87272854bef 100644 (file)
@@ -197,7 +197,7 @@ static void dump_packet(const struct nf_loginfo *info,
        }
        case IPPROTO_ICMP: {
                struct icmphdr _icmph, *ich;
-               static size_t required_len[NR_ICMP_TYPES+1]
+               static const size_t required_len[NR_ICMP_TYPES+1]
                        = { [ICMP_ECHOREPLY] = 4,
                            [ICMP_DEST_UNREACH]
                            = 8 + sizeof(struct iphdr),
@@ -351,7 +351,7 @@ static void dump_packet(const struct nf_loginfo *info,
        /* maxlen = 230+   91  + 230 + 252 = 803 */
 }
 
-struct nf_loginfo default_loginfo = {
+static struct nf_loginfo default_loginfo = {
        .type   = NF_LOG_TYPE_LOG,
        .u = {
                .log = {
index a65e508fbd40e4681bb9b5649c36d5ed8959b913..0d7dc668db46f53ae7cd4430c047233c00ae950e 100644 (file)
@@ -98,7 +98,7 @@ fold_field(void *mib[], int offt)
 }
 
 /* snmp items */
-static struct snmp_mib snmp4_ipstats_list[] = {
+static const struct snmp_mib snmp4_ipstats_list[] = {
        SNMP_MIB_ITEM("InReceives", IPSTATS_MIB_INRECEIVES),
        SNMP_MIB_ITEM("InHdrErrors", IPSTATS_MIB_INHDRERRORS),
        SNMP_MIB_ITEM("InAddrErrors", IPSTATS_MIB_INADDRERRORS),
@@ -119,7 +119,7 @@ static struct snmp_mib snmp4_ipstats_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp4_icmp_list[] = {
+static const struct snmp_mib snmp4_icmp_list[] = {
        SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS),
        SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS),
        SNMP_MIB_ITEM("InDestUnreachs", ICMP_MIB_INDESTUNREACHS),
@@ -149,7 +149,7 @@ static struct snmp_mib snmp4_icmp_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp4_tcp_list[] = {
+static const struct snmp_mib snmp4_tcp_list[] = {
        SNMP_MIB_ITEM("RtoAlgorithm", TCP_MIB_RTOALGORITHM),
        SNMP_MIB_ITEM("RtoMin", TCP_MIB_RTOMIN),
        SNMP_MIB_ITEM("RtoMax", TCP_MIB_RTOMAX),
@@ -167,7 +167,7 @@ static struct snmp_mib snmp4_tcp_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp4_udp_list[] = {
+static const struct snmp_mib snmp4_udp_list[] = {
        SNMP_MIB_ITEM("InDatagrams", UDP_MIB_INDATAGRAMS),
        SNMP_MIB_ITEM("NoPorts", UDP_MIB_NOPORTS),
        SNMP_MIB_ITEM("InErrors", UDP_MIB_INERRORS),
@@ -175,7 +175,7 @@ static struct snmp_mib snmp4_udp_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp4_net_list[] = {
+static const struct snmp_mib snmp4_net_list[] = {
        SNMP_MIB_ITEM("SyncookiesSent", LINUX_MIB_SYNCOOKIESSENT),
        SNMP_MIB_ITEM("SyncookiesRecv", LINUX_MIB_SYNCOOKIESRECV),
        SNMP_MIB_ITEM("SyncookiesFailed", LINUX_MIB_SYNCOOKIESFAILED),
index 381dd6a6aebbedc10ac861b957cdd1a55932dc52..f701a136a6ae010c48fae0204b7e028aafb90c8f 100644 (file)
@@ -1371,7 +1371,7 @@ out:      kfree_skb(skb);
  *     are needed for AMPRnet AX.25 paths.
  */
 
-static unsigned short mtu_plateau[] =
+static const unsigned short mtu_plateau[] =
 {32000, 17914, 8166, 4352, 2002, 1492, 576, 296, 216, 128 };
 
 static __inline__ unsigned short guess_mtu(unsigned short old_mtu)
@@ -3149,8 +3149,7 @@ int __init ip_rt_init(void)
                                        sizeof(struct rt_hash_bucket),
                                        rhash_entries,
                                        (num_physpages >= 128 * 1024) ?
-                                               (27 - PAGE_SHIFT) :
-                                               (29 - PAGE_SHIFT),
+                                       15 : 17,
                                        HASH_HIGHMEM,
                                        &rt_hash_log,
                                        &rt_hash_mask,
index 9ac7a4f46bd84ef912f8bea32ce051a09f2bb611..ef98b14ac56d0f6dd2ed726689eccf3391e4e040 100644 (file)
@@ -1413,7 +1413,7 @@ recv_urg:
  *     closed.
  */
 
-static unsigned char new_state[16] = {
+static const unsigned char new_state[16] = {
   /* current state:        new state:      action:     */
   /* (Invalid)         */ TCP_CLOSE,
   /* TCP_ESTABLISHED   */ TCP_FIN_WAIT1 | TCP_ACTION_FIN,
@@ -2065,8 +2065,7 @@ void __init tcp_init(void)
                                        sizeof(struct inet_ehash_bucket),
                                        thash_entries,
                                        (num_physpages >= 128 * 1024) ?
-                                               (25 - PAGE_SHIFT) :
-                                               (27 - PAGE_SHIFT),
+                                       13 : 15,
                                        HASH_HIGHMEM,
                                        &tcp_hashinfo.ehash_size,
                                        NULL,
@@ -2082,8 +2081,7 @@ void __init tcp_init(void)
                                        sizeof(struct inet_bind_hashbucket),
                                        tcp_hashinfo.ehash_size,
                                        (num_physpages >= 128 * 1024) ?
-                                               (25 - PAGE_SHIFT) :
-                                               (27 - PAGE_SHIFT),
+                                       13 : 15,
                                        HASH_HIGHMEM,
                                        &tcp_hashinfo.bhash_size,
                                        NULL,
index 1bdf0fb8bf8a05ac8fa44193a434c3fcad5a1dc6..34a332225c1749f215f126d46788404f5e5e9850 100644 (file)
@@ -751,7 +751,7 @@ void icmpv6_cleanup(void)
        inet6_del_protocol(&icmpv6_protocol, IPPROTO_ICMPV6);
 }
 
-static struct icmp6_err {
+static const struct icmp6_err {
        int err;
        int fatal;
 } tab_unreach[] = {
index c1fa693511a176c71f601cb3d78696ba83e25437..8523c76ebf768b9f2096a00fce912c14065c7562 100644 (file)
@@ -774,7 +774,8 @@ out_err_release:
        *dst = NULL;
        return err;
 }
-inline int ip6_ufo_append_data(struct sock *sk,
+
+static inline int ip6_ufo_append_data(struct sock *sk,
                        int getfrag(void *from, char *to, int offset, int len,
                        int odd, struct sk_buff *skb),
                        void *from, int length, int hh_len, int fragheaderlen,
index 25757ade989f50d23bf2e7d948d1286918678070..3620718defe61947040716fe3138478c3b49397c 100644 (file)
@@ -628,8 +628,8 @@ e_inval:
        return -EINVAL;
 }
 
-int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr,
-                          char __user *optval, int len)
+static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr,
+                                 char __user *optval, int len)
 {
        if (!hdr)
                return 0;
index 7d492226c16e8fef4c414872a0916e40e59d9fcc..95d469271c4d1879a75e6d9d3235b786f76f8691 100644 (file)
@@ -1972,7 +1972,7 @@ static int ip6t_get_matches(char *buffer, char **start, off_t offset, int length
        return pos;
 }
 
-static struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] =
+static const struct { char *name; get_info_t *get_info; } ip6t_proc_entry[] =
 { { "ip6_tables_names", ip6t_get_tables },
   { "ip6_tables_targets", ip6t_get_targets },
   { "ip6_tables_matches", ip6t_get_matches },