Home | History | Annotate | Download | only in ofw
History log of /src/sys/dev/ofw/ofdisk.c
RevisionDateAuthorComments
 1.54  26-Jan-2020  thorpej Fix __HAVE_OLD_DISKLABEL bits so they at least compile.
 1.53  27-Mar-2019  martin branches: 1.53.6;
Add a disk ioctl DIOCRMWEDGES to remove all wedges of a given disk
(if not busy).
 1.52  25-Mar-2017  martin branches: 1.52.6; 1.52.14;
Virtio block devices may have a "scsi" device_type instead of "block",
so accept both.
 1.51  26-Apr-2015  mlelstv branches: 1.51.2; 1.51.4;
Use C99-style initializers for struct dkdriver.
 1.50  31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.49  31-Dec-2014  christos Centralize wedge ioctls in disk_ioctl.
 1.48  09-Nov-2014  mlelstv branches: 1.48.2;
support DIOCMWEDGES ioctl
 1.47  25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.46  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.45  16-Mar-2014  dholland branches: 1.45.2;
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.44  26-Jul-2011  mrg branches: 1.44.2; 1.44.12; 1.44.16;
convert to device_t, cfdata_t and CFATTACH_DECL_NEW.
 1.43  12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.42  12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.41  12-Jun-2008  cegger branches: 1.41.10;
use device_lookup_private to get softc
 1.40  08-Apr-2008  cegger branches: 1.40.2; 1.40.4; 1.40.6; 1.40.8;
use aprint_*_dev and device_xname
 1.39  17-Oct-2007  he branches: 1.39.16;
Correct the order of the arguments to disk_init().
 1.38  08-Oct-2007  ad branches: 1.38.2;
Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.37  29-Jul-2007  ad branches: 1.37.4; 1.37.6; 1.37.8; 1.37.10;
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.36  21-Jul-2007  ad Replace some uses of lockmgr().
 1.35  04-Mar-2007  christos branches: 1.35.2; 1.35.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.34  29-Jan-2007  hubertf branches: 1.34.2;
Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
 1.33  29-Mar-2006  thorpej branches: 1.33.8;
Use device_private().
 1.32  11-Dec-2005  christos branches: 1.32.4; 1.32.6; 1.32.8; 1.32.10; 1.32.12;
merge ktrace-lwp.
 1.31  09-Jun-2005  he branches: 1.31.2;
Now that OF_read and OF_write have different signatures, we need to
cast one of them before assigning to a common function pointer.
Yes, this breaks strict type checking, but is needed to compile with
-Wcast-qual turned on.
 1.30  27-Feb-2005  perry nuke trailing whitespace
 1.29  25-Sep-2004  thorpej branches: 1.29.4; 1.29.6;
Add support for wedges to the OpenFirmware disk driver.
 1.28  23-Apr-2004  itojun use safer string manipulation function
 1.27  10-May-2003  thorpej branches: 1.27.2;
Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.26  02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.25  01-Nov-2002  mrg implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail. however, the next time this is
change it will not fail again.

this is just the kernel portion.
 1.24  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.23  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.22  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.21  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.20  18-Sep-2002  chs fix error checking in ofdisk_open().
remove all vesitages of dk_establish().
 1.19  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.18  13-Nov-2001  lukem branches: 1.18.8;
add RCSIDs
 1.17  26-Aug-2001  matt branches: 1.17.2;
Make compile with -Wmissing-prototype -Wstrict-prototypes
 1.16  25-Aug-2001  matt Make this compile with -Wmissing-prototypes by adding appropriate
cdev_decl, bdev_decl, cons_decl
 1.15  08-Jan-2001  fvdl branches: 1.15.2; 1.15.4;
Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
 1.14  07-Jan-2001  fvdl Adapt all disk devices in MI directories to handle ODIOC* calls
for ports that have bumped MAXPARTITIONS (and thus define
__HAVE_OLD_DISKLABEL).
 1.13  16-May-2000  thorpej branches: 1.13.4;
Nuke dk_establish() from orbit except from those ports which still use
it to determine the boot device: mvme68k, pc532, macppc, ofppc. Those
platforms should be changed to use device_register(). In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
 1.12  21-Mar-1998  cgd branches: 1.12.14;
-Wall (one real bug, even!)
 1.11  24-Feb-1998  mycroft Minor style change.
 1.10  24-Feb-1998  mycroft Several things:
Clean up the name space here a bit.
Add a `busname' element to struct ofprobe (now struct ofbus_attach_args), and
check against it.
Nuke `ofroot'.
Rename the `openfirm' attribute to `ofbus'.
 1.9  12-Jan-1998  thorpej Update for config changes.
 1.8  08-Oct-1997  thorpej Oops, fix a couple of typos.
 1.7  08-Oct-1997  thorpej Implement DIOCGDEFLABEL.
 1.6  23-Jul-1997  thorpej branches: 1.6.2;
Fix an oversight and a typo.
 1.5  24-Jun-1997  thorpej Three changes to ofdsize():
- If the partition is already open, skip the open/close step. (Sync
with other disk drivers.)
- foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
from the disklabel accordingly.
- Pass correct arguments to ofdopen() and ofdclose().
 1.4  16-Apr-1997  thorpej - Update for no __BROKEN_INDIRECT_CONFIG.
- Determine and remember if we are a floppy.
- Workaround for what is apparently a firmware bug - ignore the sector
size returned by the device. On my Firepower's floppy, block-size
is the same as max-transfer, which causes Lossage.
- Don't read the disklabel on a floppy; do what the ISA floppy driver
does, which is assign the entire disk to each "partition", although
we do not deal with the density stuff.
- FIREPOWERBUGS -> FIRMWORKSBUGS
- Some general cleanup.
 1.3  13-Oct-1996  christos backout kprintf changes
 1.2  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.1  30-Sep-1996  ws PowerPC port
 1.6.2.1  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.14.2  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.12.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.13.4.1  01-May-2001  he Pull up revisions 1.14-1.15 (requested by fvdl):
Increase the number of BSD disklabel partitions on i386 to 16.
 1.15.4.3  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.15.4.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.4.1  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.15.2.7  11-Nov-2002  nathanw Catch up to -current
 1.15.2.6  18-Oct-2002  nathanw Catch up to -current.
 1.15.2.5  17-Sep-2002  nathanw Catch up to -current.
 1.15.2.4  10-Jul-2002  nathanw Need curproc as parameter to ofdisk_{open,close}().
 1.15.2.3  24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.15.2.2  14-Nov-2001  nathanw Catch up to -current.
 1.15.2.1  21-Sep-2001  nathanw Catch up to -current.
 1.17.2.1  10-Oct-2001  fvdl Convert all remaining devices.
 1.18.8.1  16-May-2002  gehenna Add the block/character device switches.
 1.27.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.27.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.27.2.5  31-Jan-2005  skrll Adapt to branch.
 1.27.2.4  19-Oct-2004  skrll Sync with HEAD
 1.27.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.27.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.27.2.1  03-Aug-2004  skrll Sync with HEAD
 1.29.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.29.4.1  29-Apr-2005  kent sync with -current
 1.31.2.4  27-Oct-2007  yamt sync with head.
 1.31.2.3  03-Sep-2007  yamt sync with head.
 1.31.2.2  26-Feb-2007  yamt sync with head.
 1.31.2.1  21-Jun-2006  yamt sync with head.
 1.32.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.32.10.1  19-Apr-2006  elad sync with head.
 1.32.8.1  01-Apr-2006  yamt sync with head.
 1.32.6.1  22-Apr-2006  simonb Sync with head.
 1.32.4.1  09-Sep-2006  rpaulo sync with head
 1.33.8.1  01-Feb-2007  ad Sync with head.
 1.34.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.35.10.1  15-Aug-2007  skrll Sync with HEAD.
 1.35.2.3  23-Oct-2007  ad Sync with head.
 1.35.2.2  20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.35.2.1  19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.37.10.2  29-Jul-2007  ad 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.37.10.1  29-Jul-2007  ad file ofdisk.c was added on branch matt-mips64 on 2007-07-29 12:15:44 +0000
 1.37.8.2  18-Oct-2007  yamt sync with head.
 1.37.8.1  14-Oct-2007  yamt sync with head.
 1.37.6.1  06-Nov-2007  matt sync with HEAD
 1.37.4.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.38.2.1  25-Oct-2007  bouyer Sync with HEAD.
 1.39.16.2  29-Jun-2008  mjf Sync with HEAD.
 1.39.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.40.8.1  18-Jun-2008  simonb Sync with head.
 1.40.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.40.4.2  16-May-2009  yamt sync with head
 1.40.4.1  04-May-2009  yamt sync with head.
 1.40.2.1  17-Jun-2008  yamt sync with head.
 1.41.10.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.44.16.1  18-May-2014  rmind sync with head
 1.44.12.2  03-Dec-2017  jdolecek update from HEAD
 1.44.12.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.44.2.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.45.2.1  10-Aug-2014  tls Rebase.
 1.48.2.3  28-Aug-2017  skrll Sync with HEAD
 1.48.2.2  06-Jun-2015  skrll Sync with HEAD
 1.48.2.1  06-Apr-2015  skrll Sync with HEAD
 1.51.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.51.2.1  26-Apr-2017  pgoyette Sync with HEAD
 1.52.14.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.52.14.1  10-Jun-2019  christos Sync with HEAD
 1.52.6.1  05-Apr-2019  msaitoh Pull up following revision(s) (requested by martin in ticket #1223):
sys/sys/dkio.h: revision 1.25
sys/kern/subr_disk.c: revision 1.123
sys/dev/dksubr.c: revision 1.107
sys/dev/ccd.c: revision 1.179
sys/dev/ofw/ofdisk.c: revision 1.53
Add a disk ioctl DIOCRMWEDGES to remove all wedges of a given disk
(if not busy).
 1.53.6.1  29-Feb-2020  ad Sync with head.

RSS XML Feed