* Linux 2.4.0-ac6
@ 2001-01-11 1:59 Alan Cox
2001-01-11 10:51 ` J . A . Magallon
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alan Cox @ 2001-01-11 1:59 UTC (permalink / raw)
To: linux-kernel
ftp://ftp.kernel.org/pub/linux/kernel/people/alan/2.4/
2.4.0-ac6
o Sunrpc locking fix ()
o Made agpgart smarter about i815 (Charles McLachlan)
o Speed up truncate for shmem and clean up (Christoph Rohland)
o Fix kmalloc test in udf (Ingo Molnar)
o Fix ramfs kmalloc testing (Ingo Molnar)
o Fix irq and sense handling bugs in S/390 (Holger Smolinksi)
o Fix string.h for userspace accidental include (me)
| noted by Ulrich Weigand
o Red Hat office move (David Woodhouse)
o Fix missing highmem includes (Jens Axboe)
o Fix nfs_flushd deadlock (Trond Myklebust)
o Honour owner in mpu401 (Chris Rankin)
o Fix raid5 kmalloc check (Ingo Molnar)
o Export mmu_cr4_features (Adam J Richter)
o Update ide floppy maintainer (Paul Bristow)
o Fix IP_ADD_MEMBERSHIP case (Stefan Jonsson)
o Wavelan resource leak fixes (Hans Grobler)
o Fix spinlock error introduced from 2.4.1pre (Benjamin Redelings)
o Fix u32 classifier possible hang (Dave Miller)
o Further warning fixes (Rich Baum)
o RCPCI driver further cleanups (Rasmus Andersen)
o Remove unneeded test from rlimit code (Hans Grobler)
o Generate header file tags as well as code (Hans Grobler)
o Fix ppp_generic label problem (William Lee Irwin)
o Fix errors failing to restore IRQ's on smctr (Hans Grobler)
o Fix bulkmem kmalloc check error (Ingo Molnar)
o Fix pci kmalloc fail handling error (Ingo Molnar)
o Fix dac960 kmalloc check (Ingo Molnar)
| new driver rev from LNZ due anyway however
o Fix pcmcia cs kmalloc check error (Thiago Rondon)
o Fix pcmcia ds kmalloc check error (Thiago Rondon)
o Bootmem.c uses phys_to_virt but misses include (Bjorn Wesen)
o Fix sknet kmalloc check (Ingo Molnar)
o Fix lmc kmalloc check (Ingo Molnar)
o Atarilance kmalloc check (Ingo Molnar)
o Make some symbols static (Dan Aloni)
o Fix sgiseeq kmalloc fail handling (Ingo Molnar)
o ISDN kmalloc null check fix (Ingo Molnar)
o ATM kmalloc fix (Ingo Molnar)
o Apa1480 kmalloc null check fix (Ingo Molnar)
o Sunlance kmalloc check fix (Ingo Molnar)
o Baget lance kmalloc check fix (Ingo Molnar)
o Update Jes Sorensen's email addr (me)
o Fix athlon crash on boot with local apic/nmi (Ingo Molnar)
o Further ds fix (Dan Aloni)
(Can the pcmcia folk verify that in fact you
could just move it)
o Fix iucv kmalloc bogon (Ingo Molnar)
o Fix sun3 video kmalloc check (Thiago Rondon)
o Further raid5 fixes (Ingo Molnar)
o Netfilter updates (Rusty Russell)
| (so come to www.linux.conf.au and say thanks)
o Update audio locking fixes (Chris Rankin)
o Remove ymf_sb driver now ymfpci handles all (Pete Zaitcev)
2.4.0-ac5
o Fix qnx build error (Frank Davis)
o Further generic_file_write fix (me)
| no signal on short write
| write data on write overlapping max fs size
o 3c515 dereferenced freeed skbuffs (Hans Grobler)
o opl3sa2 driver update (Scott Murray)
o Uninline strstr to fix gcc compile problems (me)
| as in 2.2
o Fix dmfe oops if no card found (Andrew Morton)
o Fix df reporting on ntfs (Anton Altaparmakov)
| alternate fix to one by Willem Dekker
o Fix error path on macii_init that left irqs off (Hans Grobler)
o Fix memory/resource leaks in tlan driver (Hans Grobler)
o Fix vmalloc end on highmem (Ingo Molnar)
o Allow dac960 root device specifiers (Leonard Zubkoff)
o Fix missing NULL kmalloc check in fore200e (Hans Grobler)
o AF_UNIX cleanup continued (Hans Grobler)
o Chkconfig fixes (Niels Jensen)
o Fix kmalloc check missing on ppc proc/rtas (Hans Grobler)
o Add recovery for get_block failures (Al Viro)
o Fix partially mapped page handling in gfw (Al Viro)
o Use s_maxbytes in lseek (Al Viro)
o Correct various ext2 items (Al Viro)
o Fix memory leak in 3c527 driver (Hans Grobler)
o Clean up ipc formatting etc except shm (Ingo Molnar)
o Add mising BSDCOMP documentation (Kai Germaschewski)
o Fix unchecked allocation in isdn_ppp.c (Hans Grobler)
o Revised ad1848 patch (Chris Rankin)
o Fix missing kmalloc check on hdlc (Krzysztof Halasa)
o Make mnt name behaviour predictable on oom (Ingo Molnar)
o Configure doc fixes (Jeremy Dolan)
o Fix amifb endif typo (Rich Baum)
o Fix bug where mtd driver left irqs off on error (Hans Grobler)
o Adjusted ext2 max size rule (Andreas Dilger)
o Fix non SMP build of S/390 tree (Bernhard Rosenkraenzer)
o Uniprocessor APIC support/NMI wdog etc (Mikael Pettersson,
Maciej W. Rozycki
Ingo Molnar)
o IXJ driver cleanups/fixes/updates (David Huggins-Daines)
o Fix endian and other minor partition bugs (Andrzej M. Krzysztofowicz)
o Fix nasty irda bug which could leave ints off (Hans Grobler)
o FIx bmac case where ints could be left off (Arnaldo Carvalho
de Melo)
o Remove surplus break from de620 (Hans Grobler)
o Fix iph5526 dereference of free skb (Hans Grobler)
o Remove invalid netfilter url from docs (David Rees)
o Fix madvise crash (Andrew Morton)
o Fix memleak in eepro driver error path (Hans Grobler)
o Ultrastor driver used wrong type for save_flags (Thiago Rondon)
o Fix spin_unlock missing in s390 error path (Hans Grobler)
o MTD update (David Woodhouse)
o Tidy softdog driver (Hans Grobler)
o Fix sunos syscall memory leak (Hans Grobler)
o Fix surplus remove_flags in 53c7xx,8xx driver (Arnaldo Carvalho
de Melo)
o Tidy isicom, fix missing restore_flags (Arnaldo Carvalho
de Melo)
o Fix missing restore_flags in sscape (Arnaldo Carvalho
de Melo)
o Make ixj use dynamic board structures (David Huggins-Daines)
o Fix missing spin_unlock in i2o block (Hans Grobler)
o Fix ad1848 missing restore_flags (Arnaldo Carvalho
de Melo)
o Fix missing spin_unlock in ymfpci (Hans Grobler)
o Adaptec 1542 SCSI command line options (Dmitry Potapov)
o Fix missing ksym (Eyal Lebedinsky)
o Fix megaraid driver (Anwar Payyoorayil)
o Sparc xor fix (Anton Blanchard)
o Fix error returns on truncate/open (Al Viro)
o Fix missing restore_flags in n_r3964 (Arnaldo Carvalho
de Melo)
o mxser driver capable/return fixes (Arnaldo Carvalho
de Melo)
o Fix missing __restore_flags on IDE (Arnaldo Carvalho
de Melo)
o Fix missing spin_unlock_irqrestore in EMU10K (Hans Grobler)
o Resync with Linus tree
2.4.0-ac4
o Fix dereference of freed skbuff in iphase (Hans Grobler)
o Fix dereference of freed skbuff in isdn_ppp (Hans Grobler)
o Fix dereference of freed skbuff in comx (Hans Grobler)
o Fix dereference of freed skbuff in atarilance (Arnaldo Carvalho
de Melo)
o Fix missing NULL check of dev_alloc_skb in (Hans Grobler)
hdlc layer
o Fix vesafb typo (Dag Wieers)
o Z85230 driver cleanup (Hans Grobler)
o Remove spare restore_flags in de600 (Hans Grobler)
o Catch failed kmallocs in ppc ethernet (Hans Grobler)
o AF_PACKET socket cleanup (Hans Grobler)
o ATAPI IDE format facility (Sam Varshavchik)
| Don't rely on the abi or anything yet, Gadi
| the maintainer has yet to comment on it
o Fix smc9194 crash on out of memory (Hans Grobler)
o Documentation fixes (Dag Wieers)
o Fusion driver updates (Steve Ralston,
Eddie Dost,
Arnaldo Carvalho
de Melo)
o Fix ramfs hangs (me)
o Fix assorted LFS problems and missing rlimit (me)
checks. In theory file size rules are now
right and properly enforced except for those
folks not using generic_file_write who need to
do their homework 8)
2.4.0-ac3
o Add support for the newer 3c905 cards (Andrew Morton)
o Drop unused field from scc.h (Hans Grobler)
o Remove dead sysctl stuff from econet (Hans Grobler)
o Fix documentation indexes (Paul Gortmaker)
o Fix post free reference of an skb in lance (Paul Gortmaker)
o Tidy appletalk code (Hans Grobler)
o Fix bootup vesafb hang (David Wragg)
o TCP 'reset_xmit_timer' fix (Dave Miller)
o Tidy up cursor positioning on menuconfig (Kirk Reiser)
o Add missing wait.h includes to some asm/semaphore
(Hans Grobler)
o AF_UNIX socket cleanup (Hans Grobler)
o Update sd locking fixes (Oliver Neukum)
o Add module locking to audio coprocessor calls (Chris Rankin)
o Minor further X.25 tidy (Hans Grobler)
o Fix scsi ioctl/scan crash on out of memory (Douglas Gilbert)
o Soundscape patches (Chris Rankin)
o M68K fixes for mem stats and stram (Geert Uytterhoeven)
o Set MSG_TRUNC correctly on atm sockets (Matti Aarnio)
o Add infrastructure for parport autoloading (Adam J Richter)
o Make lp driver use capable not old suser() (Tim Waugh)
o Fix thread/unload race on i2o block (me)
o Fix drivers that use asm/delay not linux/delay (Geert Uytterhoeven)
o Further warning fixes (Rich Baum)
o Netfilter config/Makefile fixes (Dave Miller)
o Merge updated cs4281 driver and tidy it (Tom Woller)
| some cleanups by me, possibly broken it ;)
o Fix bagetlance reference of freed buffer (Arnaldo Carvalho de Melo)
o ISDN small fixes (Andrea Baldoni,
Daniel Stodden)
o ESS Maestro 3 driver (Zach Brown)
2.4.0-ac2
o Clean up strip driver (Hans Grobler)
o Fix fore atm makefile (Jan Rekorajski)
o Fix m68k lance mismerge (Geert Uytterhoeven)
o Fix tty documentation typos (Hans Grobler)
o Fix ohci1394 build (Arjan van de Ven)
o Remove dead lapbether inits (Hans Grobler)
o Workaround the acpi recursive variable name (Bill Wendling)
Makefile problem
o Further minor S/390 merge (Ulrich Weigand)
o Fix DRM build problem on ATI Rage 120/no AGP (Gareth Hughes)
o Fix mac address setting in 8139too (Ben Greear)
o AGP oops fix/ALi cleanup (Bill Crawford)
o Further DECnet cleanups (Hans Grobler)
o S/390 last fixes (Ulrich Weigand)
o Fix missing arlan symbol (Hans Grobler)
o Do basic IPX/SPX cleanups (Hans Grobler)
2.4.0-ac1
o Resync with Linus
o Fix serial compile bug (Bill Notthingham)
o Clean up lapbether (Hans Grobler)
o Fix endian handling in ne.c (Geert Uytterhoeven)
o Fix root umount handling (Chris Mason &
Al Viro)
o Bring wan drivers up to scratch for 2.4 (Krzysztof Halasa)
o SD module locking fix (Oliver Neukum)
o Merge S/390 32/64bit ports (IBM)
| some rough edges to tidy up yet - guys can
| you change the DMA ifdefs to match 2.2 style..
2.4.0prerelease-ac6
o Cleanup econet (Hans Grobler)
o Further amateur radio cleanups (Hans Grobler)
o Fix irda/SMP deadlocks (Marc Zyngier)
o Further YAM fixes (Hans Grobler)
o Fix rio500 locking bug (Greg Kroah-Hartmann)
o Fix isdn net leak on error (Arnaldo Carvalho de Melo)
o Fix proc_get_inode export (for comx) (Hans Grobler)
o Fix locking error on get_swap_page (Marcelo Tosatti)
o Fix further warnings, and other stuff new gcc (Arjan van de Ven)
shows up
o Add isapnp module device tables to drivers (Bill Nottingham)
[Added to ns558, serial, ide-pnp, cadet,
3c509,3c515, aironet4500,ne,sb1000, aha1542,
NCR5380, ad1816, awe_wave, sb, ixj]
o Resync with Linus prepatch
2.4.0prerelease-ac5
o Resync with Linus prepatch
o One liner microcode driver fix (Tigran Aivazian)
o Fix ACPI ksyms problems (Keith Owens)
o Correctly resync ide-cd fixes (Byron Stanoszek)
o Fix i2o block driver race (Arjan van de Ven)
o Acorn makefile/driver fixes (Russell King)
o Make cyberfb use pci_get_drvdata (Russell King)
o Kill redundant ARM timer irq code (Russell King)
o Remove some ARM hacks from fbmem.c (Russell King)
o Fix config bugs with fusion, indenting (Andrzej M. Krzysztofowicz)
o Handle bootmem order changes in arm (Russell King)
o SA1100 update (Russell King)
o Handle ALI AGP flushes (Ian Hastie)
o Merge some of the PPC changes (Cort Dougan)
2.4.0prerelease-ac4
o DecNET updates (Steve Whitehouse)
o Devices.txt typo fix (Roberto Nibali)
o Fix 15-23bit direct colour in logos (Geert Uytterhoeven)
o Correct framebuffer device.txt (Geert Uytterhoeven)
o Small mkiss fixes (Hans Grobler)
o Fix write off end of disk bug (Jari Ruusu)
2.4.0prerelease-ac3
o Fix cs46xx driver crash (David Huggins-Daines)
2.4.0prerelease-ac2
o Fix further CVS gcc compile warnings (Rich Baum)
2.4.0prerelease-ac1
o Merge with Linux prerelease
2.4.0test13pre7-ac1
o Merge Linus pre7
o Fix eepro100 on machines with unsigned char (Russell King)
o Give the FIQ on the ARM its own handlers (Russell King)
o Update ARM mm code (Russell King)
o Fix ARM optimisations (Russell King)
o Update arm initd patch (Russell King)
o Improve ARM I/O operations (Russell King)
o ARM boot code updates (Russell King)
o ARM scsi driver updates (Russell King)
o Update ARM makefiles to new style (Russell King)
o Add missing sections to arm link script for glue(Russell King)
o Update ARM io includes (Russell King)
o Clean up frame pointer printing on ARM traps (Russell King)
o Update ARM machine definitions (Russell King)
o Move the ARM task unmapped base definition (Russell King)
o Remove ARM specific hacks from char/mem.c (Russell King)
o Fix BIOS32 code for ARM (Russell King)
o Back out bogus SMP halt change (Andi Kleen)
o Update logo palette handling (Geert Uytterhoeven)
o Drop out the compiler selector (2.96/7 seem to work)
2.4.0test13pre6-ac1
o Merge Linus pre6
2.4.0test13pre5-ac1
o Merge Linus pre5
2.4.0test13pre4-ac2
o Further quota build fix (Jarno Paananen)
o Fix various combinations that don't build (Arjan van de Ven)
o Further Fusion driver updates (Steve Ralston)
o Alpha makefile fixes (Dave Gilbert)
2.4.0test13pre4-ac1
o Merge Linus pre4
o Fix network register/hotplug/publish problems (Andrew Morton)
o Hopefully fix quotaless compile (me)
o Help for irda options question (Steven Cole)
2.4.0test13pre3-ac4
o Fix frame size on toshoboe (Christian Gennerat)
o Quota fixes/updates (Jan Kara)
o Fix keyspan usb config (Hugh Blemings)
o Fix module handling in usb serial (Greg Kroah-Hartmann)
o Fix sparc64 build of fusion drivers (Eddie Dost)
o Clean up config.h includes (Niels Jensen)
2.4.0test13pre3-ac3
o Fix the patch file. Some stuff got corrupted.
2.4.0test13pre3-ac2 adds
o Resync with the powerpc folks (Cort Dougan)
o Parport experimental label fix (Tim Waugh)
o Make uhci return the same error code as the (David Brownell)
other USB hub controllers
o Merge Fusion drivers (Steve Ralston)
2.4.0test13pre3-ac1 adds
o Fix leak in link() syscall (Christopher Yeoh)
o Fix ramfs deadlock (Al Viro)
o Fix udf deadlock (Al Viro)
o Improve parport docs (Tim Waugh)
o Document some of the macros (Tim Waugh)
o Fix ppa timing issues (Tim Waugh)
o Mark the parport fifo code as experimental (Tim Waugh)
o Resynch ppa changelog (Tim Waugh)
| Tim please double check as I got offsets
o Add documentation to the PCI api (Jani Monoses)
o Fix inode.c documentation (Jani Monoses)
o Fix ext2 modular build (Jeff Raubitschek)
o Fix bug in scripts/Configure.in matching (Matthew Wilcox)
o Update SiS video drivers (Can-Ru Yeou)
o Yamaha audio doc fix (Pavel Roskin)
o Fix timeout problms with rocktports at 249 days
2.4.0test12-ac1 adds
o ARM bootup/initd fixes (Russell King)
o Fix ymf_sb setup bug (Pavel Roskin)
o Correctly print names of md10+ (me)
[Based on code from Roberto Ragusa]
o Fix sound crashes in various drivers (Tjeerd Mulder)
o Update epic100 to new pci api (Francois Romieu)
o Fix IOC/SIOC ioctl problems in ac97 code (Dick Streefland)
To merge
o Fix Ruffian Alpha boot (Ivan Kokshaysky)
o Bridge handling patches needed for Alpha (Ivan Kokshaysky /
Richard Henderson)
o Epic100 update
o Support mixed pnp and legacy sb cards
o Hopefully fix the bugs in the FAT and HPFS file systems that
caused fs corruption
o Fix cramfs vanishing data bug
o Power management locking fixes
o filemap posix compliance fix
o Fix pte handling race
o Remove unneeded inits to 0 in ide code (Bartlomiej Zolnierkiewicz)
o IDE documentation fixes (Bartlomiej Zolnierkiewicz)
Submitted to Linus
o Add the powermac extras to the input and (Franz Sirl)
keyboard drivers
scripts in 2.4test
o Fix kd_mksound declaration (Geert Uytterhoeven)
o SMC token ring driver update (Jay Schulist)
o Update USB documentation (Greg Kroah-Hartmann)
o Cleanup ramdisk namespace (Jeff Garzik)
o Ramdisk missing blkdev_put
Merged by Linus from -ac or direct
o Add clocking option to maestro (broken laptop (me)
stuff again)
o Put back the module locking in soundcore (David Schleef)
that someone disabled
o Abyss driver cleanup (Jeff Garzik)
o Fix most of the tq changes (Mohammad A. Haque)
o DOC1000 driver fixes (David Woodhouse)
o Switch tvaudio and msp3400 to use up_and_exit (David Woodhouse)
o usb-uhci was using constants not flags for (Jeff Garzik)
pci interface
o Small fix for kdoc (Tim Waugh)
o Fix nubus build (Geert Uytterhoeven)
o atari/sun3lance update (Geert Uytterhoeven)
o Amiga gayle pcmcia fixups (Geert Uytterhoeven)
o Fixes for amiga scsi drivers (Geert Uytterhoeven)
o Simplify amiga irq handling code (Geert Uytterhoeven)
o Amiga sound/fb driver update (Geert Uytterhoeven)
o Amiga/Mac/Atari keyboard driver changes (Geert Uytterhoeven)
o Integrate atari stram with bootmem (Geert Uytterhoeven)
o Restore atafb_fix that someone deleted (Geert Uytterhoeven)
o m68k include updates for 64bit structs (Geert Uytterhoeven)
o Add driver for MVME147 onboard scsi (Geert Uytterhoeven)
o Enable Q40 ide interface (Geert Uytterhoeven)
o Replace init with initdata in places on m68k (Geert Uytterhoeven)
o MMU code changes for m68k (Geert Uytterhoeven)
o dma_addr_t and other minor updates for m68k (Geert Uytterhoeven)
o m68k ptrace update (Geert Uytterhoeven)
o Fix pmc551 when used without bugfix enabled (David Woodhouse)
o Fix endianness on ftl layer (David Woodhouse)
o Fix atm build (Markus Kossmann)
o Update 8139too driver (Jeff Garzik)
o Fix readdir returns on procfs (Matt Kraai)
o Make SET_MODULE_OWNER macro safer (Jeff Garzik)
o Hisax needed __init (Jeff Garzik)
o APM updates, fix the Dell 5000e check for APM=m (Stephen Rothwell)
o Fix module initialization oops (Keith Owens)
o Clean up Abyss driver (Jeff Garzik)
o Fix raid linking order (Neil Brown)
o Cleanup console_verbose() duplication
o Radio driver cleanups
o BTTV radio config option
o Fix qcam VIDIOCGWIN bugs
o 8390 seperate tx timeout path
o Tulip crash fix on weird eeproms
o ISAPnP hang on boot port fix
o Maestro pci_enable fix
o Fix function prototype in wacom drivr
o Fix SCSI / PCI dependancies (Jeff Garzik)
o m68k config fixes (Geert Uytterhoeven)
o Fix dquot overflow/recovery (Jan Kara)
o Make uid16 macros safer (Andreas Schwab)
o Fix missing Config doc and sound doc error (Thierry Vignaud)
o APM update (Stephen Rothwell)
o Fix SMP build on x86 (Steven Cole)
o Maestro ioctl locking fix (Zach Brown)
o Make console_* static inline not extern (Jeff Garzik)
o Work arounds for broken Dell laptop APM (me)
o Fix aha1542 memory scribbles (Phil Stracchino)
o Fix ide scsi printk (Geert Uytterhoeven)
o Update EATA driver and Ultrastor driver (Dario Ballabio)
o Clean up printk formatting in a few drivers (me)
o Documentation for CONFIG_TOSHIBA
o Updated version of Rusty's kernel-hacking doc
o Updated SubmittingDrivers
o Added SubmittingPatches
o Updated procfs docs
o Updated initrd docs
o Tidy network drivers module locking (Jeff Garzik)
(Some in, a few to go)
o Alpha PCI fixes (update resource not __init, (Ivan Kokshaysky)
off by one on check)
o Fix warning in rclan driver (Rasmus Andersen)
o Clean up rcpci driver (new style pci etc) (Jeff Garzik)
o Fix generic bitops bugs
o Fix pcnet32 printk problems (Vojtech Pavlik)
o Network driver check/request region fixes
o MDAcon cleanup (Pavel Rabel)
o Tidy up mad16 driver (Pavel Rabel)
o ACPI updates (Andrew Grover)
o Fix FPU emulation compile (Adam Richter)
o M68K/PPC makefile fixes (Geert Uytterhoeven)
o Work around a funny in the Solaris NFS client (Neil Brown)
o Fix building of network modules (Peter Samuelson)
o Fix media makefiles (me)
o FPU emulator source set for m68k (Geert Uytterhoeven)
o Fix m68k build with rmw disabled (Geert Uytterhoeven)
o Fix sun3 scsi, mmu and includes (Geert Uytterhoeven)
o M68k setup update (Geert Uytterhoeven)
o Revert accidental amifb change (Geert Uytterhoeven)
o Remove obsolete bits for q40 (Geert Uytterhoeven)
o Tidy m68k includes (Geert Uytterhoeven)
o I2C bus driver updates (Frodo Looijaard)
o Fix reference counting in ATM (Patrick van de Lageweg)
o Update Changes to give correct modutils rev (Steven Cole)
o Fix NLS config.in bug for SMB
o Fix xconfig/menuconfig problems with config (Andrzej Krzysztofowicz)
o Add firestream ATM driver (Patrick van de Lageweg)
o Rename block_til_ready in generic_serial (Patrick van de Lageweg)
o Fix i810 tco locking (me)
o Tidy riscom8 and sx namespace (Jeff Garzik)
o Fix pcmcia ordering on socket remove (David Woodhouse)
o Merge aha152x delay fixes
o Fix warning in sim710 driver (Pavel Rabel)
o Improve the ALSxxx sound driver documentation (Jonathan Woithe)
o Tidy the tachyon 5526 driver (Rasmus Andersen)
o Clean old old compile time config stuff from (Pavel Rabel)
mad16 driver
o Push Davicom support into the main tulip driver (Tobias Ringstrom)
o Merge bttv 0.7.50 (Gerd Knorr)
o Clean it up to use pci_pci_quirks properly (me)
o OSST scsi driver for Onstream drives (Willem Riede)
o Merge typo/doc fixes from 2.2.18
o Further NetROM tidies (Hans Grobler)
o Further rose fixes (Hans Grobler)
o Documentation/script fixes (Tim Waugh)
o BPQ ethernet tidy (Hans Grobler)
o Updated AX.25 tidy (Hans Grobler)
o Update credits to add Hans Grobler (Hans Grobler)
o Handle TLB flush reruns caused by APIC rexmit (me)
o Fix Yam driver for Linux 2.4test (Hans Grobler)
o Fix AF_ROSE sockets for 2.4 (Hans Grobler)
o Fix AF_NETROM sockets for 2.4 (Hans Grobler)
o Tidy AF_AX25 sockets for 2.4 (Hans Grobler)
o Teach kernel-doc about const (Jani Monoses)
o First block of mkiss driver fixes (Hans Grobler)
o Update acenic patches (Jes Sorensen)
o Acenic update
o Watchdog header to use __u32 etc (Eric Brower)
o Correct md name printing (Luca Berra)
o Add Steven Cole to the credits file (Steven Cole)
o DC390 update (Kurt Garloff)
o X.25 ifdef cleanups (Henner Eisen)
o Update OSST driver to 0.9.4.3 (Kurt Garloff)
o Fix make xconfig failure on irda (Steven Cole)
o Fix crashes on unload of msr and cpuid drivers
o Remove crud from epca driver (me)
o Merge support for CPU's >2Ghz from 2.2.18
o Merge core loops_per_jiffy support
o Merge first batch of driver fixes from 2.2.18
o Make smp cpu halt synchronous (Andi Kleen)
o Fix eepro module warnings (Aristeu Filho)
o Fix most of the netfilter oops cases (David Miller)
o Fix appletalk config entry (William McGonigle)
o CCISS root= table (Charles White)
o Rusty's fixes/review of unsafe set_bit usage
(A few left to go)
o RCPCI45 PCI cleanup fixes (mark 2) (Rasmus Andersen)
o Fix 8139too signal handling and task scribble (Andrew Morton)
o Fix signal handling for usermode helper (Shuu Yamaguchi)
o Fix tty DoS bug (Andrew Morton)
o Wireless include update (Jean Tourrilhes)
o Resync mac ethernet drivers (Cort Dougan)
o Remove bogus asserts in 8139too driver (Jeff Garzik)
o Fix radio drivers (Russell Kroll)
o Fix rcpci build error (Hans Grobler)
o Fix incorrect preprocessor use in umsdos (Andreas Franck)
o DRM makefile fix (Keith Owens)
o IDE 2.4.0-prerelease*1231.patch (Andre Hedrick)
o Fixes for CVS gcc and semaphores (Andreas Franck)
o Better atm linking fix (Jan Rekorajski)
o Macintosh IDE updates (Geert Uytterhoeven)
o Update 68k ksyms (Geert Uytterhoeven)
o Fix m68k keyboard ioctls (Geert Uytterhoeven)
o Fix fbdev config.in allow PM2 modular (Geert Uytterhoeven)
o Update m68k ethernet drivers (Geert Uytterhoeven)
o 2.4 Y2K fixes for Amiga clock (Geert Uytterhoeven)
o Fix sun/mac scsi drivers (Geert Uytterhoeven)
o Fix fb init order (Geert Uytterhoeven)
o Fix m68k miscellaneous stuff (Geert Uytterhoeven)
o Update m68k lance driver (Geert Uytterhoeven)
o Fix m68k asm constraints (Geert Uytterhoeven)
o Fix m68k config (Geert Uytterhoeven)
o Amiga serial update/serial console support (Geert Uytterhoeven)
o Update m68k to use loops_per_jiffy (Geert Uytterhoeven)
o Add support functions needed by gcc (Geert Uytterhoeven)
o Fix amiga resource management (Geert Uytterhoeven)
o Fix raid buffer leak (Neil Brown)
o Additional knfsd locking (Neil Brown)
o Fix loops per jiffy oddments (Geert Uytterhoeven)
o Fixed lost video patch in -ac (Geert Uytterhoeven)
o Tidy up LAPB code (Hans Grobler)
o Tidy up X.25 code (Hans Grobler)
o General warning/minor bug fixes (Arjan van de Ven)
o Remove extra codec reset from i810 audio (Anwar Payyoorayil)
| should fix failed VRA on some boards
o Fix page allocator recursion (Rik van Riel)
o Fix CMOS locking for 2.4.x (Paul Gortmaker)
o FAT cache locking for SMP ('manmower')
o Skip older dm9100's from tulip driver (me)
o Further iee1394 build fixes (Andreas Bombe)
o Fix i810 divide by zero bug (Anwar)
o Remove dead pi and pt drivers (Hans Grobler)
o SCC driver update (Hans Grobler)
o Adjust csr0 on tulip for known iffy chipsets (me)
| Thanks to Don Becker and others for the chipset list
| and knowing what the problem was.
o 6pack cleanups (Hans Grobler)
o Documentation cleanups (Hans Grobler)
o Fix unchecked scsi_allocate_request in sg.c (me)
| Spotted by Doug Gilbert
o Fix compile bug in pcxx driver (me)
o Fix spelling of pedant (Tim Waugh)
o Fix mkiss build error (Hans Grobler)
o Patches to fix warnings from gcc 2.97 cvs (Marcel Schmidt)
Superceded by other fixes
o Features is back to flags for compatibility (me)
o MTRR updates (36bit etc)
o Dont crash on boot with a dual cpu board holding a non intel cpu
o CS46xx update
o NFS atomic fixes (Trond Myklebust)
o Fix O_SYNC for ext2fs (Stephen Tweedie)
[ I believe so anyway ]
o Disable PMC511 driver - its obviously broken (me)
o kbuild documentation improvements (Neil Brown)
o Fix ppa and imm hangs on io_request_lock (Tim Waugh)
o Fix pport reverse/forward logic error (Tim Waugh)
o ACPI updates (Andrew Grover)
o E820 handling fixup (Andrea Arcangeli)
o Fix missing memory barrier in bootp/dhcp code (Cort Dougan)
o Fix ACPI driver wakeup races (David Woodhouse)
o Fix drm makefiles (Peter Samuelson)
o Link correctly with ACPI on ACPI_INTERPRETER off
o Shared memory fixes (Christoph Rohland)
o Fix bug in VFAT short name handling (Nicolas Goutte)
o Clean up the i810 driver (Tjeerd Mulder)
o Clean up misleading indenting in partition code (JAmes Antill)
o Support kgcc autodetect
Other
---
Alan Cox <alan@lxorguk.ukuu.org.uk>
Red Hat Kernel Hacker
& Linux 2.2 Maintainer Brainbench MVP for TCP/IP
http://www.linux.org.uk/diary http://www.brainbench.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux 2.4.0-ac6
2001-01-11 1:59 Linux 2.4.0-ac6 Alan Cox
@ 2001-01-11 10:51 ` J . A . Magallon
2001-01-11 15:59 ` Udo A. Steinberg
2001-01-11 21:59 ` [PATCH] improved IDE OnStream support for linux 2.4 Marcel J.E. Mol
2 siblings, 0 replies; 6+ messages in thread
From: J . A . Magallon @ 2001-01-11 10:51 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-kernel
On 2001.01.11 Alan Cox wrote:
> ftp://ftp.kernel.org/pub/linux/kernel/people/alan/2.4/
>
> 2.4.0-ac6
The PentiumIII misnaming in arch/i386/Makefile is still there:
--- linux-2.4.0-ac6/arch/i386/Makefile.org Thu Jan 11 11:48:09 2001
+++ linux-2.4.0-ac6/arch/i386/Makefile Thu Jan 11 11:48:21 2001
@@ -50,7 +50,7 @@
CFLAGS += -march=i686
endif
-ifdef CONFIG_M686FXSR
+ifdef CONFIG_MPENTIUMIII
CFLAGS += -march=i686
endif
--
J.A. Magallon $> cd pub
mailto:jamagallon@able.es $> more beer
Linux werewolf 2.4.0-ac5 #1 SMP Wed Jan 10 23:36:11 CET 2001 i686
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux 2.4.0-ac6
2001-01-11 1:59 Linux 2.4.0-ac6 Alan Cox
2001-01-11 10:51 ` J . A . Magallon
@ 2001-01-11 15:59 ` Udo A. Steinberg
2001-01-11 17:40 ` [OOPS] APIC on Athlon [was Re: Linux 2.4.0-ac6] Udo A. Steinberg
2001-01-11 21:59 ` [PATCH] improved IDE OnStream support for linux 2.4 Marcel J.E. Mol
2 siblings, 1 reply; 6+ messages in thread
From: Udo A. Steinberg @ 2001-01-11 15:59 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-kernel
Alan Cox wrote:
>
> 2.4.0-ac6
> o Fix athlon crash on boot with local apic/nmi (Ingo Molnar)
Still crashes here with -ac6 on my Athlon. I'll have to write down the
oops by hand later on or set up a serial console, but once that's done
I'll post the trace - unless someone already knows what's still wrong
with it.
-Udo.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [OOPS] APIC on Athlon [was Re: Linux 2.4.0-ac6]
2001-01-11 15:59 ` Udo A. Steinberg
@ 2001-01-11 17:40 ` Udo A. Steinberg
0 siblings, 0 replies; 6+ messages in thread
From: Udo A. Steinberg @ 2001-01-11 17:40 UTC (permalink / raw)
To: Alan Cox, linux-kernel, Ingo Molnar
"Udo A. Steinberg" wrote:
>
> Alan Cox wrote:
> >
> > 2.4.0-ac6
> > o Fix athlon crash on boot with local apic/nmi (Ingo Molnar)
>
> Still crashes here with -ac6 on my Athlon. I'll have to write down the
> oops by hand later on or set up a serial console, but once that's done
> I'll post the trace - unless someone already knows what's still wrong
> with it.
Ok, here goes:
Right before it oopses, I can still read the following info on the
console which might be of help to someone:
Getting VERSION: 40010
Getting VERSION: 40010
Getting ID: 0
Getting ID: f000000
Getting LVT0: 700
Getting LVT1: 400
enabling Ext INT on CPU#0
ESR value before enabling vector: 00000000
ESR value after enabling vector: 00000000
general protection fault: 0000
ksymoops 2.3.7 on i686 2.4.0. Options used
-V (default)
-K (specified)
-L (specified)
-o /lib/modules/2.4.0-ac6 (specified)
-m /boot/System.map-2.4.0-ac6 (specified)
No modules in ksyms, skipping objects
CPU: 0
EIP: 0010:[<c011174a>]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010246
eax: 00000000 ebx: 00000000 ecx: 00000186 edx: 00000000
esi: 00000004 edi: c0105000 ebp: 0008e000 esp: c02a1fc0
ds: 0018 es: 0018 ss: 0018
Process swapper (pid: 0, stackpage=c02a1000)
Stack: 00000000 c02a787b 0000ffec 00099800 c02a7ae3 c02a27f5 c02a2900 c022f620
0000ffec 0000ffec 0000ffec 0000ffec 0000ffec 00000000 c02d8ce0 c0100192
Call Trace: [<c0100192>]
Code: 0f 30 41 0f 30 b9 c1 00 00 00 0f 30 b9 c2 00 00 00 0f 30 b8
>>EIP; c011174a <setup_apic_nmi_watchdog+a/90> <=====
Trace; c0100192 <L6+0/2>
Code; c011174a <setup_apic_nmi_watchdog+a/90>
00000000 <_EIP>:
Code; c011174a <setup_apic_nmi_watchdog+a/90> <=====
0: 0f 30 wrmsr <=====
Code; c011174c <setup_apic_nmi_watchdog+c/90>
2: 41 incl %ecx
Code; c011174d <setup_apic_nmi_watchdog+d/90>
3: 0f 30 wrmsr
Code; c011174f <setup_apic_nmi_watchdog+f/90>
5: b9 c1 00 00 00 movl $0xc1,%ecx
Code; c0111754 <setup_apic_nmi_watchdog+14/90>
a: 0f 30 wrmsr
Code; c0111756 <setup_apic_nmi_watchdog+16/90>
c: b9 c2 00 00 00 movl $0xc2,%ecx
Code; c011175b <setup_apic_nmi_watchdog+1b/90>
11: 0f 30 wrmsr
Code; c011175d <setup_apic_nmi_watchdog+1d/90>
13: b8 00 00 00 00 movl $0x0,%eax
Kernel panic: Attempted to kill the idle task!
-Udo.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] improved IDE OnStream support for linux 2.4
2001-01-11 1:59 Linux 2.4.0-ac6 Alan Cox
2001-01-11 10:51 ` J . A . Magallon
2001-01-11 15:59 ` Udo A. Steinberg
@ 2001-01-11 21:59 ` Marcel J.E. Mol
2001-01-11 22:04 ` Andre Hedrick
2 siblings, 1 reply; 6+ messages in thread
From: Marcel J.E. Mol @ 2001-01-11 21:59 UTC (permalink / raw)
To: Alan Cox, Linus Torvalds
Cc: linux-kernel, Jack Bombeeck, Gadi Oxman, Willem Riede, Andre Hedrick
Hi guys,
Below is a patch to fix some problems in the OnStream tape drive support
in ide-tape.c.
- It implements Early Warning (e.g. retuns ENOSPC) for reaching end-of-tape.
This fixes a real nasty problem when writing beyond end-of-tape, rendering
the 'backup' more ore less useless.
- Includes a workaround for a read error around block 3000.
- The module use counts were gone allowing to remove the module while it was
still busy.
- Support for other IDE OnStream tape drives (e.g. DI-50).
- A few cosmetic fixes to improve readability.
Patch is against linux 2.4.0-prerelease.
Andre: a patch for 2.2.18 is almost ready to be included in the ide patchset.
-Marcel
--
======-------- Marcel J.E. Mol MESA Consulting B.V.
=======--------- ph. +31-(0)6-54724868 P.O. Box 112
=======--------- marcel@mesa.nl 2630 AC Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
They couldn't think of a number, so they gave me a name!
-- Rupert Hine http://www.ruperthine.com/
--- linux/drivers/ide/ide-tape.c.org Wed Jan 3 00:13:40 2001
+++ linux/drivers/ide/ide-tape.c Thu Jan 11 22:41:36 2001
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/ide-tape.c Version 1.16f Dec 15, 1999
+ * linux/drivers/ide/ide-tape.c Version 1.17 Jan, 2001
*
* Copyright (C) 1995 - 1999 Gadi Oxman <gadio@netvision.net.il>
*
@@ -274,6 +274,18 @@
* this section correctly, a hypothetical and unwanted situation
* is being described)
* Ver 1.16f Dec 15 99 Change place of the secondary OnStream header frames.
+ * Ver 1.17 Nov 2000 / Jan 2001 Marcel Mol, marcel@mesa.nl
+ * - Add idetape_onstream_mode_sense_tape_parameter_page
+ * function to get tape capacity in frames: tape->capacity.
+ * - Add support for DI-50 drives( or any DI- drive).
+ * - 'workaround' for read error/blank block arround block 3000.
+ * - Implement Early warning for end of media for Onstream.
+ * - Cosmetic code changes for readability.
+ * - Idetape_position_tape should not use SKIP bit during
+ * Onstream read recovery.
+ * - Add capacity, logical_blk_num and first/last_frame_position
+ * to /proc/ide/hd?/settings.
+ * - Module use count was gone in the Linux 2.4 driver.
*
*
* Here are some words from the first releases of hd.c, which are quoted
@@ -384,7 +396,7 @@
* sharing a (fast) ATA-2 disk with any (slow) new ATAPI device.
*/
-#define IDETAPE_VERSION "1.16f"
+#define IDETAPE_VERSION "1.17"
#include <linux/config.h>
#include <linux/module.h>
@@ -421,7 +433,11 @@
#define OS_CONFIG_PARTITION (0xff)
#define OS_DATA_PARTITION (0)
#define OS_PARTITION_VERSION (1)
+#define OS_EW 300
+#define OS_ADR_MINREV 2
+#define OS_DATA_STARTFRAME1 20
+#define OS_DATA_ENDFRAME1 2980
/*
* partition
*/
@@ -512,12 +528,33 @@
} os_header_t;
/*
+ * OnStream Tape Parameters Page
+ */
+typedef struct {
+ unsigned page_code :6; /* Page code - Should be 0x2b */
+ unsigned reserved1_6 :1;
+ unsigned ps :1;
+ __u8 reserved2;
+ __u8 density; /* kbpi */
+ __u8 reserved3,reserved4;
+ __u16 segtrk; /* segment of per track */
+ __u16 trks; /* tracks per tape */
+ __u8 reserved5,reserved6,reserved7,reserved8,reserved9,reserved10;
+} onstream_tape_paramtr_page_t;
+
+/*
* OnStream ADRL frame
*/
#define OS_FRAME_SIZE (32 * 1024 + 512)
#define OS_DATA_SIZE (32 * 1024)
#define OS_AUX_SIZE (512)
+/*
+ * internal error codes for onstream
+ */
+#define OS_PART_ERROR 2
+#define OS_WRITE_ERROR 1
+
#include <linux/mtio.h>
/**************************** Tunable parameters *****************************/
@@ -949,6 +986,7 @@
int eod_frame_addr;
unsigned long cmd_start_time;
unsigned long max_cmd_time;
+ unsigned capacity;
/*
* Optimize the number of "buffer filling"
@@ -1157,7 +1195,7 @@
typedef union {
unsigned all :8;
struct {
- unsigned dma :1; /* Using DMA of PIO */
+ unsigned dma :1; /* Using DMA or PIO */
unsigned reserved321 :3; /* Reserved */
unsigned reserved654 :3; /* Reserved (Tag Type) */
unsigned reserved7 :1; /* Reserved */
@@ -1287,7 +1325,9 @@
* by ide-tape.
*/
#define IDETAPE_CAPABILITIES_PAGE 0x2a
+#define IDETAPE_PARAMTR_PAGE 0x2b /* onstream only */
#define IDETAPE_BLOCK_SIZE_PAGE 0x30
+#define IDETAPE_BUFFER_FILLING_PAGE 0x33
/*
* Mode Parameter Header for the MODE SENSE packet command
@@ -1428,6 +1468,14 @@
#endif /* IDETAPE_DEBUG_LOG_VERBOSE */
/*
+ * Function declarations
+ *
+ */
+static void idetape_onstream_mode_sense_tape_parameter_page(ide_drive_t *drive, int debug);
+static int idetape_chrdev_release (struct inode *inode, struct file *filp);
+static void idetape_write_release (struct inode *inode);
+
+/*
* Too bad. The drive wants to send us data which we are not ready to accept.
* Just throw it away.
*/
@@ -1452,7 +1500,8 @@
#endif /* IDETAPE_DEBUG_BUGS */
count = IDE_MIN (bh->b_size - atomic_read(&bh->b_count), bcount);
atapi_input_bytes (drive, bh->b_data + atomic_read(&bh->b_count), count);
- bcount -= count; atomic_add(count, &bh->b_count);
+ bcount -= count;
+ atomic_add(count, &bh->b_count);
if (atomic_read(&bh->b_count) == bh->b_size) {
bh = bh->b_reqnext;
if (bh)
@@ -1476,7 +1525,9 @@
#endif /* IDETAPE_DEBUG_BUGS */
count = IDE_MIN (pc->b_count, bcount);
atapi_output_bytes (drive, pc->b_data, count);
- bcount -= count; pc->b_data += count; pc->b_count -= count;
+ bcount -= count;
+ pc->b_data += count;
+ pc->b_count -= count;
if (!pc->b_count) {
pc->bh = bh = bh->b_reqnext;
if (bh) {
@@ -1577,20 +1628,23 @@
* to analyze the request sense. We currently do not utilize this
* information.
*/
-static void idetape_analyze_error (ide_drive_t *drive,idetape_request_sense_result_t *result)
+static void idetape_analyze_error (ide_drive_t *drive, idetape_request_sense_result_t *result)
{
idetape_tape_t *tape = drive->driver_data;
idetape_pc_t *pc = tape->failed_pc;
- tape->sense = *result;
- tape->sense_key = result->sense_key; tape->asc = result->asc; tape->ascq = result->ascq;
+ tape->sense = *result;
+ tape->sense_key = result->sense_key;
+ tape->asc = result->asc;
+ tape->ascq = result->ascq;
#if IDETAPE_DEBUG_LOG
/*
* Without debugging, we only log an error if we decided to
* give up retrying.
*/
if (tape->debug_level >= 1)
- printk (KERN_INFO "ide-tape: pc = %x, sense key = %x, asc = %x, ascq = %x\n",pc->c[0],result->sense_key,result->asc,result->ascq);
+ printk (KERN_INFO "ide-tape: pc = %x, sense key = %x, asc = %x, ascq = %x\n",
+ pc->c[0], result->sense_key, result->asc, result->ascq);
#if IDETAPE_DEBUG_LOG_VERBOSE
if (tape->debug_level >= 1)
printk (KERN_INFO "ide-tape: pc = %s, sense key = %x, asc = %x, ascq = %x\n",
@@ -1660,7 +1714,7 @@
static void idetape_active_next_stage (ide_drive_t *drive)
{
idetape_tape_t *tape = drive->driver_data;
- idetape_stage_t *stage=tape->next_stage;
+ idetape_stage_t *stage = tape->next_stage;
struct request *rq = &stage->rq;
#if IDETAPE_DEBUG_LOG
@@ -1676,9 +1730,9 @@
rq->buffer = NULL;
rq->bh = stage->bh;
- tape->active_data_request=rq;
- tape->active_stage=stage;
- tape->next_stage=stage->next;
+ tape->active_data_request = rq;
+ tape->active_stage = stage;
+ tape->next_stage = stage->next;
}
/*
@@ -1756,12 +1810,12 @@
return;
}
#endif /* IDETAPE_DEBUG_BUGS */
- stage=tape->first_stage;
- tape->first_stage=stage->next;
+ stage = tape->first_stage;
+ tape->first_stage = stage->next;
idetape_kfree_stage (tape, stage);
tape->nr_stages--;
if (tape->first_stage == NULL) {
- tape->last_stage=NULL;
+ tape->last_stage = NULL;
#if IDETAPE_DEBUG_BUGS
if (tape->next_stage != NULL)
printk (KERN_ERR "ide-tape: bug: tape->next_stage != NULL\n");
@@ -1821,12 +1875,12 @@
}
#endif
if (tape->onstream && !tape->raw) {
- if (tape->first_frame_position == 0xba4) {
+ if (tape->first_frame_position == OS_DATA_ENDFRAME1) {
#if ONSTREAM_DEBUG
- if (tape->debug_level >= 2)
- printk("ide-tape: %s: skipping over config parition..\n", tape->name);
+ if (tape->debug_level >= 2)
+ printk("ide-tape: %s: skipping over config parition..\n", tape->name);
#endif
- tape->onstream_write_error = 2;
+ tape->onstream_write_error = OS_PART_ERROR;
if (tape->sem)
up(tape->sem);
}
@@ -1839,7 +1893,7 @@
if (tape->onstream && !tape->raw && error == IDETAPE_ERROR_GENERAL && tape->sense.sense_key == 3) {
clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags);
printk(KERN_ERR "ide-tape: %s: write error, enabling error recovery\n", tape->name);
- tape->onstream_write_error = 1;
+ tape->onstream_write_error = OS_WRITE_ERROR;
remove_stage = 0;
tape->nr_pending_stages++;
tape->next_stage = tape->first_stage;
@@ -1883,11 +1937,11 @@
printk (KERN_INFO "ide-tape: Reached idetape_request_sense_callback\n");
#endif /* IDETAPE_DEBUG_LOG */
if (!tape->pc->error) {
- idetape_analyze_error (drive,(idetape_request_sense_result_t *) tape->pc->buffer);
- idetape_end_request (1,HWGROUP (drive));
+ idetape_analyze_error (drive, (idetape_request_sense_result_t *) tape->pc->buffer);
+ idetape_end_request (1, HWGROUP (drive));
} else {
printk (KERN_ERR "ide-tape: Error in REQUEST SENSE itself - Aborting request!\n");
- idetape_end_request (0,HWGROUP (drive));
+ idetape_end_request (0, HWGROUP (drive));
}
return ide_stopped;
}
@@ -1980,7 +2034,7 @@
idetape_status_reg_t status;
idetape_bcount_reg_t bcount;
idetape_ireason_reg_t ireason;
- idetape_pc_t *pc=tape->pc;
+ idetape_pc_t *pc = tape->pc;
unsigned int temp;
unsigned long cmd_time;
@@ -2011,7 +2065,7 @@
*/
set_bit (PC_DMA_ERROR, &pc->flags);
} else if (!status.b.check) {
- pc->actually_transferred=pc->request_transfer;
+ pc->actually_transferred = pc->request_transfer;
idetape_update_buffers (pc);
}
#if IDETAPE_DEBUG_LOG
@@ -2064,7 +2118,7 @@
return ide_stopped;
}
if (tape->failed_pc == pc)
- tape->failed_pc=NULL;
+ tape->failed_pc = NULL;
return pc->callback(drive); /* Command finished - Call the callback function */
}
#ifdef CONFIG_BLK_DEV_IDEDMA
@@ -2075,9 +2129,9 @@
return ide_do_reset (drive);
}
#endif /* CONFIG_BLK_DEV_IDEDMA */
- bcount.b.high=IN_BYTE (IDE_BCOUNTH_REG); /* Get the number of bytes to transfer */
- bcount.b.low=IN_BYTE (IDE_BCOUNTL_REG); /* on this interrupt */
- ireason.all=IN_BYTE (IDE_IREASON_REG);
+ bcount.b.high = IN_BYTE (IDE_BCOUNTH_REG); /* Get the number of bytes to transfer */
+ bcount.b.low = IN_BYTE (IDE_BCOUNTL_REG); /* on this interrupt */
+ ireason.all = IN_BYTE (IDE_IREASON_REG);
if (ireason.b.cod) {
printk (KERN_ERR "ide-tape: CoD != 0 in idetape_pc_intr\n");
@@ -2093,8 +2147,8 @@
if ( temp > pc->request_transfer) {
if (temp > pc->buffer_size) {
printk (KERN_ERR "ide-tape: The tape wants to send us more data than expected - discarding data\n");
- idetape_discard_data (drive,bcount.all);
- ide_set_handler (drive,&idetape_pc_intr,IDETAPE_WAIT_CMD,NULL);
+ idetape_discard_data (drive, bcount.all);
+ ide_set_handler (drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL);
return ide_started;
}
#if IDETAPE_DEBUG_LOG
@@ -2114,13 +2168,13 @@
else
atapi_input_bytes (drive,pc->current_position,bcount.all); /* Read the current buffer */
}
- pc->actually_transferred+=bcount.all; /* Update the current position */
+ pc->actually_transferred += bcount.all; /* Update the current position */
pc->current_position+=bcount.all;
#if IDETAPE_DEBUG_LOG
if (tape->debug_level >= 2)
printk(KERN_INFO "ide-tape: [cmd %x] transferred %d bytes on that interrupt\n", pc->c[0], bcount.all);
#endif
- ide_set_handler (drive,&idetape_pc_intr,IDETAPE_WAIT_CMD,NULL); /* And set the interrupt handler again */
+ ide_set_handler (drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); /* And set the interrupt handler again */
return ide_started;
}
@@ -2178,7 +2232,7 @@
printk (KERN_ERR "ide-tape: Strange, packet command initiated yet DRQ isn't asserted\n");
return startstop;
}
- ireason.all=IN_BYTE (IDE_IREASON_REG);
+ ireason.all = IN_BYTE (IDE_IREASON_REG);
while (retries-- && (!ireason.b.cod || ireason.b.io)) {
printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while issuing a packet command, retrying\n");
udelay(100);
@@ -2203,7 +2257,7 @@
{
idetape_tape_t *tape = drive->driver_data;
idetape_bcount_reg_t bcount;
- int dma_ok=0;
+ int dma_ok = 0;
#if IDETAPE_DEBUG_BUGS
if (tape->pc->c[0] == IDETAPE_REQUEST_SENSE_CMD && pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) {
@@ -2212,8 +2266,8 @@
#endif /* IDETAPE_DEBUG_BUGS */
if (tape->failed_pc == NULL && pc->c[0] != IDETAPE_REQUEST_SENSE_CMD)
- tape->failed_pc=pc;
- tape->pc=pc; /* Set the current packet command */
+ tape->failed_pc = pc;
+ tape->pc = pc; /* Set the current packet command */
if (pc->retries > IDETAPE_MAX_PC_RETRIES || test_bit (PC_ABORT, &pc->flags)) {
/*
@@ -2223,24 +2277,25 @@
* example).
*/
if (!test_bit (PC_ABORT, &pc->flags)) {
- if (!(pc->c[0] == 0 && tape->sense_key == 2 && tape->asc == 4 && (tape->ascq == 1 || tape->ascq == 8))) {
+ if (!(pc->c[0] == IDETAPE_TEST_UNIT_READY_CMD && tape->sense_key == 2 &&
+ tape->asc == 4 && (tape->ascq == 1 || tape->ascq == 8))) {
printk (KERN_ERR "ide-tape: %s: I/O error, pc = %2x, key = %2x, asc = %2x, ascq = %2x\n",
tape->name, pc->c[0], tape->sense_key, tape->asc, tape->ascq);
- if (tape->onstream && pc->c[0] == 8 && tape->sense_key == 3 && tape->asc == 0x11) /* AJN-1: 11 should be 0x11 */
+ if (tape->onstream && pc->c[0] == IDETAPE_READ_CMD && tape->sense_key == 3 && tape->asc == 0x11) /* AJN-1: 11 should be 0x11 */
printk(KERN_ERR "ide-tape: %s: enabling read error recovery\n", tape->name);
}
pc->error = IDETAPE_ERROR_GENERAL; /* Giving up */
}
- tape->failed_pc=NULL;
+ tape->failed_pc = NULL;
return pc->callback(drive);
}
#if IDETAPE_DEBUG_LOG
if (tape->debug_level >= 2)
- printk (KERN_INFO "ide-tape: Retry number - %d\n",pc->retries);
+ printk (KERN_INFO "ide-tape: Retry number - %d\n", pc->retries);
#endif /* IDETAPE_DEBUG_LOG */
pc->retries++;
- pc->actually_transferred=0; /* We haven't transferred any data yet */
+ pc->actually_transferred = 0; /* We haven't transferred any data yet */
pc->current_position=pc->buffer;
bcount.all=pc->request_transfer; /* Request to transfer the entire buffer at once */
@@ -2250,15 +2305,15 @@
(void) HWIF(drive)->dmaproc(ide_dma_off, drive);
}
if (test_bit (PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma)
- dma_ok=!HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive);
+ dma_ok = !HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive);
#endif /* CONFIG_BLK_DEV_IDEDMA */
if (IDE_CONTROL_REG)
- OUT_BYTE (drive->ctl,IDE_CONTROL_REG);
- OUT_BYTE (dma_ok ? 1:0,IDE_FEATURE_REG); /* Use PIO/DMA */
- OUT_BYTE (bcount.b.high,IDE_BCOUNTH_REG);
- OUT_BYTE (bcount.b.low,IDE_BCOUNTL_REG);
- OUT_BYTE (drive->select.all,IDE_SELECT_REG);
+ OUT_BYTE (drive->ctl, IDE_CONTROL_REG);
+ OUT_BYTE (dma_ok ? 1 : 0, IDE_FEATURE_REG); /* Use PIO/DMA */
+ OUT_BYTE (bcount.b.high, IDE_BCOUNTH_REG);
+ OUT_BYTE (bcount.b.low, IDE_BCOUNTL_REG);
+ OUT_BYTE (drive->select.all, IDE_SELECT_REG);
#ifdef CONFIG_BLK_DEV_IDEDMA
if (dma_ok) { /* Begin DMA, if necessary */
set_bit (PC_DMA_IN_PROGRESS, &pc->flags);
@@ -2287,7 +2342,7 @@
printk (KERN_INFO "ide-tape: Reached idetape_pc_callback\n");
#endif /* IDETAPE_DEBUG_LOG */
- idetape_end_request (tape->pc->error ? 0:1, HWGROUP(drive));
+ idetape_end_request (tape->pc->error ? 0 : 1, HWGROUP(drive));
return ide_stopped;
}
@@ -2333,7 +2388,7 @@
if (tape->debug_level >= 1)
printk(KERN_INFO "ide-tape: buffer fill callback, %d/%d\n", tape->cur_frames, tape->max_frames);
#endif
- idetape_end_request (tape->pc->error ? 0:1, HWGROUP(drive));
+ idetape_end_request (tape->pc->error ? 0 : 1, HWGROUP(drive));
return ide_stopped;
}
@@ -2344,7 +2399,7 @@
pc = idetape_next_pc_storage (drive);
rq = idetape_next_rq_storage (drive);
- idetape_create_mode_sense_cmd (pc, 0x33);
+ idetape_create_mode_sense_cmd (pc, IDETAPE_BUFFER_FILLING_PAGE);
pc->callback = idetape_onstream_buffer_fill_callback;
idetape_queue_pc_head (drive, pc, rq);
}
@@ -2564,7 +2619,7 @@
* We do not support buffer cache originated requests.
*/
printk (KERN_NOTICE "ide-tape: %s: Unsupported command in request queue (%d)\n", drive->name, rq->cmd);
- ide_end_request (0,HWGROUP (drive)); /* Let the common code handle it */
+ ide_end_request (0, HWGROUP (drive)); /* Let the common code handle it */
return ide_stopped;
}
@@ -2578,7 +2633,7 @@
if (postponed_rq != NULL)
if (rq != postponed_rq) {
printk (KERN_ERR "ide-tape: ide-tape.c bug - Two DSC requests were queued\n");
- idetape_end_request (0,HWGROUP (drive));
+ idetape_end_request (0, HWGROUP (drive));
return ide_stopped;
}
#endif /* IDETAPE_DEBUG_BUGS */
@@ -2624,8 +2679,15 @@
tape->insert_speed = tape->insert_size / 1024 * HZ / (jiffies - tape->insert_time);
calculate_speeds(drive);
if (tape->onstream && tape->max_frames &&
- ((rq->cmd == IDETAPE_WRITE_RQ && (tape->cur_frames == tape->max_frames || (tape->speed_control && tape->cur_frames > 5 && (tape->insert_speed > tape->max_insert_speed || (0 /* tape->cur_frames > 30 && tape->tape_still_time > 200 */))))) ||
- (rq->cmd == IDETAPE_READ_RQ && (tape->cur_frames == 0 || (tape->speed_control && (tape->cur_frames < tape->max_frames - 5) && tape->insert_speed > tape->max_insert_speed)) && rq->nr_sectors))) {
+ ((rq->cmd == IDETAPE_WRITE_RQ &&
+ ( tape->cur_frames == tape->max_frames ||
+ ( tape->speed_control && tape->cur_frames > 5 &&
+ (tape->insert_speed > tape->max_insert_speed ||
+ (0 /* tape->cur_frames > 30 && tape->tape_still_time > 200 */) ) ) ) ) ||
+ (rq->cmd == IDETAPE_READ_RQ &&
+ ( tape->cur_frames == 0 ||
+ ( tape->speed_control && (tape->cur_frames < tape->max_frames - 5) &&
+ tape->insert_speed > tape->max_insert_speed ) ) && rq->nr_sectors) ) ) {
#if IDETAPE_DEBUG_LOG
if (tape->debug_level >= 4)
printk(KERN_INFO "ide-tape: postponing request, cmd %d, cur %d, max %d\n",
@@ -2672,7 +2734,7 @@
if (jiffies > tape->last_buffer_fill + 5 * HZ / 100)
tape->req_buffer_fill = 1;
}
- pc=idetape_next_pc_storage (drive);
+ pc = idetape_next_pc_storage (drive);
idetape_create_read_cmd (tape, pc, rq->current_nr_sectors, rq->bh);
break;
case IDETAPE_WRITE_RQ:
@@ -2689,12 +2751,12 @@
tape->req_buffer_fill = 1;
calculate_speeds(drive);
}
- pc=idetape_next_pc_storage (drive);
+ pc = idetape_next_pc_storage (drive);
idetape_create_write_cmd (tape, pc, rq->current_nr_sectors, rq->bh);
break;
case IDETAPE_READ_BUFFER_RQ:
tape->postpone_cnt = 0;
- pc=idetape_next_pc_storage (drive);
+ pc = idetape_next_pc_storage (drive);
idetape_create_read_buffer_cmd (tape, pc, rq->current_nr_sectors, rq->bh);
break;
case IDETAPE_ABORTED_WRITE_RQ:
@@ -2710,7 +2772,7 @@
idetape_end_request (IDETAPE_ERROR_EOD, HWGROUP(drive));
return ide_stopped;
case IDETAPE_PC_RQ1:
- pc=(idetape_pc_t *) rq->buffer;
+ pc = (idetape_pc_t *) rq->buffer;
rq->cmd = IDETAPE_PC_RQ2;
break;
case IDETAPE_PC_RQ2:
@@ -2718,7 +2780,7 @@
return ide_stopped;
default:
printk (KERN_ERR "ide-tape: bug in IDETAPE_RQ_CMD macro\n");
- idetape_end_request (0,HWGROUP (drive));
+ idetape_end_request (0, HWGROUP (drive));
return ide_stopped;
}
return idetape_issue_packet_command (drive, pc);
@@ -2844,7 +2906,9 @@
#endif /* IDETAPE_DEBUG_BUGS */
count = IDE_MIN (bh->b_size - atomic_read(&bh->b_count), n);
copy_from_user (bh->b_data + atomic_read(&bh->b_count), buf, count);
- n -= count; atomic_add(count, &bh->b_count); buf += count;
+ n -= count;
+ atomic_add(count, &bh->b_count);
+ buf += count;
if (atomic_read(&bh->b_count) == bh->b_size) {
bh = bh->b_reqnext;
if (bh)
@@ -2868,7 +2932,10 @@
#endif /* IDETAPE_DEBUG_BUGS */
count = IDE_MIN (tape->b_count, n);
copy_to_user (buf, tape->b_data, count);
- n -= count; tape->b_data += count; tape->b_count -= count; buf += count;
+ n -= count;
+ tape->b_data += count;
+ tape->b_count -= count;
+ buf += count;
if (!tape->b_count) {
tape->bh = bh = bh->b_reqnext;
if (bh) {
@@ -2920,10 +2987,10 @@
if (tape->last_stage != NULL)
tape->last_stage->next=stage;
else
- tape->first_stage=tape->next_stage=stage;
- tape->last_stage=stage;
+ tape->first_stage = tape->next_stage=stage;
+ tape->last_stage = stage;
if (tape->next_stage == NULL)
- tape->next_stage=tape->last_stage;
+ tape->next_stage = tape->last_stage;
tape->nr_stages++;
tape->nr_pending_stages++;
spin_unlock_irqrestore(&tape->spinlock, flags);
@@ -2953,26 +3020,21 @@
par->par_desc_ver = OS_PARTITION_VERSION;
par->wrt_pass_cntr = htons(0xffff);
par->first_frame_addr = htonl(0);
- par->last_frame_addr = htonl(0xbb7);
+ par->last_frame_addr = htonl(0xbb7); /* 2999 */
+ aux->frame_seq_num = htonl(0);
+ aux->logical_blk_num_high = htonl(0);
+ aux->logical_blk_num = htonl(0);
+ aux->next_mark_addr = htonl(tape->first_mark_addr);
} else {
aux->update_frame_cntr = htonl(0);
par->partition_num = OS_DATA_PARTITION;
par->par_desc_ver = OS_PARTITION_VERSION;
par->wrt_pass_cntr = htons(tape->wrt_pass_cntr);
- par->first_frame_addr = htonl(0x14);
- par->last_frame_addr = htonl(19239 * 24);
- }
- if (frame_type != OS_FRAME_TYPE_HEADER) {
+ par->first_frame_addr = htonl(OS_DATA_STARTFRAME1);
+ par->last_frame_addr = htonl(tape->capacity);
aux->frame_seq_num = htonl(logical_blk_num);
aux->logical_blk_num_high = htonl(0);
aux->logical_blk_num = htonl(logical_blk_num);
- } else {
- aux->frame_seq_num = htonl(0);
- aux->logical_blk_num_high = htonl(0);
- aux->logical_blk_num = htonl(0);
- }
-
- if (frame_type != OS_FRAME_TYPE_HEADER) {
dat->dat_sz = 8;
dat->reserved1 = 0;
dat->entry_cnt = 1;
@@ -2987,11 +3049,10 @@
else
dat->dat_list[0].flags = OS_DAT_FLAGS_DATA;
dat->dat_list[0].reserved = 0;
- } else
- aux->next_mark_addr = htonl(tape->first_mark_addr);
- aux->filemark_cnt = ntohl(tape->filemark_cnt);
- aux->phys_fm = ntohl(0xffffffff);
- aux->last_mark_addr = ntohl(tape->last_mark_addr);
+ }
+ aux->filemark_cnt = ntohl(tape->filemark_cnt); /* shouldn't this be htonl ?? */
+ aux->phys_fm = ntohl(0xffffffff); /* shouldn't this be htonl ?? */
+ aux->last_mark_addr = ntohl(tape->last_mark_addr); /* shouldn't this be htonl ?? */
}
/*
@@ -3042,7 +3103,7 @@
if (result->bpu) {
printk (KERN_INFO "ide-tape: Block location is unknown to the tape\n");
clear_bit (IDETAPE_ADDRESS_VALID, &tape->flags);
- idetape_end_request (0,HWGROUP (drive));
+ idetape_end_request (0, HWGROUP (drive));
} else {
#if IDETAPE_DEBUG_LOG
if (tape->debug_level >= 2)
@@ -3053,10 +3114,10 @@
tape->last_frame_position = ntohl (result->last_block);
tape->blocks_in_buffer = result->blocks_in_buffer[2];
set_bit (IDETAPE_ADDRESS_VALID, &tape->flags);
- idetape_end_request (1,HWGROUP (drive));
+ idetape_end_request (1, HWGROUP (drive));
}
} else {
- idetape_end_request (0,HWGROUP (drive));
+ idetape_end_request (0, HWGROUP (drive));
}
return ide_stopped;
}
@@ -3076,8 +3137,8 @@
idetape_init_pc (pc);
pc->c[0] = IDETAPE_WRITE_FILEMARK_CMD;
if (tape->onstream)
- pc->c[1] = 1;
- pc->c[4] = write_filemark;
+ pc->c[1] = 1; /* Immed bit */
+ pc->c[4] = write_filemark; /* not used for OnStream ?? */
set_bit (PC_WAIT_FOR_DSC, &pc->flags);
pc->callback = &idetape_pc_callback;
}
@@ -3109,7 +3170,7 @@
* the request to the request list without waiting for it to be serviced !
* In that case, we usually use idetape_queue_pc_head.
*/
-static int __idetape_queue_pc_tail (ide_drive_t *drive,idetape_pc_t *pc)
+static int __idetape_queue_pc_tail (ide_drive_t *drive, idetape_pc_t *pc)
{
struct request rq;
@@ -3150,7 +3211,7 @@
return 0;
if (tape->sense_key == 2 && tape->asc == 4 && tape->ascq == 2) {
idetape_create_load_unload_cmd (drive, &pc, IDETAPE_LU_LOAD_MASK);
- __idetape_queue_pc_tail(drive,&pc);
+ __idetape_queue_pc_tail(drive, &pc);
idetape_create_test_unit_ready_cmd(&pc);
if (!__idetape_queue_pc_tail(drive, &pc))
return 0;
@@ -3169,7 +3230,8 @@
int rc;
rc = __idetape_queue_pc_tail(drive, pc);
- if (rc) return rc;
+ if (rc)
+ return rc;
if (tape->onstream && test_bit(PC_WAIT_FOR_DSC, &pc->flags))
rc = idetape_wait_ready(drive, 60 * 10 * HZ); /* AJN-4: Changed from 5 to 10 minutes;
because retension takes approx. 8:20 with Onstream 30GB tape */
@@ -3182,7 +3244,7 @@
int rc;
idetape_create_write_filemark_cmd(drive, &pc, 0);
- if ((rc = idetape_queue_pc_tail (drive,&pc)))
+ if ((rc = idetape_queue_pc_tail (drive, &pc)))
return rc;
idetape_wait_ready(drive, 60 * 5 * HZ);
return 0;
@@ -3206,7 +3268,7 @@
idetape_flush_tape_buffers(drive);
#endif
idetape_create_read_position_cmd(&pc);
- if (idetape_queue_pc_tail (drive,&pc))
+ if (idetape_queue_pc_tail (drive, &pc))
return -1;
position = tape->first_frame_position;
#ifdef NO_LONGER_REQUIRED
@@ -3231,12 +3293,17 @@
idetape_init_pc (pc);
pc->c[0] = IDETAPE_LOCATE_CMD;
if (tape->onstream)
- pc->c[1] = 1;
+ pc->c[1] = 1; /* Immediate bit */
else
pc->c[1] = 2;
put_unaligned (htonl (block), (unsigned int *) &pc->c[3]);
pc->c[8] = partition;
if (tape->onstream)
+ /*
+ * Set SKIP bit.
+ * In case of write error this will write buffered
+ * data in the drive to this new position!
+ */
pc->c[9] = skip << 7;
set_bit (PC_WAIT_FOR_DSC, &pc->flags);
pc->callback = &idetape_pc_callback;
@@ -3307,11 +3374,12 @@
__idetape_discard_read_pipeline(drive);
idetape_wait_ready(drive, 60 * 5 * HZ);
idetape_create_locate_cmd (drive, &pc, block, partition, skip);
- retval=idetape_queue_pc_tail (drive,&pc);
- if (retval) return (retval);
+ retval = idetape_queue_pc_tail (drive, &pc);
+ if (retval)
+ return (retval);
idetape_create_read_position_cmd (&pc);
- return (idetape_queue_pc_tail (drive,&pc));
+ return (idetape_queue_pc_tail (drive, &pc));
}
static void idetape_discard_read_pipeline (ide_drive_t *drive, int restore_position)
@@ -3339,7 +3407,7 @@
{
idetape_pc_t pc;
- idetape_create_mode_sense_cmd (&pc, 0x33);
+ idetape_create_mode_sense_cmd (&pc, IDETAPE_BUFFER_FILLING_PAGE);
pc.callback = idetape_onstream_buffer_fill_callback;
(void) idetape_queue_pc_tail(drive, &pc);
}
@@ -3447,33 +3515,41 @@
idetape_tape_t *tape = drive->driver_data;
unsigned int block;
- if (tape->onstream_write_error == 1) {
- printk(KERN_ERR "ide-tape: %s: detected physical bad block at %u\n", tape->name, ntohl(tape->sense.information));
- block = ntohl(tape->sense.information) + 80;
+ if (tape->onstream_write_error == OS_WRITE_ERROR) {
+ printk(KERN_ERR "ide-tape: %s: onstream_write_error_recovery: detected physical bad block at %u, logical %u first frame %u last_frame %u bufblocks %u stages %u skipping %u frames\n",
+ tape->name, ntohl(tape->sense.information), tape->logical_blk_num,
+ tape->first_frame_position, tape->last_frame_position,
+ tape->blocks_in_buffer, tape->nr_stages,
+ (ntohl(tape->sense.command_specific) >> 16) & 0xff );
+ block = ntohl(tape->sense.information) + ((ntohl(tape->sense.command_specific) >> 16) & 0xff);
idetape_update_stats(drive);
printk(KERN_ERR "ide-tape: %s: relocating %d buffered logical blocks to physical block %u\n", tape->name, tape->cur_frames, block);
+#if 0 /* isn't once enough ??? MM */
idetape_update_stats(drive);
+#endif
if (tape->firmware_revision_num >= 106)
idetape_position_tape(drive, block, 0, 1);
else {
idetape_onstream_read_back_buffer(drive);
idetape_position_tape(drive, block, 0, 0);
}
+#if 0 /* already done in idetape_position_tape MM */
idetape_read_position(drive);
+#endif
#if ONSTREAM_DEBUG
if (tape->debug_level >= 1)
printk(KERN_ERR "ide-tape: %s: positioning complete, cur_frames %d, pos %d, tape pos %d\n", tape->name, tape->cur_frames, tape->first_frame_position, tape->last_frame_position);
#endif
- } else if (tape->onstream_write_error == 2) {
+ } else if (tape->onstream_write_error == OS_PART_ERROR) {
#if ONSTREAM_DEBUG
if (tape->debug_level >= 1)
printk(KERN_INFO "ide-tape: %s: skipping over config partition\n", tape->name);
#endif
idetape_flush_tape_buffers(drive);
block = idetape_read_position(drive);
- if (block != 0xba4)
- printk(KERN_ERR "ide-tape: warning, current position %d, expected %d\n", block, 0xba4);
- idetape_position_tape(drive, 0xbb8, 0, 0);
+ if (block != OS_DATA_ENDFRAME1)
+ printk(KERN_ERR "ide-tape: warning, current position %d, expected %d\n", block, OS_DATA_ENDFRAME1);
+ idetape_position_tape(drive, 0xbb8, 0, 0); /* 3000 */
}
tape->onstream_write_error = 0;
}
@@ -3572,48 +3648,48 @@
return 1;
}
if (rq->errors == IDETAPE_ERROR_GENERAL) {
- printk(KERN_INFO "ide-tape: %s: skipping frame, read error\n", tape->name);
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, read error\n", tape->name, tape->first_frame_position);
return 0;
}
if (rq->errors == IDETAPE_ERROR_EOD) {
- printk(KERN_INFO "ide-tape: %s: skipping frame, eod\n", tape->name);
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, eod\n", tape->name, tape->first_frame_position);
return 0;
}
if (ntohl(aux->format_id) != 0) {
- printk(KERN_INFO "ide-tape: %s: skipping frame, format_id %u\n", tape->name, ntohl(aux->format_id));
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, format_id %u\n", tape->name, tape->first_frame_position, ntohl(aux->format_id));
return 0;
}
if (memcmp(aux->application_sig, tape->application_sig, 4) != 0) {
- printk(KERN_INFO "ide-tape: %s: skipping frame, incorrect application signature\n", tape->name);
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, incorrect application signature\n", tape->name, tape->first_frame_position);
return 0;
}
if (aux->frame_type != OS_FRAME_TYPE_DATA &&
aux->frame_type != OS_FRAME_TYPE_EOD &&
aux->frame_type != OS_FRAME_TYPE_MARKER) {
- printk(KERN_INFO "ide-tape: %s: skipping frame, frame type %x\n", tape->name, aux->frame_type);
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, frame type %x\n", tape->name, tape->first_frame_position, aux->frame_type);
return 0;
}
if (par->partition_num != OS_DATA_PARTITION) {
if (!tape->linux_media || tape->linux_media_version != 2) {
- printk(KERN_INFO "ide-tape: %s: skipping frame, partition num %d\n", tape->name, par->partition_num);
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, partition num %d\n", tape->name, tape->first_frame_position, par->partition_num);
return 0;
}
}
if (par->par_desc_ver != OS_PARTITION_VERSION) {
- printk(KERN_INFO "ide-tape: %s: skipping frame, partition version %d\n", tape->name, par->par_desc_ver);
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, partition version %d\n", tape->name, tape->first_frame_position, par->par_desc_ver);
return 0;
}
if (ntohs(par->wrt_pass_cntr) != tape->wrt_pass_cntr) {
- printk(KERN_INFO "ide-tape: %s: skipping frame, wrt_pass_cntr %d (expected %d)(logical_blk_num %u)\n", tape->name, ntohs(par->wrt_pass_cntr), tape->wrt_pass_cntr, ntohl(aux->logical_blk_num));
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, wrt_pass_cntr %d (expected %d)(logical_blk_num %u)\n", tape->name, tape->first_frame_position, ntohs(par->wrt_pass_cntr), tape->wrt_pass_cntr, ntohl(aux->logical_blk_num));
return 0;
}
if (aux->frame_seq_num != aux->logical_blk_num) {
- printk(KERN_INFO "ide-tape: %s: skipping frame, seq != logical\n", tape->name);
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, seq != logical\n", tape->name, tape->first_frame_position);
return 0;
}
if (logical_blk_num != -1 && ntohl(aux->logical_blk_num) != logical_blk_num) {
if (!quiet)
- printk(KERN_INFO "ide-tape: %s: skipping frame, logical_blk_num %u (expected %d)\n", tape->name, ntohl(aux->logical_blk_num), logical_blk_num);
+ printk(KERN_INFO "ide-tape: %s: skipping frame %d, logical_blk_num %u (expected %d)\n", tape->name, tape->first_frame_position, ntohl(aux->logical_blk_num), logical_blk_num);
return 0;
}
if (aux->frame_type == OS_FRAME_TYPE_MARKER) {
@@ -3689,7 +3765,7 @@
idetape_switch_buffers (tape, new_stage);
idetape_init_stage(drive, new_stage, OS_FRAME_TYPE_DATA, tape->logical_blk_num);
tape->logical_blk_num++;
- idetape_add_stage_tail (drive,new_stage);
+ idetape_add_stage_tail (drive, new_stage);
tape->pipeline_head++;
#if USE_IOTRACE
IO_trace(IO_IDETAPE_FIFO, tape->pipeline_head, tape->buffer_head, tape->tape_head, tape->minor);
@@ -3766,7 +3842,7 @@
}
#endif /* IDETAPE_DEBUG_BUGS */
if (tape->merge_stage_size) {
- blocks=tape->merge_stage_size/tape->tape_block_size;
+ blocks = tape->merge_stage_size / tape->tape_block_size;
if (tape->merge_stage_size % tape->tape_block_size) {
blocks++;
i = tape->tape_block_size - tape->merge_stage_size % tape->tape_block_size;
@@ -3797,7 +3873,7 @@
tape->merge_stage = NULL;
}
clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags);
- tape->chrdev_direction=idetape_direction_none;
+ tape->chrdev_direction = idetape_direction_none;
/*
* On the next backup, perform the feedback loop again.
@@ -3874,13 +3950,13 @@
rq.sector = tape->first_frame_position;
rq.nr_sectors = rq.current_nr_sectors = blocks;
if (!test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags) && tape->nr_stages <= max_stages) {
- new_stage=idetape_kmalloc_stage (tape);
+ new_stage = idetape_kmalloc_stage (tape);
while (new_stage != NULL) {
- new_stage->rq=rq;
- idetape_add_stage_tail (drive,new_stage);
+ new_stage->rq = rq;
+ idetape_add_stage_tail (drive, new_stage);
if (tape->nr_stages >= max_stages)
break;
- new_stage=idetape_kmalloc_stage (tape);
+ new_stage = idetape_kmalloc_stage (tape);
}
}
if (!idetape_pipeline_active(tape)) {
@@ -3922,16 +3998,23 @@
#endif
clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags);
position = idetape_read_position(drive);
+ printk(KERN_INFO "ide-tape: %s: blank block detected at %d\n", tape->name, position);
if (position >= 3000 && position < 3080)
- position += 32;
- if (position >= 2980 && position < 3000)
+ position += 32; /* Why is this check and number ??? MM */
+ if (position >= OS_DATA_ENDFRAME1 && position < 3000)
position = 3000;
else
+ /*
+ * compensate for write errors that generally skip 80 frames,
+ * expect around 20 read errors in a row...
+ */
position += 60;
- if (position >= 2980 && position < 3000)
+ if (position >= OS_DATA_ENDFRAME1 && position < 3000)
position = 3000;
- printk(KERN_INFO "ide-tape: %s: blank block detected, positioning tape to block %d\n", tape->name, position);
- idetape_position_tape(drive, position, 0, 1);
+ printk(KERN_INFO "ide-tape: %s: positioning tape to block %d\n", tape->name, position);
+ if (position == 3000) /* seems to be needed to correctly position at block 3000 MM */
+ idetape_position_tape(drive, 0, 0, 0);
+ idetape_position_tape(drive, position, 0, 0);
cnt += 40;
continue;
} else
@@ -4089,12 +4172,14 @@
#endif /* IDETAPE_DEBUG_LOG */
idetape_create_rewind_cmd (drive, &pc);
- retval=idetape_queue_pc_tail (drive,&pc);
- if (retval) return retval;
+ retval = idetape_queue_pc_tail (drive, &pc);
+ if (retval)
+ return retval;
idetape_create_read_position_cmd (&pc);
- retval = idetape_queue_pc_tail (drive,&pc);
- if (retval) return retval;
+ retval = idetape_queue_pc_tail (drive, &pc);
+ if (retval)
+ return retval;
tape->logical_blk_num = 0;
return 0;
}
@@ -4412,7 +4497,7 @@
switch (mt_op) {
case MTFSF:
idetape_create_space_cmd (&pc,mt_count-count,IDETAPE_SPACE_OVER_FILEMARK);
- return (idetape_queue_pc_tail (drive,&pc));
+ return (idetape_queue_pc_tail (drive, &pc));
case MTFSFM:
if (!tape->capabilities.sprev)
return (-EIO);
@@ -4423,7 +4508,7 @@
if (!tape->capabilities.sprev)
return (-EIO);
idetape_create_space_cmd (&pc,-(mt_count+count),IDETAPE_SPACE_OVER_FILEMARK);
- return (idetape_queue_pc_tail (drive,&pc));
+ return (idetape_queue_pc_tail (drive, &pc));
case MTBSFM:
if (!tape->capabilities.sprev)
return (-EIO);
@@ -4460,7 +4545,7 @@
struct inode *inode = file->f_dentry->d_inode;
ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
idetape_tape_t *tape = drive->driver_data;
- ssize_t bytes_read,temp,actually_read=0, rc;
+ ssize_t bytes_read,temp, actually_read = 0, rc;
if (ppos != &file->f_pos) {
/* "A request was outside the capabilities of the device." */
@@ -4482,28 +4567,32 @@
}
if ((rc = idetape_initiate_read(drive, tape->max_stages)) < 0)
return rc;
- if (count==0)
+ if (count == 0)
return (0);
if (tape->merge_stage_size) {
- actually_read=IDE_MIN (tape->merge_stage_size,count);
+ actually_read = IDE_MIN (tape->merge_stage_size, count);
idetape_copy_stage_to_user (tape, buf, tape->merge_stage, actually_read);
- buf += actually_read; tape->merge_stage_size -= actually_read; count-=actually_read;
+ buf += actually_read;
+ tape->merge_stage_size -= actually_read;
+ count -= actually_read;
}
while (count >= tape->stage_size) {
- bytes_read=idetape_add_chrdev_read_request (drive, tape->capabilities.ctl);
+ bytes_read = idetape_add_chrdev_read_request (drive, tape->capabilities.ctl);
if (bytes_read <= 0)
goto finish;
idetape_copy_stage_to_user (tape, buf, tape->merge_stage, bytes_read);
- buf += bytes_read; count -= bytes_read; actually_read += bytes_read;
+ buf += bytes_read;
+ count -= bytes_read;
+ actually_read += bytes_read;
}
if (count) {
bytes_read=idetape_add_chrdev_read_request (drive, tape->capabilities.ctl);
if (bytes_read <= 0)
goto finish;
- temp=IDE_MIN (count,bytes_read);
+ temp = IDE_MIN (count, bytes_read);
idetape_copy_stage_to_user (tape, buf, tape->merge_stage, temp);
- actually_read+=temp;
- tape->merge_stage_size=bytes_read-temp;
+ actually_read += temp;
+ tape->merge_stage_size = bytes_read-temp;
}
finish:
if (!actually_read && test_bit (IDETAPE_FILEMARK, &tape->flags)) {
@@ -4515,7 +4604,8 @@
return 0;
}
if (tape->onstream && !actually_read && test_and_clear_bit(IDETAPE_READ_ERROR, &tape->flags)) {
- printk(KERN_ERR "ide-tape: %s: unrecovered read error on logical block number %d, skipping\n", tape->name, tape->logical_blk_num);
+ printk(KERN_ERR "ide-tape: %s: unrecovered read error on logical block number %d, skipping\n",
+ tape->name, tape->logical_blk_num);
tape->logical_blk_num++;
return -EIO;
}
@@ -4576,6 +4666,37 @@
return;
}
+static void idetape_write_filler (ide_drive_t *drive, int block, int cnt)
+{
+ idetape_tape_t *tape = drive->driver_data;
+ idetape_stage_t *stage;
+ int rc;
+
+ if (!tape->onstream || tape->raw)
+ return;
+ stage = __idetape_kmalloc_stage(tape, 1, 1);
+ if (stage == NULL)
+ return;
+ idetape_init_stage(drive, stage, OS_FRAME_TYPE_FILL, 0);
+ idetape_wait_ready(drive, 60 * 5 * HZ);
+ rc = idetape_position_tape(drive, block, 0, 0);
+#if ONSTREAM_DEBUG
+ printk(KERN_INFO "write_filler: positioning failed it returned %d\n", rc);
+#endif
+ if (rc != 0)
+ return; /* don't write fillers if we cannot position the tape. */
+
+ strcpy(stage->bh->b_data, "Filler");
+ while (cnt--) {
+ if (!idetape_queue_rw_tail (drive, IDETAPE_WRITE_RQ, 1, stage->bh)) {
+ printk(KERN_INFO "ide-tape: %s: write_filler: couldn't write header frame\n", tape->name);
+ __idetape_kfree_stage (stage);
+ return;
+ }
+ }
+ __idetape_kfree_stage (stage);
+}
+
static void __idetape_write_header (ide_drive_t *drive, int block, int cnt)
{
idetape_tape_t *tape = drive->driver_data;
@@ -4591,12 +4712,12 @@
memset(&header, 0, sizeof(header));
strcpy(header.ident_str, "ADR_SEQ");
header.major_rev = 1;
- header.minor_rev = 2;
+ header.minor_rev = OS_ADR_MINREV;
header.par_num = 1;
header.partition.partition_num = OS_DATA_PARTITION;
header.partition.par_desc_ver = OS_PARTITION_VERSION;
- header.partition.first_frame_addr = htonl(0x14);
- header.partition.last_frame_addr = htonl(19239 * 24);
+ header.partition.first_frame_addr = htonl(OS_DATA_STARTFRAME1);
+ header.partition.last_frame_addr = htonl(tape->capacity);
header.partition.wrt_pass_cntr = htons(tape->wrt_pass_cntr);
header.partition.eod_frame_addr = htonl(tape->eod_frame_addr);
memcpy(stage->bh->b_data, &header, sizeof(header));
@@ -4623,7 +4744,7 @@
return;
tape->update_frame_cntr++;
__idetape_write_header(drive, 5, 5);
- __idetape_write_header(drive, 0xbae, 5);
+ __idetape_write_header(drive, 0xbae, 5); /* 2990 */
if (locate_eod) {
#if ONSTREAM_DEBUG
if (tape->debug_level >= 2)
@@ -4639,22 +4760,39 @@
struct inode *inode = file->f_dentry->d_inode;
ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
idetape_tape_t *tape = drive->driver_data;
- ssize_t retval,actually_written=0;
+ ssize_t retval, actually_written = 0;
int position;
if (ppos != &file->f_pos) {
/* "A request was outside the capabilities of the device." */
return -ENXIO;
}
- if (tape->onstream && (count != tape->tape_block_size)) {
- printk(KERN_ERR "ide-tape: %s: use %d bytes as block size (%Zd used)\n", tape->name, tape->tape_block_size, count);
- return -EINVAL;
- }
+
#if IDETAPE_DEBUG_LOG
if (tape->debug_level >= 3)
printk (KERN_INFO "ide-tape: Reached idetape_chrdev_write, count %Zd\n", count);
#endif /* IDETAPE_DEBUG_LOG */
+ if (tape->onstream) {
+ if (count != tape->tape_block_size) {
+ printk(KERN_ERR "ide-tape: %s: chrdev_write: use %d bytes as block size (%d used)\n",
+ tape->name, tape->tape_block_size, count);
+ return -EINVAL;
+ }
+ /*
+ * Check if we reach the end of the tape. Just assume the whole pipeline
+ * is filled with write requests!
+ */
+ if (tape->first_frame_position + tape->nr_stages >= tape->capacity - OS_EW) {
+#if ONSTREAM_DEBUG
+ printk(KERN_INFO, "chrdev_write: Write truncated at EOM early warning");
+#endif
+ if (tape->chrdev_direction == idetape_direction_write)
+ idetape_write_release(inode);
+ return -ENOSPC;
+ }
+ }
+
if (tape->chrdev_direction != idetape_direction_write) { /* Initialize write operation */
if (tape->chrdev_direction == idetape_direction_read)
idetape_discard_read_pipeline (drive, 1);
@@ -4671,17 +4809,17 @@
if (tape->onstream) {
position = idetape_read_position(drive);
- if (position <= 20) {
+ if (position <= OS_DATA_STARTFRAME1) {
tape->logical_blk_num = 0;
tape->wrt_pass_cntr++;
#if ONSTREAM_DEBUG
if (tape->debug_level >= 2)
- printk(KERN_INFO "ide-tape: %s: logical block num 0, setting eod to 20\n", tape->name);
+ printk(KERN_INFO "ide-tape: %s: logical block num 0, setting eod to %d\n", tape->name, OS_DATA_STARTFRAME1);
if (tape->debug_level >= 2)
printk(KERN_INFO "ide-tape: %s: allocating new write pass counter %d\n", tape->name, tape->wrt_pass_cntr);
#endif
tape->filemark_cnt = 0;
- tape->eod_frame_addr = 20;
+ tape->eod_frame_addr = OS_DATA_STARTFRAME1;
tape->first_mark_addr = tape->last_mark_addr = -1;
idetape_write_header(drive, 1);
}
@@ -4715,7 +4853,7 @@
printk("ide-tape: first_frame_position %d\n", tape->first_frame_position);
#endif
}
- if (count==0)
+ if (count == 0)
return (0);
if (tape->restart_speed_control_req)
idetape_restart_speed_control(drive);
@@ -4723,32 +4861,35 @@
#if IDETAPE_DEBUG_BUGS
if (tape->merge_stage_size >= tape->stage_size) {
printk (KERN_ERR "ide-tape: bug: merge buffer too big\n");
- tape->merge_stage_size=0;
+ tape->merge_stage_size = 0;
}
#endif /* IDETAPE_DEBUG_BUGS */
- actually_written=IDE_MIN (tape->stage_size-tape->merge_stage_size,count);
+ actually_written = IDE_MIN (tape->stage_size - tape->merge_stage_size, count);
idetape_copy_stage_from_user (tape, tape->merge_stage, buf, actually_written);
- buf+=actually_written;tape->merge_stage_size+=actually_written;count-=actually_written;
+ buf += actually_written;
+ tape->merge_stage_size += actually_written;
+ count -= actually_written;
if (tape->merge_stage_size == tape->stage_size) {
tape->merge_stage_size = 0;
- retval=idetape_add_chrdev_write_request (drive, tape->capabilities.ctl);
+ retval = idetape_add_chrdev_write_request (drive, tape->capabilities.ctl);
if (retval <= 0)
return (retval);
}
}
while (count >= tape->stage_size) {
idetape_copy_stage_from_user (tape, tape->merge_stage, buf, tape->stage_size);
- buf+=tape->stage_size;count-=tape->stage_size;
- retval=idetape_add_chrdev_write_request (drive, tape->capabilities.ctl);
- actually_written+=tape->stage_size;
+ buf += tape->stage_size;
+ count -= tape->stage_size;
+ retval = idetape_add_chrdev_write_request (drive, tape->capabilities.ctl);
+ actually_written += tape->stage_size;
if (retval <= 0)
return (retval);
}
if (count) {
actually_written+=count;
idetape_copy_stage_from_user (tape, tape->merge_stage, buf, count);
- tape->merge_stage_size+=count;
+ tape->merge_stage_size += count;
}
return (actually_written);
}
@@ -4760,8 +4901,8 @@
idetape_pc_t pc;
if (!tape->onstream) {
- idetape_create_write_filemark_cmd(drive, &pc,1); /* Write a filemark */
- if (idetape_queue_pc_tail (drive,&pc)) {
+ idetape_create_write_filemark_cmd(drive, &pc, 1); /* Write a filemark */
+ if (idetape_queue_pc_tail (drive, &pc)) {
printk (KERN_ERR "ide-tape: Couldn't write a filemark\n");
return -EIO;
}
@@ -4937,24 +5078,24 @@
if (idetape_rewind_tape(drive))
return -EIO;
if (tape->onstream && !tape->raw)
- return idetape_position_tape(drive, 20, 0, 0);
+ return idetape_position_tape(drive, OS_DATA_STARTFRAME1, 0, 0);
return 0;
case MTLOAD:
idetape_discard_read_pipeline (drive, 0);
idetape_create_load_unload_cmd (drive, &pc, IDETAPE_LU_LOAD_MASK);
- return (idetape_queue_pc_tail (drive,&pc));
+ return (idetape_queue_pc_tail (drive, &pc));
case MTUNLOAD:
case MTOFFL:
idetape_discard_read_pipeline (drive, 0);
idetape_create_load_unload_cmd (drive, &pc,!IDETAPE_LU_LOAD_MASK);
- return (idetape_queue_pc_tail (drive,&pc));
+ return (idetape_queue_pc_tail (drive, &pc));
case MTNOP:
idetape_discard_read_pipeline (drive, 0);
return (idetape_flush_tape_buffers (drive));
case MTRETEN:
idetape_discard_read_pipeline (drive, 0);
idetape_create_load_unload_cmd (drive, &pc,IDETAPE_LU_RETENSION_MASK | IDETAPE_LU_LOAD_MASK);
- return (idetape_queue_pc_tail (drive,&pc));
+ return (idetape_queue_pc_tail (drive, &pc));
case MTEOM:
if (tape->onstream) {
#if ONSTREAM_DEBUG
@@ -4968,24 +5109,30 @@
return -EIO;
return 0;
}
- idetape_create_space_cmd (&pc,0,IDETAPE_SPACE_TO_EOD);
- return (idetape_queue_pc_tail (drive,&pc));
+ idetape_create_space_cmd (&pc, 0, IDETAPE_SPACE_TO_EOD);
+ return (idetape_queue_pc_tail (drive, &pc));
case MTERASE:
if (tape->onstream) {
- tape->eod_frame_addr = 20;
+ tape->eod_frame_addr = OS_DATA_STARTFRAME1;
tape->logical_blk_num = 0;
tape->first_mark_addr = tape->last_mark_addr = -1;
idetape_position_tape(drive, tape->eod_frame_addr, 0, 0);
idetape_write_eod(drive);
idetape_flush_tape_buffers (drive);
idetape_write_header(drive, 0);
+ /*
+ * write filler frames to the unused frames...
+ * REMOVE WHEN going to LIN4 application type...
+ */
+ idetape_write_filler(drive, OS_DATA_STARTFRAME1 - 10, 10);
+ idetape_write_filler(drive, OS_DATA_ENDFRAME1, 10);
idetape_flush_tape_buffers (drive);
(void) idetape_rewind_tape (drive);
return 0;
}
(void) idetape_rewind_tape (drive);
idetape_create_erase_cmd (&pc);
- return (idetape_queue_pc_tail (drive,&pc));
+ return (idetape_queue_pc_tail (drive, &pc));
case MTSETBLK:
if (tape->onstream) {
if (mt_count != tape->tape_block_size) {
@@ -5028,14 +5175,14 @@
case MTLOCK:
if (!idetape_create_prevent_cmd(drive, &pc, 1))
return 0;
- retval = idetape_queue_pc_tail (drive,&pc);
+ retval = idetape_queue_pc_tail (drive, &pc);
if (retval) return retval;
tape->door_locked = DOOR_EXPLICITLY_LOCKED;
return 0;
case MTUNLOCK:
if (!idetape_create_prevent_cmd(drive, &pc, 0))
return 0;
- retval = idetape_queue_pc_tail (drive,&pc);
+ retval = idetape_queue_pc_tail (drive, &pc);
if (retval) return retval;
tape->door_locked = DOOR_UNLOCKED;
return 0;
@@ -5113,7 +5260,7 @@
mtget.mt_gstat |= GMT_ONLINE(0xffffffff);
if (tape->first_stage && tape->first_stage->aux->frame_type == OS_FRAME_TYPE_EOD)
mtget.mt_gstat |= GMT_EOD(0xffffffff);
- if (position <= 20)
+ if (position <= OS_DATA_STARTFRAME1)
mtget.mt_gstat |= GMT_BOT(0xffffffff);
}
if (copy_to_user ((char *) arg,(char *) &mtget, sizeof (struct mtget)))
@@ -5150,7 +5297,7 @@
tape->header_ok = tape->linux_media = 0;
tape->update_frame_cntr = 0;
tape->wrt_pass_cntr = 0;
- tape->eod_frame_addr = 20;
+ tape->eod_frame_addr = OS_DATA_STARTFRAME1;
tape->first_mark_addr = tape->last_mark_addr = -1;
stage = __idetape_kmalloc_stage (tape, 0, 0);
if (stage == NULL)
@@ -5172,8 +5319,8 @@
__idetape_kfree_stage (stage);
return 0;
}
- if (header->major_rev != 1 || (header->minor_rev != 1 && header->minor_rev != 2))
- printk(KERN_INFO "ide-tape: warning: revision %d.%d detected (1.1/1.2 supported)\n", header->major_rev, header->minor_rev);
+ if (header->major_rev != 1 || (header->minor_rev > OS_ADR_MINREV))
+ printk(KERN_INFO "ide-tape: warning: revision %d.%d detected (up to 1.%d supported)\n", header->major_rev, header->minor_rev, OS_ADR_MINREV);
if (header->par_num != 1)
printk(KERN_INFO "ide-tape: warning: %d partitions defined, only one supported\n", header->par_num);
tape->wrt_pass_cntr = ntohs(header->partition.wrt_pass_cntr);
@@ -5182,12 +5329,14 @@
tape->first_mark_addr = ntohl(aux->next_mark_addr);
tape->last_mark_addr = ntohl(aux->last_mark_addr);
tape->update_frame_cntr = ntohl(aux->update_frame_cntr);
- memcpy(tape->application_sig, aux->application_sig, 4); tape->application_sig[4] = 0;
+ memcpy(tape->application_sig, aux->application_sig, 4);
+ tape->application_sig[4] = 0;
if (memcmp(tape->application_sig, "LIN", 3) == 0) {
tape->linux_media = 1;
tape->linux_media_version = tape->application_sig[3] - '0';
if (tape->linux_media_version != 3)
- printk(KERN_INFO "ide-tape: %s: Linux media version %d detected (current 3)\n", tape->name, tape->linux_media_version);
+ printk(KERN_INFO "ide-tape: %s: Linux media version %d detected (current 3)\n",
+ tape->name, tape->linux_media_version);
} else {
printk(KERN_INFO "ide-tape: %s: non Linux media detected (%s)\n", tape->name, tape->application_sig);
tape->linux_media = 0;
@@ -5214,18 +5363,14 @@
for (block = 5; block < 10; block++)
if (__idetape_analyze_headers(drive, block))
goto ok;
-#if 0
- for (block = 0xbae; block < 0xbb8; block++)
-#else
- for (block = 0xbae; block < 0xbb3; block++)
-#endif
+ for (block = 0xbae; block < 0xbb3; block++) /* 2990 - 2994 */
if (__idetape_analyze_headers(drive, block))
goto ok;
printk(KERN_ERR "ide-tape: %s: failed to find valid ADRL header\n", tape->name);
return 0;
ok:
- if (position < 20)
- position = 20;
+ if (position < OS_DATA_STARTFRAME1)
+ position = OS_DATA_STARTFRAME1;
idetape_position_tape(drive, position, 0, 0);
tape->header_ok = 1;
return 1;
@@ -5251,6 +5396,7 @@
if (test_and_set_bit (IDETAPE_BUSY, &tape->flags))
return -EBUSY;
+ MOD_INC_USE_COUNT;
if (!tape->onstream) {
idetape_read_position(drive);
if (!test_bit (IDETAPE_ADDRESS_VALID, &tape->flags))
@@ -5263,18 +5409,22 @@
tape->tape_block_size = tape->stage_size = 32768;
tape->raw = 0;
}
+ idetape_onstream_mode_sense_tape_parameter_page(drive, tape->debug_level);
}
if (idetape_wait_ready(drive, 60 * HZ)) {
clear_bit(IDETAPE_BUSY, &tape->flags);
printk(KERN_ERR "ide-tape: %s: drive not ready\n", tape->name);
+ MOD_DEC_USE_COUNT;
return -EBUSY;
}
idetape_read_position(drive);
+ MOD_DEC_USE_COUNT;
clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags);
if (tape->chrdev_direction == idetape_direction_none) {
+ MOD_INC_USE_COUNT;
if (idetape_create_prevent_cmd(drive, &pc, 1)) {
- if (!idetape_queue_pc_tail (drive,&pc)) {
+ if (!idetape_queue_pc_tail (drive, &pc)) {
if (tape->door_locked != DOOR_EXPLICITLY_LOCKED)
tape->door_locked = DOOR_LOCKED;
}
@@ -5287,6 +5437,28 @@
return 0;
}
+static void idetape_write_release (struct inode *inode)
+{
+ ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
+ idetape_tape_t *tape = drive->driver_data;
+ unsigned int minor=MINOR (inode->i_rdev);
+
+ idetape_empty_write_pipeline (drive);
+ tape->merge_stage = __idetape_kmalloc_stage (tape, 1, 0);
+ if (tape->merge_stage != NULL) {
+ idetape_pad_zeros (drive, tape->tape_block_size * (tape->user_bs_factor - 1));
+ __idetape_kfree_stage (tape->merge_stage);
+ tape->merge_stage = NULL;
+ }
+ idetape_write_filemark(drive);
+ idetape_write_eod(drive);
+ idetape_flush_tape_buffers (drive);
+ idetape_write_header(drive, minor >= 128);
+ idetape_flush_tape_buffers (drive);
+
+ return;
+}
+
/*
* Our character device release function.
*/
@@ -5305,18 +5477,7 @@
#endif /* IDETAPE_DEBUG_LOG */
if (tape->chrdev_direction == idetape_direction_write) {
- idetape_empty_write_pipeline (drive);
- tape->merge_stage = __idetape_kmalloc_stage (tape, 1, 0);
- if (tape->merge_stage != NULL) {
- idetape_pad_zeros (drive, tape->tape_block_size * (tape->user_bs_factor - 1));
- __idetape_kfree_stage (tape->merge_stage);
- tape->merge_stage = NULL;
- }
- idetape_write_filemark(drive);
- idetape_write_eod(drive);
- idetape_flush_tape_buffers (drive);
- idetape_write_header(drive, minor >= 128);
- idetape_flush_tape_buffers (drive);
+ idetape_write_release(inode);
}
if (tape->chrdev_direction == idetape_direction_read) {
if (minor < 128)
@@ -5333,9 +5494,10 @@
if (tape->chrdev_direction == idetape_direction_none) {
if (tape->door_locked != DOOR_EXPLICITLY_LOCKED) {
if (idetape_create_prevent_cmd(drive, &pc, 0))
- if (!idetape_queue_pc_tail (drive,&pc))
+ if (!idetape_queue_pc_tail (drive, &pc))
tape->door_locked = DOOR_UNLOCKED;
}
+ MOD_DEC_USE_COUNT;
}
clear_bit (IDETAPE_BUSY, &tape->flags);
unlock_kernel();
@@ -5491,7 +5653,7 @@
pc.buffer[4 + 5] = vendor[3];
pc.buffer[4 + 6] = 0;
pc.buffer[4 + 7] = 0;
- if (idetape_queue_pc_tail (drive,&pc))
+ if (idetape_queue_pc_tail (drive, &pc))
printk (KERN_ERR "ide-tape: Couldn't set vendor name to %s\n", vendor);
}
@@ -5513,7 +5675,7 @@
pc.buffer[4 + 1] = 2;
pc.buffer[4 + 2] = 4;
pc.buffer[4 + 3] = retries;
- if (idetape_queue_pc_tail (drive,&pc))
+ if (idetape_queue_pc_tail (drive, &pc))
printk (KERN_ERR "ide-tape: Couldn't set retries to %d\n", retries);
}
#endif
@@ -5530,8 +5692,8 @@
/*
* Get the current block size from the block size mode page
*/
- idetape_create_mode_sense_cmd (&pc,IDETAPE_BLOCK_SIZE_PAGE);
- if (idetape_queue_pc_tail (drive,&pc))
+ idetape_create_mode_sense_cmd (&pc, IDETAPE_BLOCK_SIZE_PAGE);
+ if (idetape_queue_pc_tail (drive, &pc))
printk (KERN_ERR "ide-tape: can't get tape block size mode page\n");
header = (idetape_mode_parameter_header_t *) pc.buffer;
bs = (idetape_block_size_page_t *) (pc.buffer + sizeof(idetape_mode_parameter_header_t) + header->bdl);
@@ -5552,7 +5714,7 @@
bs->record32 = 0;
bs->record32_5 = 1;
idetape_create_mode_select_cmd(&pc, sizeof(*header) + sizeof(*bs));
- if (idetape_queue_pc_tail (drive,&pc))
+ if (idetape_queue_pc_tail (drive, &pc))
printk (KERN_ERR "ide-tape: Couldn't set tape block size mode page\n");
#if ONSTREAM_DEBUG
@@ -5575,7 +5737,7 @@
idetape_inquiry_result_t *inquiry;
idetape_create_inquiry_cmd(&pc);
- if (idetape_queue_pc_tail (drive,&pc)) {
+ if (idetape_queue_pc_tail (drive, &pc)) {
printk (KERN_ERR "ide-tape: %s: can't get INQUIRY results\n", tape->name);
return;
}
@@ -5618,6 +5780,34 @@
}
/*
+ * idetape_get_mode_sense_parameters asks the tape about its various
+ * parameters. This may work for other drives to???
+ */
+static void idetape_onstream_mode_sense_tape_parameter_page(ide_drive_t *drive, int debug)
+{
+ idetape_tape_t *tape = drive->driver_data;
+ idetape_pc_t pc;
+ idetape_mode_parameter_header_t *header;
+ onstream_tape_paramtr_page_t *prm;
+
+ idetape_create_mode_sense_cmd (&pc, IDETAPE_PARAMTR_PAGE);
+ if (idetape_queue_pc_tail (drive, &pc)) {
+ printk (KERN_ERR "ide-tape: Can't get tape parameters page - probably no tape inserted in onstream drive\n");
+ return;
+ }
+ header = (idetape_mode_parameter_header_t *) pc.buffer;
+ prm = (onstream_tape_paramtr_page_t *) (pc.buffer + sizeof(idetape_mode_parameter_header_t) + header->bdl);
+
+ tape->capacity = ntohs(prm->segtrk) * ntohs(prm->trks);
+ if (debug) {
+ printk (KERN_INFO "ide-tape: %s <-> %s: Tape length %dMB (%d frames/track, %d tracks = %d blocks, density: %dKbpi)\n",
+ drive->name, tape->name, tape->capacity/32, ntohs(prm->segtrk), ntohs(prm->trks), tape->capacity, prm->density);
+ }
+
+ return;
+}
+
+/*
* idetape_get_mode_sense_results asks the tape about its various
* parameters. In particular, we will adjust our data transfer buffer
* size to the recommended value as returned by the tape.
@@ -5629,8 +5819,8 @@
idetape_mode_parameter_header_t *header;
idetape_capabilities_page_t *capabilities;
- idetape_create_mode_sense_cmd (&pc,IDETAPE_CAPABILITIES_PAGE);
- if (idetape_queue_pc_tail (drive,&pc)) {
+ idetape_create_mode_sense_cmd (&pc, IDETAPE_CAPABILITIES_PAGE);
+ if (idetape_queue_pc_tail (drive, &pc)) {
printk (KERN_ERR "ide-tape: Can't get tape parameters - assuming some default values\n");
tape->tape_block_size = 512; tape->capabilities.ctl = 52;
tape->capabilities.speed = 450; tape->capabilities.buffer_size = 6 * 52;
@@ -5721,6 +5911,9 @@
ide_add_setting(drive, "tape_still_time",SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->tape_still_time, NULL);
ide_add_setting(drive, "max_insert_speed",SETTING_RW, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->max_insert_speed, NULL);
ide_add_setting(drive, "insert_size", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->insert_size, NULL);
+ ide_add_setting(drive, "capacity", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->capacity, NULL);
+ ide_add_setting(drive, "first_frame", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->first_frame_position, NULL);
+ ide_add_setting(drive, "logical_blk", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->logical_blk_num, NULL);
}
}
@@ -5747,7 +5940,7 @@
spin_lock_init(&tape->spinlock);
drive->driver_data = tape;
drive->ready_stat = 0; /* An ATAPI device ignores DRDY */
- if (strstr(drive->id->model, "OnStream DI-30"))
+ if (strstr(drive->id->model, "OnStream DI-"))
tape->onstream = 1;
drive->dsc_overlap = 1;
#ifdef CONFIG_BLK_DEV_IDEPCI
@@ -5778,8 +5971,10 @@
idetape_get_inquiry_results(drive);
idetape_get_mode_sense_results(drive);
- if (tape->onstream)
- idetape_configure_onstream(drive);
+ if (tape->onstream) {
+ idetape_onstream_mode_sense_tape_parameter_page(drive, 1);
+ idetape_configure_onstream(drive);
+ }
tape->user_bs_factor = 1;
tape->stage_size = tape->capabilities.ctl * tape->tape_block_size;
@@ -5867,8 +6062,8 @@
char *out = page;
int len;
- len = sprintf(out,"%s\n", tape->name);
- PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
+ len = sprintf(out, "%s\n", tape->name);
+ PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
}
static ide_proc_entry_t idetape_proc[] = {
@@ -5962,7 +6157,7 @@
continue;
}
if (drive->scsi) {
- if (strstr(drive->id->model, "OnStream DI-30")) {
+ if (strstr(drive->id->model, "OnStream DI-")) {
printk("ide-tape: ide-scsi emulation is not supported for %s.\n", drive->id->model);
} else {
printk("ide-tape: passing drive %s to ide-scsi emulation.\n", drive->name);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] improved IDE OnStream support for linux 2.4
2001-01-11 21:59 ` [PATCH] improved IDE OnStream support for linux 2.4 Marcel J.E. Mol
@ 2001-01-11 22:04 ` Andre Hedrick
0 siblings, 0 replies; 6+ messages in thread
From: Andre Hedrick @ 2001-01-11 22:04 UTC (permalink / raw)
To: Marcel J.E. Mol
Cc: Alan Cox, Linus Torvalds, linux-kernel, Jack Bombeeck,
Gadi Oxman, Willem Riede
Its cool with me...
On Thu, 11 Jan 2001, Marcel J.E. Mol wrote:
> Hi guys,
>
> Below is a patch to fix some problems in the OnStream tape drive support
> in ide-tape.c.
>
> - It implements Early Warning (e.g. retuns ENOSPC) for reaching end-of-tape.
> This fixes a real nasty problem when writing beyond end-of-tape, rendering
> the 'backup' more ore less useless.
> - Includes a workaround for a read error around block 3000.
> - The module use counts were gone allowing to remove the module while it was
> still busy.
> - Support for other IDE OnStream tape drives (e.g. DI-50).
> - A few cosmetic fixes to improve readability.
>
> Patch is against linux 2.4.0-prerelease.
>
> Andre: a patch for 2.2.18 is almost ready to be included in the ide patchset.
>
> -Marcel
> --
> ======-------- Marcel J.E. Mol MESA Consulting B.V.
> =======--------- ph. +31-(0)6-54724868 P.O. Box 112
> =======--------- marcel@mesa.nl 2630 AC Nootdorp
> __==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
> They couldn't think of a number, so they gave me a name!
> -- Rupert Hine http://www.ruperthine.com/
>
> --- linux/drivers/ide/ide-tape.c.org Wed Jan 3 00:13:40 2001
> +++ linux/drivers/ide/ide-tape.c Thu Jan 11 22:41:36 2001
> @@ -1,5 +1,5 @@
> /*
> - * linux/drivers/ide/ide-tape.c Version 1.16f Dec 15, 1999
> + * linux/drivers/ide/ide-tape.c Version 1.17 Jan, 2001
> *
> * Copyright (C) 1995 - 1999 Gadi Oxman <gadio@netvision.net.il>
> *
> @@ -274,6 +274,18 @@
> * this section correctly, a hypothetical and unwanted situation
> * is being described)
> * Ver 1.16f Dec 15 99 Change place of the secondary OnStream header frames.
> + * Ver 1.17 Nov 2000 / Jan 2001 Marcel Mol, marcel@mesa.nl
> + * - Add idetape_onstream_mode_sense_tape_parameter_page
> + * function to get tape capacity in frames: tape->capacity.
> + * - Add support for DI-50 drives( or any DI- drive).
> + * - 'workaround' for read error/blank block arround block 3000.
> + * - Implement Early warning for end of media for Onstream.
> + * - Cosmetic code changes for readability.
> + * - Idetape_position_tape should not use SKIP bit during
> + * Onstream read recovery.
> + * - Add capacity, logical_blk_num and first/last_frame_position
> + * to /proc/ide/hd?/settings.
> + * - Module use count was gone in the Linux 2.4 driver.
> *
> *
> * Here are some words from the first releases of hd.c, which are quoted
> @@ -384,7 +396,7 @@
> * sharing a (fast) ATA-2 disk with any (slow) new ATAPI device.
> */
>
> -#define IDETAPE_VERSION "1.16f"
> +#define IDETAPE_VERSION "1.17"
>
> #include <linux/config.h>
> #include <linux/module.h>
> @@ -421,7 +433,11 @@
> #define OS_CONFIG_PARTITION (0xff)
> #define OS_DATA_PARTITION (0)
> #define OS_PARTITION_VERSION (1)
> +#define OS_EW 300
> +#define OS_ADR_MINREV 2
>
> +#define OS_DATA_STARTFRAME1 20
> +#define OS_DATA_ENDFRAME1 2980
> /*
> * partition
> */
> @@ -512,12 +528,33 @@
> } os_header_t;
>
> /*
> + * OnStream Tape Parameters Page
> + */
> +typedef struct {
> + unsigned page_code :6; /* Page code - Should be 0x2b */
> + unsigned reserved1_6 :1;
> + unsigned ps :1;
> + __u8 reserved2;
> + __u8 density; /* kbpi */
> + __u8 reserved3,reserved4;
> + __u16 segtrk; /* segment of per track */
> + __u16 trks; /* tracks per tape */
> + __u8 reserved5,reserved6,reserved7,reserved8,reserved9,reserved10;
> +} onstream_tape_paramtr_page_t;
> +
> +/*
> * OnStream ADRL frame
> */
> #define OS_FRAME_SIZE (32 * 1024 + 512)
> #define OS_DATA_SIZE (32 * 1024)
> #define OS_AUX_SIZE (512)
>
> +/*
> + * internal error codes for onstream
> + */
> +#define OS_PART_ERROR 2
> +#define OS_WRITE_ERROR 1
> +
> #include <linux/mtio.h>
>
> /**************************** Tunable parameters *****************************/
> @@ -949,6 +986,7 @@
> int eod_frame_addr;
> unsigned long cmd_start_time;
> unsigned long max_cmd_time;
> + unsigned capacity;
>
> /*
> * Optimize the number of "buffer filling"
> @@ -1157,7 +1195,7 @@
> typedef union {
> unsigned all :8;
> struct {
> - unsigned dma :1; /* Using DMA of PIO */
> + unsigned dma :1; /* Using DMA or PIO */
> unsigned reserved321 :3; /* Reserved */
> unsigned reserved654 :3; /* Reserved (Tag Type) */
> unsigned reserved7 :1; /* Reserved */
> @@ -1287,7 +1325,9 @@
> * by ide-tape.
> */
> #define IDETAPE_CAPABILITIES_PAGE 0x2a
> +#define IDETAPE_PARAMTR_PAGE 0x2b /* onstream only */
> #define IDETAPE_BLOCK_SIZE_PAGE 0x30
> +#define IDETAPE_BUFFER_FILLING_PAGE 0x33
>
> /*
> * Mode Parameter Header for the MODE SENSE packet command
> @@ -1428,6 +1468,14 @@
> #endif /* IDETAPE_DEBUG_LOG_VERBOSE */
>
> /*
> + * Function declarations
> + *
> + */
> +static void idetape_onstream_mode_sense_tape_parameter_page(ide_drive_t *drive, int debug);
> +static int idetape_chrdev_release (struct inode *inode, struct file *filp);
> +static void idetape_write_release (struct inode *inode);
> +
> +/*
> * Too bad. The drive wants to send us data which we are not ready to accept.
> * Just throw it away.
> */
> @@ -1452,7 +1500,8 @@
> #endif /* IDETAPE_DEBUG_BUGS */
> count = IDE_MIN (bh->b_size - atomic_read(&bh->b_count), bcount);
> atapi_input_bytes (drive, bh->b_data + atomic_read(&bh->b_count), count);
> - bcount -= count; atomic_add(count, &bh->b_count);
> + bcount -= count;
> + atomic_add(count, &bh->b_count);
> if (atomic_read(&bh->b_count) == bh->b_size) {
> bh = bh->b_reqnext;
> if (bh)
> @@ -1476,7 +1525,9 @@
> #endif /* IDETAPE_DEBUG_BUGS */
> count = IDE_MIN (pc->b_count, bcount);
> atapi_output_bytes (drive, pc->b_data, count);
> - bcount -= count; pc->b_data += count; pc->b_count -= count;
> + bcount -= count;
> + pc->b_data += count;
> + pc->b_count -= count;
> if (!pc->b_count) {
> pc->bh = bh = bh->b_reqnext;
> if (bh) {
> @@ -1577,20 +1628,23 @@
> * to analyze the request sense. We currently do not utilize this
> * information.
> */
> -static void idetape_analyze_error (ide_drive_t *drive,idetape_request_sense_result_t *result)
> +static void idetape_analyze_error (ide_drive_t *drive, idetape_request_sense_result_t *result)
> {
> idetape_tape_t *tape = drive->driver_data;
> idetape_pc_t *pc = tape->failed_pc;
>
> - tape->sense = *result;
> - tape->sense_key = result->sense_key; tape->asc = result->asc; tape->ascq = result->ascq;
> + tape->sense = *result;
> + tape->sense_key = result->sense_key;
> + tape->asc = result->asc;
> + tape->ascq = result->ascq;
> #if IDETAPE_DEBUG_LOG
> /*
> * Without debugging, we only log an error if we decided to
> * give up retrying.
> */
> if (tape->debug_level >= 1)
> - printk (KERN_INFO "ide-tape: pc = %x, sense key = %x, asc = %x, ascq = %x\n",pc->c[0],result->sense_key,result->asc,result->ascq);
> + printk (KERN_INFO "ide-tape: pc = %x, sense key = %x, asc = %x, ascq = %x\n",
> + pc->c[0], result->sense_key, result->asc, result->ascq);
> #if IDETAPE_DEBUG_LOG_VERBOSE
> if (tape->debug_level >= 1)
> printk (KERN_INFO "ide-tape: pc = %s, sense key = %x, asc = %x, ascq = %x\n",
> @@ -1660,7 +1714,7 @@
> static void idetape_active_next_stage (ide_drive_t *drive)
> {
> idetape_tape_t *tape = drive->driver_data;
> - idetape_stage_t *stage=tape->next_stage;
> + idetape_stage_t *stage = tape->next_stage;
> struct request *rq = &stage->rq;
>
> #if IDETAPE_DEBUG_LOG
> @@ -1676,9 +1730,9 @@
>
> rq->buffer = NULL;
> rq->bh = stage->bh;
> - tape->active_data_request=rq;
> - tape->active_stage=stage;
> - tape->next_stage=stage->next;
> + tape->active_data_request = rq;
> + tape->active_stage = stage;
> + tape->next_stage = stage->next;
> }
>
> /*
> @@ -1756,12 +1810,12 @@
> return;
> }
> #endif /* IDETAPE_DEBUG_BUGS */
> - stage=tape->first_stage;
> - tape->first_stage=stage->next;
> + stage = tape->first_stage;
> + tape->first_stage = stage->next;
> idetape_kfree_stage (tape, stage);
> tape->nr_stages--;
> if (tape->first_stage == NULL) {
> - tape->last_stage=NULL;
> + tape->last_stage = NULL;
> #if IDETAPE_DEBUG_BUGS
> if (tape->next_stage != NULL)
> printk (KERN_ERR "ide-tape: bug: tape->next_stage != NULL\n");
> @@ -1821,12 +1875,12 @@
> }
> #endif
> if (tape->onstream && !tape->raw) {
> - if (tape->first_frame_position == 0xba4) {
> + if (tape->first_frame_position == OS_DATA_ENDFRAME1) {
> #if ONSTREAM_DEBUG
> - if (tape->debug_level >= 2)
> - printk("ide-tape: %s: skipping over config parition..\n", tape->name);
> + if (tape->debug_level >= 2)
> + printk("ide-tape: %s: skipping over config parition..\n", tape->name);
> #endif
> - tape->onstream_write_error = 2;
> + tape->onstream_write_error = OS_PART_ERROR;
> if (tape->sem)
> up(tape->sem);
> }
> @@ -1839,7 +1893,7 @@
> if (tape->onstream && !tape->raw && error == IDETAPE_ERROR_GENERAL && tape->sense.sense_key == 3) {
> clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags);
> printk(KERN_ERR "ide-tape: %s: write error, enabling error recovery\n", tape->name);
> - tape->onstream_write_error = 1;
> + tape->onstream_write_error = OS_WRITE_ERROR;
> remove_stage = 0;
> tape->nr_pending_stages++;
> tape->next_stage = tape->first_stage;
> @@ -1883,11 +1937,11 @@
> printk (KERN_INFO "ide-tape: Reached idetape_request_sense_callback\n");
> #endif /* IDETAPE_DEBUG_LOG */
> if (!tape->pc->error) {
> - idetape_analyze_error (drive,(idetape_request_sense_result_t *) tape->pc->buffer);
> - idetape_end_request (1,HWGROUP (drive));
> + idetape_analyze_error (drive, (idetape_request_sense_result_t *) tape->pc->buffer);
> + idetape_end_request (1, HWGROUP (drive));
> } else {
> printk (KERN_ERR "ide-tape: Error in REQUEST SENSE itself - Aborting request!\n");
> - idetape_end_request (0,HWGROUP (drive));
> + idetape_end_request (0, HWGROUP (drive));
> }
> return ide_stopped;
> }
> @@ -1980,7 +2034,7 @@
> idetape_status_reg_t status;
> idetape_bcount_reg_t bcount;
> idetape_ireason_reg_t ireason;
> - idetape_pc_t *pc=tape->pc;
> + idetape_pc_t *pc = tape->pc;
>
> unsigned int temp;
> unsigned long cmd_time;
> @@ -2011,7 +2065,7 @@
> */
> set_bit (PC_DMA_ERROR, &pc->flags);
> } else if (!status.b.check) {
> - pc->actually_transferred=pc->request_transfer;
> + pc->actually_transferred = pc->request_transfer;
> idetape_update_buffers (pc);
> }
> #if IDETAPE_DEBUG_LOG
> @@ -2064,7 +2118,7 @@
> return ide_stopped;
> }
> if (tape->failed_pc == pc)
> - tape->failed_pc=NULL;
> + tape->failed_pc = NULL;
> return pc->callback(drive); /* Command finished - Call the callback function */
> }
> #ifdef CONFIG_BLK_DEV_IDEDMA
> @@ -2075,9 +2129,9 @@
> return ide_do_reset (drive);
> }
> #endif /* CONFIG_BLK_DEV_IDEDMA */
> - bcount.b.high=IN_BYTE (IDE_BCOUNTH_REG); /* Get the number of bytes to transfer */
> - bcount.b.low=IN_BYTE (IDE_BCOUNTL_REG); /* on this interrupt */
> - ireason.all=IN_BYTE (IDE_IREASON_REG);
> + bcount.b.high = IN_BYTE (IDE_BCOUNTH_REG); /* Get the number of bytes to transfer */
> + bcount.b.low = IN_BYTE (IDE_BCOUNTL_REG); /* on this interrupt */
> + ireason.all = IN_BYTE (IDE_IREASON_REG);
>
> if (ireason.b.cod) {
> printk (KERN_ERR "ide-tape: CoD != 0 in idetape_pc_intr\n");
> @@ -2093,8 +2147,8 @@
> if ( temp > pc->request_transfer) {
> if (temp > pc->buffer_size) {
> printk (KERN_ERR "ide-tape: The tape wants to send us more data than expected - discarding data\n");
> - idetape_discard_data (drive,bcount.all);
> - ide_set_handler (drive,&idetape_pc_intr,IDETAPE_WAIT_CMD,NULL);
> + idetape_discard_data (drive, bcount.all);
> + ide_set_handler (drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL);
> return ide_started;
> }
> #if IDETAPE_DEBUG_LOG
> @@ -2114,13 +2168,13 @@
> else
> atapi_input_bytes (drive,pc->current_position,bcount.all); /* Read the current buffer */
> }
> - pc->actually_transferred+=bcount.all; /* Update the current position */
> + pc->actually_transferred += bcount.all; /* Update the current position */
> pc->current_position+=bcount.all;
> #if IDETAPE_DEBUG_LOG
> if (tape->debug_level >= 2)
> printk(KERN_INFO "ide-tape: [cmd %x] transferred %d bytes on that interrupt\n", pc->c[0], bcount.all);
> #endif
> - ide_set_handler (drive,&idetape_pc_intr,IDETAPE_WAIT_CMD,NULL); /* And set the interrupt handler again */
> + ide_set_handler (drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); /* And set the interrupt handler again */
> return ide_started;
> }
>
> @@ -2178,7 +2232,7 @@
> printk (KERN_ERR "ide-tape: Strange, packet command initiated yet DRQ isn't asserted\n");
> return startstop;
> }
> - ireason.all=IN_BYTE (IDE_IREASON_REG);
> + ireason.all = IN_BYTE (IDE_IREASON_REG);
> while (retries-- && (!ireason.b.cod || ireason.b.io)) {
> printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while issuing a packet command, retrying\n");
> udelay(100);
> @@ -2203,7 +2257,7 @@
> {
> idetape_tape_t *tape = drive->driver_data;
> idetape_bcount_reg_t bcount;
> - int dma_ok=0;
> + int dma_ok = 0;
>
> #if IDETAPE_DEBUG_BUGS
> if (tape->pc->c[0] == IDETAPE_REQUEST_SENSE_CMD && pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) {
> @@ -2212,8 +2266,8 @@
> #endif /* IDETAPE_DEBUG_BUGS */
>
> if (tape->failed_pc == NULL && pc->c[0] != IDETAPE_REQUEST_SENSE_CMD)
> - tape->failed_pc=pc;
> - tape->pc=pc; /* Set the current packet command */
> + tape->failed_pc = pc;
> + tape->pc = pc; /* Set the current packet command */
>
> if (pc->retries > IDETAPE_MAX_PC_RETRIES || test_bit (PC_ABORT, &pc->flags)) {
> /*
> @@ -2223,24 +2277,25 @@
> * example).
> */
> if (!test_bit (PC_ABORT, &pc->flags)) {
> - if (!(pc->c[0] == 0 && tape->sense_key == 2 && tape->asc == 4 && (tape->ascq == 1 || tape->ascq == 8))) {
> + if (!(pc->c[0] == IDETAPE_TEST_UNIT_READY_CMD && tape->sense_key == 2 &&
> + tape->asc == 4 && (tape->ascq == 1 || tape->ascq == 8))) {
> printk (KERN_ERR "ide-tape: %s: I/O error, pc = %2x, key = %2x, asc = %2x, ascq = %2x\n",
> tape->name, pc->c[0], tape->sense_key, tape->asc, tape->ascq);
> - if (tape->onstream && pc->c[0] == 8 && tape->sense_key == 3 && tape->asc == 0x11) /* AJN-1: 11 should be 0x11 */
> + if (tape->onstream && pc->c[0] == IDETAPE_READ_CMD && tape->sense_key == 3 && tape->asc == 0x11) /* AJN-1: 11 should be 0x11 */
> printk(KERN_ERR "ide-tape: %s: enabling read error recovery\n", tape->name);
> }
> pc->error = IDETAPE_ERROR_GENERAL; /* Giving up */
> }
> - tape->failed_pc=NULL;
> + tape->failed_pc = NULL;
> return pc->callback(drive);
> }
> #if IDETAPE_DEBUG_LOG
> if (tape->debug_level >= 2)
> - printk (KERN_INFO "ide-tape: Retry number - %d\n",pc->retries);
> + printk (KERN_INFO "ide-tape: Retry number - %d\n", pc->retries);
> #endif /* IDETAPE_DEBUG_LOG */
>
> pc->retries++;
> - pc->actually_transferred=0; /* We haven't transferred any data yet */
> + pc->actually_transferred = 0; /* We haven't transferred any data yet */
> pc->current_position=pc->buffer;
> bcount.all=pc->request_transfer; /* Request to transfer the entire buffer at once */
>
> @@ -2250,15 +2305,15 @@
> (void) HWIF(drive)->dmaproc(ide_dma_off, drive);
> }
> if (test_bit (PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma)
> - dma_ok=!HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive);
> + dma_ok = !HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive);
> #endif /* CONFIG_BLK_DEV_IDEDMA */
>
> if (IDE_CONTROL_REG)
> - OUT_BYTE (drive->ctl,IDE_CONTROL_REG);
> - OUT_BYTE (dma_ok ? 1:0,IDE_FEATURE_REG); /* Use PIO/DMA */
> - OUT_BYTE (bcount.b.high,IDE_BCOUNTH_REG);
> - OUT_BYTE (bcount.b.low,IDE_BCOUNTL_REG);
> - OUT_BYTE (drive->select.all,IDE_SELECT_REG);
> + OUT_BYTE (drive->ctl, IDE_CONTROL_REG);
> + OUT_BYTE (dma_ok ? 1 : 0, IDE_FEATURE_REG); /* Use PIO/DMA */
> + OUT_BYTE (bcount.b.high, IDE_BCOUNTH_REG);
> + OUT_BYTE (bcount.b.low, IDE_BCOUNTL_REG);
> + OUT_BYTE (drive->select.all, IDE_SELECT_REG);
> #ifdef CONFIG_BLK_DEV_IDEDMA
> if (dma_ok) { /* Begin DMA, if necessary */
> set_bit (PC_DMA_IN_PROGRESS, &pc->flags);
> @@ -2287,7 +2342,7 @@
> printk (KERN_INFO "ide-tape: Reached idetape_pc_callback\n");
> #endif /* IDETAPE_DEBUG_LOG */
>
> - idetape_end_request (tape->pc->error ? 0:1, HWGROUP(drive));
> + idetape_end_request (tape->pc->error ? 0 : 1, HWGROUP(drive));
> return ide_stopped;
> }
>
> @@ -2333,7 +2388,7 @@
> if (tape->debug_level >= 1)
> printk(KERN_INFO "ide-tape: buffer fill callback, %d/%d\n", tape->cur_frames, tape->max_frames);
> #endif
> - idetape_end_request (tape->pc->error ? 0:1, HWGROUP(drive));
> + idetape_end_request (tape->pc->error ? 0 : 1, HWGROUP(drive));
> return ide_stopped;
> }
>
> @@ -2344,7 +2399,7 @@
>
> pc = idetape_next_pc_storage (drive);
> rq = idetape_next_rq_storage (drive);
> - idetape_create_mode_sense_cmd (pc, 0x33);
> + idetape_create_mode_sense_cmd (pc, IDETAPE_BUFFER_FILLING_PAGE);
> pc->callback = idetape_onstream_buffer_fill_callback;
> idetape_queue_pc_head (drive, pc, rq);
> }
> @@ -2564,7 +2619,7 @@
> * We do not support buffer cache originated requests.
> */
> printk (KERN_NOTICE "ide-tape: %s: Unsupported command in request queue (%d)\n", drive->name, rq->cmd);
> - ide_end_request (0,HWGROUP (drive)); /* Let the common code handle it */
> + ide_end_request (0, HWGROUP (drive)); /* Let the common code handle it */
> return ide_stopped;
> }
>
> @@ -2578,7 +2633,7 @@
> if (postponed_rq != NULL)
> if (rq != postponed_rq) {
> printk (KERN_ERR "ide-tape: ide-tape.c bug - Two DSC requests were queued\n");
> - idetape_end_request (0,HWGROUP (drive));
> + idetape_end_request (0, HWGROUP (drive));
> return ide_stopped;
> }
> #endif /* IDETAPE_DEBUG_BUGS */
> @@ -2624,8 +2679,15 @@
> tape->insert_speed = tape->insert_size / 1024 * HZ / (jiffies - tape->insert_time);
> calculate_speeds(drive);
> if (tape->onstream && tape->max_frames &&
> - ((rq->cmd == IDETAPE_WRITE_RQ && (tape->cur_frames == tape->max_frames || (tape->speed_control && tape->cur_frames > 5 && (tape->insert_speed > tape->max_insert_speed || (0 /* tape->cur_frames > 30 && tape->tape_still_time > 200 */))))) ||
> - (rq->cmd == IDETAPE_READ_RQ && (tape->cur_frames == 0 || (tape->speed_control && (tape->cur_frames < tape->max_frames - 5) && tape->insert_speed > tape->max_insert_speed)) && rq->nr_sectors))) {
> + ((rq->cmd == IDETAPE_WRITE_RQ &&
> + ( tape->cur_frames == tape->max_frames ||
> + ( tape->speed_control && tape->cur_frames > 5 &&
> + (tape->insert_speed > tape->max_insert_speed ||
> + (0 /* tape->cur_frames > 30 && tape->tape_still_time > 200 */) ) ) ) ) ||
> + (rq->cmd == IDETAPE_READ_RQ &&
> + ( tape->cur_frames == 0 ||
> + ( tape->speed_control && (tape->cur_frames < tape->max_frames - 5) &&
> + tape->insert_speed > tape->max_insert_speed ) ) && rq->nr_sectors) ) ) {
> #if IDETAPE_DEBUG_LOG
> if (tape->debug_level >= 4)
> printk(KERN_INFO "ide-tape: postponing request, cmd %d, cur %d, max %d\n",
> @@ -2672,7 +2734,7 @@
> if (jiffies > tape->last_buffer_fill + 5 * HZ / 100)
> tape->req_buffer_fill = 1;
> }
> - pc=idetape_next_pc_storage (drive);
> + pc = idetape_next_pc_storage (drive);
> idetape_create_read_cmd (tape, pc, rq->current_nr_sectors, rq->bh);
> break;
> case IDETAPE_WRITE_RQ:
> @@ -2689,12 +2751,12 @@
> tape->req_buffer_fill = 1;
> calculate_speeds(drive);
> }
> - pc=idetape_next_pc_storage (drive);
> + pc = idetape_next_pc_storage (drive);
> idetape_create_write_cmd (tape, pc, rq->current_nr_sectors, rq->bh);
> break;
> case IDETAPE_READ_BUFFER_RQ:
> tape->postpone_cnt = 0;
> - pc=idetape_next_pc_storage (drive);
> + pc = idetape_next_pc_storage (drive);
> idetape_create_read_buffer_cmd (tape, pc, rq->current_nr_sectors, rq->bh);
> break;
> case IDETAPE_ABORTED_WRITE_RQ:
> @@ -2710,7 +2772,7 @@
> idetape_end_request (IDETAPE_ERROR_EOD, HWGROUP(drive));
> return ide_stopped;
> case IDETAPE_PC_RQ1:
> - pc=(idetape_pc_t *) rq->buffer;
> + pc = (idetape_pc_t *) rq->buffer;
> rq->cmd = IDETAPE_PC_RQ2;
> break;
> case IDETAPE_PC_RQ2:
> @@ -2718,7 +2780,7 @@
> return ide_stopped;
> default:
> printk (KERN_ERR "ide-tape: bug in IDETAPE_RQ_CMD macro\n");
> - idetape_end_request (0,HWGROUP (drive));
> + idetape_end_request (0, HWGROUP (drive));
> return ide_stopped;
> }
> return idetape_issue_packet_command (drive, pc);
> @@ -2844,7 +2906,9 @@
> #endif /* IDETAPE_DEBUG_BUGS */
> count = IDE_MIN (bh->b_size - atomic_read(&bh->b_count), n);
> copy_from_user (bh->b_data + atomic_read(&bh->b_count), buf, count);
> - n -= count; atomic_add(count, &bh->b_count); buf += count;
> + n -= count;
> + atomic_add(count, &bh->b_count);
> + buf += count;
> if (atomic_read(&bh->b_count) == bh->b_size) {
> bh = bh->b_reqnext;
> if (bh)
> @@ -2868,7 +2932,10 @@
> #endif /* IDETAPE_DEBUG_BUGS */
> count = IDE_MIN (tape->b_count, n);
> copy_to_user (buf, tape->b_data, count);
> - n -= count; tape->b_data += count; tape->b_count -= count; buf += count;
> + n -= count;
> + tape->b_data += count;
> + tape->b_count -= count;
> + buf += count;
> if (!tape->b_count) {
> tape->bh = bh = bh->b_reqnext;
> if (bh) {
> @@ -2920,10 +2987,10 @@
> if (tape->last_stage != NULL)
> tape->last_stage->next=stage;
> else
> - tape->first_stage=tape->next_stage=stage;
> - tape->last_stage=stage;
> + tape->first_stage = tape->next_stage=stage;
> + tape->last_stage = stage;
> if (tape->next_stage == NULL)
> - tape->next_stage=tape->last_stage;
> + tape->next_stage = tape->last_stage;
> tape->nr_stages++;
> tape->nr_pending_stages++;
> spin_unlock_irqrestore(&tape->spinlock, flags);
> @@ -2953,26 +3020,21 @@
> par->par_desc_ver = OS_PARTITION_VERSION;
> par->wrt_pass_cntr = htons(0xffff);
> par->first_frame_addr = htonl(0);
> - par->last_frame_addr = htonl(0xbb7);
> + par->last_frame_addr = htonl(0xbb7); /* 2999 */
> + aux->frame_seq_num = htonl(0);
> + aux->logical_blk_num_high = htonl(0);
> + aux->logical_blk_num = htonl(0);
> + aux->next_mark_addr = htonl(tape->first_mark_addr);
> } else {
> aux->update_frame_cntr = htonl(0);
> par->partition_num = OS_DATA_PARTITION;
> par->par_desc_ver = OS_PARTITION_VERSION;
> par->wrt_pass_cntr = htons(tape->wrt_pass_cntr);
> - par->first_frame_addr = htonl(0x14);
> - par->last_frame_addr = htonl(19239 * 24);
> - }
> - if (frame_type != OS_FRAME_TYPE_HEADER) {
> + par->first_frame_addr = htonl(OS_DATA_STARTFRAME1);
> + par->last_frame_addr = htonl(tape->capacity);
> aux->frame_seq_num = htonl(logical_blk_num);
> aux->logical_blk_num_high = htonl(0);
> aux->logical_blk_num = htonl(logical_blk_num);
> - } else {
> - aux->frame_seq_num = htonl(0);
> - aux->logical_blk_num_high = htonl(0);
> - aux->logical_blk_num = htonl(0);
> - }
> -
> - if (frame_type != OS_FRAME_TYPE_HEADER) {
> dat->dat_sz = 8;
> dat->reserved1 = 0;
> dat->entry_cnt = 1;
> @@ -2987,11 +3049,10 @@
> else
> dat->dat_list[0].flags = OS_DAT_FLAGS_DATA;
> dat->dat_list[0].reserved = 0;
> - } else
> - aux->next_mark_addr = htonl(tape->first_mark_addr);
> - aux->filemark_cnt = ntohl(tape->filemark_cnt);
> - aux->phys_fm = ntohl(0xffffffff);
> - aux->last_mark_addr = ntohl(tape->last_mark_addr);
> + }
> + aux->filemark_cnt = ntohl(tape->filemark_cnt); /* shouldn't this be htonl ?? */
> + aux->phys_fm = ntohl(0xffffffff); /* shouldn't this be htonl ?? */
> + aux->last_mark_addr = ntohl(tape->last_mark_addr); /* shouldn't this be htonl ?? */
> }
>
> /*
> @@ -3042,7 +3103,7 @@
> if (result->bpu) {
> printk (KERN_INFO "ide-tape: Block location is unknown to the tape\n");
> clear_bit (IDETAPE_ADDRESS_VALID, &tape->flags);
> - idetape_end_request (0,HWGROUP (drive));
> + idetape_end_request (0, HWGROUP (drive));
> } else {
> #if IDETAPE_DEBUG_LOG
> if (tape->debug_level >= 2)
> @@ -3053,10 +3114,10 @@
> tape->last_frame_position = ntohl (result->last_block);
> tape->blocks_in_buffer = result->blocks_in_buffer[2];
> set_bit (IDETAPE_ADDRESS_VALID, &tape->flags);
> - idetape_end_request (1,HWGROUP (drive));
> + idetape_end_request (1, HWGROUP (drive));
> }
> } else {
> - idetape_end_request (0,HWGROUP (drive));
> + idetape_end_request (0, HWGROUP (drive));
> }
> return ide_stopped;
> }
> @@ -3076,8 +3137,8 @@
> idetape_init_pc (pc);
> pc->c[0] = IDETAPE_WRITE_FILEMARK_CMD;
> if (tape->onstream)
> - pc->c[1] = 1;
> - pc->c[4] = write_filemark;
> + pc->c[1] = 1; /* Immed bit */
> + pc->c[4] = write_filemark; /* not used for OnStream ?? */
> set_bit (PC_WAIT_FOR_DSC, &pc->flags);
> pc->callback = &idetape_pc_callback;
> }
> @@ -3109,7 +3170,7 @@
> * the request to the request list without waiting for it to be serviced !
> * In that case, we usually use idetape_queue_pc_head.
> */
> -static int __idetape_queue_pc_tail (ide_drive_t *drive,idetape_pc_t *pc)
> +static int __idetape_queue_pc_tail (ide_drive_t *drive, idetape_pc_t *pc)
> {
> struct request rq;
>
> @@ -3150,7 +3211,7 @@
> return 0;
> if (tape->sense_key == 2 && tape->asc == 4 && tape->ascq == 2) {
> idetape_create_load_unload_cmd (drive, &pc, IDETAPE_LU_LOAD_MASK);
> - __idetape_queue_pc_tail(drive,&pc);
> + __idetape_queue_pc_tail(drive, &pc);
> idetape_create_test_unit_ready_cmd(&pc);
> if (!__idetape_queue_pc_tail(drive, &pc))
> return 0;
> @@ -3169,7 +3230,8 @@
> int rc;
>
> rc = __idetape_queue_pc_tail(drive, pc);
> - if (rc) return rc;
> + if (rc)
> + return rc;
> if (tape->onstream && test_bit(PC_WAIT_FOR_DSC, &pc->flags))
> rc = idetape_wait_ready(drive, 60 * 10 * HZ); /* AJN-4: Changed from 5 to 10 minutes;
> because retension takes approx. 8:20 with Onstream 30GB tape */
> @@ -3182,7 +3244,7 @@
> int rc;
>
> idetape_create_write_filemark_cmd(drive, &pc, 0);
> - if ((rc = idetape_queue_pc_tail (drive,&pc)))
> + if ((rc = idetape_queue_pc_tail (drive, &pc)))
> return rc;
> idetape_wait_ready(drive, 60 * 5 * HZ);
> return 0;
> @@ -3206,7 +3268,7 @@
> idetape_flush_tape_buffers(drive);
> #endif
> idetape_create_read_position_cmd(&pc);
> - if (idetape_queue_pc_tail (drive,&pc))
> + if (idetape_queue_pc_tail (drive, &pc))
> return -1;
> position = tape->first_frame_position;
> #ifdef NO_LONGER_REQUIRED
> @@ -3231,12 +3293,17 @@
> idetape_init_pc (pc);
> pc->c[0] = IDETAPE_LOCATE_CMD;
> if (tape->onstream)
> - pc->c[1] = 1;
> + pc->c[1] = 1; /* Immediate bit */
> else
> pc->c[1] = 2;
> put_unaligned (htonl (block), (unsigned int *) &pc->c[3]);
> pc->c[8] = partition;
> if (tape->onstream)
> + /*
> + * Set SKIP bit.
> + * In case of write error this will write buffered
> + * data in the drive to this new position!
> + */
> pc->c[9] = skip << 7;
> set_bit (PC_WAIT_FOR_DSC, &pc->flags);
> pc->callback = &idetape_pc_callback;
> @@ -3307,11 +3374,12 @@
> __idetape_discard_read_pipeline(drive);
> idetape_wait_ready(drive, 60 * 5 * HZ);
> idetape_create_locate_cmd (drive, &pc, block, partition, skip);
> - retval=idetape_queue_pc_tail (drive,&pc);
> - if (retval) return (retval);
> + retval = idetape_queue_pc_tail (drive, &pc);
> + if (retval)
> + return (retval);
>
> idetape_create_read_position_cmd (&pc);
> - return (idetape_queue_pc_tail (drive,&pc));
> + return (idetape_queue_pc_tail (drive, &pc));
> }
>
> static void idetape_discard_read_pipeline (ide_drive_t *drive, int restore_position)
> @@ -3339,7 +3407,7 @@
> {
> idetape_pc_t pc;
>
> - idetape_create_mode_sense_cmd (&pc, 0x33);
> + idetape_create_mode_sense_cmd (&pc, IDETAPE_BUFFER_FILLING_PAGE);
> pc.callback = idetape_onstream_buffer_fill_callback;
> (void) idetape_queue_pc_tail(drive, &pc);
> }
> @@ -3447,33 +3515,41 @@
> idetape_tape_t *tape = drive->driver_data;
> unsigned int block;
>
> - if (tape->onstream_write_error == 1) {
> - printk(KERN_ERR "ide-tape: %s: detected physical bad block at %u\n", tape->name, ntohl(tape->sense.information));
> - block = ntohl(tape->sense.information) + 80;
> + if (tape->onstream_write_error == OS_WRITE_ERROR) {
> + printk(KERN_ERR "ide-tape: %s: onstream_write_error_recovery: detected physical bad block at %u, logical %u first frame %u last_frame %u bufblocks %u stages %u skipping %u frames\n",
> + tape->name, ntohl(tape->sense.information), tape->logical_blk_num,
> + tape->first_frame_position, tape->last_frame_position,
> + tape->blocks_in_buffer, tape->nr_stages,
> + (ntohl(tape->sense.command_specific) >> 16) & 0xff );
> + block = ntohl(tape->sense.information) + ((ntohl(tape->sense.command_specific) >> 16) & 0xff);
> idetape_update_stats(drive);
> printk(KERN_ERR "ide-tape: %s: relocating %d buffered logical blocks to physical block %u\n", tape->name, tape->cur_frames, block);
> +#if 0 /* isn't once enough ??? MM */
> idetape_update_stats(drive);
> +#endif
> if (tape->firmware_revision_num >= 106)
> idetape_position_tape(drive, block, 0, 1);
> else {
> idetape_onstream_read_back_buffer(drive);
> idetape_position_tape(drive, block, 0, 0);
> }
> +#if 0 /* already done in idetape_position_tape MM */
> idetape_read_position(drive);
> +#endif
> #if ONSTREAM_DEBUG
> if (tape->debug_level >= 1)
> printk(KERN_ERR "ide-tape: %s: positioning complete, cur_frames %d, pos %d, tape pos %d\n", tape->name, tape->cur_frames, tape->first_frame_position, tape->last_frame_position);
> #endif
> - } else if (tape->onstream_write_error == 2) {
> + } else if (tape->onstream_write_error == OS_PART_ERROR) {
> #if ONSTREAM_DEBUG
> if (tape->debug_level >= 1)
> printk(KERN_INFO "ide-tape: %s: skipping over config partition\n", tape->name);
> #endif
> idetape_flush_tape_buffers(drive);
> block = idetape_read_position(drive);
> - if (block != 0xba4)
> - printk(KERN_ERR "ide-tape: warning, current position %d, expected %d\n", block, 0xba4);
> - idetape_position_tape(drive, 0xbb8, 0, 0);
> + if (block != OS_DATA_ENDFRAME1)
> + printk(KERN_ERR "ide-tape: warning, current position %d, expected %d\n", block, OS_DATA_ENDFRAME1);
> + idetape_position_tape(drive, 0xbb8, 0, 0); /* 3000 */
> }
> tape->onstream_write_error = 0;
> }
> @@ -3572,48 +3648,48 @@
> return 1;
> }
> if (rq->errors == IDETAPE_ERROR_GENERAL) {
> - printk(KERN_INFO "ide-tape: %s: skipping frame, read error\n", tape->name);
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, read error\n", tape->name, tape->first_frame_position);
> return 0;
> }
> if (rq->errors == IDETAPE_ERROR_EOD) {
> - printk(KERN_INFO "ide-tape: %s: skipping frame, eod\n", tape->name);
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, eod\n", tape->name, tape->first_frame_position);
> return 0;
> }
> if (ntohl(aux->format_id) != 0) {
> - printk(KERN_INFO "ide-tape: %s: skipping frame, format_id %u\n", tape->name, ntohl(aux->format_id));
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, format_id %u\n", tape->name, tape->first_frame_position, ntohl(aux->format_id));
> return 0;
> }
> if (memcmp(aux->application_sig, tape->application_sig, 4) != 0) {
> - printk(KERN_INFO "ide-tape: %s: skipping frame, incorrect application signature\n", tape->name);
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, incorrect application signature\n", tape->name, tape->first_frame_position);
> return 0;
> }
> if (aux->frame_type != OS_FRAME_TYPE_DATA &&
> aux->frame_type != OS_FRAME_TYPE_EOD &&
> aux->frame_type != OS_FRAME_TYPE_MARKER) {
> - printk(KERN_INFO "ide-tape: %s: skipping frame, frame type %x\n", tape->name, aux->frame_type);
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, frame type %x\n", tape->name, tape->first_frame_position, aux->frame_type);
> return 0;
> }
> if (par->partition_num != OS_DATA_PARTITION) {
> if (!tape->linux_media || tape->linux_media_version != 2) {
> - printk(KERN_INFO "ide-tape: %s: skipping frame, partition num %d\n", tape->name, par->partition_num);
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, partition num %d\n", tape->name, tape->first_frame_position, par->partition_num);
> return 0;
> }
> }
> if (par->par_desc_ver != OS_PARTITION_VERSION) {
> - printk(KERN_INFO "ide-tape: %s: skipping frame, partition version %d\n", tape->name, par->par_desc_ver);
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, partition version %d\n", tape->name, tape->first_frame_position, par->par_desc_ver);
> return 0;
> }
> if (ntohs(par->wrt_pass_cntr) != tape->wrt_pass_cntr) {
> - printk(KERN_INFO "ide-tape: %s: skipping frame, wrt_pass_cntr %d (expected %d)(logical_blk_num %u)\n", tape->name, ntohs(par->wrt_pass_cntr), tape->wrt_pass_cntr, ntohl(aux->logical_blk_num));
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, wrt_pass_cntr %d (expected %d)(logical_blk_num %u)\n", tape->name, tape->first_frame_position, ntohs(par->wrt_pass_cntr), tape->wrt_pass_cntr, ntohl(aux->logical_blk_num));
> return 0;
> }
> if (aux->frame_seq_num != aux->logical_blk_num) {
> - printk(KERN_INFO "ide-tape: %s: skipping frame, seq != logical\n", tape->name);
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, seq != logical\n", tape->name, tape->first_frame_position);
> return 0;
> }
> if (logical_blk_num != -1 && ntohl(aux->logical_blk_num) != logical_blk_num) {
> if (!quiet)
> - printk(KERN_INFO "ide-tape: %s: skipping frame, logical_blk_num %u (expected %d)\n", tape->name, ntohl(aux->logical_blk_num), logical_blk_num);
> + printk(KERN_INFO "ide-tape: %s: skipping frame %d, logical_blk_num %u (expected %d)\n", tape->name, tape->first_frame_position, ntohl(aux->logical_blk_num), logical_blk_num);
> return 0;
> }
> if (aux->frame_type == OS_FRAME_TYPE_MARKER) {
> @@ -3689,7 +3765,7 @@
> idetape_switch_buffers (tape, new_stage);
> idetape_init_stage(drive, new_stage, OS_FRAME_TYPE_DATA, tape->logical_blk_num);
> tape->logical_blk_num++;
> - idetape_add_stage_tail (drive,new_stage);
> + idetape_add_stage_tail (drive, new_stage);
> tape->pipeline_head++;
> #if USE_IOTRACE
> IO_trace(IO_IDETAPE_FIFO, tape->pipeline_head, tape->buffer_head, tape->tape_head, tape->minor);
> @@ -3766,7 +3842,7 @@
> }
> #endif /* IDETAPE_DEBUG_BUGS */
> if (tape->merge_stage_size) {
> - blocks=tape->merge_stage_size/tape->tape_block_size;
> + blocks = tape->merge_stage_size / tape->tape_block_size;
> if (tape->merge_stage_size % tape->tape_block_size) {
> blocks++;
> i = tape->tape_block_size - tape->merge_stage_size % tape->tape_block_size;
> @@ -3797,7 +3873,7 @@
> tape->merge_stage = NULL;
> }
> clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags);
> - tape->chrdev_direction=idetape_direction_none;
> + tape->chrdev_direction = idetape_direction_none;
>
> /*
> * On the next backup, perform the feedback loop again.
> @@ -3874,13 +3950,13 @@
> rq.sector = tape->first_frame_position;
> rq.nr_sectors = rq.current_nr_sectors = blocks;
> if (!test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags) && tape->nr_stages <= max_stages) {
> - new_stage=idetape_kmalloc_stage (tape);
> + new_stage = idetape_kmalloc_stage (tape);
> while (new_stage != NULL) {
> - new_stage->rq=rq;
> - idetape_add_stage_tail (drive,new_stage);
> + new_stage->rq = rq;
> + idetape_add_stage_tail (drive, new_stage);
> if (tape->nr_stages >= max_stages)
> break;
> - new_stage=idetape_kmalloc_stage (tape);
> + new_stage = idetape_kmalloc_stage (tape);
> }
> }
> if (!idetape_pipeline_active(tape)) {
> @@ -3922,16 +3998,23 @@
> #endif
> clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags);
> position = idetape_read_position(drive);
> + printk(KERN_INFO "ide-tape: %s: blank block detected at %d\n", tape->name, position);
> if (position >= 3000 && position < 3080)
> - position += 32;
> - if (position >= 2980 && position < 3000)
> + position += 32; /* Why is this check and number ??? MM */
> + if (position >= OS_DATA_ENDFRAME1 && position < 3000)
> position = 3000;
> else
> + /*
> + * compensate for write errors that generally skip 80 frames,
> + * expect around 20 read errors in a row...
> + */
> position += 60;
> - if (position >= 2980 && position < 3000)
> + if (position >= OS_DATA_ENDFRAME1 && position < 3000)
> position = 3000;
> - printk(KERN_INFO "ide-tape: %s: blank block detected, positioning tape to block %d\n", tape->name, position);
> - idetape_position_tape(drive, position, 0, 1);
> + printk(KERN_INFO "ide-tape: %s: positioning tape to block %d\n", tape->name, position);
> + if (position == 3000) /* seems to be needed to correctly position at block 3000 MM */
> + idetape_position_tape(drive, 0, 0, 0);
> + idetape_position_tape(drive, position, 0, 0);
> cnt += 40;
> continue;
> } else
> @@ -4089,12 +4172,14 @@
> #endif /* IDETAPE_DEBUG_LOG */
>
> idetape_create_rewind_cmd (drive, &pc);
> - retval=idetape_queue_pc_tail (drive,&pc);
> - if (retval) return retval;
> + retval = idetape_queue_pc_tail (drive, &pc);
> + if (retval)
> + return retval;
>
> idetape_create_read_position_cmd (&pc);
> - retval = idetape_queue_pc_tail (drive,&pc);
> - if (retval) return retval;
> + retval = idetape_queue_pc_tail (drive, &pc);
> + if (retval)
> + return retval;
> tape->logical_blk_num = 0;
> return 0;
> }
> @@ -4412,7 +4497,7 @@
> switch (mt_op) {
> case MTFSF:
> idetape_create_space_cmd (&pc,mt_count-count,IDETAPE_SPACE_OVER_FILEMARK);
> - return (idetape_queue_pc_tail (drive,&pc));
> + return (idetape_queue_pc_tail (drive, &pc));
> case MTFSFM:
> if (!tape->capabilities.sprev)
> return (-EIO);
> @@ -4423,7 +4508,7 @@
> if (!tape->capabilities.sprev)
> return (-EIO);
> idetape_create_space_cmd (&pc,-(mt_count+count),IDETAPE_SPACE_OVER_FILEMARK);
> - return (idetape_queue_pc_tail (drive,&pc));
> + return (idetape_queue_pc_tail (drive, &pc));
> case MTBSFM:
> if (!tape->capabilities.sprev)
> return (-EIO);
> @@ -4460,7 +4545,7 @@
> struct inode *inode = file->f_dentry->d_inode;
> ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
> idetape_tape_t *tape = drive->driver_data;
> - ssize_t bytes_read,temp,actually_read=0, rc;
> + ssize_t bytes_read,temp, actually_read = 0, rc;
>
> if (ppos != &file->f_pos) {
> /* "A request was outside the capabilities of the device." */
> @@ -4482,28 +4567,32 @@
> }
> if ((rc = idetape_initiate_read(drive, tape->max_stages)) < 0)
> return rc;
> - if (count==0)
> + if (count == 0)
> return (0);
> if (tape->merge_stage_size) {
> - actually_read=IDE_MIN (tape->merge_stage_size,count);
> + actually_read = IDE_MIN (tape->merge_stage_size, count);
> idetape_copy_stage_to_user (tape, buf, tape->merge_stage, actually_read);
> - buf += actually_read; tape->merge_stage_size -= actually_read; count-=actually_read;
> + buf += actually_read;
> + tape->merge_stage_size -= actually_read;
> + count -= actually_read;
> }
> while (count >= tape->stage_size) {
> - bytes_read=idetape_add_chrdev_read_request (drive, tape->capabilities.ctl);
> + bytes_read = idetape_add_chrdev_read_request (drive, tape->capabilities.ctl);
> if (bytes_read <= 0)
> goto finish;
> idetape_copy_stage_to_user (tape, buf, tape->merge_stage, bytes_read);
> - buf += bytes_read; count -= bytes_read; actually_read += bytes_read;
> + buf += bytes_read;
> + count -= bytes_read;
> + actually_read += bytes_read;
> }
> if (count) {
> bytes_read=idetape_add_chrdev_read_request (drive, tape->capabilities.ctl);
> if (bytes_read <= 0)
> goto finish;
> - temp=IDE_MIN (count,bytes_read);
> + temp = IDE_MIN (count, bytes_read);
> idetape_copy_stage_to_user (tape, buf, tape->merge_stage, temp);
> - actually_read+=temp;
> - tape->merge_stage_size=bytes_read-temp;
> + actually_read += temp;
> + tape->merge_stage_size = bytes_read-temp;
> }
> finish:
> if (!actually_read && test_bit (IDETAPE_FILEMARK, &tape->flags)) {
> @@ -4515,7 +4604,8 @@
> return 0;
> }
> if (tape->onstream && !actually_read && test_and_clear_bit(IDETAPE_READ_ERROR, &tape->flags)) {
> - printk(KERN_ERR "ide-tape: %s: unrecovered read error on logical block number %d, skipping\n", tape->name, tape->logical_blk_num);
> + printk(KERN_ERR "ide-tape: %s: unrecovered read error on logical block number %d, skipping\n",
> + tape->name, tape->logical_blk_num);
> tape->logical_blk_num++;
> return -EIO;
> }
> @@ -4576,6 +4666,37 @@
> return;
> }
>
> +static void idetape_write_filler (ide_drive_t *drive, int block, int cnt)
> +{
> + idetape_tape_t *tape = drive->driver_data;
> + idetape_stage_t *stage;
> + int rc;
> +
> + if (!tape->onstream || tape->raw)
> + return;
> + stage = __idetape_kmalloc_stage(tape, 1, 1);
> + if (stage == NULL)
> + return;
> + idetape_init_stage(drive, stage, OS_FRAME_TYPE_FILL, 0);
> + idetape_wait_ready(drive, 60 * 5 * HZ);
> + rc = idetape_position_tape(drive, block, 0, 0);
> +#if ONSTREAM_DEBUG
> + printk(KERN_INFO "write_filler: positioning failed it returned %d\n", rc);
> +#endif
> + if (rc != 0)
> + return; /* don't write fillers if we cannot position the tape. */
> +
> + strcpy(stage->bh->b_data, "Filler");
> + while (cnt--) {
> + if (!idetape_queue_rw_tail (drive, IDETAPE_WRITE_RQ, 1, stage->bh)) {
> + printk(KERN_INFO "ide-tape: %s: write_filler: couldn't write header frame\n", tape->name);
> + __idetape_kfree_stage (stage);
> + return;
> + }
> + }
> + __idetape_kfree_stage (stage);
> +}
> +
> static void __idetape_write_header (ide_drive_t *drive, int block, int cnt)
> {
> idetape_tape_t *tape = drive->driver_data;
> @@ -4591,12 +4712,12 @@
> memset(&header, 0, sizeof(header));
> strcpy(header.ident_str, "ADR_SEQ");
> header.major_rev = 1;
> - header.minor_rev = 2;
> + header.minor_rev = OS_ADR_MINREV;
> header.par_num = 1;
> header.partition.partition_num = OS_DATA_PARTITION;
> header.partition.par_desc_ver = OS_PARTITION_VERSION;
> - header.partition.first_frame_addr = htonl(0x14);
> - header.partition.last_frame_addr = htonl(19239 * 24);
> + header.partition.first_frame_addr = htonl(OS_DATA_STARTFRAME1);
> + header.partition.last_frame_addr = htonl(tape->capacity);
> header.partition.wrt_pass_cntr = htons(tape->wrt_pass_cntr);
> header.partition.eod_frame_addr = htonl(tape->eod_frame_addr);
> memcpy(stage->bh->b_data, &header, sizeof(header));
> @@ -4623,7 +4744,7 @@
> return;
> tape->update_frame_cntr++;
> __idetape_write_header(drive, 5, 5);
> - __idetape_write_header(drive, 0xbae, 5);
> + __idetape_write_header(drive, 0xbae, 5); /* 2990 */
> if (locate_eod) {
> #if ONSTREAM_DEBUG
> if (tape->debug_level >= 2)
> @@ -4639,22 +4760,39 @@
> struct inode *inode = file->f_dentry->d_inode;
> ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
> idetape_tape_t *tape = drive->driver_data;
> - ssize_t retval,actually_written=0;
> + ssize_t retval, actually_written = 0;
> int position;
>
> if (ppos != &file->f_pos) {
> /* "A request was outside the capabilities of the device." */
> return -ENXIO;
> }
> - if (tape->onstream && (count != tape->tape_block_size)) {
> - printk(KERN_ERR "ide-tape: %s: use %d bytes as block size (%Zd used)\n", tape->name, tape->tape_block_size, count);
> - return -EINVAL;
> - }
> +
> #if IDETAPE_DEBUG_LOG
> if (tape->debug_level >= 3)
> printk (KERN_INFO "ide-tape: Reached idetape_chrdev_write, count %Zd\n", count);
> #endif /* IDETAPE_DEBUG_LOG */
>
> + if (tape->onstream) {
> + if (count != tape->tape_block_size) {
> + printk(KERN_ERR "ide-tape: %s: chrdev_write: use %d bytes as block size (%d used)\n",
> + tape->name, tape->tape_block_size, count);
> + return -EINVAL;
> + }
> + /*
> + * Check if we reach the end of the tape. Just assume the whole pipeline
> + * is filled with write requests!
> + */
> + if (tape->first_frame_position + tape->nr_stages >= tape->capacity - OS_EW) {
> +#if ONSTREAM_DEBUG
> + printk(KERN_INFO, "chrdev_write: Write truncated at EOM early warning");
> +#endif
> + if (tape->chrdev_direction == idetape_direction_write)
> + idetape_write_release(inode);
> + return -ENOSPC;
> + }
> + }
> +
> if (tape->chrdev_direction != idetape_direction_write) { /* Initialize write operation */
> if (tape->chrdev_direction == idetape_direction_read)
> idetape_discard_read_pipeline (drive, 1);
> @@ -4671,17 +4809,17 @@
>
> if (tape->onstream) {
> position = idetape_read_position(drive);
> - if (position <= 20) {
> + if (position <= OS_DATA_STARTFRAME1) {
> tape->logical_blk_num = 0;
> tape->wrt_pass_cntr++;
> #if ONSTREAM_DEBUG
> if (tape->debug_level >= 2)
> - printk(KERN_INFO "ide-tape: %s: logical block num 0, setting eod to 20\n", tape->name);
> + printk(KERN_INFO "ide-tape: %s: logical block num 0, setting eod to %d\n", tape->name, OS_DATA_STARTFRAME1);
> if (tape->debug_level >= 2)
> printk(KERN_INFO "ide-tape: %s: allocating new write pass counter %d\n", tape->name, tape->wrt_pass_cntr);
> #endif
> tape->filemark_cnt = 0;
> - tape->eod_frame_addr = 20;
> + tape->eod_frame_addr = OS_DATA_STARTFRAME1;
> tape->first_mark_addr = tape->last_mark_addr = -1;
> idetape_write_header(drive, 1);
> }
> @@ -4715,7 +4853,7 @@
> printk("ide-tape: first_frame_position %d\n", tape->first_frame_position);
> #endif
> }
> - if (count==0)
> + if (count == 0)
> return (0);
> if (tape->restart_speed_control_req)
> idetape_restart_speed_control(drive);
> @@ -4723,32 +4861,35 @@
> #if IDETAPE_DEBUG_BUGS
> if (tape->merge_stage_size >= tape->stage_size) {
> printk (KERN_ERR "ide-tape: bug: merge buffer too big\n");
> - tape->merge_stage_size=0;
> + tape->merge_stage_size = 0;
> }
> #endif /* IDETAPE_DEBUG_BUGS */
> - actually_written=IDE_MIN (tape->stage_size-tape->merge_stage_size,count);
> + actually_written = IDE_MIN (tape->stage_size - tape->merge_stage_size, count);
> idetape_copy_stage_from_user (tape, tape->merge_stage, buf, actually_written);
> - buf+=actually_written;tape->merge_stage_size+=actually_written;count-=actually_written;
> + buf += actually_written;
> + tape->merge_stage_size += actually_written;
> + count -= actually_written;
>
> if (tape->merge_stage_size == tape->stage_size) {
> tape->merge_stage_size = 0;
> - retval=idetape_add_chrdev_write_request (drive, tape->capabilities.ctl);
> + retval = idetape_add_chrdev_write_request (drive, tape->capabilities.ctl);
> if (retval <= 0)
> return (retval);
> }
> }
> while (count >= tape->stage_size) {
> idetape_copy_stage_from_user (tape, tape->merge_stage, buf, tape->stage_size);
> - buf+=tape->stage_size;count-=tape->stage_size;
> - retval=idetape_add_chrdev_write_request (drive, tape->capabilities.ctl);
> - actually_written+=tape->stage_size;
> + buf += tape->stage_size;
> + count -= tape->stage_size;
> + retval = idetape_add_chrdev_write_request (drive, tape->capabilities.ctl);
> + actually_written += tape->stage_size;
> if (retval <= 0)
> return (retval);
> }
> if (count) {
> actually_written+=count;
> idetape_copy_stage_from_user (tape, tape->merge_stage, buf, count);
> - tape->merge_stage_size+=count;
> + tape->merge_stage_size += count;
> }
> return (actually_written);
> }
> @@ -4760,8 +4901,8 @@
> idetape_pc_t pc;
>
> if (!tape->onstream) {
> - idetape_create_write_filemark_cmd(drive, &pc,1); /* Write a filemark */
> - if (idetape_queue_pc_tail (drive,&pc)) {
> + idetape_create_write_filemark_cmd(drive, &pc, 1); /* Write a filemark */
> + if (idetape_queue_pc_tail (drive, &pc)) {
> printk (KERN_ERR "ide-tape: Couldn't write a filemark\n");
> return -EIO;
> }
> @@ -4937,24 +5078,24 @@
> if (idetape_rewind_tape(drive))
> return -EIO;
> if (tape->onstream && !tape->raw)
> - return idetape_position_tape(drive, 20, 0, 0);
> + return idetape_position_tape(drive, OS_DATA_STARTFRAME1, 0, 0);
> return 0;
> case MTLOAD:
> idetape_discard_read_pipeline (drive, 0);
> idetape_create_load_unload_cmd (drive, &pc, IDETAPE_LU_LOAD_MASK);
> - return (idetape_queue_pc_tail (drive,&pc));
> + return (idetape_queue_pc_tail (drive, &pc));
> case MTUNLOAD:
> case MTOFFL:
> idetape_discard_read_pipeline (drive, 0);
> idetape_create_load_unload_cmd (drive, &pc,!IDETAPE_LU_LOAD_MASK);
> - return (idetape_queue_pc_tail (drive,&pc));
> + return (idetape_queue_pc_tail (drive, &pc));
> case MTNOP:
> idetape_discard_read_pipeline (drive, 0);
> return (idetape_flush_tape_buffers (drive));
> case MTRETEN:
> idetape_discard_read_pipeline (drive, 0);
> idetape_create_load_unload_cmd (drive, &pc,IDETAPE_LU_RETENSION_MASK | IDETAPE_LU_LOAD_MASK);
> - return (idetape_queue_pc_tail (drive,&pc));
> + return (idetape_queue_pc_tail (drive, &pc));
> case MTEOM:
> if (tape->onstream) {
> #if ONSTREAM_DEBUG
> @@ -4968,24 +5109,30 @@
> return -EIO;
> return 0;
> }
> - idetape_create_space_cmd (&pc,0,IDETAPE_SPACE_TO_EOD);
> - return (idetape_queue_pc_tail (drive,&pc));
> + idetape_create_space_cmd (&pc, 0, IDETAPE_SPACE_TO_EOD);
> + return (idetape_queue_pc_tail (drive, &pc));
> case MTERASE:
> if (tape->onstream) {
> - tape->eod_frame_addr = 20;
> + tape->eod_frame_addr = OS_DATA_STARTFRAME1;
> tape->logical_blk_num = 0;
> tape->first_mark_addr = tape->last_mark_addr = -1;
> idetape_position_tape(drive, tape->eod_frame_addr, 0, 0);
> idetape_write_eod(drive);
> idetape_flush_tape_buffers (drive);
> idetape_write_header(drive, 0);
> + /*
> + * write filler frames to the unused frames...
> + * REMOVE WHEN going to LIN4 application type...
> + */
> + idetape_write_filler(drive, OS_DATA_STARTFRAME1 - 10, 10);
> + idetape_write_filler(drive, OS_DATA_ENDFRAME1, 10);
> idetape_flush_tape_buffers (drive);
> (void) idetape_rewind_tape (drive);
> return 0;
> }
> (void) idetape_rewind_tape (drive);
> idetape_create_erase_cmd (&pc);
> - return (idetape_queue_pc_tail (drive,&pc));
> + return (idetape_queue_pc_tail (drive, &pc));
> case MTSETBLK:
> if (tape->onstream) {
> if (mt_count != tape->tape_block_size) {
> @@ -5028,14 +5175,14 @@
> case MTLOCK:
> if (!idetape_create_prevent_cmd(drive, &pc, 1))
> return 0;
> - retval = idetape_queue_pc_tail (drive,&pc);
> + retval = idetape_queue_pc_tail (drive, &pc);
> if (retval) return retval;
> tape->door_locked = DOOR_EXPLICITLY_LOCKED;
> return 0;
> case MTUNLOCK:
> if (!idetape_create_prevent_cmd(drive, &pc, 0))
> return 0;
> - retval = idetape_queue_pc_tail (drive,&pc);
> + retval = idetape_queue_pc_tail (drive, &pc);
> if (retval) return retval;
> tape->door_locked = DOOR_UNLOCKED;
> return 0;
> @@ -5113,7 +5260,7 @@
> mtget.mt_gstat |= GMT_ONLINE(0xffffffff);
> if (tape->first_stage && tape->first_stage->aux->frame_type == OS_FRAME_TYPE_EOD)
> mtget.mt_gstat |= GMT_EOD(0xffffffff);
> - if (position <= 20)
> + if (position <= OS_DATA_STARTFRAME1)
> mtget.mt_gstat |= GMT_BOT(0xffffffff);
> }
> if (copy_to_user ((char *) arg,(char *) &mtget, sizeof (struct mtget)))
> @@ -5150,7 +5297,7 @@
> tape->header_ok = tape->linux_media = 0;
> tape->update_frame_cntr = 0;
> tape->wrt_pass_cntr = 0;
> - tape->eod_frame_addr = 20;
> + tape->eod_frame_addr = OS_DATA_STARTFRAME1;
> tape->first_mark_addr = tape->last_mark_addr = -1;
> stage = __idetape_kmalloc_stage (tape, 0, 0);
> if (stage == NULL)
> @@ -5172,8 +5319,8 @@
> __idetape_kfree_stage (stage);
> return 0;
> }
> - if (header->major_rev != 1 || (header->minor_rev != 1 && header->minor_rev != 2))
> - printk(KERN_INFO "ide-tape: warning: revision %d.%d detected (1.1/1.2 supported)\n", header->major_rev, header->minor_rev);
> + if (header->major_rev != 1 || (header->minor_rev > OS_ADR_MINREV))
> + printk(KERN_INFO "ide-tape: warning: revision %d.%d detected (up to 1.%d supported)\n", header->major_rev, header->minor_rev, OS_ADR_MINREV);
> if (header->par_num != 1)
> printk(KERN_INFO "ide-tape: warning: %d partitions defined, only one supported\n", header->par_num);
> tape->wrt_pass_cntr = ntohs(header->partition.wrt_pass_cntr);
> @@ -5182,12 +5329,14 @@
> tape->first_mark_addr = ntohl(aux->next_mark_addr);
> tape->last_mark_addr = ntohl(aux->last_mark_addr);
> tape->update_frame_cntr = ntohl(aux->update_frame_cntr);
> - memcpy(tape->application_sig, aux->application_sig, 4); tape->application_sig[4] = 0;
> + memcpy(tape->application_sig, aux->application_sig, 4);
> + tape->application_sig[4] = 0;
> if (memcmp(tape->application_sig, "LIN", 3) == 0) {
> tape->linux_media = 1;
> tape->linux_media_version = tape->application_sig[3] - '0';
> if (tape->linux_media_version != 3)
> - printk(KERN_INFO "ide-tape: %s: Linux media version %d detected (current 3)\n", tape->name, tape->linux_media_version);
> + printk(KERN_INFO "ide-tape: %s: Linux media version %d detected (current 3)\n",
> + tape->name, tape->linux_media_version);
> } else {
> printk(KERN_INFO "ide-tape: %s: non Linux media detected (%s)\n", tape->name, tape->application_sig);
> tape->linux_media = 0;
> @@ -5214,18 +5363,14 @@
> for (block = 5; block < 10; block++)
> if (__idetape_analyze_headers(drive, block))
> goto ok;
> -#if 0
> - for (block = 0xbae; block < 0xbb8; block++)
> -#else
> - for (block = 0xbae; block < 0xbb3; block++)
> -#endif
> + for (block = 0xbae; block < 0xbb3; block++) /* 2990 - 2994 */
> if (__idetape_analyze_headers(drive, block))
> goto ok;
> printk(KERN_ERR "ide-tape: %s: failed to find valid ADRL header\n", tape->name);
> return 0;
> ok:
> - if (position < 20)
> - position = 20;
> + if (position < OS_DATA_STARTFRAME1)
> + position = OS_DATA_STARTFRAME1;
> idetape_position_tape(drive, position, 0, 0);
> tape->header_ok = 1;
> return 1;
> @@ -5251,6 +5396,7 @@
>
> if (test_and_set_bit (IDETAPE_BUSY, &tape->flags))
> return -EBUSY;
> + MOD_INC_USE_COUNT;
> if (!tape->onstream) {
> idetape_read_position(drive);
> if (!test_bit (IDETAPE_ADDRESS_VALID, &tape->flags))
> @@ -5263,18 +5409,22 @@
> tape->tape_block_size = tape->stage_size = 32768;
> tape->raw = 0;
> }
> + idetape_onstream_mode_sense_tape_parameter_page(drive, tape->debug_level);
> }
> if (idetape_wait_ready(drive, 60 * HZ)) {
> clear_bit(IDETAPE_BUSY, &tape->flags);
> printk(KERN_ERR "ide-tape: %s: drive not ready\n", tape->name);
> + MOD_DEC_USE_COUNT;
> return -EBUSY;
> }
> idetape_read_position(drive);
> + MOD_DEC_USE_COUNT;
> clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags);
>
> if (tape->chrdev_direction == idetape_direction_none) {
> + MOD_INC_USE_COUNT;
> if (idetape_create_prevent_cmd(drive, &pc, 1)) {
> - if (!idetape_queue_pc_tail (drive,&pc)) {
> + if (!idetape_queue_pc_tail (drive, &pc)) {
> if (tape->door_locked != DOOR_EXPLICITLY_LOCKED)
> tape->door_locked = DOOR_LOCKED;
> }
> @@ -5287,6 +5437,28 @@
> return 0;
> }
>
> +static void idetape_write_release (struct inode *inode)
> +{
> + ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
> + idetape_tape_t *tape = drive->driver_data;
> + unsigned int minor=MINOR (inode->i_rdev);
> +
> + idetape_empty_write_pipeline (drive);
> + tape->merge_stage = __idetape_kmalloc_stage (tape, 1, 0);
> + if (tape->merge_stage != NULL) {
> + idetape_pad_zeros (drive, tape->tape_block_size * (tape->user_bs_factor - 1));
> + __idetape_kfree_stage (tape->merge_stage);
> + tape->merge_stage = NULL;
> + }
> + idetape_write_filemark(drive);
> + idetape_write_eod(drive);
> + idetape_flush_tape_buffers (drive);
> + idetape_write_header(drive, minor >= 128);
> + idetape_flush_tape_buffers (drive);
> +
> + return;
> +}
> +
> /*
> * Our character device release function.
> */
> @@ -5305,18 +5477,7 @@
> #endif /* IDETAPE_DEBUG_LOG */
>
> if (tape->chrdev_direction == idetape_direction_write) {
> - idetape_empty_write_pipeline (drive);
> - tape->merge_stage = __idetape_kmalloc_stage (tape, 1, 0);
> - if (tape->merge_stage != NULL) {
> - idetape_pad_zeros (drive, tape->tape_block_size * (tape->user_bs_factor - 1));
> - __idetape_kfree_stage (tape->merge_stage);
> - tape->merge_stage = NULL;
> - }
> - idetape_write_filemark(drive);
> - idetape_write_eod(drive);
> - idetape_flush_tape_buffers (drive);
> - idetape_write_header(drive, minor >= 128);
> - idetape_flush_tape_buffers (drive);
> + idetape_write_release(inode);
> }
> if (tape->chrdev_direction == idetape_direction_read) {
> if (minor < 128)
> @@ -5333,9 +5494,10 @@
> if (tape->chrdev_direction == idetape_direction_none) {
> if (tape->door_locked != DOOR_EXPLICITLY_LOCKED) {
> if (idetape_create_prevent_cmd(drive, &pc, 0))
> - if (!idetape_queue_pc_tail (drive,&pc))
> + if (!idetape_queue_pc_tail (drive, &pc))
> tape->door_locked = DOOR_UNLOCKED;
> }
> + MOD_DEC_USE_COUNT;
> }
> clear_bit (IDETAPE_BUSY, &tape->flags);
> unlock_kernel();
> @@ -5491,7 +5653,7 @@
> pc.buffer[4 + 5] = vendor[3];
> pc.buffer[4 + 6] = 0;
> pc.buffer[4 + 7] = 0;
> - if (idetape_queue_pc_tail (drive,&pc))
> + if (idetape_queue_pc_tail (drive, &pc))
> printk (KERN_ERR "ide-tape: Couldn't set vendor name to %s\n", vendor);
>
> }
> @@ -5513,7 +5675,7 @@
> pc.buffer[4 + 1] = 2;
> pc.buffer[4 + 2] = 4;
> pc.buffer[4 + 3] = retries;
> - if (idetape_queue_pc_tail (drive,&pc))
> + if (idetape_queue_pc_tail (drive, &pc))
> printk (KERN_ERR "ide-tape: Couldn't set retries to %d\n", retries);
> }
> #endif
> @@ -5530,8 +5692,8 @@
> /*
> * Get the current block size from the block size mode page
> */
> - idetape_create_mode_sense_cmd (&pc,IDETAPE_BLOCK_SIZE_PAGE);
> - if (idetape_queue_pc_tail (drive,&pc))
> + idetape_create_mode_sense_cmd (&pc, IDETAPE_BLOCK_SIZE_PAGE);
> + if (idetape_queue_pc_tail (drive, &pc))
> printk (KERN_ERR "ide-tape: can't get tape block size mode page\n");
> header = (idetape_mode_parameter_header_t *) pc.buffer;
> bs = (idetape_block_size_page_t *) (pc.buffer + sizeof(idetape_mode_parameter_header_t) + header->bdl);
> @@ -5552,7 +5714,7 @@
> bs->record32 = 0;
> bs->record32_5 = 1;
> idetape_create_mode_select_cmd(&pc, sizeof(*header) + sizeof(*bs));
> - if (idetape_queue_pc_tail (drive,&pc))
> + if (idetape_queue_pc_tail (drive, &pc))
> printk (KERN_ERR "ide-tape: Couldn't set tape block size mode page\n");
>
> #if ONSTREAM_DEBUG
> @@ -5575,7 +5737,7 @@
> idetape_inquiry_result_t *inquiry;
>
> idetape_create_inquiry_cmd(&pc);
> - if (idetape_queue_pc_tail (drive,&pc)) {
> + if (idetape_queue_pc_tail (drive, &pc)) {
> printk (KERN_ERR "ide-tape: %s: can't get INQUIRY results\n", tape->name);
> return;
> }
> @@ -5618,6 +5780,34 @@
> }
>
> /*
> + * idetape_get_mode_sense_parameters asks the tape about its various
> + * parameters. This may work for other drives to???
> + */
> +static void idetape_onstream_mode_sense_tape_parameter_page(ide_drive_t *drive, int debug)
> +{
> + idetape_tape_t *tape = drive->driver_data;
> + idetape_pc_t pc;
> + idetape_mode_parameter_header_t *header;
> + onstream_tape_paramtr_page_t *prm;
> +
> + idetape_create_mode_sense_cmd (&pc, IDETAPE_PARAMTR_PAGE);
> + if (idetape_queue_pc_tail (drive, &pc)) {
> + printk (KERN_ERR "ide-tape: Can't get tape parameters page - probably no tape inserted in onstream drive\n");
> + return;
> + }
> + header = (idetape_mode_parameter_header_t *) pc.buffer;
> + prm = (onstream_tape_paramtr_page_t *) (pc.buffer + sizeof(idetape_mode_parameter_header_t) + header->bdl);
> +
> + tape->capacity = ntohs(prm->segtrk) * ntohs(prm->trks);
> + if (debug) {
> + printk (KERN_INFO "ide-tape: %s <-> %s: Tape length %dMB (%d frames/track, %d tracks = %d blocks, density: %dKbpi)\n",
> + drive->name, tape->name, tape->capacity/32, ntohs(prm->segtrk), ntohs(prm->trks), tape->capacity, prm->density);
> + }
> +
> + return;
> +}
> +
> +/*
> * idetape_get_mode_sense_results asks the tape about its various
> * parameters. In particular, we will adjust our data transfer buffer
> * size to the recommended value as returned by the tape.
> @@ -5629,8 +5819,8 @@
> idetape_mode_parameter_header_t *header;
> idetape_capabilities_page_t *capabilities;
>
> - idetape_create_mode_sense_cmd (&pc,IDETAPE_CAPABILITIES_PAGE);
> - if (idetape_queue_pc_tail (drive,&pc)) {
> + idetape_create_mode_sense_cmd (&pc, IDETAPE_CAPABILITIES_PAGE);
> + if (idetape_queue_pc_tail (drive, &pc)) {
> printk (KERN_ERR "ide-tape: Can't get tape parameters - assuming some default values\n");
> tape->tape_block_size = 512; tape->capabilities.ctl = 52;
> tape->capabilities.speed = 450; tape->capabilities.buffer_size = 6 * 52;
> @@ -5721,6 +5911,9 @@
> ide_add_setting(drive, "tape_still_time",SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->tape_still_time, NULL);
> ide_add_setting(drive, "max_insert_speed",SETTING_RW, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->max_insert_speed, NULL);
> ide_add_setting(drive, "insert_size", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->insert_size, NULL);
> + ide_add_setting(drive, "capacity", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->capacity, NULL);
> + ide_add_setting(drive, "first_frame", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->first_frame_position, NULL);
> + ide_add_setting(drive, "logical_blk", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->logical_blk_num, NULL);
> }
> }
>
> @@ -5747,7 +5940,7 @@
> spin_lock_init(&tape->spinlock);
> drive->driver_data = tape;
> drive->ready_stat = 0; /* An ATAPI device ignores DRDY */
> - if (strstr(drive->id->model, "OnStream DI-30"))
> + if (strstr(drive->id->model, "OnStream DI-"))
> tape->onstream = 1;
> drive->dsc_overlap = 1;
> #ifdef CONFIG_BLK_DEV_IDEPCI
> @@ -5778,8 +5971,10 @@
>
> idetape_get_inquiry_results(drive);
> idetape_get_mode_sense_results(drive);
> - if (tape->onstream)
> - idetape_configure_onstream(drive);
> + if (tape->onstream) {
> + idetape_onstream_mode_sense_tape_parameter_page(drive, 1);
> + idetape_configure_onstream(drive);
> + }
>
> tape->user_bs_factor = 1;
> tape->stage_size = tape->capabilities.ctl * tape->tape_block_size;
> @@ -5867,8 +6062,8 @@
> char *out = page;
> int len;
>
> - len = sprintf(out,"%s\n", tape->name);
> - PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
> + len = sprintf(out, "%s\n", tape->name);
> + PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
> }
>
> static ide_proc_entry_t idetape_proc[] = {
> @@ -5962,7 +6157,7 @@
> continue;
> }
> if (drive->scsi) {
> - if (strstr(drive->id->model, "OnStream DI-30")) {
> + if (strstr(drive->id->model, "OnStream DI-")) {
> printk("ide-tape: ide-scsi emulation is not supported for %s.\n", drive->id->model);
> } else {
> printk("ide-tape: passing drive %s to ide-scsi emulation.\n", drive->name);
>
Andre Hedrick
Linux ATA Development
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-01-11 22:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-11 1:59 Linux 2.4.0-ac6 Alan Cox
2001-01-11 10:51 ` J . A . Magallon
2001-01-11 15:59 ` Udo A. Steinberg
2001-01-11 17:40 ` [OOPS] APIC on Athlon [was Re: Linux 2.4.0-ac6] Udo A. Steinberg
2001-01-11 21:59 ` [PATCH] improved IDE OnStream support for linux 2.4 Marcel J.E. Mol
2001-01-11 22:04 ` Andre Hedrick
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®