Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/hp300/dev/mt.c
RevisionDateAuthorComments
 1.56  26-Nov-2022  tsutsui Misc KNF and cosmetics.

No binary change.
 1.55  05-Jul-2021  tsutsui Pull HP-IB probe fixes from OpenBSD/hp300.

https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2
> Overhaul the way HP-IB devices are probed. We will now do an exhaustive
> probe of the (slave, punit) tuple space, since this is the only way we
> can get a dual disk or dual tape enclosure to attach two devices of the
> same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.
 1.54  25-Jul-2014  dholland branches: 1.54.32; 1.54.44;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.53  25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.52  24-Mar-2014  christos branches: 1.52.2;
- remove unused
- use cpu_{g,s}etmodel
 1.51  16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.50  05-Dec-2009  pooka branches: 1.50.12; 1.50.22; 1.50.26;
Convert tsleep(&lbolt) to kpause(). Make ltsleep/mtsleep on lbolt
illegal. I examined all places where lbolt is referenced to make
sure there were pointer aliases of it passed to tsleep, but put a
KASSERT in m/ltsleep() just to be sure.
 1.49  26-May-2009  he Remove a now-unused local variable.
 1.48  26-May-2009  ad Build failure, reported by he@
 1.47  18-May-2009  ad Don't pass a buffer to physio(), let it be allocated dynamically.

This leaves only scsipi and atapi doing the same.
 1.46  13-Jan-2009  yamt g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.45  17-Jun-2008  he branches: 1.45.4;
Correct minor mistakes and restore this to a buildable state.
 1.44  13-Jun-2008  cegger use device_lookup_private to get softc
 1.43  28-Apr-2008  martin branches: 1.43.2; 1.43.4;
Remove clause 3 and 4 from TNF licenses
 1.42  29-Mar-2008  tsutsui branches: 1.42.2; 1.42.4;
Split device_t/softc, and misc cosmetic changes.
 1.41  02-Jan-2008  ad branches: 1.41.6;
Merge vmlocking2 to head.
 1.40  17-Oct-2007  garbled branches: 1.40.2; 1.40.4; 1.40.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.39  29-Jul-2007  ad branches: 1.39.6;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.38  12-Jul-2007  he branches: 1.38.2; 1.38.4;
Adapt to the new signature of callout_init().
 1.37  04-Mar-2007  christos branches: 1.37.2; 1.37.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.36  15-Feb-2007  reinoud branches: 1.36.2;
Rename the B_XXX flag to B_DEVPRIVATE flag since it was never used for
debugging and its main use is in device drivers. Its used there to signal
that the flagged buffer has a special meaning or should be handled
differently.

OK'd by Bill Sudenmund on tech-kern.
 1.35  21-Jul-2006  tsutsui Some KNF.
 1.34  28-Mar-2006  thorpej Use device_unit().
 1.33  19-Mar-2006  tsutsui TAB/space cleanup.
 1.32  23-Feb-2006  thorpej branches: 1.32.2; 1.32.4; 1.32.6;
Use device_parent().
 1.31  11-Dec-2005  christos branches: 1.31.2; 1.31.4; 1.31.6;
merge ktrace-lwp.
 1.30  15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.29  02-Jun-2005  tsutsui branches: 1.29.2;
Add const.
 1.28  19-Feb-2005  tsutsui Include "ioconf.h" for struct cfdriver *_cd decls.
 1.27  28-Oct-2004  yamt branches: 1.27.4; 1.27.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.26  22-Sep-2004  yamt fix printf formats to match with sys/buf.h 1.75.
 1.25  28-Aug-2004  thorpej Use ANSI function decls, static, and const.
 1.24  17-Nov-2003  tsutsui TAB/space cleanup.
 1.23  29-Jun-2003  fvdl branches: 1.23.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.22  29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.21  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.20  02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.19  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.18  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.17  26-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.16  15-Mar-2002  gmcgarry branches: 1.16.4;
Add RCSIDs.
 1.15  23-Feb-2002  gmcgarry Unnecessary to cast splx() to void.
 1.14  19-May-2000  thorpej branches: 1.14.6; 1.14.8; 1.14.12;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.13  23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.12  06-Feb-2000  frueauf remove unused variable *dp.
 1.11  21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.10  12-Jan-1998  thorpej branches: 1.10.14;
Update for changes to config.
 1.9  04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.8  31-Mar-1997  scottr branches: 1.8.4;
Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
 1.7  30-Jan-1997  thorpej Convert to new-style autoconfiguration; old-style config is no longer
supported.
 1.6  14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.5  13-Oct-1996  christos backout previous kprintf changes
 1.4  11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.3  14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.2  02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.
 1.1  02-Oct-1995  thorpej Driver for HP 7974a, 7978a/b, 7979a, 7980a, and 7980xc 9-track HP-IB tapes.
Original version contributed to Utah by Mt. Xinu. Ported to 4.4BSD by
Mark Davies and Andrew Vignaux.
 1.8.4.1  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.14.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.12.6  11-Nov-2002  nathanw Catch up to -current
 1.14.12.5  18-Oct-2002  nathanw Catch up to -current.
 1.14.12.4  17-Sep-2002  nathanw Catch up to -current.
 1.14.12.3  01-Aug-2002  nathanw Catch up to -current.
 1.14.12.2  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.14.12.1  28-Feb-2002  nathanw Catch up to -current.
 1.14.8.4  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.8.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.14.8.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.8.1  16-Mar-2002  jdolecek Catch up with -current.
 1.14.6.1  10-Oct-2001  fvdl Convert all remaining devices.
 1.16.4.2  30-Aug-2002  gehenna catch up with -current.
 1.16.4.1  17-May-2002  gehenna Add device switch.
 1.23.2.9  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.23.2.8  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.23.2.7  24-Jan-2005  skrll Adapt to branch.
 1.23.2.6  02-Nov-2004  skrll Sync with HEAD.
 1.23.2.5  24-Sep-2004  skrll Sync with HEAD.
 1.23.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.23.2.2  03-Sep-2004  skrll Sync with HEAD
 1.23.2.1  03-Aug-2004  skrll Sync with HEAD
 1.27.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.27.4.1  29-Apr-2005  kent sync with -current
 1.29.2.5  21-Jan-2008  yamt sync with head
 1.29.2.4  03-Sep-2007  yamt sync with head.
 1.29.2.3  26-Feb-2007  yamt sync with head.
 1.29.2.2  30-Dec-2006  yamt sync with head.
 1.29.2.1  21-Jun-2006  yamt sync with head.
 1.31.6.1  22-Apr-2006  simonb Sync with head.
 1.31.4.1  09-Sep-2006  rpaulo sync with head
 1.31.2.1  01-Mar-2006  yamt sync with head.
 1.32.6.2  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.32.6.1  28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.32.4.1  19-Apr-2006  elad sync with head - hopefully this will work
 1.32.2.2  11-Aug-2006  yamt sync with head
 1.32.2.1  01-Apr-2006  yamt sync with head.
 1.36.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.37.10.1  03-Oct-2007  garbled Sync with HEAD
 1.37.2.2  19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.37.2.1  15-Jul-2007  ad Sync with head.
 1.38.4.1  15-Aug-2007  skrll Sync with HEAD.
 1.38.2.1  07-Aug-2007  matt Sync with HEAD.
 1.39.6.2  09-Jan-2008  matt sync with HEAD
 1.39.6.1  06-Nov-2007  matt sync with HEAD
 1.40.8.1  02-Jan-2008  bouyer Sync with HEAD
 1.40.4.1  31-Dec-2007  ad Make compile with new buffer cache locking scheme.

XXX This should be largely MI, please do not make another clone of disksubr.c.
 1.40.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.41.6.4  17-Jan-2009  mjf Sync with HEAD.
 1.41.6.3  29-Jun-2008  mjf Sync with HEAD.
 1.41.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.41.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.42.4.4  11-Mar-2010  yamt sync with head
 1.42.4.3  20-Jun-2009  yamt sync with head
 1.42.4.2  04-May-2009  yamt sync with head.
 1.42.4.1  16-May-2008  yamt sync with head.
 1.42.2.2  17-Jun-2008  yamt sync with head.
 1.42.2.1  18-May-2008  yamt sync with head.
 1.43.4.1  18-Jun-2008  simonb Sync with head.
 1.43.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.45.4.1  19-Jan-2009  skrll Sync with HEAD.
 1.50.26.1  18-May-2014  rmind sync with head
 1.50.22.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.50.12.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.52.2.1  10-Aug-2014  tls Rebase.
 1.54.44.1  01-Aug-2021  thorpej Sync with HEAD.
 1.54.32.1  14-Jul-2021  martin Pull up following revision(s) (requested by tsutsui in ticket #1323):

sys/arch/hp300/dev/rd.c: revision 1.109
sys/arch/hp300/stand/Makefile.buildboot: revision 1.37
sys/arch/hp300/stand/common/ct.c: revision 1.8
sys/arch/hp300/dev/hpibvar.h: revision 1.22
sys/arch/hp300/dev/ct.c: revision 1.62
sys/arch/hp300/dev/hpibvar.h: revision 1.23
sys/arch/hp300/dev/ct.c: revision 1.63
sys/arch/hp300/dev/hpibvar.h: revision 1.24
sys/arch/hp300/dev/mt.c: revision 1.55
sys/arch/hp300/dev/rdreg.h: revision 1.14
sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch)
sys/arch/hp300/dev/rdreg.h: revision 1.15
sys/arch/hp300/dev/rdreg.h: revision 1.16
sys/arch/hp300/dev/rdreg.h: revision 1.17
etc/etc.hp300/MAKEDEV.conf: revision 1.15
sys/arch/hp300/stand/common/hpibvar.h: revision 1.6
sys/arch/hp300/stand/common/rd.c: revision 1.11
sys/arch/hp300/dev/ctreg.h: revision 1.11
sys/arch/hp300/dev/rdvar.h: revision 1.24
sys/arch/hp300/dev/rdvar.h: revision 1.25
sys/arch/hp300/dev/rdvar.h: revision 1.26
sys/arch/hp300/dev/rd.c: revision 1.103
sys/arch/hp300/dev/rd.c: revision 1.104
sys/arch/hp300/dev/rd.c: revision 1.105
sys/arch/hp300/dev/rd.c: revision 1.106
sys/arch/hp300/dev/rd.c: revision 1.107
sys/arch/hp300/dev/rd.c: revision 1.108

Consistently use #define<tab> here.

Consistently use #define<tab> as rdreg.h.

No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.

Pull HP-IB probe fixes from OpenBSD/hp300.
https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2

Overhaul the way HP-IB devices are probed. We will now do an exhaustive
probe of the (slave, punit) tuple space, since this is the only way we
can get a dual disk or dual tape enclosure to attach two devices of the
same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.

Move attach messages from common rdident() to explicit rdattach().

Cleanup duplicated CS/80 indentify structures. From OpenBSD.
https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2

Define the CS/80 identify structure only once and correctly, instead of
duplicating it in every CS/80 driver and using an hardcoded number for
its size.
No functional change.
https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2

Pick HP-IB describe structures changes from main kernel code here as well.

Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.

Specify -fno-unwind-tables to shrink binaries.

Before:
text data bss dec hex filename
77902 4328 137120 219350 358d6 uboot

After:
text data bss dec hex filename
64186 4328 137120 205634 32342 uboot

Create rd3 device nodes, for HPDisk.

Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive. Briefly tested on HPDisk.

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks

RSS XML Feed