Commit 36573454 authored by Paul Mackerras's avatar Paul Mackerras

Merge samba.org:/home/paulus/kernel/linux-2.5

into samba.org:/home/paulus/kernel/for-linus-ppc
parents c834cb05 ab1180be
......@@ -154,7 +154,6 @@ LOG := $(patsubst %.sgml, %.log, $(BOOKS))
OUT := $(patsubst %.sgml, %.out, $(BOOKS))
clean:
@echo 'Cleaning up (DocBook)'
@rm -f core *~
@rm -f $(BOOKS)
@rm -f $(DVI) $(AUX) $(TEX) $(LOG) $(OUT)
......@@ -162,7 +161,6 @@ clean:
@rm -f $(C-procfs-example)
mrproper:
@echo 'Making mrproper (DocBook)'
@rm -f $(PS) $(PDF)
@rm -f -r $(HTML) $(patsubst %.html,%,$(HTML))
......
Ext3 Filesystem
===============
ext3 was originally released in September 1999. Written by Stephen Tweedie
for 2.2 branch, and ported to 2.4 kernels by Peter Braam, Andreas Dilger,
Andrew Morton, Alexander Viro, Ted Ts'o and Stephen Tweedie.
ext3 is ext2 filesystem enhanced with journalling capabilities.
Options
=======
When mounting an ext3 filesystem, the following option are accepted:
(*) == default
jounal=update Update the ext3 file system's journal to the
current format.
journal=inum When a journal already exists, this option is
ignored. Otherwise, it specifies the number of
the inode which will represent the ext3 file
system's journal file.
bsddf (*) Make 'df' act like BSD.
minixdf Make 'df' act like Minix.
check=none Don't do extra checking of bitmaps on mount.
nocheck
debug Extra debugging information is sent to syslog.
noload Don't load the journal on mounting.
errors=remount-ro(*) Remount the filesystem read-only on an error.
errors=continue Keep going on a filesystem error.
errors=panic Panic and halt the machine if an error occurs.
grpid Give objects the same group ID as their creator.
bsdgroups
nogrpid (*) New objects have the group ID of their creator.
sysvgroups
resgid=n The group ID which may use the reserved blocks.
resuid=n The user ID which may use the reserved blocks.
sb=n Use alternate superblock at this location.
data=journal All data are commited into the journal prior
to being written into the main file system.
data=ordered (*) All data are forced directly out to the main file
system prior to its metadata being commited to
the journal.
data=writeback Data ordering is not preserved, data may be
written into the main file system after its
metadata has been committed to the journal.
quota Quota options are currently silently ignored.
noquota (see fs/ext3/super.c, line 594)
grpquota
usrquota
Specification
=============
ext3 shares all disk implementation with ext2 filesystem, and add
transactions capabilities to ext2. Journaling is done by the
Journaling block device layer.
Journaling Block Device layer
-----------------------------
The Journaling Block Device layer (JBD) isn't ext3 specific. It was
design to add journaling capabilities on a block device. The ext3
filesystem code will inform the JBD of modifications it is performing
(Call a transaction). the journal support the transactions start and
stop, and in case of crash, the journal can replayed the transactions
to put the partition on a consistant state fastly.
handles represent a single atomic update to a filesystem. JBD can
handle external journal on a block device.
Data Mode
---------
There's 3 different data modes:
* writeback mode
In data=writeback mode, ext3 does not journal data at all. This mode
provides a similar level of journaling as XFS, JFS, and ReiserFS in its
default mode - metadata journaling. A crash+recovery can cause
incorrect data to appear in files which were written shortly before the
crash. This mode will typically provide the best ext3 performance.
* ordered mode
In data=ordered mode, ext3 only officially journals metadata, but it
logically groups metadata and data blocks into a single unit called a
transaction. When it's time to write the new metadata out to disk, the
associated data blocks are written first. In general, this mode
perform slightly slower than writeback but significantly faster than
journal mode.
* journal mode
data=journal mode provides full data and metadata journaling. All new
data is written to the journal first, and then to its final location.
In the event of a crash, the journal can be replayed, bringing both
data and metadata into a consistent state. This mode is the slowest
except when data needs to be read from and written to disk at the same
time where it outperform all others mode.
Compatibility
-------------
Ext2 partitions can be easily convert to ext3, with `tune2fs -j <dev>`.
Ext3 is fully compatible with Ext2. Ext3 partitions can easily be
mounted as Ext2.
External Tools
==============
see manual pages to know more.
tune2fs: create a ext3 journal on a ext2 partition with the -j flags
mke2fs: create a ext3 partition with the -j flags
debugfs: ext2 and ext3 file system debugger
References
==========
kernel source: file:/usr/src/linux/fs/ext3
file:/usr/src/linux/fs/jbd
programs: http://e2fsprogs.sourceforge.net
useful link:
http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html
http://www-106.ibm.com/developerworks/linux/library/l-fs7/
http://www-106.ibm.com/developerworks/linux/library/l-fs8/
......@@ -71,10 +71,18 @@ There are very few options to the driver. One is 'debug' which will
tell the driver to print minimal debugging information as it runs. This
can be collected with 'dmesg' or through the klogd daemon.
The other is 'external_amp', which tells the driver to attempt to enable
One is 'external_amp', which tells the driver to attempt to enable
an external amplifier. This defaults to '1', you can tell the driver
not to bother enabling such an amplifier by setting it to '0'.
And the last is 'gpio_pin', which tells the driver which GPIO pin number
the external amp uses (0-15), The Allegro uses 8 by default, all others 1.
If everything loads correctly and seems to be working but you get no sound,
try tweaking this value.
Systems known to need a different value
Panasonic ToughBook CF-72: gpio_pin=13
Power Management
----------------
......
......@@ -1433,6 +1433,12 @@ M: Kai.Makisara@metla.fi
L: linux-scsi@vger.kernel.org
S: Maintained
SCx200 CPU SUPPORT
P: Christer Weinigel
M: christer@weinigel.se
W: http://www.weinigel.se
S: Supported
SGI VISUAL WORKSTATION 320 AND 540
P: Bent Hagemark
M: bh@sgi.com
......
This diff is collapsed.
......@@ -8,23 +8,38 @@ comma := ,
empty :=
space := $(empty) $(empty)
# Figure out paths
# Some bug traps
# ---------------------------------------------------------------------------
# Find the path relative to the toplevel dir, $(RELDIR), and express
# the toplevel dir as a relative path from this dir, $(TOPDIR_REL)
ifeq ($(findstring $(TOPDIR),$(CURDIR)),)
# Can only happen when something is built out of tree
RELDIR := $(CURDIR)
TOPDIR_REL := $(TOPDIR)
else
RELDIR := $(subst $(TOPDIR)/,,$(CURDIR))
TOPDIR_REL := $(subst $(space),,$(foreach d,$(subst /, ,$(RELDIR)),../))
ifdef O_TARGET
$(error kbuild: $(obj)/Makefile - Usage of O_TARGET := $(O_TARGET) is obsolete in 2.5. Please fix!)
endif
ifdef L_TARGET
ifneq ($(L_TARGET),lib.a)
$(warning kbuild: $(obj)/Makefile - L_TARGET := $(L_TARGET) target shall be renamed to lib.a. Please fix!)
endif
endif
ifdef list-multi
$(warning kbuild: $(obj)/Makefile - list-multi := $(list-multi) is obsolete in 2.5. Please fix!)
endif
# Some paths for the Makefiles to use
# ---------------------------------------------------------------------------
# FIXME. For now, we leave it possible to use make -C or make -f
# to do work in subdirs.
ifndef obj
obj = .
CFLAGS := $(patsubst -I%,-I$(TOPDIR)/%,$(patsubst -I$(TOPDIR)/%,-I%,$(CFLAGS)))
AFLAGS := $(patsubst -I%,-I$(TOPDIR)/%,$(patsubst -I$(TOPDIR)/%,-I%,$(AFLAGS)))
endif
# For use in the quiet output
echo_target = $@
# Usage:
#
# $(obj)/target.o : target.o in the build dir
......@@ -41,12 +56,7 @@ endif
# We don't support separate source / object yet, so these are just
# placeholders for now
obj := .
src := .
# For use in the quiet output
echo_target = $(RELDIR)/$@
src := $(obj)
# Figure out what we need to build from the various variables
# ===========================================================================
......@@ -84,16 +94,8 @@ __obj-y = $(filter-out export.o,$(obj-y))
__obj-m = $(filter-out export.o,$(obj-m))
# if $(foo-objs) exists, foo.o is a composite object
__multi-used-y := $(sort $(foreach m,$(__obj-y), $(if $($(m:.o=-objs)), $(m))))
__multi-used-m := $(sort $(foreach m,$(__obj-m), $(if $($(m:.o=-objs)), $(m))))
# FIXME: Rip this out later
# Backwards compatibility: if a composite object is listed in
# $(list-multi), skip it here, since the Makefile will have an explicit
# link rule for it
multi-used-y := $(filter-out $(list-multi),$(__multi-used-y))
multi-used-m := $(filter-out $(list-multi),$(__multi-used-m))
multi-used-y := $(sort $(foreach m,$(__obj-y), $(if $($(m:.o=-objs)), $(m))))
multi-used-m := $(sort $(foreach m,$(__obj-m), $(if $($(m:.o=-objs)), $(m))))
# Build list of the parts of our composite objects, our composite
# objects depend on those (obviously)
......@@ -111,6 +113,21 @@ real-objs-m := $(foreach m, $(obj-m), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m
# Only build module versions for files which are selected to be built
export-objs := $(filter $(export-objs),$(real-objs-y) $(real-objs-m))
# Add subdir path
EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS))
obj-y := $(addprefix $(obj)/,$(obj-y))
obj-m := $(addprefix $(obj)/,$(obj-m))
export-objs := $(addprefix $(obj)/,$(export-objs))
subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y))
real-objs-y := $(addprefix $(obj)/,$(real-objs-y))
real-objs-m := $(addprefix $(obj)/,$(real-objs-m))
multi-used-y := $(addprefix $(obj)/,$(multi-used-y))
multi-used-m := $(addprefix $(obj)/,$(multi-used-m))
multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y))
multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m))
subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
# The temporary file to save gcc -MD generated dependencies must not
# contain a comma
depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
......@@ -136,15 +153,15 @@ ifeq ($(strip $(export-objs)),)
# If we don't export any symbols in this dir, just descend
# ---------------------------------------------------------------------------
fastdep: sub_dirs
@echo -n
fastdep: $(subdir-ym)
@/bin/true
else
# This sets version suffixes on exported symbols
# ---------------------------------------------------------------------------
MODVERDIR := $(TOPDIR)/include/linux/modules/$(RELDIR)
MODVERDIR := include/linux/modules/
#
# Added the SMP separator to stop module accidents between uniprocessor
......@@ -159,7 +176,7 @@ endif
# Don't include modversions.h, we're just about to generate it here.
CFLAGS_MODULE := $(filter-out -include $(HPATH)/linux/modversions.h,$(CFLAGS_MODULE))
CFLAGS_MODULE := $(filter-out -include linux/modversions.h,$(CFLAGS_MODULE))
$(addprefix $(MODVERDIR)/,$(real-objs-y:.o=.ver)): modkern_cflags := $(CFLAGS_KERNEL)
$(addprefix $(MODVERDIR)/,$(real-objs-m:.o=.ver)): modkern_cflags := $(CFLAGS_MODULE)
......@@ -174,7 +191,7 @@ c_flags = -Wp,-MD,$(depfile) $(CFLAGS) $(NOSTDINC_FLAGS) \
# files (fix-dep filters them), so touch modversions.h if any of the .ver
# files changes
quiet_cmd_cc_ver_c = MKVER include/linux/modules/$(RELDIR)/$*.ver
quiet_cmd_cc_ver_c = MKVER include/linux/modules/$*.ver
cmd_cc_ver_c = $(CPP) $(c_flags) $< | $(GENKSYMS) $(genksyms_smp_prefix) \
-k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
......@@ -206,9 +223,9 @@ $(MODVERDIR)/%.ver: %.c FORCE
targets := $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver))
fastdep: $(targets) sub_dirs
@mkdir -p $(TOPDIR)/.tmp_export-objs/modules/$(RELDIR)
@touch $(addprefix $(TOPDIR)/.tmp_export-objs/modules/$(RELDIR)/,$(export-objs:.o=.ver))
fastdep: $(targets) $(subdir-ym)
@mkdir -p $(dir $(addprefix .tmp_export-objs/modules/,$(export-objs:.o=.ver)))
@touch $(addprefix .tmp_export-objs/modules/,$(export-objs:.o=.ver))
endif # export-objs
......@@ -219,15 +236,17 @@ ifeq ($(MAKECMDGOALS),modules_install)
# Installing modules
# ==========================================================================
quiet_cmd_modules_install = INSTALL $(obj-m)
cmd_modules_install = mkdir -p $(MODLIB)/kernel/$(obj); \
cp $(obj-m) $(MODLIB)/kernel/$(obj)
.PHONY: modules_install
modules_install: sub_dirs
modules_install: $(subdir-ym)
ifneq ($(obj-m),)
@echo Installing modules in $(MODLIB)/kernel/$(RELDIR)
@mkdir -p $(MODLIB)/kernel/$(RELDIR)
@cp $(obj-m) $(MODLIB)/kernel/$(RELDIR)
$(call cmd,modules_install)
else
@echo -n
@/bin/true
endif
else # ! modules_install
......@@ -241,15 +260,18 @@ else # ! modules_install
ifndef O_TARGET
ifndef L_TARGET
O_TARGET := built-in.o
O_TARGET := $(obj)/built-in.o
endif
endif
# The echo suppresses the "Nothing to be done for first_rule"
ifdef L_TARGET
L_TARGET := $(obj)/$(L_TARGET)
endif
first_rule: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \
$(if $(KBUILD_MODULES),$(obj-m)) \
sub_dirs
@echo -n
$(subdir-ym)
@/bin/true
# Compile C sources (.c)
# ---------------------------------------------------------------------------
......@@ -324,7 +346,7 @@ targets += $(real-objs-y) $(real-objs-m) $(EXTRA_TARGETS) $(MAKECMDGOALS)
# ---------------------------------------------------------------------------
# To build objects in subdirs, we need to descend into the directories
$(sort $(subdir-obj-y)): sub_dirs ;
$(sort $(subdir-obj-y)): $(subdir-ym) ;
#
# Rule to compile a set of .o files into one .o file
......@@ -360,7 +382,7 @@ endif
#
quiet_cmd_link_multi = LD $(echo_target)
cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs),$^)
cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs)))),$^)
# We would rather have a list of rules like
# foo.o: $(foo-objs)
......@@ -380,6 +402,10 @@ targets += $(multi-used-y) $(multi-used-m)
host-progs-single := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m)))
host-progs-multi := $(foreach m,$(host-progs),$(if $($(m)-objs),$(m)))
host-progs-multi-objs := $(foreach m,$(host-progs-multi),$($(m)-objs))
host-progs := $(addprefix $(obj)/,$(host-progs))
host-progs-single := $(addprefix $(obj)/,$(host-progs-single))
host-progs-multi := $(addprefix $(obj)/,$(host-progs-multi))
host-progs-multi-objs := $(addprefix $(obj)/,$(host-progs-multi-objs))
quiet_cmd_host_cc__c = HOSTCC $(echo_target)
cmd_host_cc__c = $(HOSTCC) -Wp,-MD,$(depfile) \
......@@ -397,7 +423,7 @@ $(host-progs-multi-objs): %.o: %.c FORCE
$(call if_changed_dep,host_cc_o_c)
quiet_cmd_host_cc__o = HOSTLD $(echo_target)
cmd_host_cc__o = $(HOSTCC) $(HOSTLDFLAGS) -o $@ $($@-objs) \
cmd_host_cc__o = $(HOSTCC) $(HOSTLDFLAGS) -o $@ $(addprefix $(obj)/,$($(subst $(obj)/,,$@)-objs)) \
$(HOST_LOADLIBES)
$(host-progs-multi): %: $(host-progs-multi-objs) FORCE
......@@ -432,7 +458,7 @@ cmd_shipped = cat $< > $@
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $(echo_target)
cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$@) \
cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
$(filter-out FORCE,$^) -o $@
# Objcopy
......@@ -454,12 +480,10 @@ cmd_gzip = gzip -f -9 < $< > $@
# Descending
# ---------------------------------------------------------------------------
.PHONY: sub_dirs $(subdir-ym)
sub_dirs: $(subdir-ym)
.PHONY: $(subdir-ym)
$(subdir-ym):
@$(MAKE) -C $@ $(MAKECMDGOALS)
+@$(call descend,$@,$(MAKECMDGOALS))
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------
......@@ -574,3 +598,10 @@ define do_cmd
$(2)
endef
# $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target>
ifeq ($(KBUILD_VERBOSE),1)
descend = echo '$(MAKE) -f $(1)/Makefile $(2)';
endif
descend += $(MAKE) -f $(1)/Makefile obj=$(1) $(2)
......@@ -95,6 +95,8 @@ core-y += arch/alpha/kernel/ arch/alpha/mm/
core-$(CONFIG_MATHEMU) += arch/alpha/math-emu/
libs-y += arch/alpha/lib/
export libs-y
MAKEBOOT = $(MAKE) -C arch/alpha/boot
rawboot:
......
......@@ -20,7 +20,7 @@ BPOBJECTS = head.o bootp.o
TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo
VMLINUX = $(TOPDIR)/vmlinux
OBJSTRIP = tools/objstrip
LIBS := $(patsubst lib/%,$(TOPDIR)/lib/%,$(LIBS))
LIBS := $(addprefix $(TOPDIR)/,$(libs-y))
all: $(TARGETS)
@echo Ready to install kernel in $(shell pwd)/vmlinux.gz
......
......@@ -1058,3 +1058,12 @@ CONFIG_SOFTWARE_SUSPEND
absence of features.
For more information take a look at Documentation/swsusp.txt.
CONFIG_SCx200
This provides basic support for the National Semiconductor SCx200
processor. Right now this is just a driver for the GPIO pins.
If you don't know what to do here, say N.
This support is also available as a module. If compiled as a
module, it will be called scx200.o.
......@@ -25,65 +25,23 @@ CFLAGS += -pipe
# prevent gcc from keeping the stack 16 byte aligned
CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi)
ifdef CONFIG_M386
CFLAGS += -march=i386
endif
ifdef CONFIG_M486
CFLAGS += -march=i486
endif
ifdef CONFIG_M586
CFLAGS += -march=i586
endif
ifdef CONFIG_M586TSC
CFLAGS += -march=i586
endif
ifdef CONFIG_M586MMX
CFLAGS += -march=i586
endif
ifdef CONFIG_M686
CFLAGS += -march=i686
endif
ifdef CONFIG_MPENTIUMIII
CFLAGS += -march=i686
endif
ifdef CONFIG_MPENTIUM4
CFLAGS += -march=i686
endif
ifdef CONFIG_MK6
CFLAGS += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi)
endif
ifdef CONFIG_MK7
CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi)
endif
ifdef CONFIG_MCRUSOE
CFLAGS += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
endif
ifdef CONFIG_MWINCHIPC6
CFLAGS += -march=i586
endif
ifdef CONFIG_MWINCHIP2
CFLAGS += -march=i586
endif
ifdef CONFIG_MWINCHIP3D
CFLAGS += -march=i586
endif
ifdef CONFIG_MCYRIXIII
CFLAGS += -march=i586
endif
cflags-$(CONFIG_M386) += -march=i386
cflags-$(CONFIG_M486) += -march=i486
cflags-$(CONFIG_M586) += -march=i586
cflags-$(CONFIG_M586TSC) += -march=i586
cflags-$(CONFIG_M586MMX) += -march=i586
cflags-$(CONFIG_M686) += -march=i686
cflags-$(CONFIG_MPENTIUMIII) += -march=i686
cflags-$(CONFIG_MPENTIUM4) += -march=i686
cflags-$(CONFIG_MK6) += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi)
cflags-$(CONFIG_MK7) += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi)
cflags-$(CONFIG_MCRUSOE) += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
cflags-$(CONFIG_MWINCHIPC6) += -march=i586
cflags-$(CONFIG_MWINCHIP2) += -march=i586
cflags-$(CONFIG_MWINCHIP3D) += -march=i586
cflags-$(CONFIG_MCYRIXIII) += -march=i586
CFLAGS += $(cflags-y)
ifdef CONFIG_VISWS
MACHINE := mach-visws
......@@ -94,47 +52,39 @@ endif
HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
libs-y += arch/i386/lib/
core-y += arch/i386/kernel/ arch/i386/mm/ arch/i386/$(MACHINE)/
core-y += arch/i386/kernel/ arch/i386/mm/ \
arch/i386/$(MACHINE)/
drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/
drivers-$(CONFIG_PCI) += arch/i386/pci/
CFLAGS += -I$(TOPDIR)/arch/i386/$(MACHINE)
AFLAGS += -I$(TOPDIR)/arch/i386/$(MACHINE)
CFLAGS += -Iarch/i386/$(MACHINE)
AFLAGS += -Iarch/i386/$(MACHINE)
MAKEBOOT = +$(MAKE) -C arch/$(ARCH)/boot
makeboot = $(call descend,arch/i386/boot,$(1))
.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
clean archclean archmrproper
all: bzImage
zImage: vmlinux
@$(MAKEBOOT) zImage
BOOTIMAGE=arch/i386/boot/bzImage
zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage
bzImage: vmlinux
@$(MAKEBOOT) bzImage
zImage bzImage: vmlinux
+@$(call makeboot,$(BOOTIMAGE))
compressed: zImage
zlilo: vmlinux
@$(MAKEBOOT) BOOTIMAGE=zImage zlilo
tmp:
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
bzlilo: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
zdisk: vmlinux
@$(MAKEBOOT) BOOTIMAGE=zImage zdisk
zlilo bzlilo: vmlinux
+@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zlilo)
bzdisk: vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zdisk
zdisk bzdisk: vmlinux
+@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zdisk)
install: vmlinux
@echo 'Cleaning up (arch)'
@$(MAKEBOOT) BOOTIMAGE=bzImage install
+@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install)
archclean:
@$(MAKEBOOT) clean
+@$(call makeboot,clean)
archmrproper:
......@@ -25,7 +25,7 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
#RAMDISK := -DRAMDISK=512
EXTRA_TARGETS := vmlinux.bin bvmlinux.bin bootsect bootsect.o \
EXTRA_TARGETS := vmlinux.bin bootsect bootsect.o \
setup setup.o zImage bzImage
host-progs := tools/build
......@@ -38,30 +38,32 @@ include $(TOPDIR)/Rules.make
# ---------------------------------------------------------------------------
zImage: IMAGE_OFFSET := 0x1000
zImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK)
bzImage: IMAGE_OFFSET := 0x100000
bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
bzImage: BUILDFLAGS := -b
$(obj)/zImage: IMAGE_OFFSET := 0x1000
$(obj)/zImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK)
$(obj)/bzImage: IMAGE_OFFSET := 0x100000
$(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
$(obj)/bzImage: BUILDFLAGS := -b
quiet_cmd_image = BUILD $(RELDIR)/$@
cmd_image = tools/build $(BUILDFLAGS) bootsect setup vmlinux.bin \
$(ROOT_DEV) > $@
quiet_cmd_image = BUILD $(echo_target)
cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
$(obj)/vmlinux.bin $(ROOT_DEV) > $@
zImage bzImage: bootsect setup vmlinux.bin tools/build FORCE
$(obj)/zImage $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \
$(obj)/vmlinux.bin $(obj)/tools/build FORCE
$(call if_changed,image)
vmlinux.bin: compressed/vmlinux FORCE
$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy)
LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
LDFLAGS_setup := -Ttext 0x0 -s --oformat binary -e begtext
setup bootsect: %: %.o FORCE
$(obj)/setup $(obj)/bootsect: %: %.o FORCE
$(call if_changed,ld)
compressed/vmlinux: FORCE
@$(MAKE) IMAGE_OFFSET=$(IMAGE_OFFSET) -C compressed vmlinux
$(obj)/compressed/vmlinux: FORCE
+@$(call descend,$(obj)/compressed,IMAGE_OFFSET=$(IMAGE_OFFSET) \
$(obj)/compressed/vmlinux)
zdisk: $(BOOTIMAGE)
......@@ -71,18 +73,16 @@ zlilo: $(BOOTIMAGE)
if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz
cp $(TOPDIR)/System.map $(INSTALL_PATH)/
cp System.map $(INSTALL_PATH)/
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
install: $(BOOTIMAGE)
sh -x ./install.sh $(KERNELRELEASE) $(BOOTIMAGE) $(TOPDIR)/System.map "$(INSTALL_PATH)"
sh $(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
clean:
@echo 'Cleaning up (boot)'
@rm -f tools/build vmlinux.bin bvmlinux.bin
@rm -f setup bootsect zImage compressed/vmlinux.out
@rm -f bsetup bbootsect bzImage compressed/bvmlinux.out
@$(MAKE) -C compressed clean
@rm -f $(host-progs) $(EXTRA_TARGETS)
+@$(call descend,$(obj)/compressed) clean
archhelp:
@echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
......
......@@ -11,19 +11,20 @@ include $(TOPDIR)/Rules.make
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32
vmlinux: head.o misc.o piggy.o FORCE
$(obj)/vmlinux: $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE
$(call if_changed,ld)
vmlinux.bin: $(TOPDIR)/vmlinux FORCE
$(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)
vmlinux.bin.gz: vmlinux.bin FORCE
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)
LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
piggy.o: vmlinux.scr vmlinux.bin.gz FORCE
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
$(call if_changed,ld)
clean:
@rm -f vmlinux vmlinux.bin vmlinux.bin.gz
@echo 'Cleaning up (boot/compressed)'
@rm -f $(EXTRA_TARGETS)
......@@ -293,6 +293,8 @@ else
fi
fi
tristate 'NatSemi SCx200 support' CONFIG_SCx200
source drivers/pci/Config.in
bool 'EISA support' CONFIG_EISA
......
......@@ -29,4 +29,7 @@ obj-$(CONFIG_X86_NUMAQ) += numaq.o
EXTRA_AFLAGS := -traditional
export-objs += scx200.o
obj-$(CONFIG_SCx200) += scx200.o
include $(TOPDIR)/Rules.make
......@@ -26,6 +26,7 @@
#include <linux/init.h>
#include <linux/cpufreq.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <asm/msr.h>
#include <asm/timex.h>
......
/* linux/arch/i386/kernel/scx200.c
Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com>
National Semiconductor SCx200 support. */
#include <linux/config.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/scx200.h>
#include <linux/scx200.h>
#define NAME "scx200"
MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>");
MODULE_DESCRIPTION("NatSemi SCx200 Driver");
MODULE_LICENSE("GPL");
unsigned scx200_gpio_base = 0;
long scx200_gpio_shadow[2];
spinlock_t scx200_gpio_lock = SPIN_LOCK_UNLOCKED;
static spinlock_t scx200_gpio_config_lock = SPIN_LOCK_UNLOCKED;
u32 scx200_gpio_configure(int index, u32 mask, u32 bits)
{
u32 config, new_config;
unsigned long flags;
spin_lock_irqsave(&scx200_gpio_config_lock, flags);
outl(index, scx200_gpio_base + 0x20);
config = inl(scx200_gpio_base + 0x24);
new_config = (config & mask) | bits;
outl(new_config, scx200_gpio_base + 0x24);
spin_unlock_irqrestore(&scx200_gpio_config_lock, flags);
return config;
}
void scx200_gpio_dump(unsigned index)
{
u32 config = scx200_gpio_configure(index, ~0, 0);
printk(KERN_DEBUG "GPIO%02u: 0x%08lx", index, (unsigned long)config);
if (config & 1)
printk(" OE"); /* output enabled */
else
printk(" TS"); /* tristate */
if (config & 2)
printk(" PP"); /* push pull */
else
printk(" OD"); /* open drain */
if (config & 4)
printk(" PUE"); /* pull up enabled */
else
printk(" PUD"); /* pull up disabled */
if (config & 8)
printk(" LOCKED"); /* locked */
if (config & 16)
printk(" LEVEL"); /* level input */
else
printk(" EDGE"); /* edge input */
if (config & 32)
printk(" HI"); /* trigger on rising edge */
else
printk(" LO"); /* trigger on falling edge */
if (config & 64)
printk(" DEBOUNCE"); /* debounce */
printk("\n");
}
int __init scx200_init(void)
{
struct pci_dev *bridge;
int bank;
unsigned base;
printk(KERN_INFO NAME ": NatSemi SCx200 Driver\n");
if ((bridge = pci_find_device(PCI_VENDOR_ID_NS,
PCI_DEVICE_ID_NS_SCx200_BRIDGE,
NULL)) == NULL)
return -ENODEV;
base = pci_resource_start(bridge, 0);
printk(KERN_INFO NAME ": GPIO base 0x%x\n", base);
if (request_region(base, SCx200_GPIO_SIZE, "NatSemi SCx200 GPIO") == 0) {
printk(KERN_ERR NAME ": can't allocate I/O for GPIOs\n");
return -EBUSY;
}
scx200_gpio_base = base;
/* read the current values driven on the GPIO signals */
for (bank = 0; bank < 2; ++bank)
scx200_gpio_shadow[bank] = inl(scx200_gpio_base + 0x10 * bank);
return 0;
}
void __exit scx200_cleanup(void)
{
release_region(scx200_gpio_base, SCx200_GPIO_SIZE);
}
module_init(scx200_init);
module_exit(scx200_cleanup);
EXPORT_SYMBOL(scx200_gpio_base);
EXPORT_SYMBOL(scx200_gpio_shadow);
EXPORT_SYMBOL(scx200_gpio_lock);
EXPORT_SYMBOL(scx200_gpio_configure);
EXPORT_SYMBOL(scx200_gpio_dump);
/*
Local variables:
compile-command: "make -k -C ../../.. SUBDIRS=arch/i386/kernel modules"
c-basic-offset: 8
End:
*/
......@@ -44,24 +44,22 @@ find_key_inode(int key)
static struct page *
alloc_hugetlb_page(void)
{
struct list_head *curr, *head;
int i;
struct page *page;
spin_lock(&htlbpage_lock);
head = &htlbpage_freelist;
curr = head->next;
if (curr == head) {
if (list_empty(&htlbpage_freelist)) {
spin_unlock(&htlbpage_lock);
return NULL;
}
page = list_entry(curr, struct page, list);
list_del(curr);
page = list_entry(htlbpage_freelist.next, struct page, list);
list_del(&page->list);
htlbpagemem--;
spin_unlock(&htlbpage_lock);
set_page_count(page, 1);
memset(page_address(page), 0, HPAGE_SIZE);
for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i)
clear_highpage(&page[i]);
return page;
}
......
......@@ -77,14 +77,14 @@ SECTIONS
. = ALIGN(32);
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
__bss_start = .; /* BSS */
.bss : { *(.bss) }
__bss_stop = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__stop___kallsyms = .;
__bss_start = .; /* BSS */
.bss : { *(.bss) }
__bss_stop = .;
_end = . ;
/* Sections to be discarded */
......
......@@ -1046,13 +1046,7 @@ static struct block_device_operations stram_fops = {
.release = stram_release,
};
static struct gendisk stram_disk = {
.major = STRAM_MAJOR,
.first_minor = STRAM_MINOR,
.minor_shift = 0,
.fops = &stram_fops,
.disk_name = "stram"
};
static struct gendisk *stram_disk;
int __init stram_device_init(void)
{
......@@ -1063,15 +1057,24 @@ int __init stram_device_init(void)
if (!max_swap_size)
/* swapping not enabled */
return -ENXIO;
stram_disk = alloc_disk();
if (!stram_disk)
return -ENOMEM;
if (register_blkdev( STRAM_MAJOR, "stram", &stram_fops)) {
printk(KERN_ERR "stram: Unable to get major %d\n", STRAM_MAJOR);
put_disk(stram_disk);
return -ENXIO;
}
blk_init_queue(BLK_DEFAULT_QUEUE(STRAM_MAJOR), do_stram_request);
set_capacity(&stram_disk, (swap_end - swap_start)/512);
add_disk(&stram_disk);
stram_disk->major = STRAM_MAJOR;
stram_disk->first_minor = STRAM_MINOR;
stram_disk->minor_shift = 0;
stram_disk->fops = &stram_fops;
sprintf(stram_disk->disk_name, "stram");
set_capacity(stram_disk, (swap_end - swap_start)/512);
add_disk(stram_disk);
return 0;
}
......
......@@ -41,8 +41,7 @@ core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/
libs-y += arch/sparc/prom/ arch/sparc/lib/
# Export what is needed by arch/sparc/boot/Makefile
export CORE_FILES
export INIT
export init-y core-y drivers-y net-y libs-y HEAD
image: vmlinux
$(MAKE) -C arch/sparc/boot image
......
......@@ -22,9 +22,8 @@ btfixupprep: btfixupprep.c
clean:
rm -f btfixupprep piggyback tftpboot.img btfix.o btfix.s image
BTOBJS := $(HEAD) $(INIT)
BTLIBS := $(CORE_FILES) $(LIBS) \
$(DRIVERS) $(NETWORKS)
BTOBJS := $(HEAD) $(init-y)
BTLIBS := $(core-y) $(LIBS) $(drivers-y) $(net-y)
# Actual linking
image: btfix.o
......
......@@ -65,8 +65,8 @@ static struct block_device_operations ubd_blops = {
static request_queue_t *ubd_queue;
static int fake_major = 0;
static struct gendisk ubd_gendisk[MAX_DEV];
static struct gendisk fake_gendisk[MAX_DEV];
static struct gendisk *ubd_gendisk[MAX_DEV];
static struct gendisk *fake_gendisk[MAX_DEV];
#ifdef CONFIG_BLK_DEV_UBD_SYNC
#define OPEN_FLAGS ((struct openflags) { r : 1, w : 1, s : 1, c : 0 })
......@@ -398,31 +398,43 @@ static int ubd_add(int n)
devfs_handle_t real, fake;
char name[sizeof("nnnnnn\0")];
struct ubd *dev = &ubd_dev[n];
struct gendisk *disk, *fake_disk;
u64 size;
if (!dev->file)
return -1;
ubd_gendisk[n].major = MAJOR_NR;
ubd_gendisk[n].first_minor = n << UBD_SHIFT;
ubd_gendisk[n].minor_shift = UBD_SHIFT;
ubd_gendisk[n].fops = &ubd_fops;
disk = alloc_disk();
if (!disk)
return -1;
disk->major = MAJOR_NR;
disk->first_minor = n << UBD_SHIFT;
disk->minor_shift = UBD_SHIFT;
disk->fops = &ubd_fops;
if (fakehd_set)
sprintf(ubd_gendisk[n].disk_name, "hd%c", n + 'a');
sprintf(disk->disk_name, "hd%c", n + 'a');
else
sprintf(ubd_gendisk[n].disk_name, "ubd%d", n);
sprintf(disk->disk_name, "ubd%d", n);
if (fake_major) {
fake_gendisk[n].major = fake_major;
fake_gendisk[n].first_minor = n << UBD_SHIFT;
fake_gendisk[n].minor_shift = UBD_SHIFT;
fake_gendisk[n].fops = &ubd_fops;
sprintf(fake_gendisk[n].disk_name, "ubd%d", n);
fake_disk = alloc_disk();
if (!fake_disk) {
put_disk(disk);
return -1;
}
fake_disk->major = fake_major;
fake_disk->first_minor = n << UBD_SHIFT;
fake_disk->minor_shift = UBD_SHIFT;
fake_disk->fops = &ubd_fops;
sprintf(fake_disk->disk_name, "ubd%d", n);
fake_gendisk[n] = fake_disk;
}
ubd_gendisk[n] = disk;
if (!dev->is_dir && ubd_file_size(dev, &size) == 0) {
set_capacity(&ubd_gendisk[n], size/512);
set_capacity(&fake_gendisk[n], size/512);
set_capacity(disk, size/512);
set_capacity(fake_disk, size/512);
}
sprintf(name, "%d", n);
......@@ -430,14 +442,14 @@ static int ubd_add(int n)
MAJOR_NR, n << UBD_SHIFT,
S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP,
&ubd_blops, NULL);
add_disk(&ubd_gendisk[n]);
add_disk(disk);
if (fake_major) {
fake = devfs_register(ubd_fake_dir_handle, name,
DEVFS_FL_REMOVABLE, fake_major,
n << UBD_SHIFT,
S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |
S_IWGRP, &ubd_blops, NULL);
add_disk(&fake_gendisk[n]);
add_disk(fake_disk);
if(fake == NULL) return(-1);
ubd_dev[n].fake = fake;
}
......@@ -445,7 +457,7 @@ static int ubd_add(int n)
if(real == NULL) return(-1);
ubd_dev[n].real = real;
make_ide_entries(ubd_gendisk[n].name);
make_ide_entries(disk->disk_name);
return(0);
}
......@@ -483,9 +495,14 @@ static int ubd_remove(char *str)
n = *str - '0';
if(n > MAX_DEV) return(-1);
dev = &ubd_dev[n];
del_gendisk(&ubd_gendisk[n]);
if (fake_major)
del_gendisk(&fake_gendisk[n]);
del_gendisk(ubd_gendisk[n]);
put_disk(ubd_gendisk[n]);
ubd_gendisk[n] = NULL;
if (fake_major) {
del_gendisk(fake_gendisk[n]);
put_disk(fake_gendisk[n]);
fake_gendisk[n] = NULL;
}
if(dev->file == NULL) return(0);
if(dev->count > 0) return(-1);
if(dev->real != NULL) devfs_unregister(dev->real);
......@@ -878,9 +895,9 @@ static int ubd_revalidate(kdev_t rdev)
err = ubd_file_size(dev, &size);
if (!err) {
set_capacity(&ubd_gendisk[n], size / 512);
set_capacity(ubd_gendisk[n], size / 512);
if(fake_major != 0)
set_capacity(&fake_gendisk[n], size / 512);
set_capacity(fake_gendisk[n], size / 512);
dev->size = size;
}
......
......@@ -203,7 +203,7 @@ static struct archy_disk_type {
*/
#define MAX_DISK_SIZE 720
static struct gendisk disks[FD_MAX_UNIT];
static struct gendisk *disks[FD_MAX_UNIT];
/* current info on each unit */
static struct archy_floppy_struct {
......@@ -961,7 +961,7 @@ static void fd_rwsec_done(int status)
if (unit[SelectedDrive].disktype > disk_type) {
/* try another disk type */
unit[SelectedDrive].disktype--;
set_capacity(&disks[SelectedDrive],
set_capacity(disks[SelectedDrive],
unit[SelectedDrive].disktype->blocks);
} else
Probing = 0;
......@@ -969,7 +969,7 @@ static void fd_rwsec_done(int status)
/* record not found, but not probing. Maybe stretch wrong ? Restart probing */
if (unit[SelectedDrive].autoprobe) {
unit[SelectedDrive].disktype = disk_type + NUM_DISK_TYPES - 1;
set_capacity(&disks[SelectedDrive],
set_capacity(disks[SelectedDrive],
unit[SelectedDrive].disktype->blocks);
Probing = 1;
}
......@@ -1242,7 +1242,7 @@ static void redo_fd_request(void)
if (!floppy->disktype) {
Probing = 1;
floppy->disktype = disk_type + NUM_DISK_TYPES - 1;
set_capacity(&disks[drive], floppy->disktype->blocks);
set_capacity(disks[drive], floppy->disktype->blocks);
floppy->autoprobe = 1;
}
} else {
......@@ -1254,7 +1254,7 @@ static void redo_fd_request(void)
goto repeat;
}
floppy->disktype = &disk_type[type];
set_capacity(&disks[drive], floppy->disktype->blocks);
set_capacity(disks[drive], floppy->disktype->blocks);
floppy->autoprobe = 0;
}
......@@ -1540,7 +1540,7 @@ static struct gendisk *floppy_find(int minor)
int drive = minor & 3;
if ((minor>> 2) > NUM_DISK_TYPES || drive >= FD_MAX_UNITS)
return NULL;
return &disks[drive];
return disks[drive];
}
int fd1772_init(void)
......@@ -1550,20 +1550,28 @@ int fd1772_init(void)
if (!machine_is_archimedes())
return 0;
for (i = 0; i < FD_MAX_UNITS; i++) {
disks[i] = alloc_disk();
if (!disks[i])
goto out;
}
if (register_blkdev(MAJOR_NR, "fd", &floppy_fops)) {
printk("Unable to get major %d for floppy\n", MAJOR_NR);
return 1;
goto out;
}
if (request_dma(FLOPPY_DMA, "fd1772")) {
printk("Unable to grab DMA%d for the floppy (1772) driver\n", FLOPPY_DMA);
return 1;
unregister_blkdev(MAJOR_NR, "fd");
goto out;
};
if (request_dma(FIQ_FD1772, "fd1772 end")) {
printk("Unable to grab DMA%d for the floppy (1772) driver\n", FIQ_FD1772);
unregister_blkdev(MAJOR_NR, "fd");
free_dma(FLOPPY_DMA);
return 1;
goto out;
};
enable_dma(FIQ_FD1772); /* This inserts a call to our command end routine */
......@@ -1582,18 +1590,22 @@ int fd1772_init(void)
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_fd_request);
for (i = 0; i < FD_MAX_UNITS; i++) {
unit[i].track = -1;
disks[i].major = MAJOR_NR;
disks[i].first_minor = 0;
disks[i].fops = &floppy_fops;
sprintf(disks[i].disk_name, "fd%d", i);
set_capacity(&disks[i], MAX_DISK_SIZE * 2);
disks[i]->major = MAJOR_NR;
disks[i]->first_minor = 0;
disks[i]->fops = &floppy_fops;
sprintf(disks[i]->disk_name, "fd%d", i);
set_capacity(disks[i], MAX_DISK_SIZE * 2);
}
blk_set_probe(MAJOR_NR, floppy_find);
for (i = 0; i < FD_MAX_UNITS; i++)
add_disk(disks + i);
add_disk(disks[i]);
config_types();
return 0;
out:
while (i--)
put_disk(disks[i]);
return 1;
}
......@@ -880,19 +880,7 @@ static void mfm_rerequest(void)
mfm_request();
}
static struct gendisk mfm_gendisk[2] = {
{
.major = MAJOR_NR,
.first_minor = 0,
.disk_name = "mfma",
.minor_shift = 6,
},
{
.major = MAJOR_NR,
.first_minor = 64,
.disk_name = "mfmb",
.minor_shift = 6,
};
static struct gendisk *mfm_gendisk[2];
static void mfm_request(void)
{
......@@ -908,6 +896,7 @@ static void mfm_request(void)
while (1) {
unsigned int dev, block, nsect, unit;
struct gendisk *disk;
DBG("mfm_request: loop start\n");
sti();
......@@ -930,14 +919,13 @@ static void mfm_request(void)
#ifdef DEBUG
/*if (unit==1) */ console_printf("mfm_request: raw vals: dev=%d (block=512 bytes) block=%d nblocks=%d\n", dev, block, nsect);
#endif
if (unit >= mfm_drives ||
block >= get_capacity(mfm_gendisk + unit) ||
((block+nsect) > get_capacity(mfm_gendisk + unit))) {
if (unit >= mfm_drives)
printk("mfm: bad minor number: device=%s\n", kdevname(CURRENT->rq_dev));
else
printk("mfm%c: bad access: block=%d, count=%d, nr_sects=%ld\n", unit+'a',
block, nsect, get_capacity(mfm_gendisk+unit));
if (unit >= mfm_drives)
printk("mfm: bad disk number: %d\n", unit);
disk = mfm_gendisk[unit];
if (block >= get_capacity(disk) ||
block+nsect > get_capacity(disk)) {
printk("%s: bad access: block=%d, count=%d, nr_sects=%ld\n",
disk->disk_name, block, nsect, get_capacity(disk));
printk("mfm: continue 1\n");
end_request(CURRENT, 0);
Busy = 0;
......@@ -1017,7 +1005,7 @@ static void mfm_interrupt_handler(int unused, void *dev_id, struct pt_regs *regs
static void mfm_geometry(int drive)
{
struct mfm_info *p = mfm_info + drive;
struct gendisk *disk = mfm_gendisk + drive;
struct gendisk *disk = mfm_gendisk[drive];
if (p->cylinders)
printk ("%s: %dMB CHS=%d/%d/%d LCC=%d RECOMP=%d\n",
disk->disk_name,
......@@ -1255,26 +1243,6 @@ static struct block_device_operations mfm_fops =
.ioctl = mfm_ioctl,
};
static void mfm_geninit (void)
{
int i;
mfm_drives = mfm_initdrives();
printk("mfm: detected %d hard drive%s\n", mfm_drives,
mfm_drives == 1 ? "" : "s");
if (request_irq(mfm_irq, mfm_interrupt_handler, SA_INTERRUPT, "MFM harddisk", NULL))
printk("mfm: unable to get IRQ%d\n", mfm_irq);
if (mfm_irqenable)
outw(0x80, mfm_irqenable); /* Required to enable IRQs from MFM podule */
for (i = 0; i < mfm_drives; i++) {
mfm_geometry(i);
add_disk(mfm_gendisk + i);
}
}
static struct expansion_card *ecs;
/*
......@@ -1317,9 +1285,10 @@ static int mfm_probecontroller (unsigned int mfm_addr)
*
* The HDC is accessed at MEDIUM IOC speeds.
*/
int mfm_init (void)
static int __init mfm_init (void)
{
unsigned char irqmask;
int i;
if (mfm_probecontroller(ONBOARD_MFM_ADDRESS)) {
mfm_addr = ONBOARD_MFM_ADDRESS;
......@@ -1344,16 +1313,12 @@ int mfm_init (void)
}
printk("mfm: found at address %08X, interrupt %d\n", mfm_addr, mfm_irq);
if (!request_region (mfm_addr, 10, "mfm")) {
ecard_release(ecs);
return -1;
}
if (!request_region (mfm_addr, 10, "mfm"))
goto out1;
if (register_blkdev(MAJOR_NR, "mfm", &mfm_fops)) {
printk("mfm_init: unable to get major number %d\n", MAJOR_NR);
ecard_release(ecs);
release_region(mfm_addr, 10);
return -1;
goto out2;
}
/* Stuff for the assembler routines to get to */
......@@ -1366,31 +1331,73 @@ int mfm_init (void)
Busy = 0;
lastspecifieddrive = -1;
mfm_geninit();
return 0;
}
mfm_drives = mfm_initdrives();
if (!mfm_drives)
goto out3;
for (i = 0; i < mfm_drives; i++) {
struct gendisk *disk = alloc_disk();
if (!disk)
goto Enomem;
disk->major = MAJOR_NR;
disk->first_minor = i << 6;
disk->minor_shift = 6;
disk->fops = &mfm_fops;
sprintf(disk->disk_name, "mfm%c", 'a'+i);
mfm_gendisk[i] = disk;
}
#ifdef MODULE
printk("mfm: detected %d hard drive%s\n", mfm_drives,
mfm_drives == 1 ? "" : "s");
if (request_irq(mfm_irq, mfm_interrupt_handler, SA_INTERRUPT, "MFM harddisk", NULL)) {
printk("mfm: unable to get IRQ%d\n", mfm_irq);
goto out4;
}
MODULE_LICENSE("GPL");
if (mfm_irqenable)
outw(0x80, mfm_irqenable); /* Required to enable IRQs from MFM podule */
int init_module(void)
{
return mfm_init();
for (i = 0; i < mfm_drives; i++) {
mfm_geometry(i);
add_disk(mfm_gendisk[i]);
}
return 0;
out4:
for (i = 0; i < mfm_drives; i++)
put_disk(mfm_gendisk[i]);
out3:
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
unregister_blkdev(MAJOR_NR, "mfm");
out2:
release_region(mfm_addr, 10);
out1:
ecard_release(ecs);
return -1;
Enomem:
while (i--)
put_disk(mfm_gendisk[i]);
goto out3;
}
void cleanup_module(void)
static void __exit mfm_exit(void)
{
int i;
if (ecs && mfm_irqenable)
outw (0, mfm_irqenable); /* Required to enable IRQs from MFM podule */
free_irq(mfm_irq, NULL);
for (i = 0; i < mfm_drives; i++) {
del_gendisk(mfm_gendisk[i]);
put_disk(mfm_gendisk[i]);
}
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
unregister_blkdev(MAJOR_NR, "mfm");
for (i = 0; i < mfm_drives; i++)
del_gendisk(mfm_gendisk + i);
if (ecs)
ecard_release(ecs);
if (mfm_addr)
release_region(mfm_addr, 10);
}
#endif
module_init(mfm_init)
module_exit(mfm_exit)
MODULE_LICENSE("GPL");
......@@ -4,7 +4,7 @@
export ACPI_CFLAGS
ACPI_CFLAGS := -D_LINUX -I$(CURDIR)/include
ACPI_CFLAGS := -D_LINUX -Idrivers/acpi/include
ifdef CONFIG_ACPI_DEBUG
ACPI_CFLAGS += -DACPI_DEBUG_OUTPUT
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := evevent.o evregion.o evsci.o evxfevnt.o \
evmisc.o evrgnini.o evxface.o evxfregn.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,10 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\
excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \
exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,7 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o hwtimer.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,9 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := nsaccess.o nsdumpdv.o nsload.o nssearch.o nsxfeval.o \
nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \
nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := psargs.o psparse.o pstree.o pswalk.o \
psopcode.o psscope.o psutils.o psxface.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := rsaddr.o rscreate.o rsio.o rslist.o rsmisc.o rsxface.o \
rscalc.o rsdump.o rsirq.o rsmemory.o rsutils.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := tbconvrt.o tbget.o tbrsdt.o tbxface.o \
tbgetall.o tbinstal.o tbutils.o tbxfroot.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
utcopy.o utdelete.o utglobal.o utmath.o utobject.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -1958,8 +1958,7 @@ static boolean DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
Controller->RequestQueue = RequestQueue;
for (n = 0; n < DAC960_MaxLogicalDrives; n++) {
struct gendisk *disk = &Controller->disks[n];
memset(disk, 0, sizeof(struct gendisk));
struct gendisk *disk = Controller->disks[n];
sprintf(disk->disk_name, "rd/c%dd%d", Controller->ControllerNumber, n);
disk->major = MajorNumber;
disk->first_minor = n << DAC960_MaxPartitionsBits;
......@@ -1983,7 +1982,7 @@ static void DAC960_UnregisterBlockDevice(DAC960_Controller_T *Controller)
int MajorNumber = DAC960_MAJOR + Controller->ControllerNumber;
int disk;
for (disk = 0; disk < DAC960_MaxLogicalDrives; disk++)
del_gendisk(&Controller->disks[disk]);
del_gendisk(Controller->disks[disk]);
/*
Unregister the Block Device Major Number for this DAC960 Controller.
*/
......@@ -2018,7 +2017,7 @@ static void DAC960_ComputeGenericDiskInfo(DAC960_Controller_T *Controller)
{
int disk;
for (disk = 0; disk < DAC960_MaxLogicalDrives; disk++)
set_capacity(Controller->disks + disk, disk_size(Controller, disk));
set_capacity(Controller->disks[disk], disk_size(Controller, disk));
}
static int DAC960_revalidate(kdev_t dev)
......@@ -2026,7 +2025,7 @@ static int DAC960_revalidate(kdev_t dev)
int ctlr = DAC960_ControllerNumber(dev);
int disk = DAC960_LogicalDriveNumber(dev);
DAC960_Controller_T *p = DAC960_Controllers[ctlr];
set_capacity(&p->disks[disk], disk_size(p, disk));
set_capacity(p->disks[disk], disk_size(p, disk));
return 0;
}
......@@ -2099,6 +2098,7 @@ static void DAC960_DetectControllers(DAC960_HardwareType_T HardwareType)
unsigned short VendorID = 0, DeviceID = 0;
unsigned int MemoryWindowSize = 0;
PCI_Device_T *PCI_Device = NULL;
int i;
switch (HardwareType)
{
case DAC960_BA_Controller:
......@@ -2199,6 +2199,11 @@ static void DAC960_DetectControllers(DAC960_HardwareType_T HardwareType)
goto Failure;
}
memset(Controller, 0, sizeof(DAC960_Controller_T));
for (i = 0; i < DAC960_MaxLogicalDrives; i++) {
Controller->disks[i] = alloc_disk();
if (!Controller->disks[i])
goto Enomem;
}
Controller->ControllerNumber = DAC960_ControllerCount;
init_waitqueue_head(&Controller->CommandWaitQueue);
init_waitqueue_head(&Controller->HealthStatusWaitQueue);
......@@ -2455,6 +2460,12 @@ static void DAC960_DetectControllers(DAC960_HardwareType_T HardwareType)
if (Controller->IRQ_Channel > 0)
free_irq(IRQ_Channel, Controller);
}
return;
Enomem:
while (i--)
put_disk(Controller->disks[i]);
kfree(Controller);
goto Failure;
}
......@@ -2493,7 +2504,10 @@ static void DAC960_SortControllers(void)
DAC960_Controller_T *Controller = DAC960_Controllers[ControllerNumber];
if (!Controller->ControllerDetectionSuccessful)
{
int i;
DAC960_Controllers[ControllerNumber] = NULL;
for (i = 0; i < DAC960_MaxLogicalDrives; i++)
put_disk(Controller->disks[i]);
kfree(Controller);
}
}
......@@ -2534,6 +2548,7 @@ static void DAC960_InitializeController(DAC960_Controller_T *Controller)
static void DAC960_FinalizeController(DAC960_Controller_T *Controller)
{
int i;
if (Controller->ControllerInitialized)
{
del_timer(&Controller->MonitoringTimer);
......@@ -2578,6 +2593,8 @@ static void DAC960_FinalizeController(DAC960_Controller_T *Controller)
DAC960_UnregisterBlockDevice(Controller);
DAC960_DestroyAuxiliaryStructures(Controller);
DAC960_Controllers[Controller->ControllerNumber] = NULL;
for (i = 0; i < DAC960_MaxLogicalDrives; i++)
put_disk(Controller->disks[i]);
kfree(Controller);
}
......@@ -2606,8 +2623,8 @@ static int DAC960_Initialize(void)
if (Controller == NULL) continue;
DAC960_InitializeController(Controller);
for (disk = 0; disk < DAC960_MaxLogicalDrives; disk++) {
set_capacity(&Controller->disks[disk], disk_size(Controller, disk));
add_disk(&Controller->disks[disk]);
set_capacity(Controller->disks[disk], disk_size(Controller, disk));
add_disk(Controller->disks[disk]);
}
}
DAC960_CreateProcEntries();
......@@ -5250,10 +5267,10 @@ static int DAC960_Open(Inode_T *Inode, File_T *File)
Controller->LogicalDriveInitiallyAccessible[LogicalDriveNumber] = true;
size = disk_size(Controller, LogicalDriveNumber);
/* BROKEN, same as modular ide-floppy/ide-disk; same fix - ->probe() */
set_capacity(&Controller->disks[LogicalDriveNumber], size);
add_disk(&Controller->disks[LogicalDriveNumber]);
set_capacity(Controller->disks[LogicalDriveNumber], size);
add_disk(Controller->disks[LogicalDriveNumber]);
}
if (!get_capacity(&Controller->disks[LogicalDriveNumber]))
if (!get_capacity(Controller->disks[LogicalDriveNumber]))
return -ENXIO;
/*
Increment Controller and Logical Drive Usage Counts.
......
......@@ -2360,7 +2360,7 @@ typedef struct DAC960_Controller
boolean MonitoringAlertMode;
boolean SuppressEnclosureMessages;
Timer_T MonitoringTimer;
struct gendisk disks[DAC960_MaxLogicalDrives];
struct gendisk *disks[DAC960_MaxLogicalDrives];
DAC960_Command_T *FreeCommands;
unsigned char *CombinedStatusBuffer;
unsigned char *CurrentStatusBuffer;
......
......@@ -367,7 +367,6 @@ static int acsi_release( struct inode * inode, struct file * file );
static void acsi_prevent_removal( int target, int flag );
static int acsi_change_blk_size( int target, int lun);
static int acsi_mode_sense( int target, int lun, SENSE_DATA *sd );
static void acsi_geninit(void);
static int acsi_revalidate (kdev_t);
/************************* End of Prototypes **************************/
......@@ -974,12 +973,12 @@ static void redo_acsi_request( void )
dev = DEVICE_NR(CURRENT->rq_dev);
block = CURRENT->sector;
if (dev >= NDevices ||
block+CURRENT->nr_sectors >= get_capacity(acsi_gendisk + dev)) {
block+CURRENT->nr_sectors >= get_capacity(acsi_gendisk[dev])) {
#ifdef DEBUG
printk( "ad%c: attempted access for blocks %d...%ld past end of device at block %ld.\n",
dev+'a',
block, block + CURRENT->nr_sectors - 1,
get_capacity(acsi_gendisk + dev));
get_capacity(acsi_gendisk[dev]));
#endif
end_request(CURRENT, 0);
goto repeat;
......@@ -1340,7 +1339,7 @@ static int acsi_mode_sense( int target, int lun, SENSE_DATA *sd )
extern struct block_device_operations acsi_fops;
static struct gendisk acsi_gendisk[MAX_DEV];
static struct gendisk *acsi_gendisk[MAX_DEV];
#define MAX_SCSI_DEVICE_CODE 10
......@@ -1607,13 +1606,53 @@ static struct block_device_operations acsi_fops = {
revalidate: acsi_revalidate,
};
static void acsi_geninit(void)
#ifdef CONFIG_ATARI_SLM_MODULE
/* call attach_slm() for each device that is a printer; needed for init of SLM
* driver as a module, since it's not yet present if acsi.c is inited and thus
* the bus gets scanned. */
void acsi_attach_SLMs( int (*attach_func)( int, int ) )
{
int i, n = 0;
for( i = 0; i < 8; ++i )
if (SLM_devices[i] >= 0)
n += (*attach_func)( i, SLM_devices[i] );
printk( KERN_INFO "Found %d SLM printer(s) total.\n", n );
}
#endif /* CONFIG_ATARI_SLM_MODULE */
int acsi_init( void )
{
int err = 0;
int i, target, lun;
struct acsi_info_struct *aip;
#ifdef CONFIG_ATARI_SLM
int n_slm = 0;
#endif
if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ACSI))
return 0;
if (register_blkdev( MAJOR_NR, "ad", &acsi_fops )) {
printk( KERN_ERR "Unable to get major %d for ACSI\n", MAJOR_NR );
err = -EBUSY;
goto out1;
}
if (!(acsi_buffer =
(char *)atari_stram_alloc(ACSI_BUFFER_SIZE, "acsi"))) {
err = -ENOMEM;
printk( KERN_ERR "Unable to get ACSI ST-Ram buffer.\n" );
goto out2;
}
phys_acsi_buffer = virt_to_phys( acsi_buffer );
STramMask = ATARIHW_PRESENT(EXTD_DMA) ? 0x00000000 : 0xff000000;
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_acsi_request, &acsi_lock);
#ifdef CONFIG_ATARI_SLM
err = slm_init();
#endif
if (err)
goto out3;
printk( KERN_INFO "Probing ACSI devices:\n" );
NDevices = 0;
......@@ -1688,9 +1727,15 @@ static void acsi_geninit(void)
printk( KERN_INFO "Found %d ACSI device(s) and %d SLM printer(s) total.\n",
NDevices, n_slm );
#endif
err = -ENOMEM;
for( i = 0; i < NDevices; ++i ) {
struct gendisk *disk = acsi_gendisk + i;
acsi_gendisk[i] = alloc_disk();
if (!acsi_gendisk[i])
goto out4;
}
for( i = 0; i < NDevices; ++i ) {
struct gendisk *disk = acsi_gendisk[i];
sprintf(disk->disk_name, "ad%c", 'a'+i);
disk->major = MAJOR_NR;
disk->first_minor = i << 4;
......@@ -1699,49 +1744,16 @@ static void acsi_geninit(void)
set_capacity(disk, acsi_info[i].size);
add_disk(disk);
}
}
#ifdef CONFIG_ATARI_SLM_MODULE
/* call attach_slm() for each device that is a printer; needed for init of SLM
* driver as a module, since it's not yet present if acsi.c is inited and thus
* the bus gets scanned. */
void acsi_attach_SLMs( int (*attach_func)( int, int ) )
{
int i, n = 0;
for( i = 0; i < 8; ++i )
if (SLM_devices[i] >= 0)
n += (*attach_func)( i, SLM_devices[i] );
printk( KERN_INFO "Found %d SLM printer(s) total.\n", n );
}
#endif /* CONFIG_ATARI_SLM_MODULE */
int acsi_init( void )
{
int err = 0;
if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ACSI))
return 0;
if (register_blkdev( MAJOR_NR, "ad", &acsi_fops )) {
printk( KERN_ERR "Unable to get major %d for ACSI\n", MAJOR_NR );
return -EBUSY;
}
if (!(acsi_buffer =
(char *)atari_stram_alloc(ACSI_BUFFER_SIZE, "acsi"))) {
printk( KERN_ERR "Unable to get ACSI ST-Ram buffer.\n" );
unregister_blkdev( MAJOR_NR, "ad" );
return -ENOMEM;
}
phys_acsi_buffer = virt_to_phys( acsi_buffer );
STramMask = ATARIHW_PRESENT(EXTD_DMA) ? 0x00000000 : 0xff000000;
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_acsi_request, &acsi_lock);
#ifdef CONFIG_ATARI_SLM
err = slm_init();
#endif
if (!err)
acsi_geninit();
return 0;
out4:
while (i--)
put_disk(acsi_gendisk[i]);
out3:
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
atari_stram_free( acsi_buffer );
out2:
unregister_blkdev( MAJOR_NR, "ad" );
out1:
return err;
}
......@@ -1770,8 +1782,10 @@ void cleanup_module(void)
if (unregister_blkdev( MAJOR_NR, "ad" ) != 0)
printk( KERN_ERR "acsi: cleanup_module failed\n");
for (i = 0; i < NDevices; i++)
del_gendisk(acsi_gendisk + i);
for (i = 0; i < NDevices; i++) {
del_gendisk(acsi_gendisk[i]);
put_disk(acsi_gendisk[i]);
}
}
#endif
......@@ -1810,6 +1824,6 @@ static int acsi_revalidate(kdev_t dev)
ENABLE_IRQ();
stdma_release();
set_capacity(acsi_gendisk + unit, aip->size);
set_capacity(acsi_gendisk[unit], aip->size);
return 0;
}
......@@ -1643,7 +1643,7 @@ static int floppy_open(struct inode *inode, struct file *filp)
unit[drive].dtype=&data_types[system];
unit[drive].blocks=unit[drive].type->heads*unit[drive].type->tracks*
data_types[system].sects*unit[drive].type->sect_mult;
set_capacity(&unit[drive].disk, unit[drive].blocks);
set_capacity(unit[drive].gendisk, unit[drive].blocks);
printk(KERN_INFO "fd%d: accessing %s-disk with %s-layout\n",drive,
unit[drive].type->name, data_types[system].name);
......@@ -1731,25 +1731,31 @@ static int __init fd_probe_drives(void)
drives=0;
nomem=0;
for(drive=0;drive<FD_MAX_UNITS;drive++) {
struct gendisk *disk;
fd_probe(drive);
if (unit[drive].type->code != FD_NODRIVE) {
struct gendisk *disk = &unit[drive].disk;
drives++;
if ((unit[drive].trackbuf = kmalloc(FLOPPY_MAX_SECTORS * 512, GFP_KERNEL)) == NULL) {
printk("no mem for ");
unit[drive].type = &drive_types[num_dr_types - 1]; /* FD_NODRIVE */
drives--;
nomem = 1;
}
printk("fd%d ",drive);
disk->major = MAJOR_NR;
disk->first_minor = drive;
disk->minor_shift = 0;
disk->fops = &floppy_fops;
sprintf(disk->disk_name, "fd%d", drive);
set_capacity(disk, 880*2);
add_disk(disk);
if (unit[drive].type->code == FD_NODRIVE)
continue;
disk = alloc_disk();
if (!disk) {
unit[drive].type->code = FD_NODRIVE;
continue;
}
unit[drive].gendisk = disk;
drives++;
if ((unit[drive].trackbuf = kmalloc(FLOPPY_MAX_SECTORS * 512, GFP_KERNEL)) == NULL) {
printk("no mem for ");
unit[drive].type = &drive_types[num_dr_types - 1]; /* FD_NODRIVE */
drives--;
nomem = 1;
}
printk("fd%d ",drive);
disk->major = MAJOR_NR;
disk->first_minor = drive;
disk->minor_shift = 0;
disk->fops = &floppy_fops;
sprintf(disk->disk_name, "fd%d", drive);
set_capacity(disk, 880*2);
add_disk(disk);
}
if ((drives > 0) || (nomem == 0)) {
if (drives == 0)
......@@ -1766,7 +1772,7 @@ static struct gendisk *floppy_find(int minor)
int drive = minor & 3;
if (unit[drive].type->code == FD_NODRIVE)
return NULL;
return &unit[drive].disk;
return unit[drive].gendisk;
}
int __init amiga_floppy_init(void)
......@@ -1875,7 +1881,8 @@ void cleanup_module(void)
for( i = 0; i < FD_MAX_UNITS; i++) {
if (unit[i].type->code != FD_NODRIVE) {
del_gendisk(&unit[i].disk);
del_gendisk(unit[i].gendisk);
put_disk(unit[i].gendisk);
kfree(unit[i].trackbuf);
}
}
......
......@@ -235,7 +235,7 @@ static struct atari_floppy_struct {
unsigned int wpstat; /* current state of WP signal (for
disk change detection) */
int flags; /* flags */
struct gendisk disk;
struct gendisk *disk;
} unit[FD_MAX_UNITS];
#define UD unit[drive]
......@@ -1093,7 +1093,7 @@ static void fd_rwsec_done1(int status)
if (SUDT[-1].blocks > ReqBlock) {
/* try another disk type */
SUDT--;
set_capacity(&unit[SelectedDrive].disk,
set_capacity(unit[SelectedDrive].disk,
SUDT->blocks);
} else
Probing = 0;
......@@ -1108,7 +1108,7 @@ static void fd_rwsec_done1(int status)
/* record not found, but not probing. Maybe stretch wrong ? Restart probing */
if (SUD.autoprobe) {
SUDT = disk_type + StartDiskType[DriveType];
set_capacity(&unit[SelectedDrive].disk,
set_capacity(unit[SelectedDrive].disk,
SUDT->blocks);
Probing = 1;
}
......@@ -1470,7 +1470,7 @@ static void redo_fd_request(void)
if (!UDT) {
Probing = 1;
UDT = disk_type + StartDiskType[DriveType];
set_capacity(&unit[drive].disk, UDT->blocks);
set_capacity(unit[drive].disk, UDT->blocks);
UD.autoprobe = 1;
}
}
......@@ -1488,7 +1488,7 @@ static void redo_fd_request(void)
}
type = minor2disktype[type].index;
UDT = &disk_type[type];
set_capacity(&unit[drive].disk, UDT->blocks);
set_capacity(unit[drive].disk, UDT->blocks);
UD.autoprobe = 0;
}
......@@ -1635,7 +1635,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
printk (KERN_INFO "floppy%d: setting %s %p!\n",
drive, dtp->name, dtp);
UDT = dtp;
set_capacity(&unit[drive].disk, UDT->blocks);
set_capacity(unit[drive].disk, UDT->blocks);
if (cmd == FDDEFPRM) {
/* save settings as permanent default type */
......@@ -1681,7 +1681,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
}
UDT = dtp;
set_capacity(&unit[drive].disk, UDT->blocks);
set_capacity(unit[drive].disk, UDT->blocks);
return 0;
case FDMSGON:
......@@ -1704,7 +1704,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
UDT = NULL;
/* MSch: invalidate default_params */
default_params[drive].blocks = 0;
set_capacity(&unit[drive].disk, MAX_DISK_SIZE * 2);
set_capacity(unit[drive].disk, MAX_DISK_SIZE * 2);
case FDFMTEND:
case FDFLUSH:
/* invalidate the buffer track to force a reread */
......@@ -1928,7 +1928,7 @@ static struct gendisk *floppy_find(int minor)
int type = minor >> 2;
if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS)
return NULL;
return &unit[drive].disk;
return unit[drive].disk;
}
int __init atari_floppy_init (void)
......@@ -1948,6 +1948,12 @@ int __init atari_floppy_init (void)
return -EBUSY;
}
for (i = 0; i < FD_MAX_UNITS; i++) {
unit[i].disk = alloc_disk();
if (!unit[i].disk)
goto Enomem;
}
if (UseTrackbuffer < 0)
/* not set by user -> use default: for now, we turn
track buffering off for all Medusas, though it
......@@ -1962,8 +1968,7 @@ int __init atari_floppy_init (void)
DMABuffer = atari_stram_alloc(BUFFER_SIZE+512, "ataflop");
if (!DMABuffer) {
printk(KERN_ERR "atari_floppy_init: cannot get dma buffer\n");
unregister_blkdev(MAJOR_NR, "fd");
return -ENOMEM;
goto Enomem;
}
TrackBuffer = DMABuffer + 512;
PhysDMABuffer = virt_to_phys(DMABuffer);
......@@ -1973,12 +1978,12 @@ int __init atari_floppy_init (void)
for (i = 0; i < FD_MAX_UNITS; i++) {
unit[i].track = -1;
unit[i].flags = 0;
unit[i].disk.major = MAJOR_NR;
unit[i].disk.first_minor = i;
sprintf(unit[i].disk.disk_name, "fd%d", i);
unit[i].disk.fops = &floppy_fops;
set_capacity(&unit[i].disk, MAX_DISK_SIZE * 2);
add_disk(&unit[i].disk);
unit[i].disk->major = MAJOR_NR;
unit[i].disk->first_minor = i;
sprintf(unit[i].disk->disk_name, "fd%d", i);
unit[i].disk->fops = &floppy_fops;
set_capacity(unit[i].disk, MAX_DISK_SIZE * 2);
add_disk(unit[i].disk);
}
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_fd_request, &ataflop_lock);
......@@ -1990,6 +1995,11 @@ int __init atari_floppy_init (void)
config_types();
return 0;
Enomem:
while (i--)
put_disk(unit[i].disk);
unregister_blkdev(MAJOR_NR, "fd");
return -ENOMEM;
}
......@@ -2035,8 +2045,10 @@ int init_module (void)
void cleanup_module (void)
{
int i;
for (i = 0; i < FD_MAX_UNITS; i++)
del_gendisk(&unit[i].disk);
for (i = 0; i < FD_MAX_UNITS; i++) {
del_gendisk(unit[i].disk);
put_disk(unit[i].disk);
}
unregister_blkdev(MAJOR_NR, "fd");
blk_set_probe(MAJOR_NR, NULL);
......
......@@ -703,7 +703,7 @@ static int cciss_revalidate(kdev_t dev)
{
int ctlr = major(dev) - MAJOR_NR;
int target = minor(dev) >> NWD_SHIFT;
struct gendisk *disk = &hba[ctlr]->gendisk[target];
struct gendisk *disk = hba[ctlr]->gendisk[target];
set_capacity(disk, hba[ctlr]->drv[target].nr_blocks);
return 0;
}
......@@ -739,7 +739,7 @@ static int revalidate_allvol(kdev_t dev)
spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);
for(i=0; i< NWD; i++) {
struct gendisk *disk = &hba[ctlr]->gendisk[i];
struct gendisk *disk = hba[ctlr]->gendisk[i];
if (disk->part)
del_gendisk(disk);
}
......@@ -761,7 +761,7 @@ static int revalidate_allvol(kdev_t dev)
/* Loop through each real device */
for (i = 0; i < NWD; i++) {
struct gendisk *disk = &hba[ctlr]->gendisk[i];
struct gendisk *disk = hba[ctlr]->gendisk[i];
drive_info_struct *drv = &(hba[ctlr]->drv[i]);
if (!drv->nr_blocks)
continue;
......@@ -776,7 +776,7 @@ static int revalidate_allvol(kdev_t dev)
static int deregister_disk(int ctlr, int logvol)
{
unsigned long flags;
struct gendisk *disk = &hba[ctlr]->gendisk[logvol];
struct gendisk *disk = hba[ctlr]->gendisk[logvol];
ctlr_info_t *h = hba[ctlr];
if (!capable(CAP_SYS_RAWIO))
......@@ -1231,7 +1231,7 @@ static int register_new_disk(int ctlr)
hba[ctlr]->drv[logvol].usage_count = 0;
++hba[ctlr]->num_luns;
/* setup partitions per disk */
disk = &hba[ctlr]->gendisk[logvol];
disk = hba[ctlr]->gendisk[logvol];
set_capacity(disk, hba[ctlr]->drv[logvol].nr_blocks);
add_disk(disk);
......@@ -2271,29 +2271,47 @@ static void cciss_getgeometry(int cntl_num)
/* Returns -1 if no free entries are left. */
static int alloc_cciss_hba(void)
{
int i;
for(i=0; i< MAX_CTLR; i++)
{
if (hba[i] == NULL)
{
hba[i] = kmalloc(sizeof(ctlr_info_t), GFP_KERNEL);
if(hba[i]==NULL)
{
printk(KERN_ERR "cciss: out of memory.\n");
return (-1);
}
return (i);
struct gendisk *disk[NWD];
int i, n;
for (n = 0; n < NWD; n++) {
disk[n] = disk_alloc();
if (!disk[n])
goto out;
}
for(i=0; i< MAX_CTLR; i++) {
if (!hba[i]) {
ctlr_info_t *p;
p = kmalloc(sizeof(ctlr_info_t), GFP_KERNEL);
if (!p)
goto Enomem;
memset(p, 0, sizeof(ctlr_info_t));
for (n = 0; n < NWD; n++)
p->gendisk[n] = disk[n];
hba[i] = p;
return i;
}
}
printk(KERN_WARNING "cciss: This driver supports a maximum"
" of 8 controllers.\n");
return(-1);
goto out;
Enomem:
printk(KERN_ERR "cciss: out of memory.\n");
out:
while (n--)
put_disk(disk[n]);
return -1;
}
static void free_hba(int i)
{
kfree(hba[i]);
hba[i]=NULL;
ctlr_info_t *p = hba[i];
int n;
hba[i] = NULL;
for (n = 0; n < NWD; n++)
put_disk(p->gendisk[n]);
kfree(p);
}
/*
......@@ -2315,7 +2333,6 @@ static int __init cciss_init_one(struct pci_dev *pdev,
i = alloc_cciss_hba();
if( i < 0 )
return (-1);
memset(hba[i], 0, sizeof(ctlr_info_t));
if (cciss_pci_init(hba[i], pdev) != 0)
{
release_io_mem(hba[i]);
......@@ -2425,7 +2442,7 @@ static int __init cciss_init_one(struct pci_dev *pdev,
for(j=0; j<NWD; j++) {
drive_info_struct *drv = &(hba[i]->drv[j]);
struct gendisk *disk = hba[i]->gendisk + j;
struct gendisk *disk = hba[i]->gendisk[j];
sprintf(disk->disk_name, "cciss/c%dd%d", i, j);
disk->major = MAJOR_NR + i;
......@@ -2482,7 +2499,7 @@ static void __devexit cciss_remove_one (struct pci_dev *pdev)
/* remove it from the disk list */
for (j = 0; j < NWD; j++) {
struct gendisk *disk = &hba[i]->gendisk[j];
struct gendisk *disk = hba[i]->gendisk[j];
if (disk->part)
del_gendisk(disk);
}
......
......@@ -81,7 +81,7 @@ struct ctlr_info
int nr_frees;
// Disk structures we need to pass back
struct gendisk gendisk[NWD];
struct gendisk *gendisk[NWD];
#ifdef CONFIG_CISS_SCSI_TAPE
void *scsi_ctlr; /* ptr to structure containing scsi related stuff */
#endif
......
......@@ -102,7 +102,7 @@ static struct board_type products[] = {
{ 0x40580E11, "Smart Array 431", &smart4_access },
};
static struct gendisk ida_gendisk[MAX_CTLR * NWD];
static struct gendisk *ida_gendisk[MAX_CTLR][NWD];
static struct proc_dir_entry *proc_array;
......@@ -115,7 +115,6 @@ static struct proc_dir_entry *proc_array;
/* Debug Extra Paranoid... */
#define DBGPX(s) do { } while(0)
int cpqarray_init(void);
static int cpqarray_pci_detect(void);
static int cpqarray_pci_init(ctlr_info_t *c, struct pci_dev *pdev);
static void *remap_pci_mem(ulong base, ulong size);
......@@ -273,19 +272,9 @@ static int ida_proc_get_info(char *buffer, char **start, off_t offset, int lengt
}
#endif /* CONFIG_PROC_FS */
#ifdef MODULE
MODULE_PARM(eisa, "1-8i");
/* This is a bit of a hack... */
int __init init_module(void)
{
if (cpqarray_init() == 0) /* all the block dev numbers already used */
return -EIO; /* or no controllers were found */
return 0;
}
void cleanup_module(void)
static void __exit cpqarray_exit(void)
{
int i, j;
char buff[4];
......@@ -312,21 +301,21 @@ void cleanup_module(void)
kfree(hba[i]->cmd_pool_bits);
for (j = 0; j < NWD; j++) {
if (ida_gendisk[i*NWD+j].part)
del_gendisk(&ida_gendisk[i*NWD+j]);
if (ida_gendisk[i][j]->part)
del_gendisk(ida_gendisk[i][j]);
put_disk(ida_gendisk[i][j]);
}
}
devfs_find_and_unregister(NULL, "ida", 0, 0, 0, 0);
remove_proc_entry("cpqarray", proc_root_driver);
}
#endif /* MODULE */
/*
* This is it. Find all the controllers and register them. I really hate
* stealing all these major device numbers.
* returns the number of block devices registered.
*/
int __init cpqarray_init(void)
static int __init cpqarray_init(void)
{
request_queue_t *q;
int i,j;
......@@ -336,7 +325,7 @@ int __init cpqarray_init(void)
cpqarray_eisa_detect();
if (nr_ctlr == 0)
return(num_cntlrs_reg);
return -ENODEV;
printk(DRIVER_NAME "\n");
printk("Found %d controller(s)\n", nr_ctlr);
......@@ -347,7 +336,7 @@ int __init cpqarray_init(void)
* Find disks and fill in structs
* Get an interrupt, set the Q depth and get into /proc
*/
for(i=0; i< nr_ctlr; i++) {
for(i=0; i < nr_ctlr; i++) {
/* If this successful it should insure that we are the only */
/* instance of the driver */
if (register_blkdev(MAJOR_NR+i, hba[i]->devname, &ida_fops)) {
......@@ -355,8 +344,6 @@ int __init cpqarray_init(void)
MAJOR_NR+i);
continue;
}
hba[i]->access.set_intr_mask(hba[i], 0);
if (request_irq(hba[i]->intr, do_ida_intr,
SA_INTERRUPT|SA_SHIRQ, hba[i]->devname, hba[i])) {
......@@ -367,33 +354,18 @@ int __init cpqarray_init(void)
continue;
}
num_cntlrs_reg++;
for (j=0; j<NWD; j++) {
ida_gendisk[i][j] = disk_alloc();
if (!ida_gendisk[i][j])
goto Enomem2;
}
hba[i]->cmd_pool = (cmdlist_t *)pci_alloc_consistent(
hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t),
&(hba[i]->cmd_pool_dhandle));
hba[i]->cmd_pool_bits = kmalloc(((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long), GFP_KERNEL);
if(hba[i]->cmd_pool_bits == NULL || hba[i]->cmd_pool == NULL)
{
nr_ctlr = i;
if(hba[i]->cmd_pool_bits)
kfree(hba[i]->cmd_pool_bits);
if(hba[i]->cmd_pool)
pci_free_consistent(hba[i]->pci_dev,
NR_CMDS * sizeof(cmdlist_t),
hba[i]->cmd_pool,
hba[i]->cmd_pool_dhandle);
free_irq(hba[i]->intr, hba[i]);
unregister_blkdev(MAJOR_NR+i, hba[i]->devname);
num_cntlrs_reg--;
printk( KERN_ERR "cpqarray: out of memory");
/* If num_cntlrs_reg == 0, no controllers worked.
* init_module will fail, so clean up global
* memory that clean_module would do.
*/
return(num_cntlrs_reg);
}
if (!hba[i]->cmd_pool_bits || !hba[i]->cmd_pool)
goto Enomem1;
memset(hba[i]->cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t));
memset(hba[i]->cmd_pool_bits, 0, ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long));
printk(KERN_INFO "cpqarray: Finding drives on %s",
......@@ -424,7 +396,7 @@ int __init cpqarray_init(void)
add_timer(&hba[i]->timer);
for(j=0; j<NWD; j++) {
struct gendisk *disk = ida_gendisk + i*NWD + j;
struct gendisk *disk = ida_gendisk[i][j];
drv_info_t *drv = &hba[i]->drv[j];
sprintf(disk->disk_name, "ida/c%dd%d", i, j);
disk->major = MAJOR_NR + i;
......@@ -440,7 +412,31 @@ int __init cpqarray_init(void)
}
}
/* done ! */
return(num_cntlrs_reg);
return num_cntlrs_reg ? 0 : -ENODEV;
Enomem1:
nr_ctlr = i;
kfree(hba[i]->cmd_pool_bits);
if (hba[i]->cmd_pool)
pci_free_consistent(hba[i]->pci_dev, NR_CMDS*sizeof(cmdlist_t),
hba[i]->cmd_pool, hba[i]->cmd_pool_dhandle);
Enomem2:
while (j--) {
put_disk(ida_gendisk[i][j]);
ida_gendisk[i][j] = NULL;
}
free_irq(hba[i]->intr, hba[i]);
unregister_blkdev(MAJOR_NR+i, hba[i]->devname);
num_cntlrs_reg--;
printk( KERN_ERR "cpqarray: out of memory");
if (!num_cntlrs_reg) {
devfs_find_and_unregister(NULL,"ida",0,0,0,0);
remove_proc_entry("cpqarray", proc_root_driver);
return -ENODEV;
}
return 0;
}
}
/*
......@@ -1434,7 +1430,7 @@ static int revalidate_allvol(kdev_t dev)
* on this controller to zero. We will reread all of this data
*/
for (i = 0; i < NWD; i++) {
struct gendisk *disk = ida_gendisk + ctlr*NWD + i;
struct gendisk *disk = ida_gendisk[ctlr][i];
if (disk->part)
del_gendisk(disk);
}
......@@ -1450,7 +1446,7 @@ static int revalidate_allvol(kdev_t dev)
hba[ctlr]->access.set_intr_mask(hba[ctlr], FIFO_NOT_EMPTY);
for(i=0; i<NWD; i++) {
struct gendisk *disk = ida_gendisk + ctlr*NWD + i;
struct gendisk *disk = ida_gendisk[ctlr][i];
drv_info_t *drv = &hba[ctlr]->drv[i];
if (!drv->nr_blks)
continue;
......@@ -1467,7 +1463,7 @@ static int ida_revalidate(kdev_t dev)
{
int ctlr = major(dev) - MAJOR_NR;
int target = DEVICE_NR(dev);
struct gendisk *gdev = &ida_gendisk[ctlr*NWD+target];
struct gendisk *gdev = ida_gendisk[ctlr][target];
set_capacity(gdev, hba[ctlr]->drv[target].nr_blks);
return 0;
}
......@@ -1635,7 +1631,7 @@ static void getgeometry(int ctlr)
(log_index < id_ctlr_buf->nr_drvs)
&& (log_unit < NWD);
log_unit++) {
struct gendisk *disk = ida_gendisk + ctlr * NWD + log_unit;
struct gendisk *disk = ida_gendisk[ctlr][log_unit];
size = sizeof(sense_log_drv_stat_t);
......@@ -1724,3 +1720,6 @@ static void getgeometry(int ctlr)
return;
}
module_init(cpqarray_init)
module_exit(cpqarray_exit)
......@@ -205,7 +205,6 @@ struct seq_operations partitions_op = {
extern int blk_dev_init(void);
extern int soc_probe(void);
extern int atmdev_init(void);
extern int cpqarray_init(void);
struct device_class disk_devclass = {
.name = "disk",
......@@ -222,9 +221,6 @@ int __init device_init(void)
/* This has to be done before scsi_dev_init */
soc_probe();
#endif
#ifdef CONFIG_BLK_CPQ_DA
cpqarray_init();
#endif
#ifdef CONFIG_ATM
(void) atmdev_init();
#endif
......
......@@ -1876,7 +1876,7 @@ void generic_make_request(struct bio *bio)
*/
int submit_bio(int rw, struct bio *bio)
{
int count = bio_sectors(bio);
int count = bio_sectors(bio) >> 1;
BUG_ON(!bio->bi_end_io);
BIO_BUG_ON(!bio->bi_size);
......
......@@ -444,15 +444,15 @@ static int nbd_ioctl(struct inode *inode, struct file *file,
temp >>= 1;
}
nbd_bytesizes[dev] &= ~(nbd_blksizes[dev]-1);
set_capacity(&lo->disk, nbd_bytesizes[dev] >> 9);
set_capacity(lo->disk, nbd_bytesizes[dev] >> 9);
return 0;
case NBD_SET_SIZE:
nbd_bytesizes[dev] = arg & ~(nbd_blksizes[dev]-1);
set_capacity(&lo->disk, nbd_bytesizes[dev] >> 9);
set_capacity(lo->disk, nbd_bytesizes[dev] >> 9);
return 0;
case NBD_SET_SIZE_BLOCKS:
nbd_bytesizes[dev] = ((u64) arg) << nbd_blksize_bits[dev];
set_capacity(&lo->disk, nbd_bytesizes[dev] >> 9);
set_capacity(lo->disk, nbd_bytesizes[dev] >> 9);
return 0;
case NBD_DO_IT:
if (!lo->file)
......@@ -498,6 +498,7 @@ static struct block_device_operations nbd_fops =
static int __init nbd_init(void)
{
int err = -ENOMEM;
int i;
if (sizeof(struct nbd_request) != 28) {
......@@ -505,17 +506,25 @@ static int __init nbd_init(void)
return -EIO;
}
for (i = 0; i < MAX_NBD; i++) {
struct gendisk *disk = alloc_disk();
if (!disk)
goto out;
nbd_dev[i].disk = disk;
}
if (register_blkdev(MAJOR_NR, "nbd", &nbd_fops)) {
printk("Unable to get major number %d for NBD\n",
MAJOR_NR);
return -EIO;
err = -EIO;
goto out;
}
#ifdef MODULE
printk("nbd: registered device at major %d\n", MAJOR_NR);
#endif
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_nbd_request, &nbd_lock);
for (i = 0; i < MAX_NBD; i++) {
struct gendisk *disk = &nbd_dev[i].disk;
struct gendisk *disk = nbd_dev[i].disk;
nbd_dev[i].refcnt = 0;
nbd_dev[i].file = NULL;
nbd_dev[i].magic = LO_MAGIC;
......@@ -541,13 +550,19 @@ static int __init nbd_init(void)
&nbd_fops, NULL);
return 0;
out:
while (i--)
put_disk(nbd_dev[i].disk);
return err;
}
static void __exit nbd_cleanup(void)
{
int i;
for (i = 0; i < MAX_NBD; i++)
del_gendisk(&nbd_dev[i].disk);
for (i = 0; i < MAX_NBD; i++) {
del_gendisk(nbd_dev[i].disk);
put_disk(nbd_dev[i].disk);
}
devfs_unregister (devfs_handle);
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
......
......@@ -222,7 +222,7 @@ struct pcd_unit {
int present; /* does this unit exist ? */
char *name; /* pcd0, pcd1, etc */
struct cdrom_device_info info; /* uniform cdrom interface */
struct gendisk disk;
struct gendisk *disk;
};
struct pcd_unit pcd[PCD_UNITS];
......@@ -281,7 +281,10 @@ static void pcd_init_units(void)
pcd_drive_count = 0;
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) {
struct gendisk *disk = &cd->disk;
struct gendisk *disk = alloc_disk();
if (!disk)
continue;
cd->disk = disk;
cd->pi = &cd->pia;
cd->present = 0;
cd->last_sense = 0;
......@@ -680,7 +683,7 @@ static int pcd_detect(void)
cd = pcd;
if (pi_init(cd->pi, 1, -1, -1, -1, -1, -1, pcd_buffer,
PI_PCD, verbose, cd->name)) {
if (!pcd_probe(cd, -1, id)) {
if (!pcd_probe(cd, -1, id) && cd->disk) {
cd->present = 1;
k++;
} else
......@@ -695,7 +698,7 @@ static int pcd_detect(void)
conf[D_UNI], conf[D_PRO], conf[D_DLY],
pcd_buffer, PI_PCD, verbose, cd->name))
continue;
if (!pcd_probe(cd, conf[D_SLV], id)) {
if (!pcd_probe(cd, conf[D_SLV], id) && cd->disk) {
cd->present = 1;
k++;
} else
......@@ -706,6 +709,8 @@ static int pcd_detect(void)
return 0;
printk("%s: No CD-ROM drive found\n", name);
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++)
put_disk(cd->disk);
return -1;
}
......@@ -925,14 +930,15 @@ static int __init pcd_init(void)
if (register_blkdev(MAJOR_NR, name, &pcd_bdops)) {
printk("pcd: unable to get major number %d\n", MAJOR_NR);
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++)
put_disk(cd->disk);
return -1;
}
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) {
if (cd->present) {
struct gendisk *disk = &cd->disk;
register_cdrom(&cd->info);
add_disk(disk);
add_disk(cd->disk);
}
}
......@@ -948,10 +954,11 @@ static void __exit pcd_exit(void)
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) {
if (cd->present) {
del_gendisk(&cd->disk);
del_gendisk(cd->disk);
pi_release(cd->pi);
unregister_cdrom(&cd->info);
}
put_disk(cd->disk);
}
unregister_blkdev(MAJOR_NR, name);
}
......
......@@ -264,7 +264,7 @@ struct pf_unit {
int access; /* count of active opens ... */
int present; /* device present ? */
char name[PF_NAMELEN]; /* pf0, pf1, ... */
struct gendisk disk;
struct gendisk *disk;
};
struct pf_unit units[PF_UNITS];
......@@ -308,7 +308,10 @@ void pf_init_units(void)
pf_drive_count = 0;
for (unit = 0, pf = units; unit < PF_UNITS; unit++, pf++) {
struct gendisk *disk = &pf->disk;
struct gendisk *disk = alloc_disk();
if (!disk)
continue;
pf->disk = disk;
pf->pi = &pf->pia;
pf->media_status = PF_NM;
pf->drive = (*drives[unit])[D_SLV];
......@@ -355,11 +358,6 @@ static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
struct pf_unit *pf = units + unit;
sector_t capacity;
if (unit >= PF_UNITS)
return -EINVAL;
if (!pf->present)
return -ENODEV;
if (cmd == CDROMEJECT) {
if (pf->access == 1) {
pf_eject(pf);
......@@ -369,7 +367,7 @@ static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
}
if (cmd != HDIO_GETGEO)
return -EINVAL;
capacity = get_capacity(&pf->disk);
capacity = get_capacity(pf->disk);
if (capacity < PF_FD_MAX) {
g.cylinders = capacity / (PF_FD_HDS * PF_FD_SPT);
g.heads = PF_FD_HDS;
......@@ -635,10 +633,10 @@ static void pf_get_capacity(struct pf_unit *pf)
pf->media_status = PF_NM;
return;
}
set_capacity(&pf->disk, xl(buf, 0) + 1);
set_capacity(pf->disk, xl(buf, 0) + 1);
bs = xl(buf, 4);
if (bs != 512) {
set_capacity(&pf->disk, 0);
set_capacity(pf->disk, 0);
if (verbose)
printk("%s: Drive %d, LUN %d,"
" unsupported block size %d\n",
......@@ -687,7 +685,7 @@ static int pf_identify(struct pf_unit *pf)
else {
if (pf->media_status == PF_RO)
printk(", RO");
printk(", %ld blocks\n", get_capacity(&pf->disk));
printk(", %ld blocks\n", get_capacity(pf->disk));
}
return 0;
}
......@@ -731,7 +729,7 @@ static int pf_detect(void)
if (pf_drive_count == 0) {
if (pi_init(pf->pi, 1, -1, -1, -1, -1, -1, pf_scratch, PI_PF,
verbose, pf->name)) {
if (!pf_probe(pf)) {
if (!pf_probe(pf) && pf->disk) {
pf->present = 1;
k++;
} else
......@@ -746,7 +744,7 @@ static int pf_detect(void)
if (pi_init(pf->pi, 0, conf[D_PRT], conf[D_MOD],
conf[D_UNI], conf[D_PRO], conf[D_DLY],
pf_scratch, PI_PF, verbose, pf->name)) {
if (!pf_probe(pf)) {
if (!pf_probe(pf) && pf->disk) {
pf->present = 1;
k++;
} else
......@@ -757,6 +755,8 @@ static int pf_detect(void)
return 0;
printk("%s: No ATAPI disk detected\n", name);
for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++)
put_disk(pf->disk);
return -1;
}
......@@ -805,7 +805,7 @@ static void do_pf_request(request_queue_t * q)
pf_count = pf_req->current_nr_sectors;
if ((unit >= PF_UNITS) ||
(pf_block + pf_count > get_capacity(&pf_current->disk))) {
(pf_block + pf_count > get_capacity(pf_current->disk))) {
end_request(pf_req, 0);
goto repeat;
}
......@@ -976,6 +976,8 @@ static int __init pf_init(void)
if (register_blkdev(MAJOR_NR, name, &pf_fops)) {
printk("pf_init: unable to get major number %d\n", major);
for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++)
put_disk(pf->disk);
return -1;
}
q = BLK_DEFAULT_QUEUE(MAJOR_NR);
......@@ -984,7 +986,7 @@ static int __init pf_init(void)
blk_queue_max_hw_segments(q, cluster);
for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) {
struct gendisk *disk = &pf->disk;
struct gendisk *disk = pf->disk;
if (!pf->present)
continue;
add_disk(disk);
......@@ -1000,7 +1002,8 @@ static void __exit pf_exit(void)
for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) {
if (!pf->present)
continue;
del_gendisk(&pf->disk);
del_gendisk(pf->disk);
put_disk(pf->disk);
pi_release(pf->pi);
}
}
......
......@@ -140,26 +140,12 @@ static struct ps2esdi_i_struct ps2esdi_info[MAX_HD] =
static struct block_device_operations ps2esdi_fops =
{
owner: THIS_MODULE,
open: ps2esdi_open,
ioctl: ps2esdi_ioctl,
.owner = THIS_MODULE,
.open = ps2esdi_open,
.ioctl = ps2esdi_ioctl,
};
static struct gendisk ps2esdi_gendisk[2] = {
{
major: MAJOR_NR,
disk_name: "eda",
first_minor: 0,
minor_shift: 6,
fops: &ps2esdi_fops,
},{
major: MAJOR_NR,
first_minor: 64,
disk_name: "edb",
minor_shift: 6,
fops: &ps2esdi_fops,
}
};
static struct gendisk *ps2esdi_gendisk[2];
/* initialization routine called by ll_rw_blk.c */
int __init ps2esdi_init(void)
......@@ -233,8 +219,10 @@ cleanup_module(void) {
free_irq(PS2ESDI_IRQ, &ps2esdi_gendisk);
unregister_blkdev(MAJOR_NR, "ed");
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
for (i = 0; i < ps2esdi_drives; i++)
del_gendisk(ps2esdi_gendisk + i);
for (i = 0; i < ps2esdi_drives; i++) {
del_gendisk(ps2esdi_gendisk[i]);
put_disk(ps2esdi_gendisk[i]);
}
}
#endif /* MODULE */
......@@ -431,14 +419,29 @@ static int __init ps2esdi_geninit(void)
}
blk_queue_max_sectors(BLK_DEFAULT_QUEUE(MAJOR_NR), 128);
error = -ENOMEM;
for (i = 0; i < ps2esdi_drives; i++) {
struct gendisk *disk = ps2esdi_gendisk + i;
struct gendisk *disk = alloc_disk();
if (!disk)
goto err_out4;
disk->major = MAJOR_NR;
disk->first_minor = i<<6;
sprintf(disk->disk_name, "ed%c", 'a'+i);
disk->minor_shift = 6;
disk->fops = &ps2esdi_fops;
ps2esdi_gendisk[i] = disk;
}
for (i = 0; i < ps2esdi_drives; i++) {
struct gendisk *disk = ps2esdi_gendisk[i];
set_capacity(disk, ps2esdi_info[i].head * ps2esdi_info[i].sect *
ps2esdi_info[i].cyl);
add_disk(disk);
}
return 0;
err_out4:
while (i--)
put_disk(ps2esdi_gendisk[i]);
err_out3:
release_region(io_base, 4);
err_out2:
......@@ -504,7 +507,7 @@ static void do_ps2esdi_request(request_queue_t * q)
} /* check for above 16Mb dmas */
else if ((unit < ps2esdi_drives) &&
(CURRENT->sector + CURRENT->current_nr_sectors <=
get_capacity(&ps2esdi_gendisk[unit])) &&
get_capacity(ps2esdi_gendisk[unit])) &&
CURRENT->flags & REQ_CMD) {
#if 0
printk("%s:got request. device : %d minor : %d command : %d sector : %ld count : %ld\n",
......@@ -533,7 +536,7 @@ static void do_ps2esdi_request(request_queue_t * q)
/* is request is valid */
else {
printk("Grrr. error. ps2esdi_drives: %d, %lu %lu\n", ps2esdi_drives,
CURRENT->sector, get_capacity(&ps2esdi_gendisk[unit]));
CURRENT->sector, get_capacity(ps2esdi_gendisk[unit]));
end_request(CURRENT, FAIL);
}
......
......@@ -213,7 +213,7 @@ static int rd_blkdev_pagecache_IO(int rw, struct bio_vec *vec,
kunmap(vec->bv_page);
if (rw == READ) {
flush_dcache_page(page);
flush_dcache_page(sbh->b_page);
} else {
SetPageDirty(page);
}
......@@ -476,6 +476,7 @@ static int __init rd_init (void)
#ifdef CONFIG_BLK_DEV_INITRD
/* We ought to separate initrd operations here */
set_capacity(initrd_disk, (initrd_end-initrd_start+511)>>9);
add_disk(initrd_disk);
devfs_register(devfs_handle, "initrd", DEVFS_FL_DEFAULT, MAJOR_NR,
INITRD_MINOR, S_IFBLK | S_IRUSR, &rd_bd_op, NULL);
......
......@@ -38,7 +38,7 @@
#include <linux/blk.h>
#include <linux/devfs_fs_kernel.h>
static struct gendisk disks[2];
static struct gendisk *disks[2];
#define MAX_FLOPPIES 2
......@@ -1014,6 +1014,7 @@ static devfs_handle_t floppy_devfs_handle;
int swim3_init(void)
{
struct device_node *swim;
int err = -ENOMEM;
int i;
floppy_devfs_handle = devfs_mk_dir(NULL, "floppy", NULL);
......@@ -1032,26 +1033,37 @@ int swim3_init(void)
swim = swim->next;
}
if (floppy_count > 0)
{
if (register_blkdev(MAJOR_NR, "fd", &floppy_fops)) {
printk(KERN_ERR "Unable to get major %d for floppy\n",
MAJOR_NR);
return -EBUSY;
}
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_fd_request, &swim3_lock);
for (i = 0; i < floppy_count; i++) {
struct gendisk *disk = disks + i;
disk->major = MAJOR_NR;
disk->first_minor = i;
disk->fops = &floppy_fops;
sprintf(disk->disk_name, "fd%d", i);
set_capacity(disk, 2880);
add_disk(disk);
}
if (!floppy_count)
return -ENODEV;
for (i = 0; i < floppy_count; i++) {
disks[i] = alloc_disk();
if (!disks[i])
goto out;
}
if (register_blkdev(MAJOR_NR, "fd", &floppy_fops)) {
printk(KERN_ERR"Unable to get major %d for floppy\n", MAJOR_NR);
err = -EBUSY;
goto out;
}
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_fd_request, &swim3_lock);
for (i = 0; i < floppy_count; i++) {
struct gendisk *disk = disks[i];
disk->major = MAJOR_NR;
disk->first_minor = i;
disk->fops = &floppy_fops;
sprintf(disk->disk_name, "fd%d", i);
set_capacity(disk, 2880);
add_disk(disk);
}
return 0;
out:
while (i--)
put_disk(disks[i]);
/* shouldn't we do something with results of swim_add_device()? */
return err;
}
static int swim3_add_device(struct device_node *swim)
......@@ -1118,8 +1130,6 @@ static int swim3_add_device(struct device_node *swim)
init_timer(&fs->timeout);
do_floppy = NULL;
printk(KERN_INFO "fd%d: SWIM3 floppy controller %s\n", floppy_count,
mediabay ? "in media bay" : "");
sprintf(floppy_name, "%s%d", floppy_devfs_handle ? "" : "floppy",
......
......@@ -82,9 +82,6 @@ static struct swim_iop_req *current_req;
static int floppy_count;
static struct floppy_state floppy_states[MAX_FLOPPIES];
static struct gendisk disks[2];
static spinlock_t swim_iop_lock = SPIN_LOCK_UNLOCKED;
static char *drive_names[7] = {
......@@ -190,9 +187,10 @@ int swimiop_init(void)
}
printk("SWIM-IOP: detected %d installed drives.\n", floppy_count);
do_floppy = NULL;
for (i = 0; i < floppy_count; i++) {
struct gendisk *disk = disks + i;
struct gendisk *disk = alloc_disk();
if (!disk)
continue;
disk->major = MAJOR_NR;
disk->first_minor = i;
disk->fops = &floppy_fops;
......
......@@ -161,7 +161,7 @@ static struct timer_list battery_timer;
static int num_cards = 0;
static struct gendisk mm_gendisk[MM_MAXCARDS];
static struct gendisk *mm_gendisk[MM_MAXCARDS];
static void check_batteries(struct cardinfo *card);
......@@ -813,7 +813,7 @@ static void del_battery_timer(void)
static int mm_revalidate(kdev_t i_rdev)
{
int card_number = DEVICE_NR(i_rdev);
set_capacity(mm_gendisk + card_number, cards[card_number].mm_size << 1);
set_capacity(mm_gendisk[card_number], cards[card_number].mm_size << 1);
return 0;
}
/*
......@@ -1186,11 +1186,17 @@ int __init mm_init(void)
printk(KERN_ERR "MM: Could not register block device\n");
return -EIO;
}
for (i = 0; i < num_cards; i++) {
mm_gendisk[i] = alloc_disk();
if (!mm_gendisk[i])
goto out;
}
devfs_handle = devfs_mk_dir(NULL, "umem", NULL);
blk_dev[MAJOR_NR].queue = mm_queue_proc;
for (i = 0; i < num_cards; i++) {
struct gendisk *disk = mm_gendisk + i;
struct gendisk *disk = mm_gendisk[i];
sprintf(disk->disk_name, "umem%c", 'a'+i);
spin_lock_init(&cards[i].lock);
disk->major = major_nr;
......@@ -1205,6 +1211,12 @@ int __init mm_init(void)
printk("MM: desc_per_page = %ld\n", DESC_PER_PAGE);
/* printk("mm_init: Done. 10-19-01 9:00\n"); */
return 0;
out:
unregister_blkdev(MAJOR_NR, "umem");
while (i--)
put_disk(mm_gendisk[i]);
return -ENOMEM;
}
/*
-----------------------------------------------------------------------------------
......@@ -1217,8 +1229,10 @@ void __exit mm_cleanup(void)
del_battery_timer();
for (i=0; i < num_cards ; i++)
del_gendisk(mm_gendisk + i);
for (i=0; i < num_cards ; i++) {
del_gendisk(mm_gendisk[i]);
put_disk(mm_gendisk[i]);
}
if (devfs_handle)
devfs_unregister(devfs_handle);
devfs_handle = NULL;
......
......@@ -58,6 +58,9 @@
#include "xd.h"
static void __init do_xd_setup (int *integers);
static int xd[5] = { -1,-1,-1,-1, };
#define XD_DONT_USE_DMA 0 /* Initial value. may be overriden using
"nodma" module option */
#define XD_INIT_DISK_DELAY (30*HZ/1000) /* 30 ms delay during disk initialization */
......@@ -123,23 +126,7 @@ static unsigned int xd_bases[] __initdata =
static spinlock_t xd_lock = SPIN_LOCK_UNLOCKED;
extern struct block_device_operations xd_fops;
static struct gendisk xd_gendisk[2] = {
{
.major = MAJOR_NR,
.first_minor = 0,
.disk_name = "xda",
.minor_shift = 6,
.fops = &xd_fops,
},{
.major = MAJOR_NR,
.first_minor = 64,
.disk_name = "xdb",
.minor_shift = 6,
.fops = &xd_fops,
}
};
static struct gendisk *xd_gendisk[2];
static struct block_device_operations xd_fops = {
owner: THIS_MODULE,
......@@ -161,10 +148,19 @@ static int nodma = XD_DONT_USE_DMA;
static devfs_handle_t devfs_handle = NULL;
/* xd_init: register the block device number and set up pointer tables */
int __init xd_init (void)
static int __init xd_init(void)
{
u_char i,controller;
unsigned int address;
int err;
#ifdef MODULE
for (i = 4; i > 0; i--)
if(((xd[i] = xd[i-1]) >= 0) && !count)
count = i;
if((xd[0] = count))
do_xd_setup(xd);
#endif
init_timer (&xd_watchdog_int); xd_watchdog_int.function = xd_watchdog;
......@@ -175,9 +171,10 @@ int __init xd_init (void)
return -ENOMEM;
}
err = -EBUSY;
if (register_blkdev(MAJOR_NR,"xd",&xd_fops)) {
printk("xd: Unable to get major number %d\n",MAJOR_NR);
return -1;
goto out1;
}
devfs_handle = devfs_mk_dir (NULL, "xd", NULL);
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_xd_request, &xd_lock);
......@@ -188,7 +185,7 @@ int __init xd_init (void)
if (!request_region(xd_iobase,4,"xd")) {
printk("xd: Ports at 0x%x are not available\n",
xd_iobase);
return -EBUSY;
goto out2;
}
if (controller)
xd_sigs[controller].init_controller(address);
......@@ -203,31 +200,65 @@ int __init xd_init (void)
}
err = -ENODEV;
if (!xd_drives)
return -ENODEV;
goto out3;
for (i = 0; i < xd_drives; i++) {
struct gendisk *disk = alloc_disk();
if (!disk)
goto Enomem;
disk->major = MAJOR_NR;
disk->first_minor = i<<6;
disk->minor_shift = 6;
sprintf(disk->disk_name, "xd%c", i+'a');
disk->fops = &xd_fops;
xd_gendisk[i] = disk;
}
err = -EBUSY;
if (request_irq(xd_irq,xd_interrupt_handler, 0, "XT hard disk", NULL)) {
printk("xd: unable to get IRQ%d\n",xd_irq);
return -EBUSY;
goto out4;
}
if (request_dma(xd_dma,"xd")) {
printk("xd: unable to get DMA%d\n",xd_dma);
free_irq(xd_irq, NULL);
return -EBUSY;
goto out5;
}
/* xd_maxsectors depends on controller - so set after detection */
blk_queue_max_sectors(BLK_DEFAULT_QUEUE(MAJOR_NR), xd_maxsectors);
for (i = 0; i < xd_drives; i++) {
struct gendisk *disk = xd_gendisk + i;
struct gendisk *disk = xd_gendisk[i];
set_capacity(disk, xd_info[i].heads * xd_info[i].cylinders *
xd_info[i].sectors);
add_disk(disk);
}
return 0;
out5:
free_irq(xd_irq, NULL);
out4:
for (i = 0; i < xd_drives; i++)
put_disk(xd_gendisk[i]);
out3:
release_region(xd_iobase,4);
out2:
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
unregister_blkdev(MAJOR_NR, "xd");
out1:
if (xd_dma_buffer)
xd_dma_mem_free((unsigned long)xd_dma_buffer,
xd_maxsectors * 0x200);
return err;
Enomem:
err = -ENOMEM;
while (i--)
put_disk(xd_gendisk[i]);
goto out3;
}
/* xd_detect: scan the possible BIOS ROM locations for the signature strings */
......@@ -282,7 +313,7 @@ static void do_xd_request (request_queue_t * q)
if (unit < xd_drives
&& (CURRENT->flags & REQ_CMD)
&& CURRENT->sector + CURRENT->nr_sectors
<= get_capacity(xd_gendisk + unit)) {
<= get_capacity(xd_gendisk[unit])) {
block = CURRENT->sector;
count = CURRENT->nr_sectors;
......@@ -980,7 +1011,7 @@ static void __init xd_override_init_drive (u_char drive)
}
/* xd_setup: initialise controller from command line parameters */
void __init do_xd_setup (int *integers)
static void __init do_xd_setup (int *integers)
{
switch (integers[0]) {
case 4: if (integers[4] < 0)
......@@ -1023,7 +1054,6 @@ static void __init xd_setparam (u_char command,u_char drive,u_char heads,u_short
#ifdef MODULE
static int xd[5] = { -1,-1,-1,-1, };
MODULE_PARM(xd, "1-4i");
MODULE_PARM(xd_geo, "3-6i");
......@@ -1031,44 +1061,16 @@ MODULE_PARM(nodma, "i");
MODULE_LICENSE("GPL");
static void xd_done (void)
void cleanup_module(void)
{
int i;
for (i = 0; i < xd_drives; i++)
del_gendisk(xd_gendisk + i);
unregister_blkdev(MAJOR_NR, "xd");
for (i = 0; i < xd_drives; i++) {
del_gendisk(xd_gendisk[i]);
put_disk(xd_gendisk[i]);
}
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
release_region(xd_iobase,4);
}
int init_module(void)
{
int i,count = 0;
int error;
for (i = 4; i > 0; i--)
if(((xd[i] = xd[i-1]) >= 0) && !count)
count = i;
if((xd[0] = count))
do_xd_setup(xd);
error = xd_init();
if (error) return error;
printk(KERN_INFO "XD: Loaded as a module.\n");
if (!xd_drives) {
/* no drives detected - unload module */
unregister_blkdev(MAJOR_NR, "xd");
xd_done();
return (-1);
}
return 0;
}
void cleanup_module(void)
{
unregister_blkdev(MAJOR_NR, "xd");
xd_done();
devfs_unregister (devfs_handle);
if (xd_drives) {
free_irq(xd_irq, NULL);
......@@ -1108,3 +1110,5 @@ __setup ("xd_geo=", xd_manual_geo_init);
#endif /* MODULE */
module_init(xd_init)
......@@ -71,13 +71,7 @@ static int current_device = -1;
static spinlock_t z2ram_lock = SPIN_LOCK_UNLOCKED;
static struct block_device_operations z2_fops;
static struct gendisk z2ram_gendisk = {
.major = MAJOR_NR,
.first_minor = 0,
.minor_shift = 0,
.fops = &z2_fops,
.disk_name = "z2ram"
};
static struct gendisk *z2ram_gendisk;
static void
do_z2_request( request_queue_t * q )
......@@ -320,7 +314,7 @@ z2_open( struct inode *inode, struct file *filp )
current_device = device;
z2ram_size <<= Z2RAM_CHUNKSHIFT;
set_capacity(&z2ram_gendisk, z2ram_size >> 9;
set_capacity(z2ram_gendisk, z2ram_size >> 9;
}
return 0;
......@@ -355,7 +349,7 @@ static struct gendisk *z2_find(int minor)
{
if (minor > Z2MINOR_COUNT)
return NULL;
return &z2ram_gendisk;
return z2ram_gendisk;
}
int __init
......@@ -371,9 +365,19 @@ z2_init( void )
MAJOR_NR );
return -EBUSY;
}
z2ram_gendisk = alloc_disk();
if (!z2ram_gendisk) {
unregister_blkdev( MAJOR_NR, DEVICE_NAME );
return -ENOMEM;
}
z2ram_gendisk->major = MAJOR_NR;
z2ram_gendisk->first_minor = 0;
z2ram_gendisk->minor_shift = 0;
z2ram_gendisk->fops = &z2_fops;
sprintf(z2ram_gendisk->disk_name, "z2ram");
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_z2_request, &z2ram_lock);
add_disk(&z2ram_gendisk);
add_disk(z2ram_gendisk);
blk_set_probe(MAJOR_NR, z2_find);
return 0;
......@@ -406,7 +410,8 @@ cleanup_module( void )
if ( unregister_blkdev( MAJOR_NR, DEVICE_NAME ) != 0 )
printk( KERN_ERR DEVICE_NAME ": unregister of device failed\n");
del_gendisk(&z2ram_gendisk);
del_gendisk(z2ram_gendisk);
put_disk(z2ram_gendisk);
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
if ( current_device != -1 )
......
......@@ -12,11 +12,20 @@ CONFIG_BLUEZ_HCIUART
HCI UART (H4) protocol support
CONFIG_BLUEZ_HCIUART_H4
UART (H4) is serial protocol for communication between Bluetooth
device and host. This protocol is required for most UART based
Bluetooth device (including PCMCIA and CF).
device and host. This protocol is required for most Bluetooth devices
with UART interface, including PCMCIA and CF cards.
Say Y here to compile support for HCI UART (H4) protocol.
HCI BCSP protocol support
CONFIG_BLUEZ_HCIUART_BCSP
BCSP (BlueCore Serial Protocol) is serial protocol for communication
between Bluetooth device and host. This protocol is required for non
USB Bluetooth devices based on CSR BlueCore chip, including PCMCIA and
CF cards.
Say Y here to compile support for HCI BCSP protocol.
HCI USB driver
CONFIG_BLUEZ_HCIUSB
Bluetooth HCI USB driver.
......@@ -26,15 +35,6 @@ CONFIG_BLUEZ_HCIUSB
Say Y here to compile support for Bluetooth USB devices into the
kernel or say M to compile it as module (hci_usb.o).
HCI USB firmware download support
CONFIG_BLUEZ_USB_FW_LOAD
Firmware download support for Bluetooth USB devices.
This support is required for devices like Broadcom BCM2033.
HCI USB driver uses external firmware downloader program provided
in BlueFW package.
For more information, see <http://bluez.sf.net/>.
HCI USB zero packet support
CONFIG_BLUEZ_USB_ZERO_PACKET
Support for USB zero packets.
......
......@@ -3,13 +3,13 @@ comment 'Bluetooth device drivers'
dep_tristate 'HCI USB driver' CONFIG_BLUEZ_HCIUSB $CONFIG_BLUEZ $CONFIG_USB
if [ "$CONFIG_BLUEZ_HCIUSB" != "n" ]; then
bool ' Firmware download support' CONFIG_BLUEZ_USB_FW_LOAD
bool ' USB zero packet support' CONFIG_BLUEZ_USB_ZERO_PACKET
fi
dep_tristate 'HCI UART driver' CONFIG_BLUEZ_HCIUART $CONFIG_BLUEZ
if [ "$CONFIG_BLUEZ_HCIUART" != "n" ]; then
bool ' UART (H4) protocol support' CONFIG_BLUEZ_HCIUART_H4
bool ' BCSP protocol support' CONFIG_BLUEZ_HCIUART_BCSP
fi
dep_tristate 'HCI DTL1 (PC Card) driver' CONFIG_BLUEZ_HCIDTL1 $CONFIG_PCMCIA $CONFIG_BLUEZ
......
......@@ -11,6 +11,7 @@ obj-$(CONFIG_BLUEZ_HCIBLUECARD) += bluecard_cs.o
hci_uart-y := hci_ldisc.o
hci_uart-$(CONFIG_BLUEZ_HCIUART_H4) += hci_h4.o
hci_uart-$(CONFIG_BLUEZ_HCIUART_BCSP) += hci_bcsp.o
hci_uart-objs := $(hci_uart-y)
include $(TOPDIR)/Rules.make
This diff is collapsed.
/*
BlueCore Serial Protocol (BCSP) for Linux Bluetooth stack (BlueZ).
Copyright 2002 by Fabrizio Gennari <fabrizio.gennari@philips.com>
Based on
hci_h4.c by Maxim Krasnyansky <maxk@qualcomm.com>
ABCSP by Carl Orsborn <cjo@csr.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation;
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
SOFTWARE IS DISCLAIMED.
*/
/*
* $Id: hci_bcsp.h,v 1.2 2002/09/26 05:05:14 maxk Exp $
*/
#ifndef __HCI_BCSP_H__
#define __HCI_BCSP_H__
#define BCSP_TXWINSIZE 4
#define BCSP_ACK_PKT 0x05
#define BCSP_LE_PKT 0x06
struct bcsp_struct {
struct sk_buff_head unack; /* Unack'ed packets queue */
struct sk_buff_head rel; /* Reliable packets queue */
struct sk_buff_head unrel; /* Unreliable packets queue */
unsigned long rx_count;
struct sk_buff *rx_skb;
u8 rxseq_txack; /* rxseq == txack. */
u8 rxack; /* Last packet sent by us that the peer ack'ed */
struct timer_list tbcsp;
enum {
BCSP_W4_PKT_DELIMITER,
BCSP_W4_PKT_START,
BCSP_W4_BCSP_HDR,
BCSP_W4_DATA,
BCSP_W4_CRC
} rx_state;
enum {
BCSP_ESCSTATE_NOESC,
BCSP_ESCSTATE_ESC
} rx_esc_state;
u16 message_crc;
u8 txack_req; /* Do we need to send ack's to the peer? */
/* Reliable packet sequence number - used to assign seq to each rel pkt. */
u8 msgq_txseq;
};
#endif /* __HCI_BCSP_H__ */
......@@ -25,9 +25,9 @@
/*
* BlueZ HCI UART(H4) protocol.
*
* $Id: hci_h4.c,v 1.2 2002/04/17 17:37:20 maxk Exp $
* $Id: hci_h4.c,v 1.3 2002/09/09 01:17:32 maxk Exp $
*/
#define VERSION "1.1"
#define VERSION "1.2"
#include <linux/config.h>
#include <linux/module.h>
......@@ -64,63 +64,61 @@
#endif
/* Initialize protocol */
static int h4_open(struct n_hci *n_hci)
static int h4_open(struct hci_uart *hu)
{
struct h4_struct *h4;
BT_DBG("n_hci %p", n_hci);
BT_DBG("hu %p", hu);
h4 = kmalloc(sizeof(*h4), GFP_ATOMIC);
if (!h4)
return -ENOMEM;
memset(h4, 0, sizeof(*h4));
n_hci->priv = h4;
skb_queue_head_init(&h4->txq);
hu->priv = h4;
return 0;
}
/* Flush protocol data */
static int h4_flush(struct n_hci *n_hci)
static int h4_flush(struct hci_uart *hu)
{
BT_DBG("n_hci %p", n_hci);
struct h4_struct *h4 = hu->priv;
BT_DBG("hu %p", hu);
skb_queue_purge(&h4->txq);
return 0;
}
/* Close protocol */
static int h4_close(struct n_hci *n_hci)
static int h4_close(struct hci_uart *hu)
{
struct h4_struct *h4 = n_hci->priv;
n_hci->priv = NULL;
struct h4_struct *h4 = hu->priv;
hu->priv = NULL;
BT_DBG("n_hci %p", n_hci);
BT_DBG("hu %p", hu);
skb_queue_purge(&h4->txq);
if (h4->rx_skb)
kfree_skb(h4->rx_skb);
hu->priv = NULL;
kfree(h4);
return 0;
}
/* Send data */
static int h4_send(struct n_hci *n_hci, void *data, int len)
/* Enqueue frame for transmittion (padding, crc, etc) */
static int h4_enqueue(struct hci_uart *hu, struct sk_buff *skb)
{
struct tty_struct *tty = n_hci->tty;
BT_DBG("n_hci %p len %d", n_hci, len);
/* Send frame to TTY driver */
tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
return tty->driver.write(tty, 0, data, len);
}
struct h4_struct *h4 = hu->priv;
/* Init frame before queueing (padding, crc, etc) */
static struct sk_buff* h4_preq(struct n_hci *n_hci, struct sk_buff *skb)
{
BT_DBG("n_hci %p skb %p", n_hci, skb);
BT_DBG("hu %p skb %p", hu, skb);
/* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &skb->pkt_type, 1);
return skb;
skb_queue_tail(&h4->txq, skb);
return 0;
}
static inline int h4_check_data_len(struct h4_struct *h4, int len)
......@@ -132,7 +130,7 @@ static inline int h4_check_data_len(struct h4_struct *h4, int len)
BT_DMP(h4->rx_skb->data, h4->rx_skb->len);
hci_recv_frame(h4->rx_skb);
} else if (len > room) {
BT_ERR("Data length is to large");
BT_ERR("Data length is too large");
kfree_skb(h4->rx_skb);
} else {
h4->rx_state = H4_W4_DATA;
......@@ -147,16 +145,17 @@ static inline int h4_check_data_len(struct h4_struct *h4, int len)
}
/* Recv data */
static int h4_recv(struct n_hci *n_hci, void *data, int count)
static int h4_recv(struct hci_uart *hu, void *data, int count)
{
struct h4_struct *h4 = n_hci->priv;
struct h4_struct *h4 = hu->priv;
register char *ptr;
hci_event_hdr *eh;
hci_acl_hdr *ah;
hci_sco_hdr *sh;
register int len, type, dlen;
BT_DBG("n_hci %p count %d rx_state %ld rx_count %ld", n_hci, count, h4->rx_state, h4->rx_count);
BT_DBG("hu %p count %d rx_state %ld rx_count %ld",
hu, count, h4->rx_state, h4->rx_count);
ptr = data;
while (count) {
......@@ -204,7 +203,7 @@ static int h4_recv(struct n_hci *n_hci, void *data, int count)
h4_check_data_len(h4, sh->dlen);
continue;
};
}
}
/* H4_W4_PACKET_TYPE */
......@@ -232,7 +231,7 @@ static int h4_recv(struct n_hci *n_hci, void *data, int count)
default:
BT_ERR("Unknown HCI packet type %2.2x", (__u8)*ptr);
n_hci->hdev.stat.err_rx++;
hu->hdev.stat.err_rx++;
ptr++; count--;
continue;
};
......@@ -246,20 +245,26 @@ static int h4_recv(struct n_hci *n_hci, void *data, int count)
h4->rx_count = 0;
return 0;
}
h4->rx_skb->dev = (void *) &n_hci->hdev;
h4->rx_skb->dev = (void *) &hu->hdev;
h4->rx_skb->pkt_type = type;
}
return count;
}
static struct sk_buff *h4_dequeue(struct hci_uart *hu)
{
struct h4_struct *h4 = hu->priv;
return skb_dequeue(&h4->txq);
}
static struct hci_uart_proto h4p = {
.id = HCI_UART_H4,
.open = h4_open,
.close = h4_close,
.send = h4_send,
.recv = h4_recv,
.preq = h4_preq,
.flush = h4_flush,
.id = HCI_UART_H4,
.open = h4_open,
.close = h4_close,
.recv = h4_recv,
.enqueue = h4_enqueue,
.dequeue = h4_dequeue,
.flush = h4_flush,
};
int h4_init(void)
......
......@@ -23,7 +23,7 @@
*/
/*
* $Id: hci_h4.h,v 1.1.1.1 2002/03/08 21:03:15 maxk Exp $
* $Id: hci_h4.h,v 1.2 2002/09/09 01:17:32 maxk Exp $
*/
#ifdef __KERNEL__
......@@ -31,6 +31,7 @@ struct h4_struct {
unsigned long rx_state;
unsigned long rx_count;
struct sk_buff *rx_skb;
struct sk_buff_head txq;
};
/* H4 receiver States */
......
This diff is collapsed.
......@@ -23,10 +23,10 @@
*/
/*
* $Id: hci_uart.h,v 1.1.1.1 2002/03/08 21:03:15 maxk Exp $
* $Id: hci_uart.h,v 1.2 2002/09/09 01:17:32 maxk Exp $
*/
#ifndef N_HCI
#ifndef N_HCI
#define N_HCI 15
#endif
......@@ -42,19 +42,19 @@
#define HCI_UART_NCSP 2
#ifdef __KERNEL__
struct n_hci;
struct hci_uart;
struct hci_uart_proto {
unsigned int id;
int (*open)(struct n_hci *n_hci);
int (*recv)(struct n_hci *n_hci, void *data, int len);
int (*send)(struct n_hci *n_hci, void *data, int len);
int (*close)(struct n_hci *n_hci);
int (*flush)(struct n_hci *n_hci);
struct sk_buff* (*preq)(struct n_hci *n_hci, struct sk_buff *skb);
int (*open)(struct hci_uart *hu);
int (*close)(struct hci_uart *hu);
int (*flush)(struct hci_uart *hu);
int (*recv)(struct hci_uart *hu, void *data, int len);
int (*enqueue)(struct hci_uart *hu, struct sk_buff *skb);
struct sk_buff *(*dequeue)(struct hci_uart *hu);
};
struct n_hci {
struct hci_uart {
struct tty_struct *tty;
struct hci_dev hdev;
unsigned long flags;
......@@ -62,19 +62,20 @@ struct n_hci {
struct hci_uart_proto *proto;
void *priv;
struct sk_buff_head txq;
unsigned long tx_state;
spinlock_t rx_lock;
struct sk_buff *tx_skb;
unsigned long tx_state;
spinlock_t rx_lock;
};
/* N_HCI flag bits */
#define N_HCI_PROTO_SET 0x00
/* HCI_UART flag bits */
#define HCI_UART_PROTO_SET 0x00
/* TX states */
#define N_HCI_SENDING 1
#define N_HCI_TX_WAKEUP 2
#define HCI_UART_SENDING 1
#define HCI_UART_TX_WAKEUP 2
int hci_uart_register_proto(struct hci_uart_proto *p);
int hci_uart_unregister_proto(struct hci_uart_proto *p);
int hci_uart_tx_wakeup(struct hci_uart *hu);
#endif /* __KERNEL__ */
......@@ -28,9 +28,9 @@
* Copyright (c) 2000 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (c) 2000 Mark Douglas Corner <mcorner@umich.edu>
*
* $Id: hci_usb.c,v 1.6 2002/04/17 17:37:20 maxk Exp $
* $Id: hci_usb.c,v 1.8 2002/07/18 17:23:09 maxk Exp $
*/
#define VERSION "2.0"
#define VERSION "2.1"
#include <linux/config.h>
#include <linux/module.h>
......@@ -73,7 +73,7 @@
static struct usb_driver hci_usb_driver;
static struct usb_device_id usb_bluetooth_ids [] = {
static struct usb_device_id bluetooth_ids[] = {
/* Generic Bluetooth USB device */
{ USB_DEVICE_INFO(HCI_DEV_CLASS, HCI_DEV_SUBCLASS, HCI_DEV_PROTOCOL) },
......@@ -83,7 +83,14 @@ static struct usb_device_id usb_bluetooth_ids [] = {
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, usb_bluetooth_ids);
MODULE_DEVICE_TABLE (usb, bluetooth_ids);
static struct usb_device_id ignore_ids[] = {
/* Broadcom BCM2033 without firmware */
{ USB_DEVICE(0x0a5c, 0x2033) },
{ } /* Terminating entry */
};
static void hci_usb_interrupt(struct urb *urb);
static void hci_usb_rx_complete(struct urb *urb);
......@@ -193,22 +200,26 @@ static int hci_usb_open(struct hci_dev *hdev)
{
struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
int i, err;
long flags;
unsigned long flags;
BT_DBG("%s", hdev->name);
if (test_and_set_bit(HCI_RUNNING, &hdev->flags))
return 0;
MOD_INC_USE_COUNT;
write_lock_irqsave(&husb->completion_lock, flags);
err = hci_usb_enable_intr(husb);
if (!err) {
for (i = 0; i < HCI_MAX_BULK_TX; i++)
for (i = 0; i < HCI_MAX_BULK_RX; i++)
hci_usb_rx_submit(husb, NULL);
} else
} else {
clear_bit(HCI_RUNNING, &hdev->flags);
MOD_DEC_USE_COUNT;
}
write_unlock_irqrestore(&husb->completion_lock, flags);
return err;
}
......@@ -246,7 +257,7 @@ static inline void hci_usb_unlink_urbs(struct hci_usb *husb)
static int hci_usb_close(struct hci_dev *hdev)
{
struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
long flags;
unsigned long flags;
if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
return 0;
......@@ -260,6 +271,8 @@ static int hci_usb_close(struct hci_dev *hdev)
hci_usb_flush(hdev);
write_unlock_irqrestore(&husb->completion_lock, flags);
MOD_DEC_USE_COUNT;
return 0;
}
......@@ -587,78 +600,11 @@ static void hci_usb_destruct(struct hci_dev *hdev)
husb = (struct hci_usb *) hdev->driver_data;
kfree(husb);
MOD_DEC_USE_COUNT;
}
#ifdef CONFIG_BLUEZ_USB_FW_LOAD
/* Support for user mode Bluetooth USB firmware loader */
#define FW_LOADER "/sbin/bluefw"
static int errno;
static int hci_usb_fw_exec(void *dev)
{
char *envp[] = { "HOME=/", "TERM=linux",
"PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
char *argv[] = { FW_LOADER, dev, NULL };
int err;
err = exec_usermodehelper(FW_LOADER, argv, envp);
if (err)
BT_ERR("failed to exec %s %s", FW_LOADER, (char *)dev);
return err;
}
static int hci_usb_fw_load(struct usb_device *udev)
int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
sigset_t tmpsig;
char dev[16];
pid_t pid;
int result;
/* Check if root fs is mounted */
if (!current->fs->root) {
BT_ERR("root fs not mounted");
return -EPERM;
}
sprintf(dev, "%3.3d/%3.3d", udev->bus->busnum, udev->devnum);
pid = kernel_thread(hci_usb_fw_exec, (void *)dev, 0);
if (pid < 0) {
BT_ERR("fork failed, errno %d\n", -pid);
return pid;
}
/* Block signals, everything but SIGKILL/SIGSTOP */
spin_lock_irq(&current->sig->siglock);
tmpsig = current->blocked;
siginitsetinv(&current->blocked, sigmask(SIGKILL) | sigmask(SIGSTOP));
recalc_sigpending();
spin_unlock_irq(&current->sig->siglock);
result = waitpid(pid, NULL, __WCLONE);
/* Allow signals again */
spin_lock_irq(&current->sig->siglock);
current->blocked = tmpsig;
recalc_sigpending();
spin_unlock_irq(&current->sig->siglock);
if (result != pid) {
BT_ERR("waitpid failed pid %d errno %d\n", pid, -result);
return -result;
}
return 0;
}
#endif /* CONFIG_BLUEZ_USB_FW_LOAD */
static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct usb_device *udev = interface_to_usbdev(intf);
struct usb_endpoint_descriptor *bulk_out_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *isoc_out_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *bulk_in_ep[HCI_MAX_IFACE_NUM];
......@@ -673,15 +619,13 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
BT_DBG("intf %p", intf);
/* Check our black list */
if (usb_match_id(intf, ignore_ids))
return -EIO;
/* Check number of endpoints */
if (intf->altsetting[0].bNumEndpoints < 3)
return -ENODEV;
MOD_INC_USE_COUNT;
#ifdef CONFIG_BLUEZ_USB_FW_LOAD
hci_usb_fw_load(udev);
#endif
return -EIO;
memset(bulk_out_ep, 0, sizeof(bulk_out_ep));
memset(isoc_out_ep, 0, sizeof(isoc_out_ep));
......@@ -802,7 +746,6 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
kfree(husb);
done:
MOD_DEC_USE_COUNT;
return -EIO;
}
......@@ -811,9 +754,9 @@ static void hci_usb_disconnect(struct usb_interface *intf)
struct hci_usb *husb = dev_get_drvdata(&intf->dev);
struct hci_dev *hdev;
dev_set_drvdata(&intf->dev, NULL);
if (!husb)
return;
dev_set_drvdata(&intf->dev, NULL);
hdev = &husb->hdev;
BT_DBG("%s", hdev->name);
......@@ -828,10 +771,10 @@ static void hci_usb_disconnect(struct usb_interface *intf)
}
static struct usb_driver hci_usb_driver = {
.name = "hci_usb",
.probe = hci_usb_probe,
.disconnect = hci_usb_disconnect,
.id_table = usb_bluetooth_ids,
.name = "hci_usb",
.probe = hci_usb_probe,
.disconnect = hci_usb_disconnect,
.id_table = bluetooth_ids
};
int hci_usb_init(void)
......
......@@ -55,8 +55,8 @@ struct hci_usb {
__u8 intr_ep;
__u8 intr_interval;
struct urb * intr_urb;
struct sk_buff * intr_skb;
struct urb *intr_urb;
struct sk_buff *intr_skb;
rwlock_t completion_lock;
......
......@@ -818,6 +818,12 @@ CONFIG_MIXCOMWD
module, say M here and read <file:Documentation/modules.txt>. Most
people will say N.
CONFIG_SCx200_WDT
Enable the built-in watchdog timer support on the National
Semiconductor SCx200 processors.
If compiled as a module, it will be called scx200_watchdog.o.
CONFIG_MACHZ_WDT
If you are using a ZF Micro MachZ processor, say Y here, otherwise
N. This is the driver for the watchdog timer builtin on that
......@@ -1021,3 +1027,9 @@ CONFIG_RAW_DRIVER
Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O.
See the raw(8) manpage for more details.
CONFIG_SCx200_GPIO
Give userspace access to the GPIO pins on the National
Semiconductor SCx200 processors.
If compiled as a module, it will be called scx200_gpio.o.
......@@ -131,6 +131,7 @@ if [ "$CONFIG_WATCHDOG" != "n" ]; then
tristate ' IB700 SBC Watchdog Timer' CONFIG_IB700_WDT
tristate ' Intel i810 TCO timer / Watchdog' CONFIG_I810_TCO
tristate ' Mixcom Watchdog' CONFIG_MIXCOMWD
tristate ' NatSemi SCx200 Watchdog' CONFIG_SCx200_WDT
tristate ' SBC-60XX Watchdog Timer' CONFIG_60XX_WDT
tristate ' W83877F (EMACS) Watchdog Timer' CONFIG_W83877F_WDT
tristate ' ZF MachZ Watchdog' CONFIG_MACHZ_WDT
......@@ -193,6 +194,8 @@ if [ "$CONFIG_X86" = "y" ]; then
tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
fi
dep_tristate 'NatSemi SCx200 GPIO Support' CONFIG_SCx200_GPIO $CONFIG_SCx200
tristate ' RAW driver (/dev/raw/rawN)' CONFIG_RAW_DRIVER
endmenu
......@@ -75,6 +75,7 @@ obj-$(CONFIG_PPDEV) += ppdev.o
obj-$(CONFIG_DZ) += dz.o
obj-$(CONFIG_NWBUTTON) += nwbutton.o
obj-$(CONFIG_NWFLASH) += nwflash.o
obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o
# Only one watchdog can succeed. We probe the hardware watchdog
# drivers first, then the softdog driver. This means if your hardware
......@@ -86,6 +87,7 @@ obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
obj-$(CONFIG_IB700_WDT) += ib700wdt.o
obj-$(CONFIG_MIXCOMWD) += mixcomwd.o
obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
obj-$(CONFIG_WDT) += wdt.o
obj-$(CONFIG_WDTPCI) += wdt_pci.o
......
This diff is collapsed.
This diff is collapsed.
......@@ -91,6 +91,28 @@ CONFIG_I2C_CHARDEV
<file:Documentation/modules.txt>.
The module will be called i2c-dev.o.
CONFIG_SCx200_I2C
Enable the use of two GPIO pins of a SCx200 processor as an I2C bus.
If you don't know what to do here, say N.
If compiled as a module, it will be called scx200_i2c.o.
CONFIG_SCx200_I2C_SCL
Enter the GPIO pin number used for the SCL signal. This value can
also be specified with a module parameter.
CONFIG_SCx200_I2C_SDA
Enter the GPIO pin number used for the SSA signal. This value can
also be specified with a module parameter.
CONFIG_SCx200_ACB
Enable the use of the ACCESS.bus controllers of a SCx200 processor.
If you don't know what to do here, say N.
If compiled as a module, it will be called scx200_acb.o.
CONFIG_I2C_PROC
This provides support for i2c device entries in the /proc filesystem.
The entries will be found in /proc/sys/dev/sensors.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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