]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
authorDavid S. Miller <davem@davemloft.net>
Fri, 15 Feb 2008 23:59:19 +0000 (15:59 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Feb 2008 23:59:19 +0000 (15:59 -0800)
97 files changed:
MAINTAINERS
arch/ia64/Kconfig
arch/x86/kernel/quirks.c
arch/x86/mm/pageattr-test.c
arch/x86/vdso/Makefile
drivers/acpi/wmi.c
drivers/ata/libata-core.c
drivers/ata/pata_amd.c
drivers/ata/pata_legacy.c
drivers/ata/pata_ninja32.c
drivers/ata/pata_via.c
drivers/ata/sata_mv.c
drivers/bluetooth/hci_ldisc.c
drivers/ide/Kconfig
drivers/ide/arm/bast-ide.c
drivers/ide/arm/palm_bk3710.c
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-dma.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-lib.c
drivers/ide/ide-probe.c
drivers/ide/ide-tape.c
drivers/ide/ide.c
drivers/ide/legacy/gayle.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/pdc202xx_old.c
drivers/net/mlx4/alloc.c
drivers/net/netconsole.c
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/ath5k/hw.c
drivers/net/wireless/b43/b43.h
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43legacy/b43legacy.h
drivers/net/wireless/b43legacy/dma.c
drivers/net/wireless/b43legacy/dma.h
drivers/net/wireless/b43legacy/main.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/net/wireless/iwlwifi/iwl4965-base.c
drivers/net/wireless/rndis_wlan.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/wavelan.h
fs/lockd/host.c
fs/lockd/svclock.c
include/asm-generic/topology.h
include/asm-ia64/param.h
include/linux/cpuset.h
include/linux/ide.h
include/linux/netdevice.h
include/linux/sunrpc/svc.h
include/net/ax25.h
include/net/ndisc.h
include/net/xfrm.h
init/Makefile
mm/memory.c
mm/mempolicy.c
net/ax25/af_ax25.c
net/ax25/ax25_dev.c
net/ax25/ax25_ds_timer.c
net/ax25/ax25_route.c
net/ax25/ax25_timer.c
net/core/dev.c
net/core/neighbour.c
net/core/rtnetlink.c
net/core/skbuff.c
net/ipv4/ah4.c
net/ipv4/arp.c
net/ipv4/esp4.c
net/ipv4/fib_trie.c
net/ipv4/inet_hashtables.c
net/ipv4/ip_sockglue.c
net/ipv6/ah6.c
net/ipv6/esp6.c
net/ipv6/ip6_output.c
net/ipv6/xfrm6_output.c
net/key/af_key.c
net/mac80211/ieee80211.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/xt_SECMARK.c
net/netlabel/netlabel_domainhash.c
net/netlabel/netlabel_unlabeled.c
net/netlabel/netlabel_user.c
net/netlink/genetlink.c
net/socket.c
net/sunrpc/xprtrdma/svc_rdma_sendto.c
net/xfrm/Kconfig
net/xfrm/xfrm_input.c
net/xfrm/xfrm_output.c
net/xfrm/xfrm_user.c
scripts/Kbuild.include
security/selinux/hooks.c
security/selinux/include/av_perm_to_string.h
security/selinux/include/av_permissions.h
security/selinux/include/class_to_string.h
security/selinux/include/flask.h

index c40f0ae965523a04ef327be9c13c97923e67fb6c..6680ec44779e8154d8c7c4397c05f4826fc076b0 100644 (file)
@@ -3561,6 +3561,8 @@ P:        Christoph Lameter
 M:     clameter@sgi.com
 P:     Pekka Enberg
 M:     penberg@cs.helsinki.fi
+P:     Matt Mackall
+M:     mpm@selenic.com
 L:     linux-mm@kvack.org
 S:     Maintained
 
index 2d4fcd01bc913a1103431516e3204827b331e886..dff9edfc7465e9954bc5b16749eaa0068e88671a 100644 (file)
@@ -232,7 +232,14 @@ config PGTABLE_4
 
 endchoice
 
+if IA64_HP_SIM
+config HZ
+       default 32
+endif
+
+if !IA64_HP_SIM
 source kernel/Kconfig.hz
+endif
 
 config IA64_BRL_EMU
        bool
index 1941482d4ca317d52ddbd9af51a7142a96a452ba..c47208fc59324a1919116ba118ce11af3d8fcda0 100644 (file)
@@ -11,7 +11,7 @@
 static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
 {
        u8 config, rev;
-       u32 word;
+       u16 word;
 
        /* BIOS may enable hardware IRQ balancing for
         * E7520/E7320/E7525(revision ID 0x9 and below)
@@ -26,8 +26,11 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
        pci_read_config_byte(dev, 0xf4, &config);
        pci_write_config_byte(dev, 0xf4, config|0x2);
 
-       /* read xTPR register */
-       raw_pci_read(0, 0, 0x40, 0x4c, 2, &word);
+       /*
+        * read xTPR register.  We may not have a pci_dev for device 8
+        * because it might be hidden until the above write.
+        */
+       pci_bus_read_config_word(dev->bus, PCI_DEVFN(8, 0), 0x4c, &word);
 
        if (!(word & (1 << 13))) {
                dev_info(&dev->dev, "Intel E7520/7320/7525 detected; "
index ed82016003540ec66ccd7b18157188f6a9d7a5cf..75f1b109aae8fe6711d12b440df3743f38150ce3 100644 (file)
@@ -40,7 +40,6 @@ struct split_state {
 static int print_split(struct split_state *s)
 {
        long i, expected, missed = 0;
-       int printed = 0;
        int err = 0;
 
        s->lpg = s->gpg = s->spg = s->exec = 0;
@@ -53,12 +52,6 @@ static int print_split(struct split_state *s)
 
                pte = lookup_address(addr, &level);
                if (!pte) {
-                       if (!printed) {
-                               dump_pagetable(addr);
-                               printk(KERN_INFO "CPA %lx no pte level %d\n",
-                                       addr, level);
-                               printed = 1;
-                       }
                        missed++;
                        i++;
                        continue;
index d28dda574700949f12c6301cf7f5f85457256e8b..f385a4b4a484e36d3262ca154b96dcfd596b7510 100644 (file)
@@ -7,7 +7,7 @@ VDSO32-$(CONFIG_X86_32)         := y
 VDSO32-$(CONFIG_COMPAT)                := y
 
 vdso-install-$(VDSO64-y)       += vdso.so
-vdso-install-$(VDSO32-y)       += $(vdso32-y:=.so)
+vdso-install-$(VDSO32-y)       += $(vdso32-images)
 
 
 # files to link into the vdso
@@ -63,6 +63,8 @@ vdso32.so-$(CONFIG_X86_32)    += int80
 vdso32.so-$(CONFIG_COMPAT)     += syscall
 vdso32.so-$(VDSO32-y)          += sysenter
 
+vdso32-images                  = $(vdso32.so-y:%=vdso32-%.so)
+
 CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)
 VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -Wl,-soname=linux-gate.so.1
 
@@ -71,21 +73,21 @@ VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -Wl,-soname=linux-gate.so.1
 override obj-dirs = $(dir $(obj)) $(obj)/vdso32/
 
 targets += vdso32/vdso32.lds
-targets += $(vdso32.so-y:%=vdso32-%.so.dbg) $(vdso32.so-y:%=vdso32-%.so)
+targets += $(vdso32-images) $(vdso32-images:=.dbg)
 targets += vdso32/note.o $(vdso32.so-y:%=vdso32/%.o)
 
-extra-y        += $(vdso32.so-y:%=vdso32-%.so)
+extra-y        += $(vdso32-images)
 
-$(obj)/vdso32.o: $(vdso32.so-y:%=$(obj)/vdso32-%.so)
+$(obj)/vdso32.o: $(vdso32-images:%=$(obj)/%)
 
 KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS))
-$(vdso32.so-y:%=$(obj)/vdso32-%.so.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
-$(vdso32.so-y:%=$(obj)/vdso32-%.so.dbg): asflags-$(CONFIG_X86_64) += -m32
+$(vdso32-images:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
+$(vdso32-images:%=$(obj)/%.dbg): asflags-$(CONFIG_X86_64) += -m32
 
-$(vdso32.so-y:%=$(obj)/vdso32-%.so.dbg): $(obj)/vdso32-%.so.dbg: FORCE \
-                                        $(obj)/vdso32/vdso32.lds \
-                                        $(obj)/vdso32/note.o \
-                                        $(obj)/vdso32/%.o
+$(vdso32-images:%=$(obj)/%.dbg): $(obj)/vdso32-%.so.dbg: FORCE \
+                                $(obj)/vdso32/vdso32.lds \
+                                $(obj)/vdso32/note.o \
+                                $(obj)/vdso32/%.o
        $(call if_changed,vdso)
 
 # Make vdso32-*-syms.lds from each image, and then make sure they match.
index 36b84ab418dd2448824c5c958043621760e0cdb0..457ed3d3f51cd3bcd7841eadc694e60c17404b30 100644 (file)
@@ -673,11 +673,11 @@ static int __init acpi_wmi_init(void)
 {
        acpi_status result;
 
+       INIT_LIST_HEAD(&wmi_blocks.list);
+
        if (acpi_disabled)
                return -ENODEV;
 
-       INIT_LIST_HEAD(&wmi_blocks.list);
-
        result = acpi_bus_register_driver(&acpi_wmi_driver);
 
        if (result < 0) {
index 3011919f3ec88f0860d39445d596d5f454f604d6..004dae4ea5bc63afaa255698bdf6528bba356235 100644 (file)
@@ -3048,6 +3048,8 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel)
 static int ata_dev_set_mode(struct ata_device *dev)
 {
        struct ata_eh_context *ehc = &dev->link->eh_context;
+       const char *dev_err_whine = "";
+       int ign_dev_err = 0;
        unsigned int err_mask;
        int rc;
 
@@ -3057,41 +3059,57 @@ static int ata_dev_set_mode(struct ata_device *dev)
 
        err_mask = ata_dev_set_xfermode(dev);
 
+       if (err_mask & ~AC_ERR_DEV)
+               goto fail;
+
+       /* revalidate */
+       ehc->i.flags |= ATA_EHI_POST_SETMODE;
+       rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0);
+       ehc->i.flags &= ~ATA_EHI_POST_SETMODE;
+       if (rc)
+               return rc;
+
        /* Old CFA may refuse this command, which is just fine */
        if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id))
-               err_mask &= ~AC_ERR_DEV;
+               ign_dev_err = 1;
 
        /* Some very old devices and some bad newer ones fail any kind of
           SET_XFERMODE request but support PIO0-2 timings and no IORDY */
        if (dev->xfer_shift == ATA_SHIFT_PIO && !ata_id_has_iordy(dev->id) &&
                        dev->pio_mode <= XFER_PIO_2)
-               err_mask &= ~AC_ERR_DEV;
+               ign_dev_err = 1;
 
        /* Early MWDMA devices do DMA but don't allow DMA mode setting.
           Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */
        if (dev->xfer_shift == ATA_SHIFT_MWDMA &&
            dev->dma_mode == XFER_MW_DMA_0 &&
            (dev->id[63] >> 8) & 1)
-               err_mask &= ~AC_ERR_DEV;
+               ign_dev_err = 1;
 
-       if (err_mask) {
-               ata_dev_printk(dev, KERN_ERR, "failed to set xfermode "
-                              "(err_mask=0x%x)\n", err_mask);
-               return -EIO;
-       }
+       /* if the device is actually configured correctly, ignore dev err */
+       if (dev->xfer_mode == ata_xfer_mask2mode(ata_id_xfermask(dev->id)))
+               ign_dev_err = 1;
 
-       ehc->i.flags |= ATA_EHI_POST_SETMODE;
-       rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0);
-       ehc->i.flags &= ~ATA_EHI_POST_SETMODE;
-       if (rc)
-               return rc;
+       if (err_mask & AC_ERR_DEV) {
+               if (!ign_dev_err)
+                       goto fail;
+               else
+                       dev_err_whine = " (device error ignored)";
+       }
 
        DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
                dev->xfer_shift, (int)dev->xfer_mode);
 
-       ata_dev_printk(dev, KERN_INFO, "configured for %s\n",
-                      ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)));
+       ata_dev_printk(dev, KERN_INFO, "configured for %s%s\n",
+                      ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
+                      dev_err_whine);
+
        return 0;
+
+ fail:
+       ata_dev_printk(dev, KERN_ERR, "failed to set xfermode "
+                      "(err_mask=0x%x)\n", err_mask);
+       return -EIO;
 }
 
 /**
index 761a66608d7bd9ce7478a7daf4db6e02f8bd3e7a..ea567e2b1703ffc4b79e09e47bce5c68082f535e 100644 (file)
@@ -772,7 +772,7 @@ static void __exit amd_exit(void)
 }
 
 MODULE_AUTHOR("Alan Cox");
-MODULE_DESCRIPTION("low-level driver for AMD PATA IDE");
+MODULE_DESCRIPTION("low-level driver for AMD and Nvidia PATA IDE");
 MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, amd);
 MODULE_VERSION(DRV_VERSION);
index 333dc15f8ccf2d69d574a097448a079d44294200..6c59969fd50ba1f69b185295a52d43cd7af4ecef 100644 (file)
@@ -127,7 +127,7 @@ static int opti82c611a;             /* Opti82c611A on primary 1, sec 2, both 3 */
 static int opti82c46x;         /* Opti 82c465MV present(pri/sec autodetect) */
 static int qdi;                        /* Set to probe QDI controllers */
 static int winbond;            /* Set to probe Winbond controllers,
-                                       give I/O port if non stdanard */
+                                       give I/O port if non standard */
 static int autospeed;          /* Chip present which snoops speed changes */
 static int pio_mask = 0x1F;    /* PIO range for autospeed devices */
 static int iordy_mask = 0xFFFFFFFF;    /* Use iordy if available */
index 1c1b83541d13f86a1ec28898d525be6bd2db6795..15dd649f89eed472c22fa838fbb259c95b4af503 100644 (file)
@@ -17,6 +17,7 @@
  *     Base + 0x00 IRQ Status
  *     Base + 0x01 IRQ control
  *     Base + 0x02 Chipset control
+ *     Base + 0x03 Unknown
  *     Base + 0x04 VDMA and reset control + wait bits
  *     Base + 0x08 BMIMBA
  *     Base + 0x0C DMA Length
@@ -174,8 +175,12 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        ata_std_ports(&ap->ioaddr);
 
        iowrite8(0x05, base + 0x01);    /* Enable interrupt lines */
-       iowrite8(0xB3, base + 0x02);    /* Burst, ?? setup */
-       iowrite8(0x00, base + 0x04);    /* WAIT0 ? */
+       iowrite8(0xBE, base + 0x02);    /* Burst, ?? setup */
+       iowrite8(0x01, base + 0x03);    /* Unknown */
+       iowrite8(0x20, base + 0x04);    /* WAIT0 */
+       iowrite8(0x8f, base + 0x05);    /* Unknown */
+       iowrite8(0xa4, base + 0x1c);    /* Unknown */
+       iowrite8(0x83, base + 0x1d);    /* BMDMA control: WAIT0 */
        /* FIXME: Should we disable them at remove ? */
        return ata_host_activate(host, dev->irq, ata_interrupt,
                                 IRQF_SHARED, &ninja32_sht);
index 39627ab684bf9dc8d2bf55ff94443b834bcf863e..d119a68c388fef2cdf87bbf8c024b9d3c1887f49 100644 (file)
@@ -84,6 +84,7 @@ enum {
        VIA_BAD_ID      = 0x100, /* Has wrong vendor ID (0x1107) */
        VIA_BAD_AST     = 0x200, /* Don't touch Address Setup Timing */
        VIA_NO_ENABLES  = 0x400, /* Has no enablebits */
+       VIA_SATA_PATA   = 0x800, /* SATA/PATA combined configuration */
 };
 
 /*
@@ -100,7 +101,7 @@ static const struct via_isa_bridge {
        { "vx800",      PCI_DEVICE_ID_VIA_VX800,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt8237s",    PCI_DEVICE_ID_VIA_8237S,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt8251",     PCI_DEVICE_ID_VIA_8251,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
-       { "cx700",      PCI_DEVICE_ID_VIA_CX700,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
+       { "cx700",      PCI_DEVICE_ID_VIA_CX700,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA },
        { "vt6410",     PCI_DEVICE_ID_VIA_6410,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES},
        { "vt8237a",    PCI_DEVICE_ID_VIA_8237A,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt8237",     PCI_DEVICE_ID_VIA_8237,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -172,6 +173,9 @@ static int via_cable_detect(struct ata_port *ap) {
        if (via_cable_override(pdev))
                return ATA_CBL_PATA40_SHORT;
 
+       if ((config->flags & VIA_SATA_PATA) && ap->port_no == 0)
+               return ATA_CBL_SATA;
+
        /* Early chips are 40 wire */
        if ((config->flags & VIA_UDMA) < VIA_UDMA_66)
                return ATA_CBL_PATA40;
index 080b8362f8d63a033a66f7119c5be35f40d4f6de..04b571764aff4f82499386234431fbf188b73b81 100644 (file)
@@ -1716,14 +1716,16 @@ static void mv_host_intr(struct ata_host *host, u32 relevant, unsigned int hc)
        VPRINTK("ENTER, hc%u relevant=0x%08x HC IRQ cause=0x%08x\n",
                hc, relevant, hc_irq_cause);
 
-       for (port = port0; port < port0 + last_port; port++) {
+       for (port = port0; port < last_port; port++) {
                struct ata_port *ap = host->ports[port];
-               struct mv_port_priv *pp = ap->private_data;
+               struct mv_port_priv *pp;
                int have_err_bits, hard_port, shift;
 
                if ((!ap) || (ap->flags & ATA_FLAG_DISABLED))
                        continue;
 
+               pp = ap->private_data;
+
                shift = port << 1;              /* (port * 2) */
                if (port >= MV_PORTS_PER_HC) {
                        shift++;        /* skip bit 8 in the HC Main IRQ reg */
@@ -2879,6 +2881,26 @@ done:
        return rc;
 }
 
+static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
+{
+       hpriv->crqb_pool   = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
+                                                            MV_CRQB_Q_SZ, 0);
+       if (!hpriv->crqb_pool)
+               return -ENOMEM;
+
+       hpriv->crpb_pool   = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
+                                                            MV_CRPB_Q_SZ, 0);
+       if (!hpriv->crpb_pool)
+               return -ENOMEM;
+
+       hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
+                                                            MV_SG_TBL_SZ, 0);
+       if (!hpriv->sg_tbl_pool)
+               return -ENOMEM;
+
+       return 0;
+}
+
 /**
  *      mv_platform_probe - handle a positive probe of an soc Marvell
  *      host
@@ -2932,6 +2954,10 @@ static int mv_platform_probe(struct platform_device *pdev)
        hpriv->base = ioremap(res->start, res->end - res->start + 1);
        hpriv->base -= MV_SATAHC0_REG_BASE;
 
+       rc = mv_create_dma_pools(hpriv, &pdev->dev);
+       if (rc)
+               return rc;
+
        /* initialize adapter */
        rc = mv_init_host(host, chip_soc);
        if (rc)
@@ -3068,26 +3094,6 @@ static void mv_print_info(struct ata_host *host)
               scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx");
 }
 
-static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
-{
-       hpriv->crqb_pool   = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
-                                                            MV_CRQB_Q_SZ, 0);
-       if (!hpriv->crqb_pool)
-               return -ENOMEM;
-
-       hpriv->crpb_pool   = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
-                                                            MV_CRPB_Q_SZ, 0);
-       if (!hpriv->crpb_pool)
-               return -ENOMEM;
-
-       hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
-                                                            MV_SG_TBL_SZ, 0);
-       if (!hpriv->sg_tbl_pool)
-               return -ENOMEM;
-
-       return 0;
-}
-
 /**
  *      mv_pci_init_one - handle a positive probe of a PCI Marvell host
  *      @pdev: PCI device found
index e68821d074b0ad90a24f1e686f1b5da9875e808a..7e31d5f1bc8aa41444821da3b6c4d34b82fe96b8 100644 (file)
@@ -208,6 +208,7 @@ static int hci_uart_close(struct hci_dev *hdev)
                return 0;
 
        hci_uart_flush(hdev);
+       hdev->flush = NULL;
        return 0;
 }
 
index 043c34ad0a05fee2659972d8e66ba41dcf9277b0..df752e690e4739f595dee6dde3c103db522da5fa 100644 (file)
@@ -378,6 +378,9 @@ config BLK_DEV_IDEPNP
          would like the kernel to automatically detect and activate
          it, say Y here.
 
+config BLK_DEV_IDEDMA_SFF
+       bool
+
 if PCI
 
 comment "PCI IDE chipsets support"
@@ -459,6 +462,7 @@ config BLK_DEV_RZ1000
 config BLK_DEV_IDEDMA_PCI
        bool
        select BLK_DEV_IDEPCI
+       select BLK_DEV_IDEDMA_SFF
 
 config BLK_DEV_AEC62XX
        tristate "AEC62XX chipset support"
@@ -688,23 +692,6 @@ config BLK_DEV_PDC202XX_OLD
 
          If unsure, say N.
 
-config PDC202XX_BURST
-       bool "Special UDMA Feature"
-       depends on BLK_DEV_PDC202XX_OLD
-       help
-         This option causes the pdc202xx driver to enable UDMA modes on the
-         PDC202xx even when the PDC202xx BIOS has not done so.
-
-         It was originally designed for the PDC20246/Ultra33, whose BIOS will
-         only setup UDMA on the first two PDC20246 cards.  It has also been
-         used successfully on a PDC20265/Ultra100, allowing use of UDMA modes
-         when the PDC20265 BIOS has been disabled (for faster boot up).
-
-         Please read the comments at the top of
-         <file:drivers/ide/pci/pdc202xx_old.c>.
-
-         If unsure, say N.
-
 config BLK_DEV_PDC202XX_NEW
        tristate "PROMISE PDC202{68|69|70|71|75|76|77} support"
        select BLK_DEV_IDEDMA_PCI
@@ -1016,7 +1003,7 @@ config BLK_DEV_Q40IDE
 config BLK_DEV_PALMCHIP_BK3710
        tristate "Palmchip bk3710 IDE controller support"
        depends on ARCH_DAVINCI
-       select BLK_DEV_IDEDMA_PCI
+       select BLK_DEV_IDEDMA_SFF
        help
          Say Y here if you want to support the onchip IDE controller on the
          TI DaVinci SoC
@@ -1124,7 +1111,8 @@ config BLK_DEV_UMC8672
 endif
 
 config BLK_DEV_IDEDMA
-       def_bool BLK_DEV_IDEDMA_PCI || BLK_DEV_IDEDMA_PMAC || BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
+       def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \
+                BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
 
 config IDE_ARCH_OBSOLETE_INIT
        def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC
index 0e7574c0ee60bcbfa48c75ef8f3843b71c44bac5..161d30c8481e8fe79bf135d97aa77c42d6be43f4 100644 (file)
 #include <asm/arch/bast-map.h>
 #include <asm/arch/bast-irq.h>
 
-/* list of registered interfaces */
-static ide_hwif_t *ifs[2];
-
-static int __init
-bastide_register(unsigned int base, unsigned int aux, int irq,
-                ide_hwif_t **hwif)
+static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
 {
        ide_hwif_t *hwif;
        hw_regs_t hw;
@@ -76,8 +71,9 @@ static int __init bastide_init(void)
 
        printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n");
 
-       bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0, &ifs[0]);
-       bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1, &ifs[1]);
+       bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0);
+       bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1);
+
        return 0;
 }
 
index c3069970a0128860693bf64864a7224640f98b4d..8e1f6bd338872c0fe08a985e81e75019c3f26983 100644 (file)
@@ -311,15 +311,37 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base)
        palm_bk3710_setpiomode(base, NULL, 0, 600, 0);
        palm_bk3710_setpiomode(base, NULL, 1, 600, 0);
 }
+
+static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
+{
+       return ATA_CBL_PATA80;
+}
+
+static void __devinit palm_bk3710_init_hwif(ide_hwif_t *hwif)
+{
+       hwif->set_pio_mode = palm_bk3710_set_pio_mode;
+       hwif->set_dma_mode = palm_bk3710_set_dma_mode;
+
+       hwif->cable_detect = palm_bk3710_cable_detect;
+}
+
+static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
+       .init_hwif              = palm_bk3710_init_hwif,
+       .host_flags             = IDE_HFLAG_NO_DMA, /* hack (no PCI) */
+       .pio_mask               = ATA_PIO4,
+       .udma_mask              = ATA_UDMA4,    /* (input clk 99MHz) */
+       .mwdma_mask             = ATA_MWDMA2,
+};
+
 static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 {
-       hw_regs_t ide_ctlr_info;
-       int index = 0;
-       int pribase;
        struct clk *clkp;
        struct resource *mem, *irq;
        ide_hwif_t *hwif;
        void __iomem *base;
+       int pribase, i;
+       hw_regs_t hw;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        clkp = clk_get(NULL, "IDECLK");
        if (IS_ERR(clkp))
@@ -330,7 +352,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
        ide_palm_clk = clk_get_rate(ideclkp)/100000;
        ide_palm_clk = (10000/ide_palm_clk) + 1;
        /* Register the IDE interface with Linux ATA Interface */
-       memset(&ide_ctlr_info, 0, sizeof(ide_ctlr_info));
+       memset(&hw, 0, sizeof(hw));
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (mem == NULL) {
@@ -349,32 +371,42 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
        palm_bk3710_chipinit(base);
 
        pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET;
-       for (index = 0; index < IDE_NR_PORTS - 2; index++)
-               ide_ctlr_info.io_ports[index] = pribase + index;
-       ide_ctlr_info.io_ports[IDE_CONTROL_OFFSET] = mem->start +
+       for (i = 0; i < IDE_NR_PORTS - 2; i++)
+               hw.io_ports[i] = pribase + i;
+       hw.io_ports[IDE_CONTROL_OFFSET] = mem->start +
                        IDE_PALM_ATA_PRI_CTL_OFFSET;
-       ide_ctlr_info.irq = irq->start;
-       ide_ctlr_info.chipset = ide_palm3710;
+       hw.irq = irq->start;
+       hw.chipset = ide_palm3710;
 
-       if (ide_register_hw(&ide_ctlr_info, NULL, &hwif) < 0) {
-               printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
-               return -ENODEV;
-       }
+       hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       if (hwif == NULL)
+               goto out;
+
+       i = hwif->index;
+
+       if (hwif->present)
+               ide_unregister(i, 0, 0);
+       else if (!hwif->hold)
+               ide_init_port_data(hwif, i);
+
+       ide_init_port_hw(hwif, &hw);
 
-       hwif->set_pio_mode = &palm_bk3710_set_pio_mode;
-       hwif->set_dma_mode = &palm_bk3710_set_dma_mode;
        hwif->mmio = 1;
        default_hwif_mmiops(hwif);
-       hwif->cbl = ATA_CBL_PATA80;
-       hwif->ultra_mask = 0x1f;        /* Ultra DMA Mode 4 Max
-                                               (input clk 99MHz) */
-       hwif->mwdma_mask = 0x7;
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
 
        ide_setup_dma(hwif, mem->start);
 
+       idx[0] = i;
+
+       ide_device_add(idx, &palm_bk3710_port_info);
+
+       if (!hwif->present)
+               goto out;
+
        return 0;
+out:
+       printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
+       return -ENODEV;
 }
 
 static struct platform_driver platform_bk_driver = {
index 5e42c19a03e3b7f9e2eec932a929660cb513730d..354c91d06a6d26d6af5f5c0fd5bb38d178d82a2f 100644 (file)
@@ -1555,7 +1555,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
        if (stat)
                return stat;
 
-       toc->hdr.toc_length = ntohs (toc->hdr.toc_length);
+       toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length);
 
        if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) {
                toc->hdr.first_track = BCD2BIN(toc->hdr.first_track);
index 3c69822507e2a59216e8d2690362c961a940579b..aed8b31ca561512bf1f048175a2c88d14102f11a 100644 (file)
@@ -590,20 +590,24 @@ static ide_proc_entry_t idedisk_proc[] = {
 static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
 {
        ide_drive_t *drive = q->queuedata;
-       ide_task_t task;
+       ide_task_t *task = kmalloc(sizeof(*task), GFP_ATOMIC);
 
-       memset(&task, 0, sizeof(task));
+       /* FIXME: map struct ide_taskfile on rq->cmd[] */
+       BUG_ON(task == NULL);
+
+       memset(task, 0, sizeof(*task));
        if (ide_id_has_flush_cache_ext(drive->id) &&
            (drive->capacity64 >= (1UL << 28)))
-               task.tf.command = WIN_FLUSH_CACHE_EXT;
+               task->tf.command = WIN_FLUSH_CACHE_EXT;
        else
-               task.tf.command = WIN_FLUSH_CACHE;
-       task.tf_flags   = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
-       task.data_phase = TASKFILE_NO_DATA;
+               task->tf.command = WIN_FLUSH_CACHE;
+       task->tf_flags   = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE |
+                          IDE_TFLAG_DYN;
+       task->data_phase = TASKFILE_NO_DATA;
 
        rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
        rq->cmd_flags |= REQ_SOFTBARRIER;
-       rq->special = &task;
+       rq->special = task;
 }
 
 /*
index a4bb32883c6bfb23d04c19f60e2b714da9a92744..d0e7b537353e38ea1bb23ff6f0604f0d93777752 100644 (file)
@@ -198,7 +198,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
 
 EXPORT_SYMBOL_GPL(ide_build_sglist);
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 /**
  *     ide_build_dmatable      -       build IDE DMA table
  *
@@ -316,7 +316,7 @@ void ide_destroy_dmatable (ide_drive_t *drive)
 
 EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 /**
  *     config_drive_for_dma    -       attempt to activate IDE DMA
  *     @drive: the drive to place in DMA mode
@@ -424,7 +424,7 @@ void ide_dma_host_set(ide_drive_t *drive, int on)
 }
 
 EXPORT_SYMBOL_GPL(ide_dma_host_set);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF  */
 
 /**
  *     ide_dma_off_quietly     -       Generic DMA kill
@@ -474,7 +474,7 @@ void ide_dma_on(ide_drive_t *drive)
        drive->hwif->dma_host_set(drive, 1);
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 /**
  *     ide_dma_setup   -       begin a DMA phase
  *     @drive: target device
@@ -591,7 +591,7 @@ static int __ide_dma_test_irq(ide_drive_t *drive)
 }
 #else
 static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
 
 int __ide_dma_bad_drive (ide_drive_t *drive)
 {
@@ -840,7 +840,7 @@ void ide_check_dma_crc(ide_drive_t *drive)
                ide_dma_on(drive);
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 void ide_dma_lost_irq (ide_drive_t *drive)
 {
        printk("%s: DMA interrupt recovery\n", drive->name);
@@ -1002,4 +1002,4 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base)
 }
 
 EXPORT_SYMBOL_GPL(ide_setup_dma);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
index 3addbe478d26743701ba669c4ae6acf5b2050725..715379605a7bb55f887eb887832c4765eccab485 100644 (file)
@@ -361,17 +361,21 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
        spin_unlock_irqrestore(&ide_lock, flags);
 
        if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
-               ide_task_t *args = (ide_task_t *) rq->special;
+               ide_task_t *task = (ide_task_t *)rq->special;
+
                if (rq->errors == 0)
-                       rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
-                       
-               if (args) {
-                       struct ide_taskfile *tf = &args->tf;
+                       rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT);
+
+               if (task) {
+                       struct ide_taskfile *tf = &task->tf;
 
                        tf->error = err;
                        tf->status = stat;
 
-                       ide_tf_read(drive, args);
+                       ide_tf_read(drive, task);
+
+                       if (task->tf_flags & IDE_TFLAG_DYN)
+                               kfree(task);
                }
        } else if (blk_pm_request(rq)) {
                struct request_pm_state *pm = rq->data;
@@ -388,7 +392,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
        spin_lock_irqsave(&ide_lock, flags);
        HWGROUP(drive)->rq = NULL;
        rq->errors = err;
-       if (__blk_end_request(rq, (rq->errors ? -EIO : 0), 0))
+       if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0),
+                                      blk_rq_bytes(rq))))
                BUG();
        spin_unlock_irqrestore(&ide_lock, flags);
 }
index c32e759df2089a5229f211154f0642da5e6e3fed..c419266234a75276a1ed85e00314d6b182b12b70 100644 (file)
@@ -786,15 +786,11 @@ static void __ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
 {
        ide_hwgroup_t *hwgroup = HWGROUP(drive);
 
-       if (hwgroup->handler != NULL) {
-               printk(KERN_CRIT "%s: ide_set_handler: handler not null; "
-                       "old=%p, new=%p\n",
-                       drive->name, hwgroup->handler, handler);
-       }
+       BUG_ON(hwgroup->handler);
        hwgroup->handler        = handler;
        hwgroup->expiry         = expiry;
        hwgroup->timer.expires  = jiffies + timeout;
-       hwgroup->req_gen_timer = hwgroup->req_gen;
+       hwgroup->req_gen_timer  = hwgroup->req_gen;
        add_timer(&hwgroup->timer);
 }
 
@@ -827,11 +823,9 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler,
                         unsigned timeout, ide_expiry_t *expiry)
 {
        unsigned long flags;
-       ide_hwgroup_t *hwgroup = HWGROUP(drive);
        ide_hwif_t *hwif = HWIF(drive);
 
        spin_lock_irqsave(&ide_lock, flags);
-       BUG_ON(hwgroup->handler);
        __ide_set_handler(drive, handler, timeout, expiry);
        hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG);
        /*
index 1ff676cc6473f56dd9a5cc00b7f31d57c4899e4d..29e2c9719c307e4147b624dcf4b188ab1f8d484c 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
-/*
- *     IDE library routines. These are plug in code that most 
- *     drivers can use but occasionally may be weird enough
- *     to want to do their own thing with
- *
- *     Add common non I/O op stuff here. Make sure it has proper
- *     kernel-doc function headers or your patch will be rejected
- */
-
 static const char *udma_str[] =
         { "UDMA/16", "UDMA/25",  "UDMA/33",  "UDMA/44",
           "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" };
index 6daea896c5dbe34ca18095e12f8f708e73a4c7b0..4a2cb28682263d6a3c3a861490dfbe770d96c2d6 100644 (file)
@@ -1051,7 +1051,7 @@ static int init_irq (ide_hwif_t *hwif)
                int sa = 0;
 #if defined(__mc68000__)
                sa = IRQF_SHARED;
-#endif /* __mc68000__ || CONFIG_APUS */
+#endif /* __mc68000__ */
 
                if (IDE_CHIPSET_IS_PCI(hwif->chipset))
                        sa = IRQF_SHARED;
@@ -1355,7 +1355,7 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
        hwif->ultra_mask = d->udma_mask;
 
        /* reset DMA masks only for SFF-style DMA controllers */
-       if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
+       if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
                hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;
 
        if (d->host_flags & IDE_HFLAG_RQSIZE_256)
index 49dd2e7bae7a788f95f8157089f9d20c8d7e695b..0598ecfd5f3706b0402182875f324474361bbf5b 100644 (file)
@@ -466,9 +466,6 @@ static void ide_tape_put(struct ide_tape_obj *tape)
 /* 0 = no tape is loaded, so we don't rewind after ejecting */
 #define IDETAPE_MEDIUM_PRESENT         9
 
-/* A define for the READ BUFFER command */
-#define IDETAPE_RETRIEVE_FAULTY_BLOCK  6
-
 /* Some defines for the SPACE command */
 #define IDETAPE_SPACE_OVER_FILEMARK    1
 #define IDETAPE_SPACE_TO_EOD           3
@@ -490,7 +487,6 @@ enum {
        REQ_IDETAPE_PC2         = (1 << 1), /* packet command (second stage) */
        REQ_IDETAPE_READ        = (1 << 2),
        REQ_IDETAPE_WRITE       = (1 << 3),
-       REQ_IDETAPE_READ_BUFFER = (1 << 4),
 };
 
 /* Error codes returned in rq->errors to the higher part of the driver. */
@@ -1523,29 +1519,6 @@ static void idetape_create_read_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
                set_bit(PC_DMA_RECOMMENDED, &pc->flags);
 }
 
-static void idetape_create_read_buffer_cmd(idetape_tape_t *tape,
-               idetape_pc_t *pc, struct idetape_bh *bh)
-{
-       int size = 32768;
-       struct idetape_bh *p = bh;
-
-       idetape_init_pc(pc);
-       pc->c[0] = READ_BUFFER;
-       pc->c[1] = IDETAPE_RETRIEVE_FAULTY_BLOCK;
-       pc->c[7] = size >> 8;
-       pc->c[8] = size & 0xff;
-       pc->callback = &idetape_pc_callback;
-       pc->bh = bh;
-       atomic_set(&bh->b_count, 0);
-       pc->buffer = NULL;
-       while (p) {
-               atomic_set(&p->b_count, 0);
-               p = p->b_reqnext;
-       }
-       pc->request_transfer = size;
-       pc->buffer_size = size;
-}
-
 static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
                unsigned int length, struct idetape_bh *bh)
 {
@@ -1655,13 +1628,6 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
                                         (struct idetape_bh *)rq->special);
                goto out;
        }
-       if (rq->cmd[0] & REQ_IDETAPE_READ_BUFFER) {
-               tape->postpone_cnt = 0;
-               pc = idetape_next_pc_storage(drive);
-               idetape_create_read_buffer_cmd(tape, pc,
-                               (struct idetape_bh *)rq->special);
-               goto out;
-       }
        if (rq->cmd[0] & REQ_IDETAPE_PC1) {
                pc = (idetape_pc_t *) rq->buffer;
                rq->cmd[0] &= ~(REQ_IDETAPE_PC1);
index ad0e9955f73c9ce38de7485b487bb778b9542e87..4a8952a6c3daa2433c8cc7c876c5d4b55388daf1 100644 (file)
@@ -44,8 +44,6 @@
  *  inspiration from lots of linux users, esp.  hamish@zot.apana.org.au
  */
 
-#define        REVISION        "Revision: 7.00alpha2"
-
 #define _IDE_C                 /* Tell ide.h it's really us */
 
 #include <linux/module.h>
@@ -1618,7 +1616,7 @@ static int __init ide_init(void)
 {
        int ret;
 
-       printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
+       printk(KERN_INFO "Uniform Multi-Platform E-IDE driver\n");
        system_bus_speed = ide_system_bus_speed();
 
        printk(KERN_INFO "ide: Assuming %dMHz system bus speed "
index 9d3851d27677785ff331fc8908cd93e9e5da81ed..b7d81090d5da50e21b221ed4b1fb20a242942c33 100644 (file)
@@ -94,7 +94,7 @@ static int gayle_ack_intr_a1200(ide_hwif_t *hwif)
 
 static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
                                     unsigned long ctl, unsigned long irq_port,
-                                    ide_ack_intr_t *ack_intr);
+                                    ide_ack_intr_t *ack_intr)
 {
        int i;
 
index 0be1a824102b90494f33410e3a199e8f5a432187..1c163e4ef03f1d7b5972d13b65a343ebd8ddba2d 100644 (file)
@@ -147,11 +147,6 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
 
        /* We must not grab the entire device, it has 'ISA' space in its
         * BARS too and we will freak out other bits of the kernel
-        *
-        * pci_enable_device_bars() is going away. I replaced it with
-        * IO only enable for now but I'll need confirmation this is
-        * allright for that device. If not, it will need some kind of
-        * quirk. --BenH.
         */
        if (pci_enable_device_io(dev)) {
                printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name);
index da4329790387c6019ceaf7b24d7394840b25fb1d..150422ec3cfabc6685d8f6a8bf5b82804cf969b4 100644 (file)
@@ -3,26 +3,6 @@
  *  Copyright (C) 2006-2007            MontaVista Software, Inc.
  *  Copyright (C) 2007                 Bartlomiej Zolnierkiewicz
  *
- *  Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
- *  compiled into the kernel if you have more than one card installed.
- *  Note that BIOS v1.29 is reported to fix the problem.  Since this is
- *  safe chipset tuning, including this support is harmless
- *
- *  Promise Ultra66 cards with BIOS v1.11 this
- *  compiled into the kernel if you have more than one card installed.
- *
- *  Promise Ultra100 cards.
- *
- *  The latest chipset code will support the following ::
- *  Three Ultra33 controllers and 12 drives.
- *  8 are UDMA supported and 4 are limited to DMA mode 2 multi-word.
- *  The 8/4 ratio is a BIOS code limit by promise.
- *
- *  UNLESS you enable "CONFIG_PDC202XX_BURST"
- *
- */
-
-/*
  *  Portions Copyright (C) 1999 Promise Technology, Inc.
  *  Author: Frank Tiernan (frankt@promise.com)
  *  Released under terms of General Public License
@@ -344,7 +324,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
                (primary_mode & 1) ? "MASTER" : "PCI",
                (secondary_mode & 1) ? "MASTER" : "PCI" );
 
-#ifdef CONFIG_PDC202XX_BURST
        if (!(udma_speed_flag & 1)) {
                printk(KERN_INFO "%s: FORCING BURST BIT 0x%02x->0x%02x ",
                        hwif->cds->name, udma_speed_flag,
@@ -352,7 +331,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
                outb(udma_speed_flag | 1, dmabase | 0x1f);
                printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN");
        }
-#endif /* CONFIG_PDC202XX_BURST */
 
        ide_setup_dma(hwif, dmabase);
 }
index 521dc0322ee4ff329b07ed469e3923d402585d6e..75ef9d0d974dc165e8b5630c28a0affc017a6969 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/bitmap.h>
 #include <linux/dma-mapping.h>
+#include <linux/vmalloc.h>
 
 #include "mlx4.h"
 
index 31e047dd7bb349d7e38d394c02e6a041f6ee29df..501e451be9110eb458e144ab12acc982101fd3b3 100644 (file)
@@ -309,8 +309,8 @@ static ssize_t show_local_mac(struct netconsole_target *nt, char *buf)
        struct net_device *dev = nt->np.dev;
 
        DECLARE_MAC_BUF(mac);
-       return snprintf(buf, PAGE_SIZE, "%s\n",
-                       print_mac(mac, dev->dev_addr));
+       return snprintf(buf, PAGE_SIZE, "%s\n", dev ?
+                       print_mac(mac, dev->dev_addr) : "ff:ff:ff:ff:ff:ff");
 }
 
 static ssize_t show_remote_mac(struct netconsole_target *nt, char *buf)
index ddc87149fe31d098730a27eee9b7df871f5d18f9..dfdaec020739c5ec6bfae806a18b41a7a2c61aa2 100644 (file)
@@ -1256,7 +1256,7 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
        if (ctl->flags & IEEE80211_TXCTL_NO_ACK)
                flags |= AR5K_TXDESC_NOACK;
 
-       pktlen = skb->len + FCS_LEN;
+       pktlen = skb->len;
 
        if (!(ctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) {
                keyidx = ctl->key_idx;
@@ -1952,7 +1952,7 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
        }
 
        ds->ds_data = bf->skbaddr;
-       ret = ah->ah_setup_tx_desc(ah, ds, skb->len + FCS_LEN,
+       ret = ah->ah_setup_tx_desc(ah, ds, skb->len,
                        ieee80211_get_hdrlen_from_skb(skb),
                        AR5K_PKT_TYPE_BEACON, (ctl->power_level * 2), ctl->tx_rate, 1,
                        AR5K_TXKEYIX_INVALID, antenna, flags, 0, 0);
index 3a4bf4035a2337eb7bc0d33ea52de1db00c50e8e..1ab57aa6e4dcf3bd1f8ded6937af544a4bfe5cc3 100644 (file)
@@ -3506,7 +3506,7 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
 {
        u32 frame_type;
        struct ath5k_hw_2w_tx_desc *tx_desc;
-       unsigned int buff_len;
+       unsigned int frame_len;
 
        tx_desc = (struct ath5k_hw_2w_tx_desc *)&desc->ds_ctl0;
 
@@ -3537,22 +3537,25 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
        /* Setup control descriptor */
 
        /* Verify and set frame length */
-       if (pkt_len & ~AR5K_2W_TX_DESC_CTL0_FRAME_LEN)
+
+       /* remove padding we might have added before */
+       frame_len = pkt_len - (hdr_len & 3) + FCS_LEN;
+
+       if (frame_len & ~AR5K_2W_TX_DESC_CTL0_FRAME_LEN)
                return -EINVAL;
 
-       tx_desc->tx_control_0 = pkt_len & AR5K_2W_TX_DESC_CTL0_FRAME_LEN;
+       tx_desc->tx_control_0 = frame_len & AR5K_2W_TX_DESC_CTL0_FRAME_LEN;
 
        /* Verify and set buffer length */
-       buff_len = pkt_len - FCS_LEN;
 
        /* NB: beacon's BufLen must be a multiple of 4 bytes */
        if(type == AR5K_PKT_TYPE_BEACON)
-               buff_len = roundup(buff_len, 4);
+               pkt_len = roundup(pkt_len, 4);
 
-       if (buff_len & ~AR5K_2W_TX_DESC_CTL1_BUF_LEN)
+       if (pkt_len & ~AR5K_2W_TX_DESC_CTL1_BUF_LEN)
                return -EINVAL;
 
-       tx_desc->tx_control_1 = buff_len & AR5K_2W_TX_DESC_CTL1_BUF_LEN;
+       tx_desc->tx_control_1 = pkt_len & AR5K_2W_TX_DESC_CTL1_BUF_LEN;
 
        /*
         * Verify and set header length
@@ -3634,7 +3637,7 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah,
 {
        struct ath5k_hw_4w_tx_desc *tx_desc;
        struct ath5k_hw_tx_status *tx_status;
-       unsigned int buff_len;
+       unsigned int frame_len;
 
        ATH5K_TRACE(ah->ah_sc);
        tx_desc = (struct ath5k_hw_4w_tx_desc *)&desc->ds_ctl0;
@@ -3669,22 +3672,25 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah,
        /* Setup control descriptor */
 
        /* Verify and set frame length */
-       if (pkt_len & ~AR5K_4W_TX_DESC_CTL0_FRAME_LEN)
+
+       /* remove padding we might have added before */
+       frame_len = pkt_len - (hdr_len & 3) + FCS_LEN;
+
+       if (frame_len & ~AR5K_4W_TX_DESC_CTL0_FRAME_LEN)
                return -EINVAL;
 
-       tx_desc->tx_control_0 = pkt_len & AR5K_4W_TX_DESC_CTL0_FRAME_LEN;
+       tx_desc->tx_control_0 = frame_len & AR5K_4W_TX_DESC_CTL0_FRAME_LEN;
 
        /* Verify and set buffer length */
-       buff_len = pkt_len - FCS_LEN;
 
        /* NB: beacon's BufLen must be a multiple of 4 bytes */
        if(type == AR5K_PKT_TYPE_BEACON)
-               buff_len = roundup(buff_len, 4);
+               pkt_len = roundup(pkt_len, 4);
 
-       if (buff_len & ~AR5K_4W_TX_DESC_CTL1_BUF_LEN)
+       if (pkt_len & ~AR5K_4W_TX_DESC_CTL1_BUF_LEN)
                return -EINVAL;
 
-       tx_desc->tx_control_1 = buff_len & AR5K_4W_TX_DESC_CTL1_BUF_LEN;
+       tx_desc->tx_control_1 = pkt_len & AR5K_4W_TX_DESC_CTL1_BUF_LEN;
 
        tx_desc->tx_control_0 |=
                AR5K_REG_SM(tx_power, AR5K_4W_TX_DESC_CTL0_XMIT_POWER) |
index 08a011f0834a045e8547a421654bc496bd367341..f13346ba9dd29dce907fb5b13e7771507fd7fb12 100644 (file)
 #include "lo.h"
 #include "phy.h"
 
+
+/* The unique identifier of the firmware that's officially supported by
+ * this driver version. */
+#define B43_SUPPORTED_FIRMWARE_ID      "FW13"
+
+
 #ifdef CONFIG_B43_DEBUG
 # define B43_DEBUG     1
 #else
index ef65c41af00fc022e4841baa843571f1ae107fda..51dfce16178a7ca2276f91ec551635ffc3e7205d 100644 (file)
@@ -58,6 +58,8 @@ MODULE_AUTHOR("Stefano Brivio");
 MODULE_AUTHOR("Michael Buesch");
 MODULE_LICENSE("GPL");
 
+MODULE_FIRMWARE(B43_SUPPORTED_FIRMWARE_ID);
+
 
 static int modparam_bad_frames_preempt;
 module_param_named(bad_frames_preempt, modparam_bad_frames_preempt, int, 0444);
@@ -1859,11 +1861,11 @@ static int b43_upload_microcode(struct b43_wldev *dev)
                err = -EOPNOTSUPP;
                goto error;
        }
-       b43dbg(dev->wl, "Loading firmware version %u.%u "
-              "(20%.2i-%.2i-%.2i %.2i:%.2i:%.2i)\n",
-              fwrev, fwpatch,
-              (fwdate >> 12) & 0xF, (fwdate >> 8) & 0xF, fwdate & 0xFF,
-              (fwtime >> 11) & 0x1F, (fwtime >> 5) & 0x3F, fwtime & 0x1F);
+       b43info(dev->wl, "Loading firmware version %u.%u "
+               "(20%.2i-%.2i-%.2i %.2i:%.2i:%.2i)\n",
+               fwrev, fwpatch,
+               (fwdate >> 12) & 0xF, (fwdate >> 8) & 0xF, fwdate & 0xFF,
+               (fwtime >> 11) & 0x1F, (fwtime >> 5) & 0x3F, fwtime & 0x1F);
 
        dev->fw.rev = fwrev;
        dev->fw.patch = fwpatch;
@@ -4200,6 +4202,33 @@ static struct ssb_driver b43_ssb_driver = {
        .resume         = b43_resume,
 };
 
+static void b43_print_driverinfo(void)
+{
+       const char *feat_pci = "", *feat_pcmcia = "", *feat_nphy = "",
+                  *feat_leds = "", *feat_rfkill = "";
+
+#ifdef CONFIG_B43_PCI_AUTOSELECT
+       feat_pci = "P";
+#endif
+#ifdef CONFIG_B43_PCMCIA
+       feat_pcmcia = "M";
+#endif
+#ifdef CONFIG_B43_NPHY
+       feat_nphy = "N";
+#endif
+#ifdef CONFIG_B43_LEDS
+       feat_leds = "L";
+#endif
+#ifdef CONFIG_B43_RFKILL
+       feat_rfkill = "R";
+#endif
+       printk(KERN_INFO "Broadcom 43xx driver loaded "
+              "[ Features: %s%s%s%s%s, Firmware-ID: "
+              B43_SUPPORTED_FIRMWARE_ID " ]\n",
+              feat_pci, feat_pcmcia, feat_nphy,
+              feat_leds, feat_rfkill);
+}
+
 static int __init b43_init(void)
 {
        int err;
@@ -4211,6 +4240,7 @@ static int __init b43_init(void)
        err = ssb_driver_register(&b43_ssb_driver);
        if (err)
                goto err_pcmcia_exit;
+       b43_print_driverinfo();
 
        return err;
 
index c80edd2b90444f9342fa41ab64a23e0f5d75689d..93d45b71799a74e035e18f568561979603ebbf6f 100644 (file)
 #include "phy.h"
 
 
+/* The unique identifier of the firmware that's officially supported by this
+ * driver version. */
+#define B43legacy_SUPPORTED_FIRMWARE_ID        "FW10"
+
 #define B43legacy_IRQWAIT_MAX_RETRIES  20
 
 #define B43legacy_RX_MAX_SSI           60 /* best guess at max ssi */
index 6e08405e8026cfca7e1a0f74f0418315b89c2bed..e87b427d5e43bc43253f0b7e2928dfd1b998b89a 100644 (file)
@@ -354,7 +354,8 @@ return 0;
 }
 
 
-u16 b43legacy_dmacontroller_base(int dma64bit, int controller_idx)
+static u16 b43legacy_dmacontroller_base(enum b43legacy_dmatype type,
+                                       int controller_idx)
 {
        static const u16 map64[] = {
                B43legacy_MMIO_DMA64_BASE0,
@@ -373,7 +374,7 @@ u16 b43legacy_dmacontroller_base(int dma64bit, int controller_idx)
                B43legacy_MMIO_DMA32_BASE5,
        };
 
-       if (dma64bit) {
+       if (type == B43legacy_DMA_64BIT) {
                B43legacy_WARN_ON(!(controller_idx >= 0 &&
                                  controller_idx < ARRAY_SIZE(map64)));
                return map64[controller_idx];
@@ -480,8 +481,9 @@ static void free_ringmemory(struct b43legacy_dmaring *ring)
 }
 
 /* Reset the RX DMA channel */
-int b43legacy_dmacontroller_rx_reset(struct b43legacy_wldev *dev,
-                                    u16 mmio_base, int dma64)
+static int b43legacy_dmacontroller_rx_reset(struct b43legacy_wldev *dev,
+                                           u16 mmio_base,
+                                           enum b43legacy_dmatype type)
 {
        int i;
        u32 value;
@@ -489,13 +491,14 @@ int b43legacy_dmacontroller_rx_reset(struct b43legacy_wldev *dev,
 
        might_sleep();
 
-       offset = dma64 ? B43legacy_DMA64_RXCTL : B43legacy_DMA32_RXCTL;
+       offset = (type == B43legacy_DMA_64BIT) ?
+                B43legacy_DMA64_RXCTL : B43legacy_DMA32_RXCTL;
        b43legacy_write32(dev, mmio_base + offset, 0);
        for (i = 0; i < 10; i++) {
-               offset = dma64 ? B43legacy_DMA64_RXSTATUS :
-                        B43legacy_DMA32_RXSTATUS;
+               offset = (type == B43legacy_DMA_64BIT) ?
+                        B43legacy_DMA64_RXSTATUS : B43legacy_DMA32_RXSTATUS;
                value = b43legacy_read32(dev, mmio_base + offset);
-               if (dma64) {
+               if (type == B43legacy_DMA_64BIT) {
                        value &= B43legacy_DMA64_RXSTAT;
                        if (value == B43legacy_DMA64_RXSTAT_DISABLED) {
                                i = -1;
@@ -519,8 +522,9 @@ int b43legacy_dmacontroller_rx_reset(struct b43legacy_wldev *dev,
 }
 
 /* Reset the RX DMA channel */
-int b43legacy_dmacontroller_tx_reset(struct b43legacy_wldev *dev,
-                                    u16 mmio_base, int dma64)
+static int b43legacy_dmacontroller_tx_reset(struct b43legacy_wldev *dev,
+                                           u16 mmio_base,
+                                           enum b43legacy_dmatype type)
 {
        int i;
        u32 value;
@@ -529,10 +533,10 @@ int b43legacy_dmacontroller_tx_reset(struct b43legacy_wldev *dev,
        might_sleep();
 
        for (i = 0; i < 10; i++) {
-               offset = dma64 ? B43legacy_DMA64_TXSTATUS :
-                        B43legacy_DMA32_TXSTATUS;
+               offset = (type == B43legacy_DMA_64BIT) ?
+                        B43legacy_DMA64_TXSTATUS : B43legacy_DMA32_TXSTATUS;
                value = b43legacy_read32(dev, mmio_base + offset);
-               if (dma64) {
+               if (type == B43legacy_DMA_64BIT) {
                        value &= B43legacy_DMA64_TXSTAT;
                        if (value == B43legacy_DMA64_TXSTAT_DISABLED ||
                            value == B43legacy_DMA64_TXSTAT_IDLEWAIT ||
@@ -547,13 +551,14 @@ int b43legacy_dmacontroller_tx_reset(struct b43legacy_wldev *dev,
                }
                msleep(1);
        }
-       offset = dma64 ? B43legacy_DMA64_TXCTL : B43legacy_DMA32_TXCTL;
+       offset = (type == B43legacy_DMA_64BIT) ? B43legacy_DMA64_TXCTL :
+                                                B43legacy_DMA32_TXCTL;
        b43legacy_write32(dev, mmio_base + offset, 0);
        for (i = 0; i < 10; i++) {
-               offset = dma64 ? B43legacy_DMA64_TXSTATUS :
-                        B43legacy_DMA32_TXSTATUS;
+               offset = (type == B43legacy_DMA_64BIT) ?
+                        B43legacy_DMA64_TXSTATUS : B43legacy_DMA32_TXSTATUS;
                value = b43legacy_read32(dev, mmio_base + offset);
-               if (dma64) {
+               if (type == B43legacy_DMA_64BIT) {
                        value &= B43legacy_DMA64_TXSTAT;
                        if (value == B43legacy_DMA64_TXSTAT_DISABLED) {
                                i = -1;
@@ -578,6 +583,32 @@ int b43legacy_dmacontroller_tx_reset(struct b43legacy_wldev *dev,
        return 0;
 }
 
+/* Check if a DMA mapping address is invalid. */
+static bool b43legacy_dma_mapping_error(struct b43legacy_dmaring *ring,
+                                       dma_addr_t addr,
+                                       size_t buffersize)
+{
+       if (unlikely(dma_mapping_error(addr)))
+               return 1;
+
+       switch (ring->type) {
+       case B43legacy_DMA_30BIT:
+               if ((u64)addr + buffersize > (1ULL << 30))
+                       return 1;
+               break;
+       case B43legacy_DMA_32BIT:
+               if ((u64)addr + buffersize > (1ULL << 32))
+                       return 1;
+               break;
+       case B43legacy_DMA_64BIT:
+               /* Currently we can't have addresses beyond 64 bits in the kernel. */
+               break;
+       }
+
+       /* The address is OK. */
+       return 0;
+}
+
 static int setup_rx_descbuffer(struct b43legacy_dmaring *ring,
                               struct b43legacy_dmadesc_generic *desc,
                               struct b43legacy_dmadesc_meta *meta,
@@ -595,7 +626,7 @@ static int setup_rx_descbuffer(struct b43legacy_dmaring *ring,
                return -ENOMEM;
        dmaaddr = map_descbuffer(ring, skb->data,
                                 ring->rx_buffersize, 0);
-       if (dma_mapping_error(dmaaddr)) {
+       if (b43legacy_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize)) {
                /* ugh. try to realloc in zone_dma */
                gfp_flags |= GFP_DMA;
 
@@ -608,7 +639,7 @@ static int setup_rx_descbuffer(struct b43legacy_dmaring *ring,
                                         ring->rx_buffersize, 0);
        }
 
-       if (dma_mapping_error(dmaaddr)) {
+       if (b43legacy_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize)) {
                dev_kfree_skb_any(skb);
                return -EIO;
        }
@@ -674,7 +705,7 @@ static int dmacontroller_setup(struct b43legacy_dmaring *ring)
        u32 trans = ssb_dma_translation(ring->dev->dev);
 
        if (ring->tx) {
-               if (ring->dma64) {
+               if (ring->type == B43legacy_DMA_64BIT) {
                        u64 ringbase = (u64)(ring->dmabase);
 
                        addrext = ((ringbase >> 32) & SSB_DMA_TRANSLATION_MASK)
@@ -709,7 +740,7 @@ static int dmacontroller_setup(struct b43legacy_dmaring *ring)
                err = alloc_initial_descbuffers(ring);
                if (err)
                        goto out;
-               if (ring->dma64) {
+               if (ring->type == B43legacy_DMA_64BIT) {
                        u64 ringbase = (u64)(ring->dmabase);
 
                        addrext = ((ringbase >> 32) & SSB_DMA_TRANSLATION_MASK)
@@ -760,16 +791,16 @@ static void dmacontroller_cleanup(struct b43legacy_dmaring *ring)
 {
        if (ring->tx) {
                b43legacy_dmacontroller_tx_reset(ring->dev, ring->mmio_base,
-                                                ring->dma64);
-               if (ring->dma64) {
+                                                ring->type);
+               if (ring->type == B43legacy_DMA_64BIT) {
                        b43legacy_dma_write(ring, B43legacy_DMA64_TXRINGLO, 0);
                        b43legacy_dma_write(ring, B43legacy_DMA64_TXRINGHI, 0);
                } else
                        b43legacy_dma_write(ring, B43legacy_DMA32_TXRING, 0);
        } else {
                b43legacy_dmacontroller_rx_reset(ring->dev, ring->mmio_base,
-                                                ring->dma64);
-               if (ring->dma64) {
+                                                ring->type);
+               if (ring->type == B43legacy_DMA_64BIT) {
                        b43legacy_dma_write(ring, B43legacy_DMA64_RXRINGLO, 0);
                        b43legacy_dma_write(ring, B43legacy_DMA64_RXRINGHI, 0);
                } else
@@ -824,11 +855,10 @@ static u64 supported_dma_mask(struct b43legacy_wldev *dev)
 
 /* Main initialization function. */
 static
-struct b43legacy_dmaring *b43legacy_setup_dmaring(
-                                       struct b43legacy_wldev *dev,
-                                       int controller_index,
-                                       int for_tx,
-                                       int dma64)
+struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
+                                                 int controller_index,
+                                                 int for_tx,
+                                                 enum b43legacy_dmatype type)
 {
        struct b43legacy_dmaring *ring;
        int err;
@@ -838,6 +868,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(
        ring = kzalloc(sizeof(*ring), GFP_KERNEL);
        if (!ring)
                goto out;
+       ring->type = type;
 
        nr_slots = B43legacy_RXRING_SLOTS;
        if (for_tx)
@@ -855,12 +886,12 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(
                        goto err_kfree_meta;
 
                /* test for ability to dma to txhdr_cache */
-               dma_test = dma_map_single(dev->dev->dev,
-                               ring->txhdr_cache,
-                               sizeof(struct b43legacy_txhdr_fw3),
-                               DMA_TO_DEVICE);
+               dma_test = dma_map_single(dev->dev->dev, ring->txhdr_cache,
+                                         sizeof(struct b43legacy_txhdr_fw3),
+                                         DMA_TO_DEVICE);
 
-               if (dma_mapping_error(dma_test)) {
+               if (b43legacy_dma_mapping_error(ring, dma_test,
+                                       sizeof(struct b43legacy_txhdr_fw3))) {
                        /* ugh realloc */
                        kfree(ring->txhdr_cache);
                        ring->txhdr_cache = kcalloc(nr_slots,
@@ -874,7 +905,8 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(
                                        sizeof(struct b43legacy_txhdr_fw3),
                                        DMA_TO_DEVICE);
 
-                       if (dma_mapping_error(dma_test))
+                       if (b43legacy_dma_mapping_error(ring, dma_test,
+                                       sizeof(struct b43legacy_txhdr_fw3)))
                                goto err_kfree_txhdr_cache;
                }
 
@@ -885,11 +917,9 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(
 
        ring->dev = dev;
        ring->nr_slots = nr_slots;
-       ring->mmio_base = b43legacy_dmacontroller_base(dma64,
-                                                      controller_index);
+       ring->mmio_base = b43legacy_dmacontroller_base(type, controller_index);
        ring->index = controller_index;
-       ring->dma64 = !!dma64;
-       if (dma64)
+       if (type == B43legacy_DMA_64BIT)
                ring->ops = &dma64_ops;
        else
                ring->ops = &dma32_ops;
@@ -939,10 +969,10 @@ static void b43legacy_destroy_dmaring(struct b43legacy_dmaring *ring)
        if (!ring)
                return;
 
-       b43legacydbg(ring->dev->wl, "DMA-%s 0x%04X (%s) max used slots:"
-                    " %d/%d\n", (ring->dma64) ? "64" : "32", ring->mmio_base,
-                    (ring->tx) ? "TX" : "RX",
-                    ring->max_used_slots, ring->nr_slots);
+       b43legacydbg(ring->dev->wl, "DMA-%u 0x%04X (%s) max used slots:"
+                    " %d/%d\n", (unsigned int)(ring->type), ring->mmio_base,
+                    (ring->tx) ? "TX" : "RX", ring->max_used_slots,
+                    ring->nr_slots);
        /* Device IRQs are disabled prior entering this function,
         * so no need to take care of concurrency with rx handler stuff.
         */
@@ -988,11 +1018,22 @@ int b43legacy_dma_init(struct b43legacy_wldev *dev)
        struct b43legacy_dmaring *ring;
        int err;
        u64 dmamask;
-       int dma64 = 0;
+       enum b43legacy_dmatype type;
 
        dmamask = supported_dma_mask(dev);
-       if (dmamask == DMA_64BIT_MASK)
-               dma64 = 1;
+       switch (dmamask) {
+       default:
+               B43legacy_WARN_ON(1);
+       case DMA_30BIT_MASK:
+               type = B43legacy_DMA_30BIT;
+               break;
+       case DMA_32BIT_MASK:
+               type = B43legacy_DMA_32BIT;
+               break;
+       case DMA_64BIT_MASK:
+               type = B43legacy_DMA_64BIT;
+               break;
+       }
 
        err = ssb_dma_set_mask(dev->dev, dmamask);
        if (err) {
@@ -1010,52 +1051,50 @@ int b43legacy_dma_init(struct b43legacy_wldev *dev)
 
        err = -ENOMEM;
        /* setup TX DMA channels. */
-       ring = b43legacy_setup_dmaring(dev, 0, 1, dma64);
+       ring = b43legacy_setup_dmaring(dev, 0, 1, type);
        if (!ring)
                goto out;
        dma->tx_ring0 = ring;
 
-       ring = b43legacy_setup_dmaring(dev, 1, 1, dma64);
+       ring = b43legacy_setup_dmaring(dev, 1, 1, type);
        if (!ring)
                goto err_destroy_tx0;
        dma->tx_ring1 = ring;
 
-       ring = b43legacy_setup_dmaring(dev, 2, 1, dma64);
+       ring = b43legacy_setup_dmaring(dev, 2, 1, type);
        if (!ring)
                goto err_destroy_tx1;
        dma->tx_ring2 = ring;
 
-       ring = b43legacy_setup_dmaring(dev, 3, 1, dma64);
+       ring = b43legacy_setup_dmaring(dev, 3, 1, type);
        if (!ring)
                goto err_destroy_tx2;
        dma->tx_ring3 = ring;
 
-       ring = b43legacy_setup_dmaring(dev, 4, 1, dma64);
+       ring = b43legacy_setup_dmaring(dev, 4, 1, type);
        if (!ring)
                goto err_destroy_tx3;
        dma->tx_ring4 = ring;
 
-       ring = b43legacy_setup_dmaring(dev, 5, 1, dma64);
+       ring = b43legacy_setup_dmaring(dev, 5, 1, type);
        if (!ring)
                goto err_destroy_tx4;
        dma->tx_ring5 = ring;
 
        /* setup RX DMA channels. */
-       ring = b43legacy_setup_dmaring(dev, 0, 0, dma64);
+       ring = b43legacy_setup_dmaring(dev, 0, 0, type);
        if (!ring)
                goto err_destroy_tx5;
        dma->rx_ring0 = ring;
 
        if (dev->dev->id.revision < 5) {
-               ring = b43legacy_setup_dmaring(dev, 3, 0, dma64);
+               ring = b43legacy_setup_dmaring(dev, 3, 0, type);
                if (!ring)
                        goto err_destroy_rx0;
                dma->rx_ring3 = ring;
        }
 
-       b43legacydbg(dev->wl, "%d-bit DMA initialized\n",
-              (dmamask == DMA_64BIT_MASK) ? 64 :
-              (dmamask == DMA_32BIT_MASK) ? 32 : 30);
+       b43legacydbg(dev->wl, "%u-bit DMA initialized\n", (unsigned int)type);
        err = 0;
 out:
        return err;
@@ -1194,9 +1233,13 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
        }
 
        meta_hdr->dmaaddr = map_descbuffer(ring, (unsigned char *)header,
-                                      sizeof(struct b43legacy_txhdr_fw3), 1);
-       if (dma_mapping_error(meta_hdr->dmaaddr))
+                                          sizeof(struct b43legacy_txhdr_fw3), 1);
+       if (b43legacy_dma_mapping_error(ring, meta_hdr->dmaaddr,
+                                       sizeof(struct b43legacy_txhdr_fw3))) {
+               ring->current_slot = old_top_slot;
+               ring->used_slots = old_used_slots;
                return -EIO;
+       }
        ops->fill_descriptor(ring, desc, meta_hdr->dmaaddr,
                             sizeof(struct b43legacy_txhdr_fw3), 1, 0, 0);
 
@@ -1211,7 +1254,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
 
        meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
        /* create a bounce buffer in zone_dma on mapping failure. */
-       if (dma_mapping_error(meta->dmaaddr)) {
+       if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len)) {
                bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA);
                if (!bounce_skb) {
                        ring->current_slot = old_top_slot;
@@ -1225,7 +1268,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
                skb = bounce_skb;
                meta->skb = skb;
                meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
-               if (dma_mapping_error(meta->dmaaddr)) {
+               if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len)) {
                        ring->current_slot = old_top_slot;
                        ring->used_slots = old_used_slots;
                        err = -EIO;
index 26f6ab08de75eb6bf760dd9c541c03e5b0b2aef9..2dd488c5be2da1bcf08d48f339a29ce4666755f1 100644 (file)
@@ -218,6 +218,12 @@ struct b43legacy_dma_ops {
        void (*set_current_rxslot)(struct b43legacy_dmaring *ring, int slot);
 };
 
+enum b43legacy_dmatype {
+       B43legacy_DMA_30BIT = 30,
+       B43legacy_DMA_32BIT = 32,
+       B43legacy_DMA_64BIT = 64,
+};
+
 struct b43legacy_dmaring {
        /* Lowlevel DMA ops. */
        const struct b43legacy_dma_ops *ops;
@@ -250,8 +256,8 @@ struct b43legacy_dmaring {
        int index;
        /* Boolean. Is this a TX ring? */
        bool tx;
-       /* Boolean. 64bit DMA if true, 32bit DMA otherwise. */
-       bool dma64;
+       /* The type of DMA engine used. */
+       enum b43legacy_dmatype type;
        /* Boolean. Is this ring stopped at ieee80211 level? */
        bool stopped;
        /* Lock, only used for TX. */
@@ -284,15 +290,6 @@ void b43legacy_dma_write(struct b43legacy_dmaring *ring,
 int b43legacy_dma_init(struct b43legacy_wldev *dev);
 void b43legacy_dma_free(struct b43legacy_wldev *dev);
 
-int b43legacy_dmacontroller_rx_reset(struct b43legacy_wldev *dev,
-                                    u16 dmacontroller_mmio_base,
-                                    int dma64);
-int b43legacy_dmacontroller_tx_reset(struct b43legacy_wldev *dev,
-                                    u16 dmacontroller_mmio_base,
-                                    int dma64);
-
-u16 b43legacy_dmacontroller_base(int dma64bit, int dmacontroller_idx);
-
 void b43legacy_dma_tx_suspend(struct b43legacy_wldev *dev);
 void b43legacy_dma_tx_resume(struct b43legacy_wldev *dev);
 
@@ -320,20 +317,6 @@ void b43legacy_dma_free(struct b43legacy_wldev *dev)
 {
 }
 static inline
-int b43legacy_dmacontroller_rx_reset(struct b43legacy_wldev *dev,
-                                    u16 dmacontroller_mmio_base,
-                                    int dma64)
-{
-       return 0;
-}
-static inline
-int b43legacy_dmacontroller_tx_reset(struct b43legacy_wldev *dev,
-                                    u16 dmacontroller_mmio_base,
-                                    int dma64)
-{
-       return 0;
-}
-static inline
 void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev,
                                struct ieee80211_tx_queue_stats *stats)
 {
index 53f7f2e97615d0c80b6c918474b9a9ed2684f333..c39de422e220d85939e44b3a15eed8478e9f0881 100644 (file)
@@ -3,7 +3,7 @@
  *  Broadcom B43legacy wireless driver
  *
  *  Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>
- *  Copyright (c) 2005-2007 Stefano Brivio <stefano.brivio@polimi.it>
+ *  Copyright (c) 2005-2008 Stefano Brivio <stefano.brivio@polimi.it>
  *  Copyright (c) 2005, 2006 Michael Buesch <mb@bu3sch.de>
  *  Copyright (c) 2005 Danny van Dyk <kugelfang@gentoo.org>
  *  Copyright (c) 2005 Andreas Jaggi <andreas.jaggi@waterwave.ch>
@@ -60,6 +60,8 @@ MODULE_AUTHOR("Stefano Brivio");
 MODULE_AUTHOR("Michael Buesch");
 MODULE_LICENSE("GPL");
 
+MODULE_FIRMWARE(B43legacy_SUPPORTED_FIRMWARE_ID);
+
 #if defined(CONFIG_B43LEGACY_DMA) && defined(CONFIG_B43LEGACY_PIO)
 static int modparam_pio;
 module_param_named(pio, modparam_pio, int, 0444);
@@ -1640,10 +1642,11 @@ static int b43legacy_upload_microcode(struct b43legacy_wldev *dev)
                err = -EOPNOTSUPP;
                goto error;
        }
-       b43legacydbg(dev->wl, "Loading firmware version 0x%X, patch level %u "
-              "(20%.2i-%.2i-%.2i %.2i:%.2i:%.2i)\n", fwrev, fwpatch,
-              (fwdate >> 12) & 0xF, (fwdate >> 8) & 0xF, fwdate & 0xFF,
-              (fwtime >> 11) & 0x1F, (fwtime >> 5) & 0x3F, fwtime & 0x1F);
+       b43legacyinfo(dev->wl, "Loading firmware version 0x%X, patch level %u "
+                     "(20%.2i-%.2i-%.2i %.2i:%.2i:%.2i)\n", fwrev, fwpatch,
+                     (fwdate >> 12) & 0xF, (fwdate >> 8) & 0xF, fwdate & 0xFF,
+                     (fwtime >> 11) & 0x1F, (fwtime >> 5) & 0x3F,
+                     fwtime & 0x1F);
 
        dev->fw.rev = fwrev;
        dev->fw.patch = fwpatch;
@@ -3806,6 +3809,32 @@ static struct ssb_driver b43legacy_ssb_driver = {
        .resume         = b43legacy_resume,
 };
 
+static void b43legacy_print_driverinfo(void)
+{
+       const char *feat_pci = "", *feat_leds = "", *feat_rfkill = "",
+                  *feat_pio = "", *feat_dma = "";
+
+#ifdef CONFIG_B43LEGACY_PCI_AUTOSELECT
+       feat_pci = "P";
+#endif
+#ifdef CONFIG_B43LEGACY_LEDS
+       feat_leds = "L";
+#endif
+#ifdef CONFIG_B43LEGACY_RFKILL
+       feat_rfkill = "R";
+#endif
+#ifdef CONFIG_B43LEGACY_PIO
+       feat_pio = "I";
+#endif
+#ifdef CONFIG_B43LEGACY_DMA
+       feat_dma = "D";
+#endif
+       printk(KERN_INFO "Broadcom 43xx driver loaded "
+              "[ Features: %s%s%s%s%s, Firmware-ID: "
+              B43legacy_SUPPORTED_FIRMWARE_ID " ]\n",
+              feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma);
+}
+
 static int __init b43legacy_init(void)
 {
        int err;
@@ -3816,6 +3845,8 @@ static int __init b43legacy_init(void)
        if (err)
                goto err_dfs_exit;
 
+       b43legacy_print_driverinfo();
+
        return err;
 
 err_dfs_exit:
index 3e6ad7b92c8316e488ca20575c1146aea6e10063..a56d9fc6354f90fce9d0f2e79b6b5ecf6eafea93 100644 (file)
@@ -3365,7 +3365,6 @@ static void ipw_rx_queue_reset(struct ipw_priv *priv,
        /* Set us so that we have processed and used all buffers, but have
         * not restocked the Rx queue with fresh buffers */
        rxq->read = rxq->write = 0;
-       rxq->processed = RX_QUEUE_SIZE - 1;
        rxq->free_count = 0;
        spin_unlock_irqrestore(&rxq->lock, flags);
 }
@@ -3607,7 +3606,22 @@ static int ipw_load(struct ipw_priv *priv)
  * Driver allocates buffers of this size for Rx
  */
 
-static inline int ipw_queue_space(const struct clx2_queue *q)
+/**
+ * ipw_rx_queue_space - Return number of free slots available in queue.
+ */
+static int ipw_rx_queue_space(const struct ipw_rx_queue *q)
+{
+       int s = q->read - q->write;
+       if (s <= 0)
+               s += RX_QUEUE_SIZE;
+       /* keep some buffer to not confuse full and empty queue */
+       s -= 2;
+       if (s < 0)
+               s = 0;
+       return s;
+}
+
+static inline int ipw_tx_queue_space(const struct clx2_queue *q)
 {
        int s = q->last_used - q->first_empty;
        if (s <= 0)
@@ -4947,7 +4961,7 @@ static int ipw_queue_tx_reclaim(struct ipw_priv *priv,
                priv->tx_packets++;
        }
       done:
-       if ((ipw_queue_space(q) > q->low_mark) &&
+       if ((ipw_tx_queue_space(q) > q->low_mark) &&
            (qindex >= 0) &&
            (priv->status & STATUS_ASSOCIATED) && netif_running(priv->net_dev))
                netif_wake_queue(priv->net_dev);
@@ -4965,7 +4979,7 @@ static int ipw_queue_tx_hcmd(struct ipw_priv *priv, int hcmd, void *buf,
        struct clx2_queue *q = &txq->q;
        struct tfd_frame *tfd;
 
-       if (ipw_queue_space(q) < (sync ? 1 : 2)) {
+       if (ipw_tx_queue_space(q) < (sync ? 1 : 2)) {
                IPW_ERROR("No space for Tx\n");
                return -EBUSY;
        }
@@ -5070,7 +5084,7 @@ static void ipw_rx_queue_restock(struct ipw_priv *priv)
 
        spin_lock_irqsave(&rxq->lock, flags);
        write = rxq->write;
-       while ((rxq->write != rxq->processed) && (rxq->free_count)) {
+       while ((ipw_rx_queue_space(rxq) > 0) && (rxq->free_count)) {
                element = rxq->rx_free.next;
                rxb = list_entry(element, struct ipw_rx_mem_buffer, list);
                list_del(element);
@@ -5187,7 +5201,6 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *priv)
        /* Set us so that we have processed and used all buffers, but have
         * not restocked the Rx queue with fresh buffers */
        rxq->read = rxq->write = 0;
-       rxq->processed = RX_QUEUE_SIZE - 1;
        rxq->free_count = 0;
 
        return rxq;
@@ -8223,13 +8236,17 @@ static void ipw_rx(struct ipw_priv *priv)
        struct ieee80211_hdr_4addr *header;
        u32 r, w, i;
        u8 network_packet;
+       u8 fill_rx = 0;
        DECLARE_MAC_BUF(mac);
        DECLARE_MAC_BUF(mac2);
        DECLARE_MAC_BUF(mac3);
 
        r = ipw_read32(priv, IPW_RX_READ_INDEX);
        w = ipw_read32(priv, IPW_RX_WRITE_INDEX);
-       i = (priv->rxq->processed + 1) % RX_QUEUE_SIZE;
+       i = priv->rxq->read;
+
+       if (ipw_rx_queue_space (priv->rxq) > (RX_QUEUE_SIZE / 2))
+               fill_rx = 1;
 
        while (i != r) {
                rxb = priv->rxq->queue[i];
@@ -8404,11 +8421,17 @@ static void ipw_rx(struct ipw_priv *priv)
                list_add_tail(&rxb->list, &priv->rxq->rx_used);
 
                i = (i + 1) % RX_QUEUE_SIZE;
+
+               /* If there are a lot of unsued frames, restock the Rx queue
+                * so the ucode won't assert */
+               if (fill_rx) {
+                       priv->rxq->read = i;
+                       ipw_rx_queue_replenish(priv);
+               }
        }
 
        /* Backtrack one entry */
-       priv->rxq->processed = (i ? i : RX_QUEUE_SIZE) - 1;
-
+       priv->rxq->read = i;
        ipw_rx_queue_restock(priv);
 }
 
@@ -10336,7 +10359,7 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
        q->first_empty = ipw_queue_inc_wrap(q->first_empty, q->n_bd);
        ipw_write32(priv, q->reg_w, q->first_empty);
 
-       if (ipw_queue_space(q) < q->high_mark)
+       if (ipw_tx_queue_space(q) < q->high_mark)
                netif_stop_queue(priv->net_dev);
 
        return NETDEV_TX_OK;
@@ -10357,7 +10380,7 @@ static int ipw_net_is_queue_full(struct net_device *dev, int pri)
        struct clx2_tx_queue *txq = &priv->txq[0];
 #endif                         /* CONFIG_IPW2200_QOS */
 
-       if (ipw_queue_space(&txq->q) < txq->q.high_mark)
+       if (ipw_tx_queue_space(&txq->q) < txq->q.high_mark)
                return 1;
 
        return 0;
index 5ee1ad69898b6f36aed5b84a2270b9431274e1ab..40b71bc2c4a4c3eea35c5896d4293e20b4f5034d 100644 (file)
@@ -687,6 +687,12 @@ static int iwl3945_enqueue_hcmd(struct iwl3945_priv *priv, struct iwl3945_host_c
        BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) &&
               !(cmd->meta.flags & CMD_SIZE_HUGE));
 
+
+       if (iwl3945_is_rfkill(priv)) {
+               IWL_DEBUG_INFO("Not sending command - RF KILL");
+               return -EIO;
+       }
+
        if (iwl3945_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) {
                IWL_ERROR("No space for Tx\n");
                return -ENOSPC;
@@ -1580,7 +1586,7 @@ static inline int iwl3945_eeprom_acquire_semaphore(struct iwl3945_priv *priv)
  */
 int iwl3945_eeprom_init(struct iwl3945_priv *priv)
 {
-       __le16 *e = (__le16 *)&priv->eeprom;
+       u16 *e = (u16 *)&priv->eeprom;
        u32 gp = iwl3945_read32(priv, CSR_EEPROM_GP);
        u32 r;
        int sz = sizeof(priv->eeprom);
@@ -1623,7 +1629,7 @@ int iwl3945_eeprom_init(struct iwl3945_priv *priv)
                        IWL_ERROR("Time out reading EEPROM[%d]", addr);
                        return -ETIMEDOUT;
                }
-               e[addr / 2] = cpu_to_le16(r >> 16);
+               e[addr / 2] = le16_to_cpu((__force __le16)(r >> 16));
        }
 
        return 0;
@@ -2806,7 +2812,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv,
 #endif
 
        /* drop all data frame if we are not associated */
-       if ((!iwl3945_is_associated(priv) || !priv->assoc_id) &&
+       if ((!iwl3945_is_associated(priv) ||
+            ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id)) &&
            ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)) {
                IWL_DEBUG_DROP("Dropping - !iwl3945_is_associated\n");
                goto drop_unlock;
@@ -4281,7 +4288,7 @@ static void iwl3945_rx_handle(struct iwl3945_priv *priv)
        int reclaim;
        unsigned long flags;
        u8 fill_rx = 0;
-       u32 count = 0;
+       u32 count = 8;
 
        /* uCode's read index (stored in shared DRAM) indicates the last Rx
         * buffer that the driver may process (last buffer filled by ucode). */
@@ -6256,6 +6263,8 @@ static void __iwl3945_down(struct iwl3945_priv *priv)
                                        STATUS_RF_KILL_HW |
                               test_bit(STATUS_RF_KILL_SW, &priv->status) <<
                                        STATUS_RF_KILL_SW |
+                              test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
+                                       STATUS_GEO_CONFIGURED |
                               test_bit(STATUS_IN_SUSPEND, &priv->status) <<
                                        STATUS_IN_SUSPEND;
                goto exit;
@@ -6267,6 +6276,8 @@ static void __iwl3945_down(struct iwl3945_priv *priv)
                                STATUS_RF_KILL_HW |
                        test_bit(STATUS_RF_KILL_SW, &priv->status) <<
                                STATUS_RF_KILL_SW |
+                       test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
+                               STATUS_GEO_CONFIGURED |
                        test_bit(STATUS_IN_SUSPEND, &priv->status) <<
                                STATUS_IN_SUSPEND |
                        test_bit(STATUS_FW_ERROR, &priv->status) <<
index f423241b95674ad7cca340fa591f27c48a10bd13..a23d4798653b716a3bad6e455797df70f90ab801 100644 (file)
@@ -692,6 +692,11 @@ static int iwl4965_enqueue_hcmd(struct iwl4965_priv *priv, struct iwl4965_host_c
        BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) &&
               !(cmd->meta.flags & CMD_SIZE_HUGE));
 
+       if (iwl4965_is_rfkill(priv)) {
+               IWL_DEBUG_INFO("Not sending command - RF KILL");
+               return -EIO;
+       }
+
        if (iwl4965_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) {
                IWL_ERROR("No space for Tx\n");
                return -ENOSPC;
@@ -1654,7 +1659,7 @@ static inline void iwl4965_eeprom_release_semaphore(struct iwl4965_priv *priv)
  */
 int iwl4965_eeprom_init(struct iwl4965_priv *priv)
 {
-       __le16 *e = (__le16 *)&priv->eeprom;
+       u16 *e = (u16 *)&priv->eeprom;
        u32 gp = iwl4965_read32(priv, CSR_EEPROM_GP);
        u32 r;
        int sz = sizeof(priv->eeprom);
@@ -1698,7 +1703,7 @@ int iwl4965_eeprom_init(struct iwl4965_priv *priv)
                        rc = -ETIMEDOUT;
                        goto done;
                }
-               e[addr / 2] = cpu_to_le16(r >> 16);
+               e[addr / 2] = le16_to_cpu((__force __le16)(r >> 16));
        }
        rc = 0;
 
@@ -2935,7 +2940,7 @@ static int iwl4965_tx_skb(struct iwl4965_priv *priv,
        /* drop all data frame if we are not associated */
        if (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) &&
           (!iwl4965_is_associated(priv) ||
-           !priv->assoc_id ||
+           ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id) ||
            !priv->assoc_station_added)) {
                IWL_DEBUG_DROP("Dropping - !iwl4965_is_associated\n");
                goto drop_unlock;
@@ -4664,7 +4669,7 @@ static void iwl4965_rx_handle(struct iwl4965_priv *priv)
        int reclaim;
        unsigned long flags;
        u8 fill_rx = 0;
-       u32 count = 0;
+       u32 count = 8;
 
        /* uCode's read index (stored in shared DRAM) indicates the last Rx
         * buffer that the driver may process (last buffer filled by ucode). */
@@ -6680,6 +6685,8 @@ static void __iwl4965_down(struct iwl4965_priv *priv)
                                        STATUS_RF_KILL_HW |
                               test_bit(STATUS_RF_KILL_SW, &priv->status) <<
                                        STATUS_RF_KILL_SW |
+                              test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
+                                       STATUS_GEO_CONFIGURED |
                               test_bit(STATUS_IN_SUSPEND, &priv->status) <<
                                        STATUS_IN_SUSPEND;
                goto exit;
@@ -6691,6 +6698,8 @@ static void __iwl4965_down(struct iwl4965_priv *priv)
                                STATUS_RF_KILL_HW |
                        test_bit(STATUS_RF_KILL_SW, &priv->status) <<
                                STATUS_RF_KILL_SW |
+                       test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
+                               STATUS_GEO_CONFIGURED |
                        test_bit(STATUS_IN_SUSPEND, &priv->status) <<
                                STATUS_IN_SUSPEND |
                        test_bit(STATUS_FW_ERROR, &priv->status) <<
index d3ecf89abd936af145ef57cbea2be20a94227e64..8ce2ddf8024f60f0c3c424b0dffe1d093b382e76 100644 (file)
@@ -2300,7 +2300,7 @@ static void rndis_update_wireless_stats(struct work_struct *work)
        struct usbnet *usbdev = priv->usbdev;
        struct iw_statistics iwstats;
        __le32 rssi, tmp;
-       int len, ret, bitrate, j;
+       int len, ret, j;
        unsigned long flags;
        int update_jiffies = STATS_UPDATE_JIFFIES;
        void *buf;
@@ -2352,14 +2352,10 @@ static void rndis_update_wireless_stats(struct work_struct *work)
        if (ret == 0)
                iwstats.discard.misc += le32_to_cpu(tmp);
 
-       /* Workaround transfer stalls on poor quality links. */
-       len = sizeof(tmp);
-       ret = rndis_query_oid(usbdev, OID_GEN_LINK_SPEED, &tmp, &len);
-       if (ret == 0) {
-               bitrate = le32_to_cpu(tmp) * 100;
-               if (bitrate > 11000000)
-                       goto end;
-
+       /* Workaround transfer stalls on poor quality links.
+        * TODO: find right way to fix these stalls (as stalls do not happen
+        * with ndiswrapper/windows driver). */
+       if (iwstats.qual.qual <= 25) {
                /* Decrease stats worker interval to catch stalls.
                 * faster. Faster than 400-500ms causes packet loss,
                 * Slower doesn't catch stalls fast enough.
index 86ded4066f5bbcc6e9d466b800b994ce329162ad..4ca9730e5e92f360074e4b08b5b2e05f50460ec9 100644 (file)
@@ -1839,11 +1839,11 @@ static struct usb_device_id rt2500usb_device_table[] = {
        /* Hercules */
        { USB_DEVICE(0x06f8, 0xe000), USB_DEVICE_DATA(&rt2500usb_ops) },
        /* Melco */
+       { USB_DEVICE(0x0411, 0x005e), USB_DEVICE_DATA(&rt2500usb_ops) },
        { USB_DEVICE(0x0411, 0x0066), USB_DEVICE_DATA(&rt2500usb_ops) },
        { USB_DEVICE(0x0411, 0x0067), USB_DEVICE_DATA(&rt2500usb_ops) },
        { USB_DEVICE(0x0411, 0x008b), USB_DEVICE_DATA(&rt2500usb_ops) },
        { USB_DEVICE(0x0411, 0x0097), USB_DEVICE_DATA(&rt2500usb_ops) },
-
        /* MSI */
        { USB_DEVICE(0x0db0, 0x6861), USB_DEVICE_DATA(&rt2500usb_ops) },
        { USB_DEVICE(0x0db0, 0x6865), USB_DEVICE_DATA(&rt2500usb_ops) },
index 27172cde5a39ed7505b71db9fb34bd7e47c564c5..9ab360558ffd8d90549c45536179f6bb2c9220ca 100644 (file)
@@ -85,7 +85,7 @@ union hacs_u
 #define                HASR_MMC_INTR           0x0002  /* Interrupt request from MMC */
 #define                HASR_MMC_BUSY           0x0004  /* MMC busy indication */
 #define                HASR_PSA_BUSY           0x0008  /* LAN parameter storage area busy */
-};
+} __attribute__ ((packed));
 
 typedef struct ha_t    ha_t;
 struct ha_t
@@ -292,7 +292,7 @@ struct mmw_t
 #define        MMW_EXT_ANT_INTERNAL    0x00    /* Internal antenna */
 #define        MMW_EXT_ANT_EXTERNAL    0x03    /* External antenna */
 #define        MMW_EXT_ANT_IQ_TEST     0x1C    /* IQ test pattern (set to 0) */
-};
+} __attribute__ ((packed));
 
 #define        MMW_SIZE        37
 
@@ -347,7 +347,7 @@ struct mmr_t
   unsigned char        mmr_unused4[1];         /* unused */
   unsigned char        mmr_fee_data_l;         /* Read data from EEPROM (low) */
   unsigned char        mmr_fee_data_h;         /* Read data from EEPROM (high) */
-};
+} __attribute__ ((packed));
 
 #define        MMR_SIZE        36
 
index ca6b16fc3101a3df88d60350060eae56d6528535..f1ef49fff118ea8aa8322dd4404e0ca65ea3e518 100644 (file)
@@ -243,10 +243,18 @@ nlm_bind_host(struct nlm_host *host)
                        .program        = &nlm_program,
                        .version        = host->h_version,
                        .authflavor     = RPC_AUTH_UNIX,
-                       .flags          = (RPC_CLNT_CREATE_HARDRTRY |
+                       .flags          = (RPC_CLNT_CREATE_NOPING |
                                           RPC_CLNT_CREATE_AUTOBIND),
                };
 
+               /*
+                * lockd retries server side blocks automatically so we want
+                * those to be soft RPC calls. Client side calls need to be
+                * hard RPC tasks.
+                */
+               if (!host->h_server)
+                       args.flags |= RPC_CLNT_CREATE_HARDRTRY;
+
                clnt = rpc_create(&args);
                if (!IS_ERR(clnt))
                        host->h_rpcclnt = clnt;
index 2f4d8fa666892b9fa8b41266a627608c55c1e8a0..fe9bdb4a220cd32827c5818001651cabb5f1966d 100644 (file)
@@ -763,11 +763,20 @@ callback:
        dprintk("lockd: GRANTing blocked lock.\n");
        block->b_granted = 1;
 
-       /* Schedule next grant callback in 30 seconds */
-       nlmsvc_insert_block(block, 30 * HZ);
+       /* keep block on the list, but don't reattempt until the RPC
+        * completes or the submission fails
+        */
+       nlmsvc_insert_block(block, NLM_NEVER);
+
+       /* Call the client -- use a soft RPC task since nlmsvc_retry_blocked
+        * will queue up a new one if this one times out
+        */
+       error = nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG,
+                               &nlmsvc_grant_ops);
 
-       /* Call the client */
-       nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, &nlmsvc_grant_ops);
+       /* RPC submission failed, wait a bit and retry */
+       if (error < 0)
+               nlmsvc_insert_block(block, 10 * HZ);
 }
 
 /*
@@ -786,6 +795,17 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
 
        dprintk("lockd: GRANT_MSG RPC callback\n");
 
+       /* if the block is not on a list at this point then it has
+        * been invalidated. Don't try to requeue it.
+        *
+        * FIXME: it's possible that the block is removed from the list
+        * after this check but before the nlmsvc_insert_block. In that
+        * case it will be added back. Perhaps we need better locking
+        * for nlm_blocked?
+        */
+       if (list_empty(&block->b_list))
+               return;
+
        /* Technically, we should down the file semaphore here. Since we
         * move the block towards the head of the queue only, no harm
         * can be done, though. */
index 5d9d70cd17fc41fecef6095b4322381c23a8a3f8..342a2a0105c4c070f988d39afc90f46d52dca12d 100644 (file)
 /* Other architectures wishing to use this simple topology API should fill
    in the below functions as appropriate in their own <asm/topology.h> file. */
 #ifndef cpu_to_node
-#define cpu_to_node(cpu)       (0)
+#define cpu_to_node(cpu)       ((void)(cpu),0)
 #endif
 #ifndef parent_node
-#define parent_node(node)      (0)
+#define parent_node(node)      ((void)(node),0)
 #endif
 #ifndef node_to_cpumask
-#define node_to_cpumask(node)  (cpu_online_map)
+#define node_to_cpumask(node)  ((void)node, cpu_online_map)
 #endif
 #ifndef node_to_first_cpu
-#define node_to_first_cpu(node)        (0)
+#define node_to_first_cpu(node)        ((void)(node),0)
 #endif
 #ifndef pcibus_to_node
-#define pcibus_to_node(node)   (-1)
+#define pcibus_to_node(bus)    ((void)(bus), -1)
 #endif
 
 #ifndef pcibus_to_cpumask
index 49c62dd5eccf2a8bfa9af981b1a2c4255ff81e3c..0964c32c1358591270323341d4a65928ab4494c7 100644 (file)
 #define MAXHOSTNAMELEN 64      /* max length of hostname */
 
 #ifdef __KERNEL__
-# ifdef CONFIG_IA64_HP_SIM
-  /*
-   * Yeah, simulating stuff is slow, so let us catch some breath between
-   * timer interrupts...
-   */
-#  define HZ     32
-# else
-#  define HZ   CONFIG_HZ
-# endif
+# define HZ            CONFIG_HZ
 # define USER_HZ       HZ
 # define CLOCKS_PER_SEC        HZ      /* frequency at which times() counts */
 #else
index f8c9a2752f067b505a59b95d07a93a61a7845cd3..0a26be353cb3763c8541ad3594bf6162f1a3b2ec 100644 (file)
@@ -26,8 +26,6 @@ extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
 #define cpuset_current_mems_allowed (current->mems_allowed)
 void cpuset_init_current_mems_allowed(void);
 void cpuset_update_task_memory_state(void);
-#define cpuset_nodes_subset_current_mems_allowed(nodes) \
-               nodes_subset((nodes), current->mems_allowed)
 int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl);
 
 extern int __cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask);
@@ -103,7 +101,6 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
 #define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY])
 static inline void cpuset_init_current_mems_allowed(void) {}
 static inline void cpuset_update_task_memory_state(void) {}
-#define cpuset_nodes_subset_current_mems_allowed(nodes) (1)
 
 static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
 {
index acec99da832dc475a44aa1e18696f84e1dae1f53..a3b69c10d667c98c5631308456673374491aaec5 100644 (file)
@@ -906,6 +906,8 @@ enum {
                                          IDE_TFLAG_IN_DEVICE,
        /* force 16-bit I/O operations */
        IDE_TFLAG_IO_16BIT              = (1 << 30),
+       /* ide_task_t was allocated using kmalloc() */
+       IDE_TFLAG_DYN                   = (1 << 31),
 };
 
 struct ide_taskfile {
@@ -998,8 +1000,7 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o
 void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *);
 void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
 
-/* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */
-#if defined(CONFIG_BLK_DEV_IDEPCI) && defined(CONFIG_BLK_DEV_IDEDMA_PCI)
+#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
 void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *);
 #else
 static inline void ide_hwif_setup_dma(ide_hwif_t *hwif,
@@ -1146,7 +1147,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t *);
 int ide_build_sglist(ide_drive_t *, struct request *);
 void ide_destroy_dmatable(ide_drive_t *);
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 extern int ide_build_dmatable(ide_drive_t *, struct request *);
 extern int ide_release_dma(ide_hwif_t *);
 extern void ide_setup_dma(ide_hwif_t *, unsigned long);
@@ -1157,7 +1158,7 @@ extern void ide_dma_start(ide_drive_t *);
 extern int __ide_dma_end(ide_drive_t *);
 extern void ide_dma_lost_irq(ide_drive_t *);
 extern void ide_dma_timeout(ide_drive_t *);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
 
 #else
 static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
@@ -1171,7 +1172,7 @@ static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
 static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 
-#ifndef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifndef CONFIG_BLK_DEV_IDEDMA_SFF
 static inline void ide_release_dma(ide_hwif_t *drive) {;}
 #endif
 
@@ -1294,7 +1295,7 @@ static inline void ide_dump_identify(u8 *id)
 static inline int hwif_to_node(ide_hwif_t *hwif)
 {
        struct pci_dev *dev = to_pci_dev(hwif->dev);
-       return dev ? pcibus_to_node(dev->bus) : -1;
+       return hwif->dev ? pcibus_to_node(dev->bus) : -1;
 }
 
 static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
index 047d432bde5551784534de19482b46d3d3eb83da..4ffa49dbb66f891f51f0895e7fc7e186c10c5225 100644 (file)
@@ -604,6 +604,10 @@ struct net_device
 
        unsigned char           broadcast[MAX_ADDR_LEN];        /* hw bcast add */
 
+       /* ingress path synchronizer */
+       spinlock_t              ingress_lock;
+       struct Qdisc            *qdisc_ingress;
+
 /*
  * Cache line mostly used on queue transmit path (qdisc)
  */
@@ -617,10 +621,6 @@ struct net_device
        /* Partially transmitted GSO packet. */
        struct sk_buff          *gso_skb;
 
-       /* ingress path synchronizer */
-       spinlock_t              ingress_lock;
-       struct Qdisc            *qdisc_ingress;
-
 /*
  * One part is mostly used on xmit path (device)
  */
index 64c771056187a3957c70ce3c212e0db82db49ff9..64c97552964a42f523b5c3dcba8a149f5edd4b3e 100644 (file)
@@ -409,16 +409,13 @@ char *               svc_print_addr(struct svc_rqst *, char *, size_t);
  * for all cases without actually generating the checksum, so we just use a
  * static value.
  */
-static inline void
-svc_reserve_auth(struct svc_rqst *rqstp, int space)
+static inline void svc_reserve_auth(struct svc_rqst *rqstp, int space)
 {
-       int                     added_space = 0;
+       int added_space = 0;
 
-       switch(rqstp->rq_authop->flavour) {
-               case RPC_AUTH_GSS:
-                       added_space = RPC_MAX_AUTH_SIZE;
-       }
-       return svc_reserve(rqstp, space + added_space);
+       if (rqstp->rq_authop->flavour)
+               added_space = RPC_MAX_AUTH_SIZE;
+       svc_reserve(rqstp, space + added_space);
 }
 
 #endif /* SUNRPC_SVC_H */
index 32a57e1dee3a4f526cc43491b909948b55d0c6d1..717e2192d521ee014ed415ad51d29d296576dba5 100644 (file)
@@ -324,6 +324,7 @@ extern void ax25_dama_on(ax25_cb *);
 extern void ax25_dama_off(ax25_cb *);
 
 /* ax25_ds_timer.c */
+extern void ax25_ds_setup_timer(ax25_dev *);
 extern void ax25_ds_set_timer(ax25_dev *);
 extern void ax25_ds_del_timer(ax25_dev *);
 extern void ax25_ds_timer(ax25_cb *);
@@ -416,6 +417,7 @@ extern void ax25_calculate_rtt(ax25_cb *);
 extern void ax25_disconnect(ax25_cb *, int);
 
 /* ax25_timer.c */
+extern void ax25_setup_timers(ax25_cb *);
 extern void ax25_start_heartbeat(ax25_cb *);
 extern void ax25_start_t1timer(ax25_cb *);
 extern void ax25_start_t2timer(ax25_cb *);
index 6684f7efbeeb84add2716337c8d8628fc6449bf8..59b70624b0563fdc93ecfbc25291a7845502d117 100644 (file)
@@ -103,7 +103,6 @@ extern void                 ndisc_send_redirect(struct sk_buff *skb,
 extern int                     ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir);
 
 
-struct rt6_info *              dflt_rt_lookup(void);
 
 /*
  *     IGMP
index ac72116636ca7f46bfb486079fd244d7b5433f9f..eea7785cc757da4c146579503a1193263a2707f5 100644 (file)
@@ -508,7 +508,10 @@ struct xfrm_skb_cb {
         } header;
 
         /* Sequence number for replay protection. */
-        u64 seq;
+       union {
+               u64 output;
+               __be32 input;
+       } seq;
 };
 
 #define XFRM_SKB_CB(__skb) ((struct xfrm_skb_cb *)&((__skb)->cb[0]))
index c5f157ce293e7625c428b8e853732d1977add6bc..4a243df426f70b9f3fbe366f1b94dbb8f4cdd1cf 100644 (file)
@@ -27,6 +27,7 @@ $(obj)/version.o: include/linux/compile.h
 # mkcompile_h will make sure to only update the
 # actual file if its content has changed.
 
+       chk_compile.h = :
  quiet_chk_compile.h = echo '  CHK     $@'
 silent_chk_compile.h = :
 include/linux/compile.h: FORCE
index e5628a5fd678ff2b8faa02521e49cec4d769970e..717aa0e3be2d7d9b0385411257a89d50f6ea3afc 100644 (file)
@@ -989,6 +989,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
        int i;
        unsigned int vm_flags;
 
+       if (len <= 0)
+               return 0;
        /* 
         * Require read or write permissions.
         * If 'force' is set, we only require the "MAY" flags.
index 83c69f8a64c29dd0878050b3912e5f0c2b1af3ac..8d246c3b340f5cd635e8e7177d23abbb38efec64 100644 (file)
@@ -116,22 +116,51 @@ static void mpol_rebind_policy(struct mempolicy *pol,
 /* Do sanity checking on a policy */
 static int mpol_check_policy(int mode, nodemask_t *nodes)
 {
-       int empty = nodes_empty(*nodes);
+       int was_empty, is_empty;
+
+       if (!nodes)
+               return 0;
+
+       /*
+        * "Contextualize" the in-coming nodemast for cpusets:
+        * Remember whether in-coming nodemask was empty,  If not,
+        * restrict the nodes to the allowed nodes in the cpuset.
+        * This is guaranteed to be a subset of nodes with memory.
+        */
+       cpuset_update_task_memory_state();
+       is_empty = was_empty = nodes_empty(*nodes);
+       if (!was_empty) {
+               nodes_and(*nodes, *nodes, cpuset_current_mems_allowed);
+               is_empty = nodes_empty(*nodes); /* after "contextualization" */
+       }
 
        switch (mode) {
        case MPOL_DEFAULT:
-               if (!empty)
+               /*
+                * require caller to specify an empty nodemask
+                * before "contextualization"
+                */
+               if (!was_empty)
                        return -EINVAL;
                break;
        case MPOL_BIND:
        case MPOL_INTERLEAVE:
-               /* Preferred will only use the first bit, but allow
-                  more for now. */
-               if (empty)
+               /*
+                * require at least 1 valid node after "contextualization"
+                */
+               if (is_empty)
+                       return -EINVAL;
+               break;
+       case MPOL_PREFERRED:
+               /*
+                * Did caller specify invalid nodes?
+                * Don't silently accept this as "local allocation".
+                */
+               if (!was_empty && is_empty)
                        return -EINVAL;
                break;
        }
-       return nodes_subset(*nodes, node_states[N_HIGH_MEMORY]) ? 0 : -EINVAL;
+       return 0;
 }
 
 /* Generate a custom zonelist for the BIND policy. */
@@ -188,8 +217,6 @@ static struct mempolicy *mpol_new(int mode, nodemask_t *nodes)
        switch (mode) {
        case MPOL_INTERLEAVE:
                policy->v.nodes = *nodes;
-               nodes_and(policy->v.nodes, policy->v.nodes,
-                                       node_states[N_HIGH_MEMORY]);
                if (nodes_weight(policy->v.nodes) == 0) {
                        kmem_cache_free(policy_cache, policy);
                        return ERR_PTR(-EINVAL);
@@ -421,18 +448,6 @@ static int mbind_range(struct vm_area_struct *vma, unsigned long start,
        return err;
 }
 
-static int contextualize_policy(int mode, nodemask_t *nodes)
-{
-       if (!nodes)
-               return 0;
-
-       cpuset_update_task_memory_state();
-       if (!cpuset_nodes_subset_current_mems_allowed(*nodes))
-               return -EINVAL;
-       return mpol_check_policy(mode, nodes);
-}
-
-
 /*
  * Update task->flags PF_MEMPOLICY bit: set iff non-default
  * mempolicy.  Allows more rapid checking of this (combined perhaps
@@ -468,7 +483,7 @@ static long do_set_mempolicy(int mode, nodemask_t *nodes)
 {
        struct mempolicy *new;
 
-       if (contextualize_policy(mode, nodes))
+       if (mpol_check_policy(mode, nodes))
                return -EINVAL;
        new = mpol_new(mode, nodes);
        if (IS_ERR(new))
@@ -915,10 +930,6 @@ asmlinkage long sys_mbind(unsigned long start, unsigned long len,
        err = get_nodes(&nodes, nmask, maxnode);
        if (err)
                return err;
-#ifdef CONFIG_CPUSETS
-       /* Restrict the nodes to the allowed nodes in the cpuset */
-       nodes_and(nodes, nodes, current->mems_allowed);
-#endif
        return do_mbind(start, len, mode, &nodes, flags);
 }
 
index 8fc64e3150a26cd437aeee127806cab19cda110d..48bfcc741f2595db4f8d4f674e43f6a65751f608 100644 (file)
@@ -510,11 +510,7 @@ ax25_cb *ax25_create_cb(void)
        skb_queue_head_init(&ax25->ack_queue);
        skb_queue_head_init(&ax25->reseq_queue);
 
-       init_timer(&ax25->timer);
-       init_timer(&ax25->t1timer);
-       init_timer(&ax25->t2timer);
-       init_timer(&ax25->t3timer);
-       init_timer(&ax25->idletimer);
+       ax25_setup_timers(ax25);
 
        ax25_fillin_cb(ax25, NULL);
 
@@ -1928,12 +1924,10 @@ static int ax25_info_show(struct seq_file *seq, void *v)
                   ax25->paclen);
 
        if (ax25->sk != NULL) {
-               bh_lock_sock(ax25->sk);
-               seq_printf(seq," %d %d %ld\n",
+               seq_printf(seq, " %d %d %lu\n",
                           atomic_read(&ax25->sk->sk_wmem_alloc),
                           atomic_read(&ax25->sk->sk_rmem_alloc),
-                          ax25->sk->sk_socket != NULL ? SOCK_INODE(ax25->sk->sk_socket)->i_ino : 0L);
-               bh_unlock_sock(ax25->sk);
+                          sock_i_ino(ax25->sk));
        } else {
                seq_puts(seq, " * * *\n");
        }
index 528c874d9828df06f6d2c880b808d31da4164041..a7a0e0c9698b0c59de7b553fdda73e947864a027 100644 (file)
@@ -82,7 +82,7 @@ void ax25_dev_device_up(struct net_device *dev)
        ax25_dev->values[AX25_VALUES_DS_TIMEOUT]= AX25_DEF_DS_TIMEOUT;
 
 #if defined(CONFIG_AX25_DAMA_SLAVE) || defined(CONFIG_AX25_DAMA_MASTER)
-       init_timer(&ax25_dev->dama.slave_timer);
+       ax25_ds_setup_timer(ax25_dev);
 #endif
 
        spin_lock_bh(&ax25_dev_lock);
index c4e3b025d21c20c824d6b0b6b5fb42105e713360..2ce79df00680eee3d9d290fd1156ac1d2ab74557 100644 (file)
@@ -40,13 +40,10 @@ static void ax25_ds_timeout(unsigned long);
  *     1/10th of a second.
  */
 
-static void ax25_ds_add_timer(ax25_dev *ax25_dev)
+void ax25_ds_setup_timer(ax25_dev *ax25_dev)
 {
-       struct timer_list *t = &ax25_dev->dama.slave_timer;
-       t->data         = (unsigned long) ax25_dev;
-       t->function     = &ax25_ds_timeout;
-       t->expires      = jiffies + HZ;
-       add_timer(t);
+       setup_timer(&ax25_dev->dama.slave_timer, ax25_ds_timeout,
+                   (unsigned long)ax25_dev);
 }
 
 void ax25_ds_del_timer(ax25_dev *ax25_dev)
@@ -60,10 +57,9 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev)
        if (ax25_dev == NULL)           /* paranoia */
                return;
 
-       del_timer(&ax25_dev->dama.slave_timer);
        ax25_dev->dama.slave_timeout =
                msecs_to_jiffies(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10;
-       ax25_ds_add_timer(ax25_dev);
+       mod_timer(&ax25_dev->dama.slave_timer, jiffies + HZ);
 }
 
 /*
index 38c7f3087ec3d17c1fc8a5ff48be10cb9dedda60..8672cd84fdf905990afb5810a70c505bc94bded8 100644 (file)
@@ -45,7 +45,7 @@ void ax25_rt_device_down(struct net_device *dev)
 {
        ax25_route *s, *t, *ax25_rt;
 
-       write_lock(&ax25_route_lock);
+       write_lock_bh(&ax25_route_lock);
        ax25_rt = ax25_route_list;
        while (ax25_rt != NULL) {
                s       = ax25_rt;
@@ -68,7 +68,7 @@ void ax25_rt_device_down(struct net_device *dev)
                        }
                }
        }
-       write_unlock(&ax25_route_lock);
+       write_unlock_bh(&ax25_route_lock);
 }
 
 static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
@@ -82,7 +82,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
        if (route->digi_count > AX25_MAX_DIGIS)
                return -EINVAL;
 
-       write_lock(&ax25_route_lock);
+       write_lock_bh(&ax25_route_lock);
 
        ax25_rt = ax25_route_list;
        while (ax25_rt != NULL) {
@@ -92,7 +92,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
                        ax25_rt->digipeat = NULL;
                        if (route->digi_count != 0) {
                                if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
-                                       write_unlock(&ax25_route_lock);
+                                       write_unlock_bh(&ax25_route_lock);
                                        return -ENOMEM;
                                }
                                ax25_rt->digipeat->lastrepeat = -1;
@@ -102,14 +102,14 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
                                        ax25_rt->digipeat->calls[i]    = route->digi_addr[i];
                                }
                        }
-                       write_unlock(&ax25_route_lock);
+                       write_unlock_bh(&ax25_route_lock);
                        return 0;
                }
                ax25_rt = ax25_rt->next;
        }
 
        if ((ax25_rt = kmalloc(sizeof(ax25_route), GFP_ATOMIC)) == NULL) {
-               write_unlock(&ax25_route_lock);
+               write_unlock_bh(&ax25_route_lock);
                return -ENOMEM;
        }
 
@@ -120,7 +120,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
        ax25_rt->ip_mode      = ' ';
        if (route->digi_count != 0) {
                if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
-                       write_unlock(&ax25_route_lock);
+                       write_unlock_bh(&ax25_route_lock);
                        kfree(ax25_rt);
                        return -ENOMEM;
                }
@@ -133,7 +133,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route)
        }
        ax25_rt->next   = ax25_route_list;
        ax25_route_list = ax25_rt;
-       write_unlock(&ax25_route_lock);
+       write_unlock_bh(&ax25_route_lock);
 
        return 0;
 }
@@ -152,7 +152,7 @@ static int ax25_rt_del(struct ax25_routes_struct *route)
        if ((ax25_dev = ax25_addr_ax25dev(&route->port_addr)) == NULL)
                return -EINVAL;
 
-       write_lock(&ax25_route_lock);
+       write_lock_bh(&ax25_route_lock);
 
        ax25_rt = ax25_route_list;
        while (ax25_rt != NULL) {
@@ -174,7 +174,7 @@ static int ax25_rt_del(struct ax25_routes_struct *route)
                        }
                }
        }
-       write_unlock(&ax25_route_lock);
+       write_unlock_bh(&ax25_route_lock);
 
        return 0;
 }
@@ -188,7 +188,7 @@ static int ax25_rt_opt(struct ax25_route_opt_struct *rt_option)
        if ((ax25_dev = ax25_addr_ax25dev(&rt_option->port_addr)) == NULL)
                return -EINVAL;
 
-       write_lock(&ax25_route_lock);
+       write_lock_bh(&ax25_route_lock);
 
        ax25_rt = ax25_route_list;
        while (ax25_rt != NULL) {
@@ -216,7 +216,7 @@ static int ax25_rt_opt(struct ax25_route_opt_struct *rt_option)
        }
 
 out:
-       write_unlock(&ax25_route_lock);
+       write_unlock_bh(&ax25_route_lock);
        return err;
 }
 
@@ -492,7 +492,7 @@ void __exit ax25_rt_free(void)
 {
        ax25_route *s, *ax25_rt = ax25_route_list;
 
-       write_lock(&ax25_route_lock);
+       write_lock_bh(&ax25_route_lock);
        while (ax25_rt != NULL) {
                s       = ax25_rt;
                ax25_rt = ax25_rt->next;
@@ -500,5 +500,5 @@ void __exit ax25_rt_free(void)
                kfree(s->digipeat);
                kfree(s);
        }
-       write_unlock(&ax25_route_lock);
+       write_unlock_bh(&ax25_route_lock);
 }
index 72594867fab6005978e9df3c2753f6558410acb2..db29ea71e80a599cd667a8d7d0730531f0a90ea3 100644 (file)
@@ -40,63 +40,45 @@ static void ax25_t2timer_expiry(unsigned long);
 static void ax25_t3timer_expiry(unsigned long);
 static void ax25_idletimer_expiry(unsigned long);
 
-void ax25_start_heartbeat(ax25_cb *ax25)
+void ax25_setup_timers(ax25_cb *ax25)
 {
-       del_timer(&ax25->timer);
-
-       ax25->timer.data     = (unsigned long)ax25;
-       ax25->timer.function = &ax25_heartbeat_expiry;
-       ax25->timer.expires  = jiffies + 5 * HZ;
+       setup_timer(&ax25->timer, ax25_heartbeat_expiry, (unsigned long)ax25);
+       setup_timer(&ax25->t1timer, ax25_t1timer_expiry, (unsigned long)ax25);
+       setup_timer(&ax25->t2timer, ax25_t2timer_expiry, (unsigned long)ax25);
+       setup_timer(&ax25->t3timer, ax25_t3timer_expiry, (unsigned long)ax25);
+       setup_timer(&ax25->idletimer, ax25_idletimer_expiry,
+                   (unsigned long)ax25);
+}
 
-       add_timer(&ax25->timer);
+void ax25_start_heartbeat(ax25_cb *ax25)
+{
+       mod_timer(&ax25->timer, jiffies + 5 * HZ);
 }
 
 void ax25_start_t1timer(ax25_cb *ax25)
 {
-       del_timer(&ax25->t1timer);
-
-       ax25->t1timer.data     = (unsigned long)ax25;
-       ax25->t1timer.function = &ax25_t1timer_expiry;
-       ax25->t1timer.expires  = jiffies + ax25->t1;
-
-       add_timer(&ax25->t1timer);
+       mod_timer(&ax25->t1timer, jiffies + ax25->t1);
 }
 
 void ax25_start_t2timer(ax25_cb *ax25)
 {
-       del_timer(&ax25->t2timer);
-
-       ax25->t2timer.data     = (unsigned long)ax25;
-       ax25->t2timer.function = &ax25_t2timer_expiry;
-       ax25->t2timer.expires  = jiffies + ax25->t2;
-
-       add_timer(&ax25->t2timer);
+       mod_timer(&ax25->t2timer, jiffies + ax25->t2);
 }
 
 void ax25_start_t3timer(ax25_cb *ax25)
 {
-       del_timer(&ax25->t3timer);
-
-       if (ax25->t3 > 0) {
-               ax25->t3timer.data     = (unsigned long)ax25;
-               ax25->t3timer.function = &ax25_t3timer_expiry;
-               ax25->t3timer.expires  = jiffies + ax25->t3;
-
-               add_timer(&ax25->t3timer);
-       }
+       if (ax25->t3 > 0)
+               mod_timer(&ax25->t3timer, jiffies + ax25->t3);
+       else
+               del_timer(&ax25->t3timer);
 }
 
 void ax25_start_idletimer(ax25_cb *ax25)
 {
-       del_timer(&ax25->idletimer);
-
-       if (ax25->idle > 0) {
-               ax25->idletimer.data     = (unsigned long)ax25;
-               ax25->idletimer.function = &ax25_idletimer_expiry;
-               ax25->idletimer.expires  = jiffies + ax25->idle;
-
-               add_timer(&ax25->idletimer);
-       }
+       if (ax25->idle > 0)
+               mod_timer(&ax25->idletimer, jiffies + ax25->idle);
+       else
+               del_timer(&ax25->idletimer);
 }
 
 void ax25_stop_heartbeat(ax25_cb *ax25)
index 9549417250bba71650547e747226ba9e8c0a1882..6cfc1238c4a6979c1d94599f990aae6c9d95f50d 100644 (file)
@@ -1071,8 +1071,6 @@ int dev_close(struct net_device *dev)
         */
        call_netdevice_notifiers(NETDEV_GOING_DOWN, dev);
 
-       dev_deactivate(dev);
-
        clear_bit(__LINK_STATE_START, &dev->state);
 
        /* Synchronize to scheduled poll. We cannot touch poll list,
@@ -1083,6 +1081,8 @@ int dev_close(struct net_device *dev)
         */
        smp_mb__after_clear_bit(); /* Commit netif_running(). */
 
+       dev_deactivate(dev);
+
        /*
         *      Call the device specific close. This cannot fail.
         *      Only if device is UP
index a16cf1ec5e5ebe9fc100cb027c740c9387184472..7bb6a9a1256df6a082d0792feca42db7d18ec0f5 100644 (file)
@@ -834,18 +834,12 @@ static void neigh_timer_handler(unsigned long arg)
        }
        if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) {
                struct sk_buff *skb = skb_peek(&neigh->arp_queue);
-               /* keep skb alive even if arp_queue overflows */
-               if (skb)
-                       skb_get(skb);
-               write_unlock(&neigh->lock);
+
                neigh->ops->solicit(neigh, skb);
                atomic_inc(&neigh->probes);
-               if (skb)
-                       kfree_skb(skb);
-       } else {
-out:
-               write_unlock(&neigh->lock);
        }
+out:
+       write_unlock(&neigh->lock);
 
        if (notify)
                neigh_update_notify(neigh);
index 61ac8d06292ce32b2dbe46e92f69f50bd327c398..ecb02afd52dc211ed9ce470f489c13510d4753cb 100644 (file)
@@ -504,7 +504,7 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id,
 
 EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo);
 
-static void set_operstate(struct net_device *dev, unsigned char transition)
+static int set_operstate(struct net_device *dev, unsigned char transition, bool send_notification)
 {
        unsigned char operstate = dev->operstate;
 
@@ -527,8 +527,12 @@ static void set_operstate(struct net_device *dev, unsigned char transition)
                write_lock_bh(&dev_base_lock);
                dev->operstate = operstate;
                write_unlock_bh(&dev_base_lock);
-               netdev_state_change(dev);
-       }
+
+               if (send_notification)
+                       netdev_state_change(dev);
+               return 1;
+       } else
+               return 0;
 }
 
 static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
@@ -822,6 +826,7 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
        if (tb[IFLA_BROADCAST]) {
                nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len);
                send_addr_notify = 1;
+               modified = 1;
        }
 
        if (ifm->ifi_flags || ifm->ifi_change) {
@@ -834,16 +839,23 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
                dev_change_flags(dev, flags);
        }
 
-       if (tb[IFLA_TXQLEN])
-               dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
+       if (tb[IFLA_TXQLEN]) {
+               if (dev->tx_queue_len != nla_get_u32(tb[IFLA_TXQLEN])) {
+                       dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
+                       modified = 1;
+               }
+       }
 
        if (tb[IFLA_OPERSTATE])
-               set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
+               modified |= set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), false);
 
        if (tb[IFLA_LINKMODE]) {
-               write_lock_bh(&dev_base_lock);
-               dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
-               write_unlock_bh(&dev_base_lock);
+               if (dev->link_mode != nla_get_u8(tb[IFLA_LINKMODE])) {
+                       write_lock_bh(&dev_base_lock);
+                       dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
+                       write_lock_bh(&dev_base_lock);
+                       modified = 1;
+               }
        }
 
        err = 0;
@@ -857,6 +869,10 @@ errout:
 
        if (send_addr_notify)
                call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
+
+       if (modified)
+               netdev_state_change(dev);
+
        return err;
 }
 
@@ -974,7 +990,7 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname,
        if (tb[IFLA_TXQLEN])
                dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
        if (tb[IFLA_OPERSTATE])
-               set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
+               set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), true);
        if (tb[IFLA_LINKMODE])
                dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
 
index 4e354221ec2338fb646bd68b19eddd956b769506..40dddcc6dc3246c8d6be2f377a70b7c7ad3fb8e9 100644 (file)
@@ -2106,11 +2106,10 @@ int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
 /**
  *     skb_pull_rcsum - pull skb and update receive checksum
  *     @skb: buffer to update
- *     @start: start of data before pull
  *     @len: length of data pulled
  *
  *     This function performs an skb_pull on the packet and updates
- *     update the CHECKSUM_COMPLETE checksum.  It should be used on
+ *     the CHECKSUM_COMPLETE checksum.  It should be used on
  *     receive path processing instead of skb_pull unless you know
  *     that the checksum difference is zero (e.g., a valid IP header)
  *     or you are setting ip_summed to CHECKSUM_NONE.
index 9d4555ec0b59136eb4e1ba259531c5d57cd7d451..8219b7e0968d1df51a315b2880bf35be09888ab3 100644 (file)
@@ -96,7 +96,7 @@ static int ah_output(struct xfrm_state *x, struct sk_buff *skb)
 
        ah->reserved = 0;
        ah->spi = x->id.spi;
-       ah->seq_no = htonl(XFRM_SKB_CB(skb)->seq);
+       ah->seq_no = htonl(XFRM_SKB_CB(skb)->seq.output);
 
        spin_lock_bh(&x->lock);
        err = ah_mac_digest(ahp, skb, ah->auth_data);
index 8e17f65f400215a72c3ac3effb908071255d2747..c663fa5339ee9cbadef76d947455806ba2db8425 100644 (file)
@@ -368,7 +368,6 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
                if (!(neigh->nud_state&NUD_VALID))
                        printk(KERN_DEBUG "trying to ucast probe in NUD_INVALID\n");
                dst_ha = neigh->ha;
-               read_lock_bh(&neigh->lock);
        } else if ((probes -= neigh->parms->app_probes) < 0) {
 #ifdef CONFIG_ARPD
                neigh_app_ns(neigh);
@@ -378,8 +377,6 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
 
        arp_send(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr,
                 dst_ha, dev->dev_addr, NULL);
-       if (dst_ha)
-               read_unlock_bh(&neigh->lock);
 }
 
 static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip)
index 258d17631b4bb9b1767b8a8afa8582250f046a3a..091e6709f83109dc1e229f24bfe3cad71d5be13a 100644 (file)
@@ -199,7 +199,7 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
        }
 
        esph->spi = x->id.spi;
-       esph->seq_no = htonl(XFRM_SKB_CB(skb)->seq);
+       esph->seq_no = htonl(XFRM_SKB_CB(skb)->seq.output);
 
        sg_init_table(sg, nfrags);
        skb_to_sgvec(skb, sg,
@@ -210,7 +210,8 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
        aead_givcrypt_set_callback(req, 0, esp_output_done, skb);
        aead_givcrypt_set_crypt(req, sg, sg, clen, iv);
        aead_givcrypt_set_assoc(req, asg, sizeof(*esph));
-       aead_givcrypt_set_giv(req, esph->enc_data, XFRM_SKB_CB(skb)->seq);
+       aead_givcrypt_set_giv(req, esph->enc_data,
+                             XFRM_SKB_CB(skb)->seq.output);
 
        ESP_SKB_CB(skb)->tmp = tmp;
        err = crypto_aead_givencrypt(req);
index f5fba3f71c06e09283a29d48f2719bc9ad1be15b..1ff446d0fa8bca4121b1436b778b830202cd9b09 100644 (file)
@@ -1762,11 +1762,9 @@ static struct leaf *trie_leafindex(struct trie *t, int index)
 {
        struct leaf *l = trie_firstleaf(t);
 
-       while (index-- > 0) {
+       while (l && index-- > 0)
                l = trie_nextleaf(l);
-               if (!l)
-                       break;
-       }
+
        return l;
 }
 
@@ -2461,6 +2459,84 @@ static const struct file_operations fib_trie_fops = {
        .release = seq_release_net,
 };
 
+struct fib_route_iter {
+       struct seq_net_private p;
+       struct trie *main_trie;
+       loff_t  pos;
+       t_key   key;
+};
+
+static struct leaf *fib_route_get_idx(struct fib_route_iter *iter, loff_t pos)
+{
+       struct leaf *l = NULL;
+       struct trie *t = iter->main_trie;
+
+       /* use cache location of last found key */
+       if (iter->pos > 0 && pos >= iter->pos && (l = fib_find_node(t, iter->key)))
+               pos -= iter->pos;
+       else {
+               iter->pos = 0;
+               l = trie_firstleaf(t);
+       }
+
+       while (l && pos-- > 0) {
+               iter->pos++;
+               l = trie_nextleaf(l);
+       }
+
+       if (l)
+               iter->key = pos;        /* remember it */
+       else
+               iter->pos = 0;          /* forget it */
+
+       return l;
+}
+
+static void *fib_route_seq_start(struct seq_file *seq, loff_t *pos)
+       __acquires(RCU)
+{
+       struct fib_route_iter *iter = seq->private;
+       struct fib_table *tb;
+
+       rcu_read_lock();
+       tb = fib_get_table(iter->p.net, RT_TABLE_MAIN);
+       if (!tb)
+               return NULL;
+
+       iter->main_trie = (struct trie *) tb->tb_data;
+       if (*pos == 0)
+               return SEQ_START_TOKEN;
+       else
+               return fib_route_get_idx(iter, *pos - 1);
+}
+
+static void *fib_route_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+       struct fib_route_iter *iter = seq->private;
+       struct leaf *l = v;
+
+       ++*pos;
+       if (v == SEQ_START_TOKEN) {
+               iter->pos = 0;
+               l = trie_firstleaf(iter->main_trie);
+       } else {
+               iter->pos++;
+               l = trie_nextleaf(l);
+       }
+
+       if (l)
+               iter->key = l->key;
+       else
+               iter->pos = 0;
+       return l;
+}
+
+static void fib_route_seq_stop(struct seq_file *seq, void *v)
+       __releases(RCU)
+{
+       rcu_read_unlock();
+}
+
 static unsigned fib_flag_trans(int type, __be32 mask, const struct fib_info *fi)
 {
        static unsigned type2flags[RTN_MAX + 1] = {
@@ -2484,7 +2560,6 @@ static unsigned fib_flag_trans(int type, __be32 mask, const struct fib_info *fi)
  */
 static int fib_route_seq_show(struct seq_file *seq, void *v)
 {
-       const struct fib_trie_iter *iter = seq->private;
        struct leaf *l = v;
        struct leaf_info *li;
        struct hlist_node *node;
@@ -2496,12 +2571,6 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
                return 0;
        }
 
-       if (iter->trie == iter->trie_local)
-               return 0;
-
-       if (IS_TNODE(l))
-               return 0;
-
        hlist_for_each_entry_rcu(li, node, &l->list, hlist) {
                struct fib_alias *fa;
                __be32 mask, prefix;
@@ -2544,16 +2613,16 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
 }
 
 static const struct seq_operations fib_route_seq_ops = {
-       .start  = fib_trie_seq_start,
-       .next   = fib_trie_seq_next,
-       .stop   = fib_trie_seq_stop,
+       .start  = fib_route_seq_start,
+       .next   = fib_route_seq_next,
+       .stop   = fib_route_seq_stop,
        .show   = fib_route_seq_show,
 };
 
 static int fib_route_seq_open(struct inode *inode, struct file *file)
 {
        return seq_open_net(inode, file, &fib_route_seq_ops,
-                           sizeof(struct fib_trie_iter));
+                           sizeof(struct fib_route_iter));
 }
 
 static const struct file_operations fib_route_fops = {
index 9cac6c034abd98335fa2d8d43539d13bd4d627c9..1aba606f6bbb610249dcc06291d3435907b53a30 100644 (file)
@@ -120,8 +120,6 @@ void inet_listen_wlock(struct inet_hashinfo *hashinfo)
        }
 }
 
-EXPORT_SYMBOL(inet_listen_wlock);
-
 /*
  * Don't inline this cruft. Here are some nice properties to exploit here. The
  * BSD API does not allow a listening sock to specify the remote port nor the
@@ -494,7 +492,6 @@ out:
                return ret;
        }
 }
-EXPORT_SYMBOL_GPL(__inet_hash_connect);
 
 /*
  * Bind a port for a connect operation and hash it.
index 754b0a5bbfe9b225a52041b7a4ced135fded0afe..de0572c888590c10d0de778785c4aa29c4ff0220 100644 (file)
@@ -514,11 +514,6 @@ static int do_ip_setsockopt(struct sock *sk, int level,
                        val &= ~3;
                        val |= inet->tos & 3;
                }
-               if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP &&
-                   !capable(CAP_NET_ADMIN)) {
-                       err = -EPERM;
-                       break;
-               }
                if (inet->tos != val) {
                        inet->tos = val;
                        sk->sk_priority = rt_tos2priority(val);
index 379c8e04c36c6ccf17e84abf860fd734fb5945be..2ff0c8233e47a0096e5670aaa3e41d80d7e3f6a3 100644 (file)
@@ -283,7 +283,7 @@ static int ah6_output(struct xfrm_state *x, struct sk_buff *skb)
 
        ah->reserved = 0;
        ah->spi = x->id.spi;
-       ah->seq_no = htonl(XFRM_SKB_CB(skb)->seq);
+       ah->seq_no = htonl(XFRM_SKB_CB(skb)->seq.output);
 
        spin_lock_bh(&x->lock);
        err = ah_mac_digest(ahp, skb, ah->auth_data);
index 8e0f1428c7167ac85dbdc0b5e4a33426e9e44a5d..0ec1402320ea63898bd9761b6bb243cab14dad12 100644 (file)
@@ -188,7 +188,7 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)
        *skb_mac_header(skb) = IPPROTO_ESP;
 
        esph->spi = x->id.spi;
-       esph->seq_no = htonl(XFRM_SKB_CB(skb)->seq);
+       esph->seq_no = htonl(XFRM_SKB_CB(skb)->seq.output);
 
        sg_init_table(sg, nfrags);
        skb_to_sgvec(skb, sg,
@@ -199,7 +199,8 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)
        aead_givcrypt_set_callback(req, 0, esp_output_done, skb);
        aead_givcrypt_set_crypt(req, sg, sg, clen, iv);
        aead_givcrypt_set_assoc(req, asg, sizeof(*esph));
-       aead_givcrypt_set_giv(req, esph->enc_data, XFRM_SKB_CB(skb)->seq);
+       aead_givcrypt_set_giv(req, esph->enc_data,
+                             XFRM_SKB_CB(skb)->seq.output);
 
        ESP_SKB_CB(skb)->tmp = tmp;
        err = crypto_aead_givencrypt(req);
index 9ac6ca2521c32fba05dd4c99e9f8e68bbf762c32..8b67ca07467d48e0bb3e62da1ae19d7a6d5b156e 100644 (file)
@@ -621,7 +621,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
         * or if the skb it not generated by a local socket.  (This last
         * check should be redundant, but it's free.)
         */
-       if (!np || np->pmtudisc >= IPV6_PMTUDISC_DO) {
+       if (!skb->local_df) {
                skb->dev = skb->dst->dev;
                icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
                IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_FRAGFAILS);
@@ -1420,6 +1420,10 @@ int ip6_push_pending_frames(struct sock *sk)
                tmp_skb->sk = NULL;
        }
 
+       /* Allow local fragmentation. */
+       if (np->pmtudisc < IPV6_PMTUDISC_DO)
+               skb->local_df = 1;
+
        ipv6_addr_copy(final_dst, &fl->fl6_dst);
        __skb_pull(skb, skb_network_header_len(skb));
        if (opt && opt->opt_flen)
index b34c58c656563851f25b548a84b82742beb72a1d..79ccfb080733d77e52831ce5dd832302856fc5be 100644 (file)
@@ -36,7 +36,7 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)
        if (mtu < IPV6_MIN_MTU)
                mtu = IPV6_MIN_MTU;
 
-       if (skb->len > mtu) {
+       if (!skb->local_df && skb->len > mtu) {
                skb->dev = dst->dev;
                icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
                ret = -EMSGSIZE;
index b3ac85e808acf288dc91a1c12d7a9c92323cdf1d..1c853927810add38d862838c702de91bb687e4f0 100644 (file)
@@ -2291,6 +2291,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
        return 0;
 
 out:
+       xp->dead = 1;
        xfrm_policy_destroy(xp);
        return err;
 }
index 67b7c75c430d337e0ddfdc5e8a33dac498b60472..28bcdf9fc3df426668eea580ea78d6102f3659c1 100644 (file)
@@ -165,6 +165,7 @@ static int ieee80211_open(struct net_device *dev)
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_if_init_conf conf;
        int res;
+       bool need_hw_reconfig = 0;
 
        sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
@@ -218,7 +219,7 @@ static int ieee80211_open(struct net_device *dev)
                        res = local->ops->start(local_to_hw(local));
                if (res)
                        return res;
-               ieee80211_hw_config(local);
+               need_hw_reconfig = 1;
                ieee80211_led_radio(local, local->hw.conf.radio_enabled);
        }
 
@@ -282,6 +283,8 @@ static int ieee80211_open(struct net_device *dev)
                atomic_inc(&local->iff_promiscs);
 
        local->open_count++;
+       if (need_hw_reconfig)
+               ieee80211_hw_config(local);
 
        netif_start_queue(dev);
 
index 202d7fa09483841ac91143f1d1c53dab9d6a6d50..62567959b66ea0c1018851aa6413db05863b12ec 100644 (file)
@@ -945,7 +945,7 @@ static int tcp_packet(struct nf_conn *ct,
 
        ct->proto.tcp.state = new_state;
        if (old_state != new_state
-           && new_state == TCP_CONNTRACK_CLOSE)
+           && new_state == TCP_CONNTRACK_FIN_WAIT)
                ct->proto.tcp.seen[dir].flags |= IP_CT_TCP_FLAG_CLOSE_INIT;
        timeout = ct->proto.tcp.retrans >= nf_ct_tcp_max_retrans
                  && tcp_timeouts[new_state] > nf_ct_tcp_timeout_max_retrans
index 7708e2084ce28efd6dcb8b70384ca23d2387c178..c0284856ccd490bf32c23b7fafd01f04ff793d08 100644 (file)
@@ -111,7 +111,7 @@ secmark_tg_check(const char *tablename, const void *entry,
        return true;
 }
 
-void secmark_tg_destroy(const struct xt_target *target, void *targinfo)
+static void secmark_tg_destroy(const struct xt_target *target, void *targinfo)
 {
        switch (mode) {
        case SECMARK_MODE_SEL:
index 9a8ea0195c4fbc2f08bb8c55a5535ae43889c809..fd462313471cb294fb9d772f7d97d5567ce080f1 100644 (file)
@@ -150,11 +150,11 @@ static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain)
        entry = netlbl_domhsh_search(domain);
        if (entry == NULL) {
                entry = rcu_dereference(netlbl_domhsh_def);
-               if (entry != NULL && entry->valid)
-                       return entry;
+               if (entry != NULL && !entry->valid)
+                       entry = NULL;
        }
 
-       return NULL;
+       return entry;
 }
 
 /*
index 42e81fd8cc491892fe371beda6de52a4e3ad775b..3e745b72fded93860d66ae29df646c889eb24e4a 100644 (file)
@@ -180,6 +180,7 @@ static void netlbl_unlabel_audit_addr4(struct audit_buffer *audit_buf,
        }
 }
 
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 /**
  * netlbl_unlabel_audit_addr6 - Audit an IPv6 address
  * @audit_buf: audit buffer
@@ -213,6 +214,7 @@ static void netlbl_unlabel_audit_addr6(struct audit_buffer *audit_buf,
                audit_log_format(audit_buf, " src_prefixlen=%d", mask_len);
        }
 }
+#endif /* IPv6 */
 
 /*
  * Unlabeled Connection Hash Table Functions
@@ -617,8 +619,6 @@ static int netlbl_unlhsh_add(struct net *net,
        int ifindex;
        struct net_device *dev;
        struct netlbl_unlhsh_iface *iface;
-       struct in_addr *addr4, *mask4;
-       struct in6_addr *addr6, *mask6;
        struct audit_buffer *audit_buf = NULL;
        char *secctx = NULL;
        u32 secctx_len;
@@ -651,7 +651,9 @@ static int netlbl_unlhsh_add(struct net *net,
        audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCADD,
                                              audit_info);
        switch (addr_len) {
-       case sizeof(struct in_addr):
+       case sizeof(struct in_addr): {
+               struct in_addr *addr4, *mask4;
+
                addr4 = (struct in_addr *)addr;
                mask4 = (struct in_addr *)mask;
                ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid);
@@ -661,8 +663,11 @@ static int netlbl_unlhsh_add(struct net *net,
                                                   addr4->s_addr,
                                                   mask4->s_addr);
                break;
+       }
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-       case sizeof(struct in6_addr):
+       case sizeof(struct in6_addr): {
+               struct in6_addr *addr6, *mask6;
+
                addr6 = (struct in6_addr *)addr;
                mask6 = (struct in6_addr *)mask;
                ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid);
@@ -671,6 +676,7 @@ static int netlbl_unlhsh_add(struct net *net,
                                                   dev_name,
                                                   addr6, mask6);
                break;
+       }
 #endif /* IPv6 */
        default:
                ret_val = -EINVAL;
@@ -1741,10 +1747,6 @@ int netlbl_unlabel_getattr(const struct sk_buff *skb,
                           u16 family,
                           struct netlbl_lsm_secattr *secattr)
 {
-       struct iphdr *hdr4;
-       struct ipv6hdr *hdr6;
-       struct netlbl_unlhsh_addr4 *addr4;
-       struct netlbl_unlhsh_addr6 *addr6;
        struct netlbl_unlhsh_iface *iface;
 
        rcu_read_lock();
@@ -1752,21 +1754,29 @@ int netlbl_unlabel_getattr(const struct sk_buff *skb,
        if (iface == NULL)
                goto unlabel_getattr_nolabel;
        switch (family) {
-       case PF_INET:
+       case PF_INET: {
+               struct iphdr *hdr4;
+               struct netlbl_unlhsh_addr4 *addr4;
+
                hdr4 = ip_hdr(skb);
                addr4 = netlbl_unlhsh_search_addr4(hdr4->saddr, iface);
                if (addr4 == NULL)
                        goto unlabel_getattr_nolabel;
                secattr->attr.secid = addr4->secid;
                break;
+       }
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-       case PF_INET6:
+       case PF_INET6: {
+               struct ipv6hdr *hdr6;
+               struct netlbl_unlhsh_addr6 *addr6;
+
                hdr6 = ipv6_hdr(skb);
                addr6 = netlbl_unlhsh_search_addr6(&hdr6->saddr, iface);
                if (addr6 == NULL)
                        goto unlabel_getattr_nolabel;
                secattr->attr.secid = addr6->secid;
                break;
+       }
 #endif /* IPv6 */
        default:
                goto unlabel_getattr_nolabel;
index 85a96a3fddaafdaa016dbdd14aea0f9433d8c22e..023fc8fe840d16169f2cb90dd1a494122f460434 100644 (file)
@@ -96,7 +96,6 @@ int netlbl_netlink_init(void)
 struct audit_buffer *netlbl_audit_start_common(int type,
                                               struct netlbl_audit *audit_info)
 {
-       struct audit_context *audit_ctx = current->audit_context;
        struct audit_buffer *audit_buf;
        char *secctx;
        u32 secctx_len;
@@ -104,7 +103,7 @@ struct audit_buffer *netlbl_audit_start_common(int type,
        if (audit_enabled == 0)
                return NULL;
 
-       audit_buf = audit_log_start(audit_ctx, GFP_ATOMIC, type);
+       audit_buf = audit_log_start(current->audit_context, GFP_ATOMIC, type);
        if (audit_buf == NULL)
                return NULL;
 
index 150579a21469d664563dfcee8bdef5d3f0e355e1..d16929c9b4bc39b6f036c22a5365a7e7a49fa8c1 100644 (file)
@@ -230,10 +230,8 @@ static void genl_unregister_mc_groups(struct genl_family *family)
 {
        struct genl_multicast_group *grp, *tmp;
 
-       genl_lock();
        list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list)
                __genl_unregister_mc_group(family, grp);
-       genl_unlock();
 }
 
 /**
@@ -396,10 +394,10 @@ int genl_unregister_family(struct genl_family *family)
 {
        struct genl_family *rc;
 
-       genl_unregister_mc_groups(family);
-
        genl_lock();
 
+       genl_unregister_mc_groups(family);
+
        list_for_each_entry(rc, genl_family_chain(family->id), family_list) {
                if (family->id != rc->id || strcmp(rc->name, family->name))
                        continue;
index 7651de0085028dc4d02b15e5844e239dd938d01e..b6d35cd72a50988e2075683ff757902ec7af6ccc 100644 (file)
@@ -701,6 +701,9 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
 {
        struct socket *sock = file->private_data;
 
+       if (unlikely(!sock->ops->splice_read))
+               return -EINVAL;
+
        return sock->ops->splice_read(sock, ppos, pipe, len, flags);
 }
 
index 3e321949e1dc55cbd89db97a857e6fe70512f6c3..0598b229c11d326720a6c56b9bce66cfaa66e6b7 100644 (file)
@@ -159,7 +159,8 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
        BUG_ON(sge_count >= 32);
        dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, "
                "write_len=%d, xdr_sge=%p, sge_count=%d\n",
-               rmr, to, xdr_off, write_len, xdr_sge, sge_count);
+               rmr, (unsigned long long)to, xdr_off,
+               write_len, xdr_sge, sge_count);
 
        ctxt = svc_rdma_get_context(xprt);
        ctxt->count = 0;
index 8f9dbec319be471688fdc78a4cea4815809406ba..9201ef8ad90eb2143a652b769ee4215e54eaa72c 100644 (file)
@@ -38,7 +38,7 @@ config XFRM_MIGRATE
 
 config XFRM_STATISTICS
        bool "Transformation statistics (EXPERIMENTAL)"
-       depends on XFRM && PROC_FS && EXPERIMENTAL
+       depends on INET && XFRM && PROC_FS && EXPERIMENTAL
        ---help---
          This statistics is not a SNMP/MIB specification but shows
          statistics about transformation error (or almost error) factor
index 4d6ebc633a944d14a328606ee675ae5cc528e191..62188c6a06ddc2d933f0ad88819f3d4f10479638 100644 (file)
@@ -109,7 +109,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
        if (encap_type < 0) {
                async = 1;
                x = xfrm_input_state(skb);
-               seq = XFRM_SKB_CB(skb)->seq;
+               seq = XFRM_SKB_CB(skb)->seq.input;
                goto resume;
        }
 
@@ -175,7 +175,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
 
                spin_unlock(&x->lock);
 
-               XFRM_SKB_CB(skb)->seq = seq;
+               XFRM_SKB_CB(skb)->seq.input = seq;
 
                nexthdr = x->type->input(x, skb);
 
index fc690368325f6b86c0ee7b1e74a16ac442b3965d..569d377932c4b5457b2512f712ac140d00b05704 100644 (file)
@@ -62,7 +62,7 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
                }
 
                if (x->type->flags & XFRM_TYPE_REPLAY_PROT) {
-                       XFRM_SKB_CB(skb)->seq = ++x->replay.oseq;
+                       XFRM_SKB_CB(skb)->seq.output = ++x->replay.oseq;
                        if (unlikely(x->replay.oseq == 0)) {
                                XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATESEQERROR);
                                x->replay.oseq--;
index 78338079b7f579d07ad4267ae782a1bfea2613e2..f971ca5645f8283991f29e06fe2bdc888b66a499 100644 (file)
@@ -1105,6 +1105,7 @@ static struct xfrm_policy *xfrm_policy_construct(struct xfrm_userpolicy_info *p,
        return xp;
  error:
        *errp = err;
+       xp->dead = 1;
        xfrm_policy_destroy(xp);
        return NULL;
 }
index da3559ea92e03759d6a2a6d32c1307a9e1dc5c3b..d64e6badc9427ed9d6c8a2d47652d5ecab693293 100644 (file)
@@ -39,10 +39,13 @@ escsq = $(subst $(squote),'\$(squote)',$1)
 # - If they are equal no change, and no timestamp update
 # - stdin is piped in from the first prerequisite ($<) so one has
 #   to specify a valid file as first prerequisite (often the kbuild file)
+       chk_filechk = :
  quiet_chk_filechk = echo '  CHK     $@'
 silent_chk_filechk = :
+       upd_filechk = :
  quiet_upd_filechk = echo '  UPD     $@'
 silent_upd_filechk = :
+
 define filechk
        $(Q)set -e;                             \
        $($(quiet)chk_filechk);                 \
index e5ed07510309edb0da10a151095cd3529bf41442..44f16d9041e3896b2444f2fc77f14c5d3181cde1 100644 (file)
@@ -1272,12 +1272,18 @@ static int task_has_perm(struct task_struct *tsk1,
                            SECCLASS_PROCESS, perms, NULL);
 }
 
+#if CAP_LAST_CAP > 63
+#error Fix SELinux to handle capabilities > 63.
+#endif
+
 /* Check whether a task is allowed to use a capability. */
 static int task_has_capability(struct task_struct *tsk,
                               int cap)
 {
        struct task_security_struct *tsec;
        struct avc_audit_data ad;
+       u16 sclass;
+       u32 av = CAP_TO_MASK(cap);
 
        tsec = tsk->security;
 
@@ -1285,8 +1291,19 @@ static int task_has_capability(struct task_struct *tsk,
        ad.tsk = tsk;
        ad.u.cap = cap;
 
-       return avc_has_perm(tsec->sid, tsec->sid,
-                           SECCLASS_CAPABILITY, CAP_TO_MASK(cap), &ad);
+       switch (CAP_TO_INDEX(cap)) {
+       case 0:
+               sclass = SECCLASS_CAPABILITY;
+               break;
+       case 1:
+               sclass = SECCLASS_CAPABILITY2;
+               break;
+       default:
+               printk(KERN_ERR
+                      "SELinux:  out of range capability %d\n", cap);
+               BUG();
+       }
+       return avc_has_perm(tsec->sid, tsec->sid, sclass, av, &ad);
 }
 
 /* Check whether a task is allowed to use a system operation. */
index 399f868c5c8fb945f430e1f3206c73036bb38045..d5696690d3a2c583bdb1762d7a75468968d67a84 100644 (file)
    S_(SECCLASS_CAPABILITY, CAPABILITY__LEASE, "lease")
    S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_WRITE, "audit_write")
    S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_CONTROL, "audit_control")
+   S_(SECCLASS_CAPABILITY, CAPABILITY__SETFCAP, "setfcap")
+   S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_OVERRIDE, "mac_override")
+   S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_ADMIN, "mac_admin")
    S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_READ, "nlmsg_read")
    S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_WRITE, "nlmsg_write")
    S_(SECCLASS_NETLINK_FIREWALL_SOCKET, NETLINK_FIREWALL_SOCKET__NLMSG_READ, "nlmsg_read")
index 84c9abc809787026b077d2f0a808ee9f1efe71ca..75b41311ab86bd94391a21daa7e03795a3192877 100644 (file)
 #define CAPABILITY__LEASE                         0x10000000UL
 #define CAPABILITY__AUDIT_WRITE                   0x20000000UL
 #define CAPABILITY__AUDIT_CONTROL                 0x40000000UL
+#define CAPABILITY__SETFCAP                       0x80000000UL
+#define CAPABILITY2__MAC_OVERRIDE                 0x00000001UL
+#define CAPABILITY2__MAC_ADMIN                    0x00000002UL
 #define NETLINK_ROUTE_SOCKET__IOCTL               0x00000001UL
 #define NETLINK_ROUTE_SOCKET__READ                0x00000002UL
 #define NETLINK_ROUTE_SOCKET__WRITE               0x00000004UL
index b1b0d1d8f9503d11004ab32581a8d17e647ea16a..bd813c366e34d3e00025136fb131967ea3d033ca 100644 (file)
@@ -71,3 +71,4 @@
     S_(NULL)
     S_(NULL)
     S_("peer")
+    S_("capability2")
index 09e9dd23ee1a5f54345122b1f286852772e25227..febf8868e8524226c637565802b6efbb411f88be 100644 (file)
@@ -51,6 +51,7 @@
 #define SECCLASS_DCCP_SOCKET                             60
 #define SECCLASS_MEMPROTECT                              61
 #define SECCLASS_PEER                                    68
+#define SECCLASS_CAPABILITY2                             69
 
 /*
  * Security identifier indices for initial entities