Commit 82ea975a authored by Anton Blanchard's avatar Anton Blanchard

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

into samba.org:/scratch/anton/linux-2.5_ppc64_new
parents 196e44a4 b3e20e41
...@@ -162,8 +162,6 @@ objtree := $(TOPDIR) ...@@ -162,8 +162,6 @@ objtree := $(TOPDIR)
export srctree objtree export srctree objtree
SUBDIRS := init kernel mm fs ipc lib drivers sound net security
# The temporary file to save gcc -MD generated dependencies must not # The temporary file to save gcc -MD generated dependencies must not
# contain a comma # contain a comma
depfile = $(subst $(comma),_,$(@D)/.$(@F).d) depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
...@@ -246,15 +244,35 @@ endif ...@@ -246,15 +244,35 @@ endif
# Link components for vmlinux # Link components for vmlinux
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
INIT := init/init.o init-y := init/
CORE_FILES := kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o security/built-in.o drivers-y := drivers/ sound/
LIBS := lib/lib.a networks-y := net/
DRIVERS := drivers/built-in.o sound/sound.o libs-y := lib/
NETWORKS := net/network.o
CORE_FILES := kernel/built-in.o mm/built-in.o fs/built-in.o \
ipc/built-in.o security/built-in.o
SUBDIRS += kernel mm fs ipc security
include arch/$(ARCH)/Makefile include arch/$(ARCH)/Makefile
export NETWORKS DRIVERS LIBS HEAD LDFLAGS MAKEBOOT ASFLAGS SUBDIRS += $(patsubst %/,%,$(filter %/, $(init-y) $(init-m)))
INIT += $(patsubst %/, %/built-in.o, $(init-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(core-y) $(core-m)))
CORE_FILES := $(patsubst %/, %/built-in.o, $(core-y)) $(CORE_FILES)
SUBDIRS += $(patsubst %/,%,$(filter %/, $(drivers-y) $(drivers-m)))
DRIVERS += $(patsubst %/, %/built-in.o, $(drivers-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(networks-y) $(networks-m)))
NETWORKS += $(patsubst %/, %/built-in.o, $(networks-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(libs-y) $(libs-m)))
LIBS += $(patsubst %/, %/lib.a, $(libs-y))
$(warning $(SUBDIRS))
export NETWORKS DRIVERS LIBS HEAD LDFLAGS MAKEBOOT
# boot target # boot target
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
......
...@@ -87,20 +87,12 @@ endif ...@@ -87,20 +87,12 @@ endif
HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
SUBDIRS += arch/i386/kernel arch/i386/mm arch/i386/lib libs-y += arch/i386/lib/
CORE_FILES := arch/i386/kernel/kernel.o arch/i386/mm/mm.o $(CORE_FILES) core-y += arch/i386/kernel/ arch/i386/mm/
LIBS := $(TOPDIR)/arch/i386/lib/lib.a $(LIBS) $(TOPDIR)/arch/i386/lib/lib.a
ifdef CONFIG_MATH_EMULATION drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/
SUBDIRS += arch/i386/math-emu drivers-$(CONFIG_PCI) += arch/i386/pci/
DRIVERS += arch/i386/math-emu/math.o
endif
ifdef CONFIG_PCI
SUBDIRS += arch/i386/pci
DRIVERS += arch/i386/pci/pci.o
endif
MAKEBOOT = +$(MAKE) -C arch/$(ARCH)/boot MAKEBOOT = +$(MAKE) -C arch/$(ARCH)/boot
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
EXTRA_TARGETS := kernel.o head.o init_task.o EXTRA_TARGETS := head.o init_task.o
O_TARGET := kernel.o
export-objs := mca.o i386_ksyms.o time.o export-objs := mca.o i386_ksyms.o time.o
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
# Makefile for wm-FPU-emu # Makefile for wm-FPU-emu
# #
O_TARGET := math.o
#DEBUG = -DDEBUGGING #DEBUG = -DDEBUGGING
DEBUG = DEBUG =
PARANOID = -DPARANOID PARANOID = -DPARANOID
......
# #
# Makefile for the linux i386-specific parts of the memory manager. # Makefile for the linux i386-specific parts of the memory manager.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := mm.o export-objs := pageattr.o
obj-y := init.o pgtable.o fault.o ioremap.o extable.o pageattr.o obj-y := init.o pgtable.o fault.o ioremap.o extable.o pageattr.o
obj-$(CONFIG_DISCONTIGMEM) += discontig.o obj-$(CONFIG_DISCONTIGMEM) += discontig.o
export-objs := pageattr.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
O_TARGET := pci.o
obj-y := i386.o obj-y := i386.o
ifdef CONFIG_VISWS ifdef CONFIG_VISWS
......
...@@ -112,7 +112,7 @@ endif ...@@ -112,7 +112,7 @@ endif
ifdef CONFIG_DECSTATION ifdef CONFIG_DECSTATION
CORE_FILES += arch/mips/dec/dec.o CORE_FILES += arch/mips/dec/dec.o
SUBDIRS += arch/mips/dec arch/mips/dec/prom SUBDIRS += arch/mips/dec arch/mips/dec/prom
LIBS += arch/mips/dec/prom/rexlib.a LIBS += arch/mips/dec/prom/lib.a
LOADADDR += 0x80040000 LOADADDR += 0x80040000
endif endif
...@@ -134,20 +134,20 @@ endif ...@@ -134,20 +134,20 @@ endif
ifdef CONFIG_MIPS_JAZZ ifdef CONFIG_MIPS_JAZZ
CORE_FILES += arch/mips/jazz/jazz.o CORE_FILES += arch/mips/jazz/jazz.o
SUBDIRS += arch/mips/jazz arch/mips/arc SUBDIRS += arch/mips/jazz arch/mips/arc
LIBS += arch/mips/arc/arclib.a LIBS += arch/mips/arc/lib.a
LOADADDR += 0x80080000 LOADADDR += 0x80080000
endif endif
ifdef CONFIG_SNI_RM200_PCI ifdef CONFIG_SNI_RM200_PCI
CORE_FILES += arch/mips/sni/sni.o CORE_FILES += arch/mips/sni/sni.o
SUBDIRS += arch/mips/sni arch/mips/arc SUBDIRS += arch/mips/sni arch/mips/arc
LIBS += arch/mips/arc/arclib.a LIBS += arch/mips/arc/lib.a
LOADADDR += 0x80080000 LOADADDR += 0x80080000
endif endif
ifdef CONFIG_SGI_IP22 ifdef CONFIG_SGI_IP22
CORE_FILES += arch/mips/sgi/kernel/ip22-kern.o CORE_FILES += arch/mips/sgi/kernel/ip22-kern.o
LIBS += arch/mips/arc/arclib.a LIBS += arch/mips/arc/lib.a
SUBDIRS += arch/mips/sgi/kernel arch/mips/arc SUBDIRS += arch/mips/sgi/kernel arch/mips/arc
# #
# Set LOADADDR to >= 0x88069000 if you want to leave space for symmon, # Set LOADADDR to >= 0x88069000 if you want to leave space for symmon,
...@@ -162,7 +162,7 @@ endif ...@@ -162,7 +162,7 @@ endif
# #
ifdef CONFIG_BAGET_MIPS ifdef CONFIG_BAGET_MIPS
SUBDIRS += arch/mips/baget arch/mips/baget/prom SUBDIRS += arch/mips/baget arch/mips/baget/prom
LIBS += arch/mips/baget/baget.a arch/mips/baget/prom/bagetlib.a LIBS += arch/mips/baget/baget.a arch/mips/baget/prom/lib.a
LOADADDR += 0x80001000 LOADADDR += 0x80001000
endif endif
......
...@@ -2,13 +2,8 @@ ...@@ -2,13 +2,8 @@
# Makefile for the SGI arcs prom monitor library routines # Makefile for the SGI arcs prom monitor library routines
# under Linux. # under Linux.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
L_TARGET = arclib.a L_TARGET = lib.a
obj-y += console.o init.o memory.o tree.o env.o cmdline.o misc.o \ obj-y += console.o init.o memory.o tree.o env.o cmdline.o misc.o \
time.o file.o identify.o time.o file.o identify.o
......
# #
# Makefile for the Baget/MIPS prom emulator library routines. # Makefile for the Baget/MIPS prom emulator library routines.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
L_TARGET := bagetlib.a L_TARGET := lib.a
obj-y := init.o obj-y := init.o
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# under Linux. # under Linux.
# #
L_TARGET := rexlib.a L_TARGET := lib.a
obj-y := init.o memory.o cmdline.o identify.o locore.o obj-y := init.o memory.o cmdline.o identify.o locore.o
......
...@@ -72,7 +72,7 @@ endif ...@@ -72,7 +72,7 @@ endif
# Board-dependent options and extra files # Board-dependent options and extra files
# #
ifdef CONFIG_SGI_IP22 ifdef CONFIG_SGI_IP22
LIBS += arch/mips64/sgi-ip22/ip22.a arch/mips64/arc/arclib.a LIBS += arch/mips64/sgi-ip22/lib.a arch/mips64/arc/lib.a
SUBDIRS += arch/mips64/sgi-ip22 arch/mips64/arc SUBDIRS += arch/mips64/sgi-ip22 arch/mips64/arc
# #
# Set LOADADDR to >= 0x88069000 if you want to leave space for symmon, # Set LOADADDR to >= 0x88069000 if you want to leave space for symmon,
...@@ -84,7 +84,7 @@ endif ...@@ -84,7 +84,7 @@ endif
ifdef CONFIG_SGI_IP27 ifdef CONFIG_SGI_IP27
CORE_FILES += arch/mips64/sgi-ip27/ip27.o CORE_FILES += arch/mips64/sgi-ip27/ip27.o
LIBS += arch/mips64/arc/arclib.a LIBS += arch/mips64/arc/lib.a
SUBDIRS += arch/mips64/sgi-ip27 arch/mips64/arc SUBDIRS += arch/mips64/sgi-ip27 arch/mips64/arc
# #
# Set LOADADDR to >= 0xc000000000300000 if you want to leave space for # Set LOADADDR to >= 0xc000000000300000 if you want to leave space for
...@@ -100,7 +100,7 @@ endif ...@@ -100,7 +100,7 @@ endif
endif endif
ifdef CONFIG_SGI_IP32 ifdef CONFIG_SGI_IP32
LIBS += arch/mips64/sgi-ip32/ip32-kern.a arch/mips64/arc/arclib.a LIBS += arch/mips64/sgi-ip32/ip32-kern.a arch/mips64/arc/lib.a
SUBDIRS += arch/mips64/sgi-ip32 arch/mips64/arc SUBDIRS += arch/mips64/sgi-ip32 arch/mips64/arc
# #
# Set LOADADDR to >= 0x????????? if you want to leave space for symmon, # Set LOADADDR to >= 0x????????? if you want to leave space for symmon,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the ARC prom monitor library routines under Linux. # Makefile for the ARC prom monitor library routines under Linux.
# #
L_TARGET = arclib.a L_TARGET = lib.a
obj-y := console.o init.o identify.o tree.o env.o cmdline.o misc.o time.o \ obj-y := console.o init.o identify.o tree.o env.o cmdline.o misc.o time.o \
file.o file.o
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
EXTRA_AFLAGS := $(CFLAGS) EXTRA_AFLAGS := $(CFLAGS)
L_TARGET = ip22.a L_TARGET = lib.a
obj-y += ip22-berr.o ip22-mc.o ip22-sc.o ip22-hpc.o ip22-int.o ip22-rtc.o \ obj-y += ip22-berr.o ip22-mc.o ip22-sc.o ip22-hpc.o ip22-int.o ip22-rtc.o \
ip22-setup.o system.o ip22-timer.o ip22-irq.o ip22-reset.o time.o ip22-setup.o system.o ip22-timer.o ip22-irq.o ip22-reset.o time.o
......
...@@ -19,7 +19,7 @@ OBJCOPY_ARGS = -O elf32-powerpc ...@@ -19,7 +19,7 @@ OBJCOPY_ARGS = -O elf32-powerpc
MKIMAGE := ./utils/mkimage.wrapper MKIMAGE := ./utils/mkimage.wrapper
lib/zlib.a: lib/zlib.c lib/lib.a: lib/zlib.c
$(MAKE) -C lib $(MAKE) -C lib
images/vmlinux.gz: $(TOPDIR)/vmlinux images/vmlinux.gz: $(TOPDIR)/vmlinux
...@@ -55,7 +55,7 @@ maketools: ...@@ -55,7 +55,7 @@ maketools:
# The targets all boards support for boot images. # The targets all boards support for boot images.
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
$(BOOT_TARGETS): vmapus lib/zlib.a images/vmlinux.gz maketools $(BOOT_TARGETS): vmapus lib/lib.a images/vmlinux.gz maketools
ifneq ($(BOOTDIRS),) ifneq ($(BOOTDIRS),)
for d in $(BOOTDIRS); do $(MAKE) -C $$d $@; done for d in $(BOOTDIRS); do $(MAKE) -C $$d $@; done
endif endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for some libs needed by zImage. # Makefile for some libs needed by zImage.
# #
L_TARGET := zlib.a L_TARGET := lib.a
obj-y := zlib.o obj-y := zlib.o
......
...@@ -40,7 +40,7 @@ SUBDIRS += arch/sparc/kernel arch/sparc/lib arch/sparc/prom \ ...@@ -40,7 +40,7 @@ SUBDIRS += arch/sparc/kernel arch/sparc/lib arch/sparc/prom \
CORE_FILES := arch/sparc/kernel/kernel.o arch/sparc/mm/mm.o $(CORE_FILES) \ CORE_FILES := arch/sparc/kernel/kernel.o arch/sparc/mm/mm.o $(CORE_FILES) \
arch/sparc/math-emu/math-emu.o arch/sparc/math-emu/math-emu.o
LIBS := $(LIBS) arch/sparc/prom/promlib.a arch/sparc/lib/lib.a LIBS := $(LIBS) arch/sparc/prom/lib.a arch/sparc/lib/lib.a
# This one has to come last # This one has to come last
SUBDIRS += arch/sparc/boot SUBDIRS += arch/sparc/boot
......
...@@ -2,13 +2,8 @@ ...@@ -2,13 +2,8 @@
# Makefile for the Sun Boot PROM interface library under # Makefile for the Sun Boot PROM interface library under
# Linux. # Linux.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
L_TARGET = promlib.a L_TARGET = lib.a
obj-y := bootstr.o devmap.o devops.o init.o memory.o misc.o mp.o \ obj-y := bootstr.o devmap.o devops.o init.o memory.o misc.o mp.o \
palloc.o ranges.o segment.o console.o printf.o tree.o palloc.o ranges.o segment.o console.o printf.o tree.o
......
...@@ -72,7 +72,7 @@ endif ...@@ -72,7 +72,7 @@ endif
CORE_FILES += arch/sparc64/math-emu/math-emu.o CORE_FILES += arch/sparc64/math-emu/math-emu.o
LIBS := $(TOPDIR)/lib/lib.a $(LIBS) $(TOPDIR)/arch/sparc64/prom/promlib.a \ LIBS := $(TOPDIR)/lib/lib.a $(LIBS) $(TOPDIR)/arch/sparc64/prom/lib.a \
$(TOPDIR)/arch/sparc64/lib/lib.a $(TOPDIR)/arch/sparc64/lib/lib.a
vmlinux.aout: vmlinux vmlinux.aout: vmlinux
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
EXTRA_AFLAGS := -ansi EXTRA_AFLAGS := -ansi
L_TARGET = promlib.a L_TARGET = lib.a
obj-y := bootstr.o devops.o init.o memory.o misc.o \ obj-y := bootstr.o devops.o init.o memory.o misc.o \
tree.o console.o printf.o p1275.o map.o tree.o console.o printf.o p1275.o map.o
......
...@@ -9,18 +9,8 @@ ...@@ -9,18 +9,8 @@
# #
export-objs := ide-iops.o ide-taskfile.o ide-proc.o ide.o ide-probe.o ide-dma.o ide-lib.o setup-pci.o export-objs := ide-iops.o ide-taskfile.o ide-proc.o ide.o ide-probe.o ide-dma.o ide-lib.o setup-pci.o
all-subdirs := arm legacy pci ppc
mod-subdirs := arm legacy pci ppc
obj-y :=
obj-m :=
ide-obj-y :=
subdir-$(CONFIG_BLK_DEV_IDEPCI) += pci
subdir-$(CONFIG_BLK_DEV_IDE) += legacy ppc arm pci
# First come modules that register themselves with the core # First come modules that register themselves with the core
obj-y += pci/idedriver-pci.o obj-$(CONFIG_BLK_DEV_IDEPCI) += pci/
# Core IDE code - must come before legacy # Core IDE code - must come before legacy
...@@ -38,10 +28,6 @@ ifeq ($(CONFIG_BLK_DEV_IDE),y) ...@@ -38,10 +28,6 @@ ifeq ($(CONFIG_BLK_DEV_IDE),y)
obj-$(CONFIG_PROC_FS) += ide-proc.o obj-$(CONFIG_PROC_FS) += ide-proc.o
endif endif
ifeq ($(CONFIG_BLK_DEV_IDE),y) obj-$(CONFIG_BLK_DEV_IDE) += legacy/ ppc/ arm/
obj-y += legacy/idedriver-legacy.o
obj-y += ppc/idedriver-ppc.o
obj-y += arm/idedriver-arm.o
endif
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
O_TARGET := idedriver-arm.o
obj-y :=
obj-m :=
obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o
obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o
......
O_TARGET := idedriver-legacy.o
obj-y :=
obj-m :=
obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o
obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o
obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o
......
O_TARGET := idedriver-pci.o
obj-y :=
obj-m :=
obj-$(CONFIG_BLK_DEV_ADMA100) += adma100.o obj-$(CONFIG_BLK_DEV_ADMA100) += adma100.o
obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o
obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o
......
O_TARGET := idedriver-ppc.o
obj-y :=
obj-m :=
obj-$(CONFIG_BLK_DEV_MPC8xx_IDE) += mpc8xx.o obj-$(CONFIG_BLK_DEV_MPC8xx_IDE) += mpc8xx.o
obj-$(CONFIG_BLK_DEV_IDE_PMAC) += pmac.o obj-$(CONFIG_BLK_DEV_IDE_PMAC) += pmac.o
obj-$(CONFIG_BLK_DEV_IDE_SWARM) += swarm.o obj-$(CONFIG_BLK_DEV_IDE_SWARM) += swarm.o
......
...@@ -2,11 +2,8 @@ ...@@ -2,11 +2,8 @@
# Makefile for the Linux IEEE 1394 implementation # Makefile for the Linux IEEE 1394 implementation
# #
O_TARGET := ieee1394drv.o
export-objs := ieee1394_core.o ohci1394.o cmp.o export-objs := ieee1394_core.o ohci1394.o cmp.o
list-multi := ieee1394.o
ieee1394-objs := ieee1394_core.o ieee1394_transactions.o hosts.o \ ieee1394-objs := ieee1394_core.o ieee1394_transactions.o hosts.o \
highlevel.o csr.o nodemgr.o highlevel.o csr.o nodemgr.o
...@@ -22,6 +19,3 @@ obj-$(CONFIG_IEEE1394_AMDTP) += amdtp.o ...@@ -22,6 +19,3 @@ obj-$(CONFIG_IEEE1394_AMDTP) += amdtp.o
obj-$(CONFIG_IEEE1394_CMP) += cmp.o obj-$(CONFIG_IEEE1394_CMP) += cmp.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
ieee1394.o: $(ieee1394-objs)
$(LD) $(LDFLAGS) -r -o $@ $(ieee1394-objs)
...@@ -59,7 +59,7 @@ static LIST_HEAD(adapter_list); ...@@ -59,7 +59,7 @@ static LIST_HEAD(adapter_list);
* This function will be called when the adapter is plugged * This function will be called when the adapter is plugged
* into the USB bus. * into the USB bus.
*/ */
static int probe_st5481(struct usb_interface *intf static int probe_st5481(struct usb_interface *intf,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
struct usb_device *dev = interface_to_usbdev(intf); struct usb_device *dev = interface_to_usbdev(intf);
...@@ -115,7 +115,7 @@ static int probe_st5481(struct usb_interface *intf ...@@ -115,7 +115,7 @@ static int probe_st5481(struct usb_interface *intf
st5481_start(adapter); st5481_start(adapter);
dev_set_drvdata(&intf->dev, adapter); dev_set_drvdata(&intf->dev, adapter);
return adapter; return 0;
err_b: err_b:
st5481_release_b(&adapter->bcs[0]); st5481_release_b(&adapter->bcs[0]);
......
# #
# Makefile for the LSI Logic Fusion MPT (Message Passing Technology) drivers. # Makefile for the LSI Logic Fusion MPT (Message Passing Technology) drivers.
# #
# Note! Dependencies are done automagically by 'make dep', which also # Note! If you want to turn on various debug defines for an extended period of
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definition is now inherited from the
# parent makefile.
#
# Note 3! If you want to turn on various debug defines for an extended period of
# time but don't want them lingering around in the Makefile when you pass it on # time but don't want them lingering around in the Makefile when you pass it on
# to someone else, use the MPT_CFLAGS env variable (thanks Steve). -nromer # to someone else, use the MPT_CFLAGS env variable (thanks Steve). -nromer
...@@ -53,27 +46,11 @@ EXTRA_CFLAGS += -I. ${MPT_CFLAGS} ...@@ -53,27 +46,11 @@ EXTRA_CFLAGS += -I. ${MPT_CFLAGS}
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
O_TARGET := fusion.o
export-objs := mptbase.o mptscsih.o mptlan.o mptctl.o isense.o export-objs := mptbase.o mptscsih.o mptlan.o mptctl.o isense.o
# ? what's list-multi for?
#list-multi := fusion.o mptscsih.o
obj-$(CONFIG_FUSION) += mptbase.o mptscsih.o obj-$(CONFIG_FUSION) += mptbase.o mptscsih.o
obj-$(CONFIG_FUSION_ISENSE) += isense.o obj-$(CONFIG_FUSION_ISENSE) += isense.o
obj-$(CONFIG_FUSION_CTL) += mptctl.o obj-$(CONFIG_FUSION_CTL) += mptctl.o
obj-$(CONFIG_FUSION_LAN) += mptlan.o obj-$(CONFIG_FUSION_LAN) += mptlan.o
O_OBJS := $(filter-out $(export-objs), $(obj-y))
OX_OBJS := $(filter $(export-objs), $(obj-y))
M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
# EXP...
## Fusion MPT extra's...
##mptscsih.o: $(mptscsih-objs)
## $(LD) -r -o $@ $(mptscsih-objs)
...@@ -1483,12 +1483,13 @@ vortex_up(struct net_device *dev) ...@@ -1483,12 +1483,13 @@ vortex_up(struct net_device *dev)
mii_reg1 = mdio_read(dev, vp->phys[0], 1); mii_reg1 = mdio_read(dev, vp->phys[0], 1);
mii_reg5 = mdio_read(dev, vp->phys[0], 5); mii_reg5 = mdio_read(dev, vp->phys[0], 5);
if (mii_reg5 == 0xffff || mii_reg5 == 0x0000) { if (mii_reg5 == 0xffff || mii_reg5 == 0x0000) {
; /* No MII device or no link partner report */ netif_carrier_off(dev); /* No MII device or no link partner report */
} else { } else {
mii_reg5 &= vp->advertising; mii_reg5 &= vp->advertising;
if ((mii_reg5 & 0x0100) != 0 /* 100baseTx-FD */ if ((mii_reg5 & 0x0100) != 0 /* 100baseTx-FD */
|| (mii_reg5 & 0x00C0) == 0x0040) /* 10T-FD, but not 100-HD */ || (mii_reg5 & 0x00C0) == 0x0040) /* 10T-FD, but not 100-HD */
vp->full_duplex = 1; vp->full_duplex = 1;
netif_carrier_on(dev);
} }
vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0); vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
if (vortex_debug > 1) if (vortex_debug > 1)
...@@ -1692,13 +1693,16 @@ vortex_timer(unsigned long data) ...@@ -1692,13 +1693,16 @@ vortex_timer(unsigned long data)
switch (dev->if_port) { switch (dev->if_port) {
case XCVR_10baseT: case XCVR_100baseTx: case XCVR_100baseFx: case XCVR_10baseT: case XCVR_100baseTx: case XCVR_100baseFx:
if (media_status & Media_LnkBeat) { if (media_status & Media_LnkBeat) {
netif_carrier_on(dev);
ok = 1; ok = 1;
if (vortex_debug > 1) if (vortex_debug > 1)
printk(KERN_DEBUG "%s: Media %s has link beat, %x.\n", printk(KERN_DEBUG "%s: Media %s has link beat, %x.\n",
dev->name, media_tbl[dev->if_port].name, media_status); dev->name, media_tbl[dev->if_port].name, media_status);
} else if (vortex_debug > 1) } else if (vortex_debug > 1) {
netif_carrier_off(dev);
printk(KERN_DEBUG "%s: Media %s has no link beat, %x.\n", printk(KERN_DEBUG "%s: Media %s has no link beat, %x.\n",
dev->name, media_tbl[dev->if_port].name, media_status); dev->name, media_tbl[dev->if_port].name, media_status);
}
break; break;
case XCVR_MII: case XCVR_NWAY: case XCVR_MII: case XCVR_NWAY:
{ {
...@@ -1707,7 +1711,7 @@ vortex_timer(unsigned long data) ...@@ -1707,7 +1711,7 @@ vortex_timer(unsigned long data)
if (vortex_debug > 2) if (vortex_debug > 2)
printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n", printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n",
dev->name, mii_status); dev->name, mii_status);
if (mii_status & 0x0004) { if (mii_status & BMSR_LSTATUS) {
int mii_reg5 = mdio_read(dev, vp->phys[0], 5); int mii_reg5 = mdio_read(dev, vp->phys[0], 5);
if (! vp->force_fd && mii_reg5 != 0xffff) { if (! vp->force_fd && mii_reg5 != 0xffff) {
int duplex; int duplex;
...@@ -1731,6 +1735,9 @@ vortex_timer(unsigned long data) ...@@ -1731,6 +1735,9 @@ vortex_timer(unsigned long data)
/* AKPM: bug: should reset Tx and Rx after setting Duplex. Page 180 */ /* AKPM: bug: should reset Tx and Rx after setting Duplex. Page 180 */
} }
} }
netif_carrier_on(dev);
} else {
netif_carrier_off(dev);
} }
} }
break; break;
......
...@@ -1226,17 +1226,6 @@ CONFIG_NATSEMI ...@@ -1226,17 +1226,6 @@ CONFIG_NATSEMI
More specific information and updates are available from More specific information and updates are available from
<http://www.scyld.com/network/natsemi.html>. <http://www.scyld.com/network/natsemi.html>.
CONFIG_NATSEMI_CABLE_MAGIC
Some systems see lots of errors with NatSemi ethernet controllers
on certain cables. If you are seeing lots of errors, try turning
this option on. Some boards have incorrect values for supporting
resistors that can cause this change to break. If you turn this
option on and your network suddenly stops working, turn this
option off.
Say N unless you are certain you need this option.
Vendors should not enable this option by default.
CONFIG_SK_G16 CONFIG_SK_G16
If you have a network (Ethernet) card of this type, say Y and read If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from the Ethernet-HOWTO, available from
......
...@@ -165,9 +165,6 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then ...@@ -165,9 +165,6 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
dep_tristate ' Mylex EISA LNE390A/B support (EXPERIMENTAL)' CONFIG_LNE390 $CONFIG_EISA $CONFIG_EXPERIMENTAL dep_tristate ' Mylex EISA LNE390A/B support (EXPERIMENTAL)' CONFIG_LNE390 $CONFIG_EISA $CONFIG_EXPERIMENTAL
dep_tristate ' Myson MTD-8xx PCI Ethernet support' CONFIG_FEALNX $CONFIG_PCI dep_tristate ' Myson MTD-8xx PCI Ethernet support' CONFIG_FEALNX $CONFIG_PCI
dep_tristate ' National Semiconductor DP8381x series PCI Ethernet support' CONFIG_NATSEMI $CONFIG_PCI dep_tristate ' National Semiconductor DP8381x series PCI Ethernet support' CONFIG_NATSEMI $CONFIG_PCI
if [ "$CONFIG_NATSEMI" = "y" -o "$CONFIG_NATSEMI" = "m" ]; then
bool ' NatSemi workaround for high errors' CONFIG_NATSEMI_CABLE_MAGIC
fi
dep_tristate ' PCI NE2000 and clones support (see help)' CONFIG_NE2K_PCI $CONFIG_PCI dep_tristate ' PCI NE2000 and clones support (see help)' CONFIG_NE2K_PCI $CONFIG_PCI
dep_tristate ' Novell/Eagle/Microdyne NE3210 EISA support (EXPERIMENTAL)' CONFIG_NE3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL dep_tristate ' Novell/Eagle/Microdyne NE3210 EISA support (EXPERIMENTAL)' CONFIG_NE3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL
dep_tristate ' Racal-Interlan EISA ES3210 support (EXPERIMENTAL)' CONFIG_ES3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL dep_tristate ' Racal-Interlan EISA ES3210 support (EXPERIMENTAL)' CONFIG_ES3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL
......
...@@ -158,7 +158,7 @@ static int act200l_change_speed(struct irda_task *task) ...@@ -158,7 +158,7 @@ static int act200l_change_speed(struct irda_task *task)
} }
break; break;
case IRDA_TASK_CHILD_WAIT: case IRDA_TASK_CHILD_WAIT:
WARNING(__FUNCTION__ "(), resetting dongle timed out!\n"); WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__);
ret = -1; ret = -1;
break; break;
case IRDA_TASK_CHILD_DONE: case IRDA_TASK_CHILD_DONE:
...@@ -203,7 +203,7 @@ static int act200l_change_speed(struct irda_task *task) ...@@ -203,7 +203,7 @@ static int act200l_change_speed(struct irda_task *task)
self->speed_task = NULL; self->speed_task = NULL;
break; break;
default: default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
irda_task_next_state(task, IRDA_TASK_DONE); irda_task_next_state(task, IRDA_TASK_DONE);
self->speed_task = NULL; self->speed_task = NULL;
ret = -1; ret = -1;
...@@ -269,7 +269,7 @@ static int act200l_reset(struct irda_task *task) ...@@ -269,7 +269,7 @@ static int act200l_reset(struct irda_task *task)
self->reset_task = NULL; self->reset_task = NULL;
break; break;
default: default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
irda_task_next_state(task, IRDA_TASK_DONE); irda_task_next_state(task, IRDA_TASK_DONE);
self->reset_task = NULL; self->reset_task = NULL;
ret = -1; ret = -1;
......
...@@ -259,7 +259,7 @@ static int actisys_reset(struct irda_task *task) ...@@ -259,7 +259,7 @@ static int actisys_reset(struct irda_task *task)
self->speed = 9600; /* That's the default */ self->speed = 9600; /* That's the default */
break; break;
default: default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
irda_task_next_state(task, IRDA_TASK_DONE); irda_task_next_state(task, IRDA_TASK_DONE);
self->reset_task = NULL; self->reset_task = NULL;
ret = -1; ret = -1;
......
This diff is collapsed.
...@@ -129,7 +129,7 @@ static int girbil_change_speed(struct irda_task *task) ...@@ -129,7 +129,7 @@ static int girbil_change_speed(struct irda_task *task)
} }
break; break;
case IRDA_TASK_CHILD_WAIT: case IRDA_TASK_CHILD_WAIT:
WARNING(__FUNCTION__ "(), resetting dongle timed out!\n"); WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__);
ret = -1; ret = -1;
break; break;
case IRDA_TASK_CHILD_DONE: case IRDA_TASK_CHILD_DONE:
...@@ -168,7 +168,7 @@ static int girbil_change_speed(struct irda_task *task) ...@@ -168,7 +168,7 @@ static int girbil_change_speed(struct irda_task *task)
self->speed_task = NULL; self->speed_task = NULL;
break; break;
default: default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
irda_task_next_state(task, IRDA_TASK_DONE); irda_task_next_state(task, IRDA_TASK_DONE);
self->speed_task = NULL; self->speed_task = NULL;
ret = -1; ret = -1;
...@@ -221,7 +221,7 @@ static int girbil_reset(struct irda_task *task) ...@@ -221,7 +221,7 @@ static int girbil_reset(struct irda_task *task)
self->reset_task = NULL; self->reset_task = NULL;
break; break;
default: default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
irda_task_next_state(task, IRDA_TASK_DONE); irda_task_next_state(task, IRDA_TASK_DONE);
self->reset_task = NULL; self->reset_task = NULL;
ret = -1; ret = -1;
......
...@@ -1171,7 +1171,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self) ...@@ -1171,7 +1171,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
irda_usb_init_qos(self); irda_usb_init_qos(self);
/* Initialise list of skb beeing curently transmitted */ /* Initialise list of skb beeing curently transmitted */
self->tx_list = hashbin_new(HB_GLOBAL); self->tx_list = hashbin_new(HB_NOLOCK); /* unused */
/* Allocate the buffer for speed changes */ /* Allocate the buffer for speed changes */
/* Don't change this buffer size and allocation without doing /* Don't change this buffer size and allocation without doing
......
This diff is collapsed.
This diff is collapsed.
...@@ -109,7 +109,7 @@ static int mcp2120_change_speed(struct irda_task *task) ...@@ -109,7 +109,7 @@ static int mcp2120_change_speed(struct irda_task *task)
} }
break; break;
case IRDA_TASK_CHILD_WAIT: case IRDA_TASK_CHILD_WAIT:
WARNING(__FUNCTION__ "(), resetting dongle timed out!\n"); WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__);
ret = -1; ret = -1;
break; break;
case IRDA_TASK_CHILD_DONE: case IRDA_TASK_CHILD_DONE:
...@@ -157,7 +157,7 @@ static int mcp2120_change_speed(struct irda_task *task) ...@@ -157,7 +157,7 @@ static int mcp2120_change_speed(struct irda_task *task)
//printk("mcp2120_change_speed irda_task_wait\n"); //printk("mcp2120_change_speed irda_task_wait\n");
break; break;
default: default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
irda_task_next_state(task, IRDA_TASK_DONE); irda_task_next_state(task, IRDA_TASK_DONE);
self->speed_task = NULL; self->speed_task = NULL;
ret = -1; ret = -1;
...@@ -212,7 +212,7 @@ static int mcp2120_reset(struct irda_task *task) ...@@ -212,7 +212,7 @@ static int mcp2120_reset(struct irda_task *task)
self->reset_task = NULL; self->reset_task = NULL;
break; break;
default: default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
irda_task_next_state(task, IRDA_TASK_DONE); irda_task_next_state(task, IRDA_TASK_DONE);
self->reset_task = NULL; self->reset_task = NULL;
ret = -1; ret = -1;
......
This diff is collapsed.
...@@ -431,6 +431,7 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base) ...@@ -431,6 +431,7 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base)
struct ircc_cb *self; struct ircc_cb *self;
struct irport_cb *irport; struct irport_cb *irport;
unsigned char low, high, chip, config, dma, irq, version; unsigned char low, high, chip, config, dma, irq, version;
unsigned long flags;
IRDA_DEBUG(0, __FUNCTION__ "\n"); IRDA_DEBUG(0, __FUNCTION__ "\n");
...@@ -484,7 +485,6 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base) ...@@ -484,7 +485,6 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base)
return -ENOMEM; return -ENOMEM;
} }
memset(self, 0, sizeof(struct ircc_cb)); memset(self, 0, sizeof(struct ircc_cb));
spin_lock_init(&self->lock);
/* Max DMA buffer size needed = (data_size + 6) * (window_size) + 6; */ /* Max DMA buffer size needed = (data_size + 6) * (window_size) + 6; */
self->rx_buff.truesize = 4000; self->rx_buff.truesize = 4000;
...@@ -555,6 +555,9 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base) ...@@ -555,6 +555,9 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base)
request_region(self->io->fir_base, CHIP_IO_EXTENT, driver_name); request_region(self->io->fir_base, CHIP_IO_EXTENT, driver_name);
/* Don't allow irport to change under us - Jean II */
spin_lock_irqsave(&self->irport->lock, flags);
/* Initialize QoS for this device */ /* Initialize QoS for this device */
irda_init_max_qos_capabilies(&irport->qos); irda_init_max_qos_capabilies(&irport->qos);
...@@ -581,6 +584,7 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base) ...@@ -581,6 +584,7 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base)
self->netdev->stop = &ircc_net_close; self->netdev->stop = &ircc_net_close;
irport_start(self->irport); irport_start(self->irport);
spin_unlock_irqrestore(&self->irport->lock, flags);
self->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, ircc_pmproc); self->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, ircc_pmproc);
if (self->pmdev) if (self->pmdev)
...@@ -598,6 +602,7 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base) ...@@ -598,6 +602,7 @@ static int __init ircc_open(unsigned int fir_base, unsigned int sir_base)
* *
* Change the speed of the device * Change the speed of the device
* *
* This function should be called with irq off and spin-lock.
*/ */
static void ircc_change_speed(void *priv, u32 speed) static void ircc_change_speed(void *priv, u32 speed)
{ {
...@@ -658,6 +663,7 @@ static void ircc_change_speed(void *priv, u32 speed) ...@@ -658,6 +663,7 @@ static void ircc_change_speed(void *priv, u32 speed)
/* Make special FIR init if necessary */ /* Make special FIR init if necessary */
if (speed > 115200) { if (speed > 115200) {
/* No need to lock, already locked - Jean II */
irport_stop(self->irport); irport_stop(self->irport);
/* Install FIR transmit handler */ /* Install FIR transmit handler */
...@@ -674,6 +680,7 @@ static void ircc_change_speed(void *priv, u32 speed) ...@@ -674,6 +680,7 @@ static void ircc_change_speed(void *priv, u32 speed)
} else { } else {
/* Install SIR transmit handler */ /* Install SIR transmit handler */
dev->hard_start_xmit = &irport_hard_xmit; dev->hard_start_xmit = &irport_hard_xmit;
/* No need to lock, already locked - Jean II */
irport_start(self->irport); irport_start(self->irport);
IRDA_DEBUG(0, __FUNCTION__ IRDA_DEBUG(0, __FUNCTION__
...@@ -727,20 +734,26 @@ static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -727,20 +734,26 @@ static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
/* Make sure tests *& speed change are atomic */
spin_lock_irqsave(&self->irport->lock, flags);
/* Note : you should make sure that speed changes are not going
* to corrupt any outgoing frame. Look at nsc-ircc for the gory
* details - Jean II */
/* Check if we need to change the speed after this frame */ /* Check if we need to change the speed after this frame */
speed = irda_get_next_speed(skb); speed = irda_get_next_speed(skb);
if ((speed != self->io->speed) && (speed != -1)) { if ((speed != self->io->speed) && (speed != -1)) {
/* Check for empty frame */ /* Check for empty frame */
if (!skb->len) { if (!skb->len) {
ircc_change_speed(self, speed); ircc_change_speed(self, speed);
spin_unlock_irqrestore(&self->irport->lock, flags);
dev_kfree_skb(skb); dev_kfree_skb(skb);
return 0; return 0;
} else } else
self->new_speed = speed; self->new_speed = speed;
} }
spin_lock_irqsave(&self->lock, flags);
memcpy(self->tx_buff.head, skb->data, skb->len); memcpy(self->tx_buff.head, skb->data, skb->len);
self->tx_buff.len = skb->len; self->tx_buff.len = skb->len;
...@@ -763,7 +776,7 @@ static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -763,7 +776,7 @@ static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev)
/* Transmit frame */ /* Transmit frame */
ircc_dma_xmit(self, iobase, 0); ircc_dma_xmit(self, iobase, 0);
} }
spin_unlock_irqrestore(&self->lock, flags); spin_unlock_irqrestore(&self->irport->lock, flags);
dev_kfree_skb(skb); dev_kfree_skb(skb);
return 0; return 0;
...@@ -936,14 +949,14 @@ static void ircc_dma_receive_complete(struct ircc_cb *self, int iobase) ...@@ -936,14 +949,14 @@ static void ircc_dma_receive_complete(struct ircc_cb *self, int iobase)
len -= 4; len -= 4;
if ((len < 2) || (len > 2050)) { if ((len < 2) || (len > 2050)) {
WARNING(__FUNCTION__ "(), bogus len=%d\n", len); WARNING("%s(), bogus len=%d\n", __FUNCTION__, len);
return; return;
} }
IRDA_DEBUG(2, __FUNCTION__ ": msgcnt = %d, len=%d\n", msgcnt, len); IRDA_DEBUG(2, __FUNCTION__ ": msgcnt = %d, len=%d\n", msgcnt, len);
skb = dev_alloc_skb(len+1); skb = dev_alloc_skb(len+1);
if (!skb) { if (!skb) {
WARNING(__FUNCTION__ "(), memory squeeze, dropping frame.\n"); WARNING("%s(), memory squeeze, dropping frame.\n", __FUNCTION__);
return; return;
} }
/* Make sure IP header gets aligned */ /* Make sure IP header gets aligned */
...@@ -985,12 +998,13 @@ static void ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -985,12 +998,13 @@ static void ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/* Check if we should use the SIR interrupt handler */ /* Check if we should use the SIR interrupt handler */
if (self->io->speed < 576000) { if (self->io->speed < 576000) {
/* Will spinlock itself - Jean II */
irport_interrupt(irq, dev_id, regs); irport_interrupt(irq, dev_id, regs);
return; return;
} }
iobase = self->io->fir_base; iobase = self->io->fir_base;
spin_lock(&self->lock); spin_lock(&self->irport->lock);
register_bank(iobase, 0); register_bank(iobase, 0);
iir = inb(iobase+IRCC_IIR); iir = inb(iobase+IRCC_IIR);
...@@ -1013,7 +1027,7 @@ static void ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1013,7 +1027,7 @@ static void ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
register_bank(iobase, 0); register_bank(iobase, 0);
outb(IRCC_IER_ACTIVE_FRAME|IRCC_IER_EOM, iobase+IRCC_IER); outb(IRCC_IER_ACTIVE_FRAME|IRCC_IER_EOM, iobase+IRCC_IER);
spin_unlock(&self->lock); spin_unlock(&self->irport->lock);
} }
#if 0 /* unused */ #if 0 /* unused */
...@@ -1072,7 +1086,7 @@ static int ircc_net_open(struct net_device *dev) ...@@ -1072,7 +1086,7 @@ static int ircc_net_open(struct net_device *dev)
if (request_dma(self->io->dma, dev->name)) { if (request_dma(self->io->dma, dev->name)) {
irport_net_close(dev); irport_net_close(dev);
WARNING(__FUNCTION__ "(), unable to allocate DMA=%d\n", self->io->dma); WARNING("%s(), unable to allocate DMA=%d\n", __FUNCTION__, self->io->dma);
return -EAGAIN; return -EAGAIN;
} }
...@@ -1093,7 +1107,7 @@ static int ircc_net_close(struct net_device *dev) ...@@ -1093,7 +1107,7 @@ static int ircc_net_close(struct net_device *dev)
struct ircc_cb *self; struct ircc_cb *self;
int iobase; int iobase;
IRDA_DEBUG(0, __FUNCTION__ "\n"); IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
ASSERT(dev != NULL, return -1;); ASSERT(dev != NULL, return -1;);
irport = (struct irport_cb *) dev->priv; irport = (struct irport_cb *) dev->priv;
...@@ -1128,17 +1142,15 @@ static void ircc_suspend(struct ircc_cb *self) ...@@ -1128,17 +1142,15 @@ static void ircc_suspend(struct ircc_cb *self)
static void ircc_wakeup(struct ircc_cb *self) static void ircc_wakeup(struct ircc_cb *self)
{ {
unsigned long flags;
if (!self->io->suspended) if (!self->io->suspended)
return; return;
save_flags(flags); /* The code was doing a "cli()" here, but this can't be right.
cli(); * If you need protection, do it in net_open with a spinlock
* or give a good reason. - Jean II */
ircc_net_open(self->netdev); ircc_net_open(self->netdev);
restore_flags(flags);
MESSAGE("%s, Waking up\n", driver_name); MESSAGE("%s, Waking up\n", driver_name);
} }
...@@ -1174,6 +1186,7 @@ static int __exit ircc_close(struct ircc_cb *self) ...@@ -1174,6 +1186,7 @@ static int __exit ircc_close(struct ircc_cb *self)
iobase = self->irport->io.fir_base; iobase = self->irport->io.fir_base;
/* This will destroy irport */
irport_close(self->irport); irport_close(self->irport);
/* Stop interrupts */ /* Stop interrupts */
...@@ -1187,6 +1200,7 @@ static int __exit ircc_close(struct ircc_cb *self) ...@@ -1187,6 +1200,7 @@ static int __exit ircc_close(struct ircc_cb *self)
outb(IRCC_CFGA_IRDA_SIR_A|IRCC_CFGA_TX_POLARITY, iobase+IRCC_SCE_CFGA); outb(IRCC_CFGA_IRDA_SIR_A|IRCC_CFGA_TX_POLARITY, iobase+IRCC_SCE_CFGA);
outb(IRCC_CFGB_IR, iobase+IRCC_SCE_CFGB); outb(IRCC_CFGB_IR, iobase+IRCC_SCE_CFGB);
#endif #endif
/* Release the PORT that this driver is using */ /* Release the PORT that this driver is using */
IRDA_DEBUG(0, __FUNCTION__ "(), releasing 0x%03x\n", iobase); IRDA_DEBUG(0, __FUNCTION__ "(), releasing 0x%03x\n", iobase);
......
...@@ -161,7 +161,7 @@ static int tekram_change_speed(struct irda_task *task) ...@@ -161,7 +161,7 @@ static int tekram_change_speed(struct irda_task *task)
irda_task_next_state(task, IRDA_TASK_CHILD_DONE); irda_task_next_state(task, IRDA_TASK_CHILD_DONE);
break; break;
case IRDA_TASK_CHILD_WAIT: case IRDA_TASK_CHILD_WAIT:
WARNING(__FUNCTION__ "(), resetting dongle timed out!\n"); WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__);
ret = -1; ret = -1;
break; break;
case IRDA_TASK_CHILD_DONE: case IRDA_TASK_CHILD_DONE:
...@@ -187,7 +187,7 @@ static int tekram_change_speed(struct irda_task *task) ...@@ -187,7 +187,7 @@ static int tekram_change_speed(struct irda_task *task)
self->speed_task = NULL; self->speed_task = NULL;
break; break;
default: default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
irda_task_next_state(task, IRDA_TASK_DONE); irda_task_next_state(task, IRDA_TASK_DONE);
self->speed_task = NULL; self->speed_task = NULL;
ret = -1; ret = -1;
...@@ -255,7 +255,7 @@ int tekram_reset(struct irda_task *task) ...@@ -255,7 +255,7 @@ int tekram_reset(struct irda_task *task)
self->reset_task = NULL; self->reset_task = NULL;
break; break;
default: default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state);
irda_task_next_state(task, IRDA_TASK_DONE); irda_task_next_state(task, IRDA_TASK_DONE);
self->reset_task = NULL; self->reset_task = NULL;
ret = -1; ret = -1;
......
...@@ -421,8 +421,8 @@ toshoboe_interrupt (int irq, void *dev_id, struct pt_regs *regs) ...@@ -421,8 +421,8 @@ toshoboe_interrupt (int irq, void *dev_id, struct pt_regs *regs)
} }
else else
{ {
printk (KERN_INFO __FUNCTION__ printk (KERN_INFO
"(), memory squeeze, dropping frame.\n"); "%s(), memory squeeze, dropping frame.\n", __FUNCTION__);
} }
self->taskfile->recv[self->rxs].control = 0x83; self->taskfile->recv[self->rxs].control = 0x83;
...@@ -824,7 +824,7 @@ toshoboe_probe (struct pci_dev *pci_dev, const struct pci_device_id *pdid) ...@@ -824,7 +824,7 @@ toshoboe_probe (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
if (!(dev = dev_alloc("irda%d", &err))) { if (!(dev = dev_alloc("irda%d", &err))) {
ERROR(__FUNCTION__ "(), dev_alloc() failed!\n"); ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__);
err = -ENOMEM; err = -ENOMEM;
goto freebufs; goto freebufs;
} }
...@@ -843,7 +843,7 @@ toshoboe_probe (struct pci_dev *pci_dev, const struct pci_device_id *pdid) ...@@ -843,7 +843,7 @@ toshoboe_probe (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
err = register_netdevice(dev); err = register_netdevice(dev);
rtnl_unlock(); rtnl_unlock();
if (err) { if (err) {
ERROR(__FUNCTION__ "(), register_netdev() failed!\n"); ERROR("%s(), register_netdev() failed!\n", __FUNCTION__);
/* XXX there is not freeing for dev? */ /* XXX there is not freeing for dev? */
goto freebufs; goto freebufs;
} }
......
...@@ -175,6 +175,7 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq, ...@@ -175,6 +175,7 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
return -ENOMEM; return -ENOMEM;
} }
memset(self, 0, sizeof(struct w83977af_ir)); memset(self, 0, sizeof(struct w83977af_ir));
spin_lock_init(&self->lock);
/* Need to store self somewhere */ /* Need to store self somewhere */
dev_self[i] = self; dev_self[i] = self;
...@@ -236,7 +237,7 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq, ...@@ -236,7 +237,7 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
self->rx_buff.data = self->rx_buff.head; self->rx_buff.data = self->rx_buff.head;
if (!(dev = dev_alloc("irda%d", &err))) { if (!(dev = dev_alloc("irda%d", &err))) {
ERROR(__FUNCTION__ "(), dev_alloc() failed!\n"); ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
dev->priv = (void *) self; dev->priv = (void *) self;
...@@ -254,7 +255,7 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq, ...@@ -254,7 +255,7 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
err = register_netdevice(dev); err = register_netdevice(dev);
rtnl_unlock(); rtnl_unlock();
if (err) { if (err) {
ERROR(__FUNCTION__ "(), register_netdevice() failed!\n"); ERROR("%s(), register_netdevice() failed!\n", __FUNCTION__);
return -1; return -1;
} }
MESSAGE("IrDA: Registered device %s\n", dev->name); MESSAGE("IrDA: Registered device %s\n", dev->name);
...@@ -603,8 +604,7 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase) ...@@ -603,8 +604,7 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase)
switch_bank(iobase, SET2); switch_bank(iobase, SET2);
outb(ADCR1_D_CHSW|/*ADCR1_DMA_F|*/ADCR1_ADV_SL, iobase+ADCR1); outb(ADCR1_D_CHSW|/*ADCR1_DMA_F|*/ADCR1_ADV_SL, iobase+ADCR1);
#ifdef CONFIG_NETWINDER_TX_DMA_PROBLEMS #ifdef CONFIG_NETWINDER_TX_DMA_PROBLEMS
save_flags(flags); spin_lock_irqsave(&self->lock, flags);
cli();
disable_dma(self->io.dma); disable_dma(self->io.dma);
clear_dma_ff(self->io.dma); clear_dma_ff(self->io.dma);
...@@ -623,7 +623,7 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase) ...@@ -623,7 +623,7 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase)
hcr = inb(iobase+HCR); hcr = inb(iobase+HCR);
outb(hcr | HCR_EN_DMA, iobase+HCR); outb(hcr | HCR_EN_DMA, iobase+HCR);
enable_dma(self->io.dma); enable_dma(self->io.dma);
restore_flags(flags); spin_unlock_irqrestore(&self->lock, flags);
#else #else
outb(inb(iobase+HCR) | HCR_EN_DMA | HCR_TX_WT, iobase+HCR); outb(inb(iobase+HCR) | HCR_EN_DMA | HCR_TX_WT, iobase+HCR);
#endif #endif
...@@ -761,8 +761,7 @@ int w83977af_dma_receive(struct w83977af_ir *self) ...@@ -761,8 +761,7 @@ int w83977af_dma_receive(struct w83977af_ir *self)
self->rx_buff.data = self->rx_buff.head; self->rx_buff.data = self->rx_buff.head;
#ifdef CONFIG_NETWINDER_RX_DMA_PROBLEMS #ifdef CONFIG_NETWINDER_RX_DMA_PROBLEMS
save_flags(flags); spin_lock_irqsave(&self->lock, flags);
cli();
disable_dma(self->io.dma); disable_dma(self->io.dma);
clear_dma_ff(self->io.dma); clear_dma_ff(self->io.dma);
...@@ -788,7 +787,7 @@ int w83977af_dma_receive(struct w83977af_ir *self) ...@@ -788,7 +787,7 @@ int w83977af_dma_receive(struct w83977af_ir *self)
hcr = inb(iobase+HCR); hcr = inb(iobase+HCR);
outb(hcr | HCR_EN_DMA, iobase+HCR); outb(hcr | HCR_EN_DMA, iobase+HCR);
enable_dma(self->io.dma); enable_dma(self->io.dma);
restore_flags(flags); spin_unlock_irqrestore(&self->lock, flags);
#else #else
outb(inb(iobase+HCR) | HCR_EN_DMA, iobase+HCR); outb(inb(iobase+HCR) | HCR_EN_DMA, iobase+HCR);
#endif #endif
...@@ -892,8 +891,8 @@ int w83977af_dma_receive_complete(struct w83977af_ir *self) ...@@ -892,8 +891,8 @@ int w83977af_dma_receive_complete(struct w83977af_ir *self)
skb = dev_alloc_skb(len+1); skb = dev_alloc_skb(len+1);
if (skb == NULL) { if (skb == NULL) {
printk(KERN_INFO __FUNCTION__ printk(KERN_INFO
"(), memory squeeze, dropping frame.\n"); "%s(), memory squeeze, dropping frame.\n", __FUNCTION__);
/* Restore set register */ /* Restore set register */
outb(set, iobase+SSR); outb(set, iobase+SSR);
...@@ -1334,9 +1333,7 @@ static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -1334,9 +1333,7 @@ static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
IRDA_DEBUG(2, __FUNCTION__ "(), %s, (cmd=0x%X)\n", dev->name, cmd); IRDA_DEBUG(2, __FUNCTION__ "(), %s, (cmd=0x%X)\n", dev->name, cmd);
/* Disable interrupts & save flags */ spin_lock_irqsave(&self->lock, flags);
save_flags(flags);
cli();
switch (cmd) { switch (cmd) {
case SIOCSBANDWIDTH: /* Set bandwidth */ case SIOCSBANDWIDTH: /* Set bandwidth */
...@@ -1360,7 +1357,7 @@ static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -1360,7 +1357,7 @@ static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
} }
out: out:
restore_flags(flags); spin_unlock_irqrestore(&self->lock, flags);
return ret; return ret;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -280,6 +280,7 @@ static const struct { ...@@ -280,6 +280,7 @@ static const struct {
{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_5434_4 }, { BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_5434_4 },
{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_5430 }, /* GD-5440 has identical id */ { BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_5430 }, /* GD-5440 has identical id */
{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_7543 }, { BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_7543 },
{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_7548 },
{ BT_GD5480, NULL, PCI_DEVICE_ID_CIRRUS_5480 }, /* MacPicasso probably */ { BT_GD5480, NULL, PCI_DEVICE_ID_CIRRUS_5480 }, /* MacPicasso probably */
{ BT_PICASSO4, NULL, PCI_DEVICE_ID_CIRRUS_5446 }, /* Picasso 4 is a GD5446 */ { BT_PICASSO4, NULL, PCI_DEVICE_ID_CIRRUS_5446 }, /* Picasso 4 is a GD5446 */
{ BT_LAGUNA, "CL Laguna", PCI_DEVICE_ID_CIRRUS_5462 }, { BT_LAGUNA, "CL Laguna", PCI_DEVICE_ID_CIRRUS_5462 },
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
# Rewritten to use lists instead of if-statements. # Rewritten to use lists instead of if-statements.
# #
O_TARGET := fs.o
export-objs := open.o dcache.o buffer.o bio.o inode.o dquot.o mpage.o aio.o \ export-objs := open.o dcache.o buffer.o bio.o inode.o dquot.o mpage.o aio.o \
fcntl.o fcntl.o
......
...@@ -59,7 +59,7 @@ nbd_end_request(struct request *req) ...@@ -59,7 +59,7 @@ nbd_end_request(struct request *req)
blk_finished_io(nsect); blk_finished_io(nsect);
req->bio = bio->bi_next; req->bio = bio->bi_next;
bio->bi_next = NULL; bio->bi_next = NULL;
bio_endio(bio, uptodate); bio_endio(bio, nsect << 9, uptodate ? 0 : -EIO);
} }
blk_put_request(req); blk_put_request(req);
spin_unlock_irqrestore(q->queue_lock, flags); spin_unlock_irqrestore(q->queue_lock, flags);
......
...@@ -691,6 +691,8 @@ enum { ...@@ -691,6 +691,8 @@ enum {
NETIF_MSG_TX_DONE = 0x0400, NETIF_MSG_TX_DONE = 0x0400,
NETIF_MSG_RX_STATUS = 0x0800, NETIF_MSG_RX_STATUS = 0x0800,
NETIF_MSG_PKTDATA = 0x1000, NETIF_MSG_PKTDATA = 0x1000,
NETIF_MSG_HW = 0x2000,
NETIF_MSG_WOL = 0x4000,
}; };
#define netif_msg_drv(p) ((p)->msg_enable & NETIF_MSG_DRV) #define netif_msg_drv(p) ((p)->msg_enable & NETIF_MSG_DRV)
...@@ -706,6 +708,8 @@ enum { ...@@ -706,6 +708,8 @@ enum {
#define netif_msg_tx_done(p) ((p)->msg_enable & NETIF_MSG_TX_DONE) #define netif_msg_tx_done(p) ((p)->msg_enable & NETIF_MSG_TX_DONE)
#define netif_msg_rx_status(p) ((p)->msg_enable & NETIF_MSG_RX_STATUS) #define netif_msg_rx_status(p) ((p)->msg_enable & NETIF_MSG_RX_STATUS)
#define netif_msg_pktdata(p) ((p)->msg_enable & NETIF_MSG_PKTDATA) #define netif_msg_pktdata(p) ((p)->msg_enable & NETIF_MSG_PKTDATA)
#define netif_msg_hw(p) ((p)->msg_enable & NETIF_MSG_HW)
#define netif_msg_wol(p) ((p)->msg_enable & NETIF_MSG_WOL)
/* Schedule rx intr now? */ /* Schedule rx intr now? */
......
...@@ -55,8 +55,8 @@ struct irda_sock { ...@@ -55,8 +55,8 @@ struct irda_sock {
__u16 mask; /* Hint bits mask */ __u16 mask; /* Hint bits mask */
__u16 hints; /* Hint bits */ __u16 hints; /* Hint bits */
__u32 ckey; /* IrLMP client handle */ void *ckey; /* IrLMP client handle */
__u32 skey; /* IrLMP service handle */ void *skey; /* IrLMP service handle */
struct ias_object *ias_obj; /* Our service name + lsap in IAS */ struct ias_object *ias_obj; /* Our service name + lsap in IAS */
struct iriap_cb *iriap; /* Used to query remote IAS */ struct iriap_cb *iriap; /* Used to query remote IAS */
......
...@@ -86,8 +86,8 @@ struct ircomm_tty_cb { ...@@ -86,8 +86,8 @@ struct ircomm_tty_cb {
struct iriap_cb *iriap; /* Instance used for querying remote IAS */ struct iriap_cb *iriap; /* Instance used for querying remote IAS */
struct ias_object* obj; struct ias_object* obj;
int skey; void *skey;
int ckey; void *ckey;
struct termios normal_termios; struct termios normal_termios;
struct termios callout_termios; struct termios callout_termios;
...@@ -104,6 +104,14 @@ struct ircomm_tty_cb { ...@@ -104,6 +104,14 @@ struct ircomm_tty_cb {
long pgrp; /* pgrp of opening process */ long pgrp; /* pgrp of opening process */
int open_count; int open_count;
int blocked_open; /* # of blocked opens */ int blocked_open; /* # of blocked opens */
/* Protect concurent access to :
* o self->open_count
* o self->ctrl_skb
* o self->tx_skb
* Maybe other things may gain to be protected as well...
* Jean II */
spinlock_t spinlock;
}; };
void ircomm_tty_start(struct tty_struct *tty); void ircomm_tty_start(struct tty_struct *tty);
......
...@@ -183,7 +183,6 @@ struct irlmp_cb { ...@@ -183,7 +183,6 @@ struct irlmp_cb {
hashbin_t *services; hashbin_t *services;
hashbin_t *cachelog; /* Current discovery log */ hashbin_t *cachelog; /* Current discovery log */
spinlock_t log_lock; /* discovery log spinlock */
int running; int running;
...@@ -197,12 +196,12 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap, notify_t *notify, __u8 pid); ...@@ -197,12 +196,12 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap, notify_t *notify, __u8 pid);
void irlmp_close_lsap( struct lsap_cb *self); void irlmp_close_lsap( struct lsap_cb *self);
__u16 irlmp_service_to_hint(int service); __u16 irlmp_service_to_hint(int service);
__u32 irlmp_register_service(__u16 hints); void *irlmp_register_service(__u16 hints);
int irlmp_unregister_service(__u32 handle); int irlmp_unregister_service(void *handle);
__u32 irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb, void *irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb,
DISCOVERY_CALLBACK1 expir_clb, void *priv); DISCOVERY_CALLBACK1 expir_clb, void *priv);
int irlmp_unregister_client(__u32 handle); int irlmp_unregister_client(void *handle);
int irlmp_update_client(__u32 handle, __u16 hint_mask, int irlmp_update_client(void *handle, __u16 hint_mask,
DISCOVERY_CALLBACK1 disco_clb, DISCOVERY_CALLBACK1 disco_clb,
DISCOVERY_CALLBACK1 expir_clb, void *priv); DISCOVERY_CALLBACK1 expir_clb, void *priv);
...@@ -221,7 +220,7 @@ void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason, ...@@ -221,7 +220,7 @@ void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason,
struct sk_buff *userdata); struct sk_buff *userdata);
int irlmp_disconnect_request(struct lsap_cb *, struct sk_buff *userdata); int irlmp_disconnect_request(struct lsap_cb *, struct sk_buff *userdata);
void irlmp_discovery_confirm(hashbin_t *discovery_log, DISCOVERY_MODE); void irlmp_discovery_confirm(hashbin_t *discovery_log, DISCOVERY_MODE mode);
void irlmp_discovery_request(int nslots); void irlmp_discovery_request(int nslots);
struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask, int nslots); struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask, int nslots);
void irlmp_do_expiry(void); void irlmp_do_expiry(void);
...@@ -258,8 +257,6 @@ extern int sysctl_discovery; ...@@ -258,8 +257,6 @@ extern int sysctl_discovery;
extern int sysctl_lap_keepalive_time; /* in ms, default is LM_IDLE_TIMEOUT */ extern int sysctl_lap_keepalive_time; /* in ms, default is LM_IDLE_TIMEOUT */
extern struct irlmp_cb *irlmp; extern struct irlmp_cb *irlmp;
static inline hashbin_t *irlmp_get_cachelog(void) { return irlmp->cachelog; }
/* Check if LAP queue is full. /* Check if LAP queue is full.
* Used by IrTTP for low control, see comments in irlap.h - Jean II */ * Used by IrTTP for low control, see comments in irlap.h - Jean II */
static inline int irlmp_lap_tx_queue_full(struct lsap_cb *self) static inline int irlmp_lap_tx_queue_full(struct lsap_cb *self)
......
...@@ -36,12 +36,12 @@ ...@@ -36,12 +36,12 @@
#define NAME_SIZE 32 #define NAME_SIZE 32
/* /*
* Hash types * Hash types (some flags can be xored)
* See comments in irqueue.c for which one to use...
*/ */
#define HB_NOLOCK 0 #define HB_NOLOCK 0 /* No concurent access prevention */
#define HB_GLOBAL 1 #define HB_LOCK 1 /* Prevent concurent write with global lock */
#define HB_LOCAL 2 #define HB_SORTED 4 /* Not yet supported */
#define HB_SORTED 4
/* /*
* Hash defines * Hash defines
...@@ -57,17 +57,12 @@ ...@@ -57,17 +57,12 @@
typedef void (*FREE_FUNC)(void *arg); typedef void (*FREE_FUNC)(void *arg);
/*
* Hashbin
*/
#define GET_HASHBIN(x) ( x & HASHBIN_MASK )
struct irda_queue { struct irda_queue {
struct irda_queue *q_next; struct irda_queue *q_next;
struct irda_queue *q_prev; struct irda_queue *q_prev;
char q_name[NAME_SIZE]; char q_name[NAME_SIZE];
__u32 q_hash; long q_hash; /* Must be able to cast a (void *) */
}; };
typedef struct irda_queue irda_queue_t; typedef struct irda_queue irda_queue_t;
...@@ -75,8 +70,9 @@ typedef struct hashbin_t { ...@@ -75,8 +70,9 @@ typedef struct hashbin_t {
__u32 magic; __u32 magic;
int hb_type; int hb_type;
int hb_size; int hb_size;
spinlock_t hb_mutex[HASHBIN_SIZE] IRDA_ALIGN; spinlock_t hb_spinlock; /* HB_LOCK - Can be used by the user */
irda_queue_t *hb_queue[HASHBIN_SIZE] IRDA_ALIGN;
irda_queue_t* hb_queue[HASHBIN_SIZE] IRDA_ALIGN;
irda_queue_t* hb_current; irda_queue_t* hb_current;
} hashbin_t; } hashbin_t;
...@@ -84,19 +80,18 @@ typedef struct hashbin_t { ...@@ -84,19 +80,18 @@ typedef struct hashbin_t {
hashbin_t *hashbin_new(int type); hashbin_t *hashbin_new(int type);
int hashbin_delete(hashbin_t* hashbin, FREE_FUNC func); int hashbin_delete(hashbin_t* hashbin, FREE_FUNC func);
int hashbin_clear(hashbin_t* hashbin, FREE_FUNC free_func); int hashbin_clear(hashbin_t* hashbin, FREE_FUNC free_func);
void hashbin_insert(hashbin_t* hashbin, irda_queue_t* entry, __u32 hashv, void hashbin_insert(hashbin_t* hashbin, irda_queue_t* entry, long hashv,
char* name); char* name);
void* hashbin_find(hashbin_t* hashbin, __u32 hashv, char* name); void* hashbin_remove(hashbin_t* hashbin, long hashv, char* name);
void* hashbin_remove(hashbin_t* hashbin, __u32 hashv, char* name);
void* hashbin_remove_first(hashbin_t *hashbin); void* hashbin_remove_first(hashbin_t *hashbin);
void* hashbin_remove_this( hashbin_t* hashbin, irda_queue_t* entry); void* hashbin_remove_this( hashbin_t* hashbin, irda_queue_t* entry);
void* hashbin_find(hashbin_t* hashbin, long hashv, char* name);
void* hashbin_lock_find(hashbin_t* hashbin, long hashv, char* name);
void* hashbin_find_next(hashbin_t* hashbin, long hashv, char* name,
void ** pnext);
irda_queue_t *hashbin_get_first(hashbin_t *hashbin); irda_queue_t *hashbin_get_first(hashbin_t *hashbin);
irda_queue_t *hashbin_get_next(hashbin_t *hashbin); irda_queue_t *hashbin_get_next(hashbin_t *hashbin);
void enqueue_last(irda_queue_t **queue, irda_queue_t* element);
void enqueue_first(irda_queue_t **queue, irda_queue_t* element);
irda_queue_t *dequeue_first(irda_queue_t **queue);
#define HASHBIN_GET_SIZE(hashbin) hashbin->hb_size #define HASHBIN_GET_SIZE(hashbin) hashbin->hb_size
#endif #endif
...@@ -62,6 +62,9 @@ struct irtty_cb { ...@@ -62,6 +62,9 @@ struct irtty_cb {
struct qos_info qos; /* QoS capabilities for this device */ struct qos_info qos; /* QoS capabilities for this device */
dongle_t *dongle; /* Dongle driver */ dongle_t *dongle; /* Dongle driver */
spinlock_t lock; /* For serializing operations */
__u32 new_speed; __u32 new_speed;
__u32 flags; /* Interface flags */ __u32 flags; /* Interface flags */
......
...@@ -165,7 +165,9 @@ struct ircc_cb { ...@@ -165,7 +165,9 @@ struct ircc_cb {
struct irport_cb *irport; struct irport_cb *irport;
spinlock_t lock; /* For serializing operations */ /* Locking : half of our operations are done with irport, so we
* use the irport spinlock to make sure *everything* is properly
* synchronised - Jean II */
__u32 new_speed; __u32 new_speed;
__u32 flags; /* Interface flags */ __u32 flags; /* Interface flags */
......
...@@ -180,6 +180,11 @@ struct w83977af_ir { ...@@ -180,6 +180,11 @@ struct w83977af_ir {
iobuff_t tx_buff; /* Transmit buffer */ iobuff_t tx_buff; /* Transmit buffer */
iobuff_t rx_buff; /* Receive buffer */ iobuff_t rx_buff; /* Receive buffer */
/* Note : currently locking is *very* incomplete, but this
* will get you started. Check in nsc-ircc.c for a proper
* locking strategy. - Jean II */
spinlock_t lock; /* For serializing operations */
__u32 flags; /* Interface flags */ __u32 flags; /* Interface flags */
__u32 new_speed; __u32 new_speed;
}; };
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
O_TARGET := init.o
obj-y := main.o version.o do_mounts.o obj-y := main.o version.o do_mounts.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
......
# #
# Makefile for the linux ipc. # Makefile for the linux ipc.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := ipc.o
obj-y := util.o obj-y := util.o
......
# #
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := kernel.o
export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o \ export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o \
printk.o platform.o suspend.o dma.o printk.o platform.o suspend.o dma.o
......
# #
# Makefile for the linux memory manager. # Makefile for the linux memory manager.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := mm.o
export-objs := shmem.o filemap.o mempool.o page_alloc.o \ export-objs := shmem.o filemap.o mempool.o page_alloc.o \
page-writeback.o page-writeback.o
......
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
# Rewritten to use lists instead of if-statements. # Rewritten to use lists instead of if-statements.
# #
O_TARGET := network.o
export-objs := netsyms.o export-objs := netsyms.o
obj-y := socket.o core/ obj-y := socket.o core/
......
...@@ -61,7 +61,7 @@ void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *new) ...@@ -61,7 +61,7 @@ void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *new)
/* Set time of first discovery if node is new (see below) */ /* Set time of first discovery if node is new (see below) */
new->first_timestamp = new->timestamp; new->first_timestamp = new->timestamp;
spin_lock_irqsave(&irlmp->log_lock, flags); spin_lock_irqsave(&cachelog->hb_spinlock, flags);
/* /*
* Remove all discoveries of devices that has previously been * Remove all discoveries of devices that has previously been
...@@ -95,13 +95,13 @@ void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *new) ...@@ -95,13 +95,13 @@ void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *new)
/* Insert the new and updated version */ /* Insert the new and updated version */
hashbin_insert(cachelog, (irda_queue_t *) new, new->daddr, NULL); hashbin_insert(cachelog, (irda_queue_t *) new, new->daddr, NULL);
spin_unlock_irqrestore(&irlmp->log_lock, flags); spin_unlock_irqrestore(&cachelog->hb_spinlock, flags);
} }
/* /*
* Function irlmp_add_discovery_log (cachelog, log) * Function irlmp_add_discovery_log (cachelog, log)
* *
* Merge a disovery log into the cachlog. * Merge a disovery log into the cachelog.
* *
*/ */
void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log) void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log)
...@@ -115,11 +115,17 @@ void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log) ...@@ -115,11 +115,17 @@ void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log)
* discovery, so restart discovery again with just the half timeout * discovery, so restart discovery again with just the half timeout
* of the normal one. * of the normal one.
*/ */
/* Well... It means that there was nobody out there - Jean II */
if (log == NULL) { if (log == NULL) {
/* irlmp_start_discovery_timer(irlmp, 150); */ /* irlmp_start_discovery_timer(irlmp, 150); */
return; return;
} }
/*
* Locking : we are the only owner of this discovery log, so
* no need to lock it.
* We just need to lock the global log in irlmp_add_discovery().
*/
discovery = (discovery_t *) hashbin_remove_first(log); discovery = (discovery_t *) hashbin_remove_first(log);
while (discovery != NULL) { while (discovery != NULL) {
irlmp_add_discovery(cachelog, discovery); irlmp_add_discovery(cachelog, discovery);
...@@ -146,7 +152,7 @@ void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force) ...@@ -146,7 +152,7 @@ void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force)
IRDA_DEBUG(4, __FUNCTION__ "()\n"); IRDA_DEBUG(4, __FUNCTION__ "()\n");
spin_lock_irqsave(&irlmp->log_lock, flags); spin_lock_irqsave(&log->hb_spinlock, flags);
discovery = (discovery_t *) hashbin_get_first(log); discovery = (discovery_t *) hashbin_get_first(log);
while (discovery != NULL) { while (discovery != NULL) {
...@@ -169,7 +175,7 @@ void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force) ...@@ -169,7 +175,7 @@ void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force)
} }
} }
spin_unlock_irqrestore(&irlmp->log_lock, flags); spin_unlock_irqrestore(&log->hb_spinlock, flags);
} }
/* /*
...@@ -230,13 +236,13 @@ struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn, __u16 m ...@@ -230,13 +236,13 @@ struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn, __u16 m
return NULL; return NULL;
/* Save spin lock - spinlock should be discovery specific */ /* Save spin lock - spinlock should be discovery specific */
spin_lock_irqsave(&irlmp->log_lock, flags); spin_lock_irqsave(&log->hb_spinlock, flags);
/* Create the client specific buffer */ /* Create the client specific buffer */
n = HASHBIN_GET_SIZE(log); n = HASHBIN_GET_SIZE(log);
buffer = kmalloc(n * sizeof(struct irda_device_info), GFP_ATOMIC); buffer = kmalloc(n * sizeof(struct irda_device_info), GFP_ATOMIC);
if (buffer == NULL) { if (buffer == NULL) {
spin_unlock_irqrestore(&irlmp->log_lock, flags); spin_unlock_irqrestore(&log->hb_spinlock, flags);
return NULL; return NULL;
} }
...@@ -257,7 +263,7 @@ struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn, __u16 m ...@@ -257,7 +263,7 @@ struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn, __u16 m
discovery = (discovery_t *) hashbin_get_next(log); discovery = (discovery_t *) hashbin_get_next(log);
} }
spin_unlock_irqrestore(&irlmp->log_lock, flags); spin_unlock_irqrestore(&log->hb_spinlock, flags);
/* Get the actual number of device in the buffer and return */ /* Get the actual number of device in the buffer and return */
*pn = i; *pn = i;
...@@ -276,7 +282,7 @@ __u32 irlmp_find_device(hashbin_t *cachelog, char *name, __u32 *saddr) ...@@ -276,7 +282,7 @@ __u32 irlmp_find_device(hashbin_t *cachelog, char *name, __u32 *saddr)
unsigned long flags; unsigned long flags;
discovery_t *d; discovery_t *d;
spin_lock_irqsave(&irlmp->log_lock, flags); spin_lock_irqsave(&cachelog->hb_spinlock, flags);
/* Look at all discoveries for that link */ /* Look at all discoveries for that link */
d = (discovery_t *) hashbin_get_first(cachelog); d = (discovery_t *) hashbin_get_first(cachelog);
...@@ -288,13 +294,13 @@ __u32 irlmp_find_device(hashbin_t *cachelog, char *name, __u32 *saddr) ...@@ -288,13 +294,13 @@ __u32 irlmp_find_device(hashbin_t *cachelog, char *name, __u32 *saddr)
if (strcmp(name, d->nickname) == 0) { if (strcmp(name, d->nickname) == 0) {
*saddr = d->saddr; *saddr = d->saddr;
spin_unlock_irqrestore(&irlmp->log_lock, flags); spin_unlock_irqrestore(&cachelog->hb_spinlock, flags);
return d->daddr; return d->daddr;
} }
d = (discovery_t *) hashbin_get_next(cachelog); d = (discovery_t *) hashbin_get_next(cachelog);
} }
spin_unlock_irqrestore(&irlmp->log_lock, flags); spin_unlock_irqrestore(&cachelog->hb_spinlock, flags);
return 0; return 0;
} }
...@@ -310,7 +316,7 @@ int discovery_proc_read(char *buf, char **start, off_t offset, int length, ...@@ -310,7 +316,7 @@ int discovery_proc_read(char *buf, char **start, off_t offset, int length,
{ {
discovery_t *discovery; discovery_t *discovery;
unsigned long flags; unsigned long flags;
hashbin_t *cachelog = irlmp_get_cachelog(); hashbin_t *cachelog = irlmp->cachelog;
int len = 0; int len = 0;
if (!irlmp) if (!irlmp)
...@@ -318,7 +324,7 @@ int discovery_proc_read(char *buf, char **start, off_t offset, int length, ...@@ -318,7 +324,7 @@ int discovery_proc_read(char *buf, char **start, off_t offset, int length,
len = sprintf(buf, "IrLMP: Discovery log:\n\n"); len = sprintf(buf, "IrLMP: Discovery log:\n\n");
spin_lock_irqsave(&irlmp->log_lock, flags); spin_lock_irqsave(&cachelog->hb_spinlock, flags);
discovery = (discovery_t *) hashbin_get_first(cachelog); discovery = (discovery_t *) hashbin_get_first(cachelog);
while (( discovery != NULL) && (len < length)) { while (( discovery != NULL) && (len < length)) {
...@@ -362,7 +368,7 @@ int discovery_proc_read(char *buf, char **start, off_t offset, int length, ...@@ -362,7 +368,7 @@ int discovery_proc_read(char *buf, char **start, off_t offset, int length,
discovery = (discovery_t *) hashbin_get_next(cachelog); discovery = (discovery_t *) hashbin_get_next(cachelog);
} }
spin_unlock_irqrestore(&irlmp->log_lock, flags); spin_unlock_irqrestore(&cachelog->hb_spinlock, flags);
return len; return len;
} }
...@@ -61,7 +61,7 @@ hashbin_t *ircomm = NULL; ...@@ -61,7 +61,7 @@ hashbin_t *ircomm = NULL;
int __init ircomm_init(void) int __init ircomm_init(void)
{ {
ircomm = hashbin_new(HB_LOCAL); ircomm = hashbin_new(HB_LOCK);
if (ircomm == NULL) { if (ircomm == NULL) {
ERROR(__FUNCTION__ "(), can't allocate hashbin!\n"); ERROR(__FUNCTION__ "(), can't allocate hashbin!\n");
return -ENOMEM; return -ENOMEM;
...@@ -505,11 +505,10 @@ int ircomm_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -505,11 +505,10 @@ int ircomm_proc_read(char *buf, char **start, off_t offset, int len)
struct ircomm_cb *self; struct ircomm_cb *self;
unsigned long flags; unsigned long flags;
save_flags(flags);
cli();
len = 0; len = 0;
spin_lock_irqsave(&ircomm->hb_spinlock, flags);
self = (struct ircomm_cb *) hashbin_get_first(ircomm); self = (struct ircomm_cb *) hashbin_get_first(ircomm);
while (self != NULL) { while (self != NULL) {
ASSERT(self->magic == IRCOMM_MAGIC, break;); ASSERT(self->magic == IRCOMM_MAGIC, break;);
...@@ -535,7 +534,7 @@ int ircomm_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -535,7 +534,7 @@ int ircomm_proc_read(char *buf, char **start, off_t offset, int len)
self = (struct ircomm_cb *) hashbin_get_next(ircomm); self = (struct ircomm_cb *) hashbin_get_next(ircomm);
} }
restore_flags(flags); spin_unlock_irqrestore(&ircomm->hb_spinlock, flags);
return len; return len;
} }
......
...@@ -177,7 +177,7 @@ void ircomm_lmp_flow_control(struct sk_buff *skb) ...@@ -177,7 +177,7 @@ void ircomm_lmp_flow_control(struct sk_buff *skb)
line = cb->line; line = cb->line;
self = (struct ircomm_cb *) hashbin_find(ircomm, line, NULL); self = (struct ircomm_cb *) hashbin_lock_find(ircomm, line, NULL);
if (!self) { if (!self) {
IRDA_DEBUG(2, __FUNCTION__ "(), didn't find myself\n"); IRDA_DEBUG(2, __FUNCTION__ "(), didn't find myself\n");
return; return;
......
...@@ -99,6 +99,8 @@ pi_param_info_t ircomm_param_info = { pi_major_call_table, 3, 0x0f, 4 }; ...@@ -99,6 +99,8 @@ pi_param_info_t ircomm_param_info = { pi_major_call_table, 3, 0x0f, 4 };
*/ */
int ircomm_param_flush(struct ircomm_tty_cb *self) int ircomm_param_flush(struct ircomm_tty_cb *self)
{ {
/* we should lock here, but I guess this function is unused...
* Jean II */
if (self->ctrl_skb) { if (self->ctrl_skb) {
ircomm_control_request(self->ircomm, self->ctrl_skb); ircomm_control_request(self->ircomm, self->ctrl_skb);
self->ctrl_skb = NULL; self->ctrl_skb = NULL;
...@@ -132,14 +134,13 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush) ...@@ -132,14 +134,13 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush)
if (self->service_type == IRCOMM_3_WIRE_RAW) if (self->service_type == IRCOMM_3_WIRE_RAW)
return 0; return 0;
save_flags(flags); spin_lock_irqsave(&self->spinlock, flags);
cli();
skb = self->ctrl_skb; skb = self->ctrl_skb;
if (!skb) { if (!skb) {
skb = dev_alloc_skb(256); skb = dev_alloc_skb(256);
if (!skb) { if (!skb) {
restore_flags(flags); spin_unlock_irqrestore(&self->spinlock, flags);
return -ENOMEM; return -ENOMEM;
} }
...@@ -154,12 +155,12 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush) ...@@ -154,12 +155,12 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush)
&ircomm_param_info); &ircomm_param_info);
if (count < 0) { if (count < 0) {
WARNING(__FUNCTION__ "(), no room for parameter!\n"); WARNING(__FUNCTION__ "(), no room for parameter!\n");
restore_flags(flags); spin_unlock_irqrestore(&self->spinlock, flags);
return -1; return -1;
} }
skb_put(skb, count); skb_put(skb, count);
restore_flags(flags); spin_unlock_irqrestore(&self->spinlock, flags);
IRDA_DEBUG(2, __FUNCTION__ "(), skb->len=%d\n", skb->len); IRDA_DEBUG(2, __FUNCTION__ "(), skb->len=%d\n", skb->len);
......
This diff is collapsed.
...@@ -331,6 +331,8 @@ static void ircomm_tty_discovery_indication(discovery_t *discovery, ...@@ -331,6 +331,8 @@ static void ircomm_tty_discovery_indication(discovery_t *discovery,
info.daddr = discovery->daddr; info.daddr = discovery->daddr;
info.saddr = discovery->saddr; info.saddr = discovery->saddr;
/* FIXME. We probably need to use hashbin_find_next(), but we first
* need to ensure that "line" is unique. - Jean II */
self = (struct ircomm_tty_cb *) hashbin_get_first(ircomm_tty); self = (struct ircomm_tty_cb *) hashbin_get_first(ircomm_tty);
while (self != NULL) { while (self != NULL) {
ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
......
...@@ -91,13 +91,13 @@ int irda_device_proc_read(char *buf, char **start, off_t offset, int len, ...@@ -91,13 +91,13 @@ int irda_device_proc_read(char *buf, char **start, off_t offset, int len,
int __init irda_device_init( void) int __init irda_device_init( void)
{ {
dongles = hashbin_new(HB_GLOBAL); dongles = hashbin_new(HB_LOCK);
if (dongles == NULL) { if (dongles == NULL) {
printk(KERN_WARNING "IrDA: Can't allocate dongles hashbin!\n"); printk(KERN_WARNING "IrDA: Can't allocate dongles hashbin!\n");
return -ENOMEM; return -ENOMEM;
} }
tasks = hashbin_new(HB_GLOBAL); tasks = hashbin_new(HB_LOCK);
if (tasks == NULL) { if (tasks == NULL) {
printk(KERN_WARNING "IrDA: Can't allocate tasks hashbin!\n"); printk(KERN_WARNING "IrDA: Can't allocate tasks hashbin!\n");
return -ENOMEM; return -ENOMEM;
...@@ -438,7 +438,7 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type) ...@@ -438,7 +438,7 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
} }
#endif #endif
if (!(reg = hashbin_find(dongles, type, NULL))) { if (!(reg = hashbin_lock_find(dongles, type, NULL))) {
ERROR("IrDA: Unable to find requested dongle\n"); ERROR("IrDA: Unable to find requested dongle\n");
return NULL; return NULL;
} }
...@@ -477,7 +477,7 @@ int irda_device_dongle_cleanup(dongle_t *dongle) ...@@ -477,7 +477,7 @@ int irda_device_dongle_cleanup(dongle_t *dongle)
int irda_device_register_dongle(struct dongle_reg *new) int irda_device_register_dongle(struct dongle_reg *new)
{ {
/* Check if this dongle has been registred before */ /* Check if this dongle has been registred before */
if (hashbin_find(dongles, new->type, NULL)) { if (hashbin_lock_find(dongles, new->type, NULL)) {
MESSAGE("%s: Dongle already registered\n", __FUNCTION__); MESSAGE("%s: Dongle already registered\n", __FUNCTION__);
return 0; return 0;
} }
......
...@@ -58,7 +58,7 @@ static const char *ias_charset_types[] = { ...@@ -58,7 +58,7 @@ static const char *ias_charset_types[] = {
#endif /* CONFIG_IRDA_DEBUG */ #endif /* CONFIG_IRDA_DEBUG */
static hashbin_t *iriap = NULL; static hashbin_t *iriap = NULL;
static __u32 service_handle; static void *service_handle;
extern char *lmp_reasons[]; extern char *lmp_reasons[];
...@@ -91,11 +91,12 @@ int __init iriap_init(void) ...@@ -91,11 +91,12 @@ int __init iriap_init(void)
__u16 hints; __u16 hints;
/* Allocate master array */ /* Allocate master array */
iriap = hashbin_new(HB_LOCAL); iriap = hashbin_new(HB_LOCK);
if (!iriap) if (!iriap)
return -ENOMEM; return -ENOMEM;
objects = hashbin_new(HB_LOCAL); /* Object repository - defined in irias_object.c */
objects = hashbin_new(HB_LOCK);
if (!objects) { if (!objects) {
WARNING("%s: Can't allocate objects hashbin!\n", __FUNCTION__); WARNING("%s: Can't allocate objects hashbin!\n", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
...@@ -182,7 +183,7 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv, ...@@ -182,7 +183,7 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
init_timer(&self->watchdog_timer); init_timer(&self->watchdog_timer);
hashbin_insert(iriap, (irda_queue_t *) self, (int) self, NULL); hashbin_insert(iriap, (irda_queue_t *) self, (long) self, NULL);
/* Initialize state machines */ /* Initialize state machines */
iriap_next_client_state(self, S_DISCONNECT); iriap_next_client_state(self, S_DISCONNECT);
...@@ -235,7 +236,7 @@ void iriap_close(struct iriap_cb *self) ...@@ -235,7 +236,7 @@ void iriap_close(struct iriap_cb *self)
self->lsap = NULL; self->lsap = NULL;
} }
entry = (struct iriap_cb *) hashbin_remove(iriap, (int) self, NULL); entry = (struct iriap_cb *) hashbin_remove(iriap, (long) self, NULL);
ASSERT(entry == self, return;); ASSERT(entry == self, return;);
__iriap_close(self); __iriap_close(self);
...@@ -973,13 +974,12 @@ int irias_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -973,13 +974,12 @@ int irias_proc_read(char *buf, char **start, off_t offset, int len)
ASSERT( objects != NULL, return 0;); ASSERT( objects != NULL, return 0;);
save_flags( flags);
cli();
len = 0; len = 0;
len += sprintf(buf+len, "LM-IAS Objects:\n"); len += sprintf(buf+len, "LM-IAS Objects:\n");
spin_lock_irqsave(&objects->hb_spinlock, flags);
/* List all objects */ /* List all objects */
obj = (struct ias_object *) hashbin_get_first(objects); obj = (struct ias_object *) hashbin_get_first(objects);
while ( obj != NULL) { while ( obj != NULL) {
...@@ -989,6 +989,11 @@ int irias_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -989,6 +989,11 @@ int irias_proc_read(char *buf, char **start, off_t offset, int len)
len += sprintf(buf+len, "id=%d", obj->id); len += sprintf(buf+len, "id=%d", obj->id);
len += sprintf(buf+len, "\n"); len += sprintf(buf+len, "\n");
/* Careful for priority inversions here !
* All other uses of attrib spinlock are independant of
* the object spinlock, so we are safe. Jean II */
spin_lock(&obj->attribs->hb_spinlock);
/* List all attributes for this object */ /* List all attributes for this object */
attrib = (struct ias_attrib *) attrib = (struct ias_attrib *)
hashbin_get_first(obj->attribs); hashbin_get_first(obj->attribs);
...@@ -1025,9 +1030,11 @@ int irias_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -1025,9 +1030,11 @@ int irias_proc_read(char *buf, char **start, off_t offset, int len)
attrib = (struct ias_attrib *) attrib = (struct ias_attrib *)
hashbin_get_next(obj->attribs); hashbin_get_next(obj->attribs);
} }
spin_unlock(&obj->attribs->hb_spinlock);
obj = (struct ias_object *) hashbin_get_next(objects); obj = (struct ias_object *) hashbin_get_next(objects);
} }
restore_flags(flags); spin_unlock_irqrestore(&objects->hb_spinlock, flags);
return len; return len;
} }
......
This diff is collapsed.
...@@ -124,7 +124,7 @@ int __init irlan_init(void) ...@@ -124,7 +124,7 @@ int __init irlan_init(void)
IRDA_DEBUG(0, __FUNCTION__ "()\n"); IRDA_DEBUG(0, __FUNCTION__ "()\n");
/* Allocate master structure */ /* Allocate master structure */
irlan = hashbin_new(HB_LOCAL); irlan = hashbin_new(HB_LOCK); /* protect from /proc */
if (irlan == NULL) { if (irlan == NULL) {
printk(KERN_WARNING "IrLAN: Can't allocate hashbin!\n"); printk(KERN_WARNING "IrLAN: Can't allocate hashbin!\n");
return -ENOMEM; return -ENOMEM;
...@@ -1089,11 +1089,10 @@ static int irlan_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -1089,11 +1089,10 @@ static int irlan_proc_read(char *buf, char **start, off_t offset, int len)
unsigned long flags; unsigned long flags;
ASSERT(irlan != NULL, return 0;); ASSERT(irlan != NULL, return 0;);
save_flags(flags);
cli();
len = 0; len = 0;
spin_lock_irqsave(&irlan->hb_spinlock, flags);
len += sprintf(buf+len, "IrLAN instances:\n"); len += sprintf(buf+len, "IrLAN instances:\n");
self = (struct irlan_cb *) hashbin_get_first(irlan); self = (struct irlan_cb *) hashbin_get_first(irlan);
...@@ -1129,7 +1128,7 @@ static int irlan_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -1129,7 +1128,7 @@ static int irlan_proc_read(char *buf, char **start, off_t offset, int len)
self = (struct irlan_cb *) hashbin_get_next(irlan); self = (struct irlan_cb *) hashbin_get_next(irlan);
} }
restore_flags(flags); spin_unlock_irqrestore(&irlan->hb_spinlock, flags);
return len; return len;
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -132,12 +132,14 @@ EXPORT_SYMBOL(irlmp_dup); ...@@ -132,12 +132,14 @@ EXPORT_SYMBOL(irlmp_dup);
EXPORT_SYMBOL(lmp_reasons); EXPORT_SYMBOL(lmp_reasons);
/* Queue */ /* Queue */
EXPORT_SYMBOL(hashbin_find);
EXPORT_SYMBOL(hashbin_new); EXPORT_SYMBOL(hashbin_new);
EXPORT_SYMBOL(hashbin_insert); EXPORT_SYMBOL(hashbin_insert);
EXPORT_SYMBOL(hashbin_delete); EXPORT_SYMBOL(hashbin_delete);
EXPORT_SYMBOL(hashbin_remove); EXPORT_SYMBOL(hashbin_remove);
EXPORT_SYMBOL(hashbin_remove_this); EXPORT_SYMBOL(hashbin_remove_this);
EXPORT_SYMBOL(hashbin_find);
EXPORT_SYMBOL(hashbin_lock_find);
EXPORT_SYMBOL(hashbin_find_next);
EXPORT_SYMBOL(hashbin_get_next); EXPORT_SYMBOL(hashbin_get_next);
EXPORT_SYMBOL(hashbin_get_first); EXPORT_SYMBOL(hashbin_get_first);
...@@ -328,7 +330,8 @@ void __exit irda_cleanup(void) ...@@ -328,7 +330,8 @@ void __exit irda_cleanup(void)
* On the other hand, it needs to be initialised *after* the basic * On the other hand, it needs to be initialised *after* the basic
* networking, the /proc/net filesystem and sysctl module. Those are * networking, the /proc/net filesystem and sysctl module. Those are
* currently initialised in .../init/main.c (before initcalls). * currently initialised in .../init/main.c (before initcalls).
* Also, it needs to be initialised *after* the random number generator. * Also, IrDA drivers needs to be initialised *after* the random number
* generator (main stack and higher layer init don't need it anymore).
* *
* Jean II * Jean II
*/ */
......
This diff is collapsed.
# Makefile for the Linux sound card driver # Makefile for the Linux sound card driver
# #
O_TARGET := sound.o
export-objs := sound_core.o export-objs := sound_core.o
obj-$(CONFIG_SOUND) += soundcore.o obj-$(CONFIG_SOUND) += soundcore.o
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment