Home | History | Annotate | only in /src/sys/dev/pci/bktr
History log of /src/sys/dev/pci/bktr
RevisionDateAuthorComments
 1.4 12-Mar-2003  wiz Merge first bktr-sf import.
 1.3 01-Jul-2000  wiz branches: 1.3.2;
re-add README that got lost in 2.12-to-2.14 merge.
 1.2 01-Jul-2000  wiz resolve conflicts.
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.2 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.1 07-May-2000  wiz Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.3.2.2 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.3.2.1 01-Jul-2000  bouyer file README was added on branch thorpej_scsipi on 2000-11-20 22:35:45 +0000
 1.7 12-Mar-2003  wiz Remove some.
 1.6 29-Nov-2001  wiz Update note about ioctl tsleep error with error report.
 1.5 28-Oct-2000  wiz branches: 1.5.2; 1.5.4; 1.5.6;
Replace remaining vm_offset_t's in NetBSD code by vaddr_t; remove now
unnecessary casts added by thorpej in 1.11 of bktr_core.c. Strike one
from the TODO list.
 1.4 03-Sep-2000  wiz remove one
 1.3 07-May-2000  wiz man page is written, remove it from TODO
 1.2 07-May-2000  wiz add one
 1.1 07-May-2000  wiz Some NetBSD specific changes; also TODO, and import script, based
on bind2netbsd by Bernd Ernesti
 1.5.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.4.1 08-Jan-2002  nathanw Catch up to -current.
 1.5.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.5.2.2 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.5.2.1 28-Oct-2000  bouyer file TODO was added on branch thorpej_scsipi on 2000-11-20 22:35:45 +0000
 1.7 08-Sep-2024  rillig normalize wording in import helpers
 1.6 30-Apr-2008  martin branches: 1.6.126;
Convert TNF licenses to new 2 clause variant
 1.5 21-Mar-2007  isaki branches: 1.5.30; 1.5.32; 1.5.34;
Fix mis-substitution of RCS Id, and avoid it.
Reviewed by wiz@.
 1.4 12-Mar-2003  wiz branches: 1.4.18; 1.4.56; 1.4.60; 1.4.62; 1.4.64;
Update script for bktr-sf imports.
 1.3 28-Oct-2000  wiz branches: 1.3.2;
Delete more files before import.
 1.2 07-May-2000  wiz multiple inclusion protection
 1.1 07-May-2000  wiz Some NetBSD specific changes; also TODO, and import script, based
on bind2netbsd by Bernd Ernesti
 1.3.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.3.2.2 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.3.2.1 28-Oct-2000  bouyer file bktr2netbsd was added on branch thorpej_scsipi on 2000-11-20 22:35:45 +0000
 1.4.64.1 29-Mar-2007  reinoud Pullup to -current
 1.4.62.1 11-Jul-2007  mjf Sync with head.
 1.4.60.1 15-Jul-2007  ad Sync with head.
 1.4.56.1 24-Mar-2007  yamt sync with head.
 1.4.18.1 03-Sep-2007  yamt sync with head.
 1.5.34.1 16-May-2008  yamt sync with head.
 1.5.32.1 18-May-2008  yamt sync with head.
 1.5.30.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.126.1 02-Aug-2025  perseant Sync with HEAD
 1.20 19-Dec-2021  andvar fix various typos in bktr driver comments.
 1.19 07-Dec-2012  msaitoh - sprintf() -> snprintf()
- Fix typo in comment.
 1.18 16-Jan-2008  jmcneill branches: 1.18.44; 1.18.54;
Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.17 19-Oct-2007  ad branches: 1.17.2; 1.17.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.16 24-Nov-2006  wiz branches: 1.16.2; 1.16.8; 1.16.16; 1.16.22; 1.16.24; 1.16.28;
s/existance/existence/, from Zafer.
 1.15 08-Mar-2006  lukem branches: 1.15.10; 1.15.12;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.14 06-Dec-2005  wiz branches: 1.14.4; 1.14.6; 1.14.8; 1.14.10;
Handle MSP3435G the same as MSP3430G. From Scott Presnell in PR 28682.
 1.13 12-May-2004  wiz branches: 1.13.10; 1.13.12;
Fix typo in comment; from Robert Nagy via OpenBSD.
 1.12 12-Mar-2003  wiz branches: 1.12.2;
Merge some more.
 1.11 12-Mar-2003  wiz Merge first bktr-sf import.
 1.10 04-Jan-2003  wiz Spell output with two ts.
 1.9 13-Nov-2001  lukem add RCSIDs
 1.8 30-Dec-2000  wiz branches: 1.8.2; 1.8.4;
Merge 2.18 to trunk.
 1.7 28-Oct-2000  wiz branches: 1.7.2;
Merge 2.17 changes to trunk.
 1.6 01-Jul-2000  wiz resolve conflicts.
 1.5 21-May-2000  wiz branches: 1.5.4;
Use bktr_softc.bktr_dev.dv_xname instead of "bktr0" when printf'ing as
requested by Klaus Klein in kern/10166.
Also add device instance name to all printf's that didn't have it.
 1.4 07-May-2000  veego It is a bad idea to declare a static bootverbose variable here. Remove it.
 1.3 07-May-2000  wiz remove unnecessary output to console
 1.2 07-May-2000  wiz Some NetBSD specific changes; also TODO, and import script, based
on bind2netbsd by Bernd Ernesti
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.5 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.4 30-Dec-2000  wiz Import release 2.18 of the bktr driver. Changes since 2.17:
o Add new ioctls to allow userland programs fuller access to the I2C
bus, BT848_MSP_READ BT848_MSP_WRITE and BT848_MSP_RESET.
o Add tuner type 0x2a. Remove 0x2c which was incorrect.
o Christian Gusenbauer <Christian.Gusenbauer@netway.at> added support
for audio on Hauppauge cards without the audio mux. The MSP is used
for audio selection. (the 44xxx models)
 1.1.1.3 28-Oct-2000  wiz Import release 2.17 of the bktr driver.
Changes: Integration of some NetBSD changes. (FreeBSD version now is also
usable as a KLD (~= LKM).)
 1.1.1.2 01-Jul-2000  wiz Import release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.
 1.1.1.1 07-May-2000  wiz Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.5.4.1 03-Jul-2000  wiz Pull up revision 1.6 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.
 1.7.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.7.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.7.2.2 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.7.2.1 28-Oct-2000  bouyer file bktr_audio.c was added on branch thorpej_scsipi on 2000-11-20 22:35:45 +0000
 1.8.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.2 07-Jan-2003  thorpej Sync with HEAD.
 1.8.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.12.2.4 11-Dec-2005  christos Sync with head.
 1.12.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13.12.4 21-Jan-2008  yamt sync with head
 1.13.12.3 27-Oct-2007  yamt sync with head.
 1.13.12.2 30-Dec-2006  yamt sync with head.
 1.13.12.1 21-Jun-2006  yamt sync with head.
 1.13.10.1 07-Dec-2005  riz Pull up following revision(s) (requested by wiz in ticket #1035):
sys/dev/pci/bktr/bktr_audio.c: revision 1.14
Handle MSP3435G the same as MSP3430G. From Scott Presnell in PR 28682.
 1.14.10.1 19-Apr-2006  elad sync with head.
 1.14.8.1 13-Mar-2006  yamt sync with head.
 1.14.6.1 22-Apr-2006  simonb Sync with head.
 1.14.4.1 09-Sep-2006  rpaulo sync with head
 1.15.12.1 10-Dec-2006  yamt sync with head.
 1.15.10.1 12-Jan-2007  ad Sync with head.
 1.16.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.16.24.2 23-Mar-2008  matt sync with HEAD
 1.16.24.1 06-Nov-2007  matt sync with HEAD
 1.16.22.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.16.16.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.16.8.1 23-Oct-2007  ad Sync with head.
 1.16.2.1 21-Jan-2008  bouyer Pull up following revision(s) (requested by jmcneill in ticket #1046):
sys/dev/pci/bktr/bktr_reg.h: revision 1.18
sys/dev/pci/bktr/bktr_audio.c: revision 1.18
sys/dev/pci/bktr/bktr_os.c: revision 1.49
sys/dev/pci/bktr/bktr_core.c: revision 1.46
sys/dev/ic/bt8xx.h: revision 1.9
sys/dev/pci/bktr/bktr_core.h: revision 1.10
Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.17.8.1 19-Jan-2008  bouyer Sync with HEAD
 1.17.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.18.54.1 25-Feb-2013  tls resync with head
 1.18.44.1 16-Jan-2013  yamt sync with (a bit old) head
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 12-May-2004  wiz Fix typo in comment; from Robert Nagy via OpenBSD.
 1.2 12-Mar-2003  wiz branches: 1.2.2;
Merge first bktr-sf import.
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.2 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.1 07-May-2000  wiz branches: 1.1.1.1.6;
Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.1.1.1.6.2 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.1.1.1.6.1 07-May-2000  bouyer file bktr_audio.h was added on branch thorpej_scsipi on 2000-11-20 22:35:46 +0000
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25 16-Oct-2013  christos remove unused variables.
 1.24 19-Oct-2007  ad branches: 1.24.54; 1.24.64; 1.24.70;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.23 16-Nov-2006  christos branches: 1.23.8; 1.23.22; 1.23.24; 1.23.28;
__unused removal on arguments; approved by core.
 1.22 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.21 06-Dec-2005  wiz branches: 1.21.20; 1.21.22;
Add support for two models of Terratec TValue cards.
From FreeBSD problem report 53383, submitted by Tanja Wittke,
updated by Simon Barner. Adapted for NetBSD by Alexander Becher,
via port-i386.
 1.20 30-May-2005  christos branches: 1.20.2;
- avoid variable shadowing
- add const
 1.19 24-Jul-2004  mrg match LeadTek's original PCI vendor ID as well as the 3-alternates
when setting CARD_LEADTEK. now with just

options BKTR_SYSTEM_DEFAULT=BROOKTREE_PAL

i get a shiny happy working card on my macppc box:

bktr0 at pci1 dev 18 function 0
bktr0: interrupting at irq 52
bktr0: Leadtek WinFast TV2000/VC100, Philips FR1216 PAL FM tuner.
 1.18 12-May-2004  wiz Add one more unofficial leadtek PCI vendor id; from Robert Nagy
via OpenBSD.
 1.17 23-Apr-2004  simonb s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
 1.16 30-Oct-2003  simonb Remove some assigned-to but otherwise unused variables.
 1.15 12-Mar-2003  wiz branches: 1.15.2;
Merge first bktr-sf import.
 1.14 14-Jan-2003  wiz Recognise tuner on WinTV-GO-FM. From PR 19844 by Wolfgang S. Rupprecht.
 1.13 10-Jan-2003  mjl Make this work on big endian platforms (mostly from OpenBSD):
Uploaded scripts work better if they are little endian, as the
card's engine expects, so convert to le first.

Also clean up attach routine a bit (use pa_id and PCI_REVISION
instead of fetching it ourselves).

This makes the driver work on my macppc G4, it can decode and
display video and tuner input. Sound does not seem to work, but
this may be my wonky formac bktr-for-macintosh card.
 1.12 23-Mar-2002  hamajima add WinFast VC100
 1.11 13-Nov-2001  lukem add RCSIDs
 1.10 16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.9 30-Dec-2000  wiz branches: 1.9.2; 1.9.4; 1.9.6;
Merge 2.18 to trunk.
 1.8 28-Oct-2000  wiz branches: 1.8.2;
Merge 2.17 changes to trunk.
 1.7 03-Sep-2000  wiz Use NetBSD's pcidevs file for vendors/cards as much as possible.
Recognize Pinnacle Studio PCTV Rave as Miro card, tested by rh@netbsd.org.
 1.6 01-Jul-2000  wiz resolve conflicts.
 1.5 21-May-2000  wiz branches: 1.5.4;
Use bktr_softc.bktr_dev.dv_xname instead of "bktr0" when printf'ing as
requested by Klaus Klein in kern/10166.
Also add device instance name to all printf's that didn't have it.
 1.4 20-May-2000  augustss Add a missing bktr%d: in one of the attach messages.

(When is this code going to be KNFed?)
 1.3 07-May-2000  veego It is a bad idea to declare a static bootverbose variable here. Remove it.
 1.2 07-May-2000  wiz Some NetBSD specific changes; also TODO, and import script, based
on bind2netbsd by Bernd Ernesti
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.5 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.4 30-Dec-2000  wiz Import release 2.18 of the bktr driver. Changes since 2.17:
o Add new ioctls to allow userland programs fuller access to the I2C
bus, BT848_MSP_READ BT848_MSP_WRITE and BT848_MSP_RESET.
o Add tuner type 0x2a. Remove 0x2c which was incorrect.
o Christian Gusenbauer <Christian.Gusenbauer@netway.at> added support
for audio on Hauppauge cards without the audio mux. The MSP is used
for audio selection. (the 44xxx models)
 1.1.1.3 28-Oct-2000  wiz Import release 2.17 of the bktr driver.
Changes: Integration of some NetBSD changes. (FreeBSD version now is also
usable as a KLD (~= LKM).)
 1.1.1.2 01-Jul-2000  wiz Import release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.
 1.1.1.1 07-May-2000  wiz Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.5.4.1 03-Jul-2000  wiz Pull up revision 1.6 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.
 1.8.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.8.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.8.2.2 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.8.2.1 28-Oct-2000  bouyer file bktr_card.c was added on branch thorpej_scsipi on 2000-11-20 22:35:46 +0000
 1.9.6.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.4 15-Jan-2003  thorpej Sync with HEAD.
 1.9.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.9.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.9.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.15.2.5 11-Dec-2005  christos Sync with head.
 1.15.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.2.3 27-Oct-2007  yamt sync with head.
 1.20.2.2 30-Dec-2006  yamt sync with head.
 1.20.2.1 21-Jun-2006  yamt sync with head.
 1.21.22.2 10-Dec-2006  yamt sync with head.
 1.21.22.1 22-Oct-2006  yamt sync with head
 1.21.20.1 18-Nov-2006  ad Sync with head.
 1.23.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.23.24.1 06-Nov-2007  matt sync with HEAD
 1.23.22.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.23.8.1 23-Oct-2007  ad Sync with head.
 1.24.70.1 18-May-2014  rmind sync with head
 1.24.64.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24.54.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.6 24-Aug-2012  msaitoh Fix typos
 1.5 06-Dec-2005  wiz branches: 1.5.110;
Add support for two models of Terratec TValue cards.
From FreeBSD problem report 53383, submitted by Tanja Wittke,
updated by Simon Barner. Adapted for NetBSD by Alexander Becher,
via port-i386.
 1.4 12-Mar-2003  wiz branches: 1.4.2; 1.4.18;
Merge first bktr-sf import.
 1.3 01-Jul-2000  wiz branches: 1.3.2;
resolve conflicts.
 1.2 07-May-2000  wiz branches: 1.2.4;
Some NetBSD specific changes; also TODO, and import script, based
on bind2netbsd by Bernd Ernesti
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.3 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.2 01-Jul-2000  wiz Import release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.
 1.1.1.1 07-May-2000  wiz Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.2.4.1 03-Jul-2000  wiz Pull up revision 1.3 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.
 1.3.2.2 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.3.2.1 01-Jul-2000  bouyer file bktr_card.h was added on branch thorpej_scsipi on 2000-11-20 22:35:46 +0000
 1.4.18.1 21-Jun-2006  yamt sync with head.
 1.4.2.1 11-Dec-2005  christos Sync with head.
 1.5.110.1 30-Oct-2012  yamt sync with head
 1.60 27-Jun-2025  andvar Grammar and spelling fixes, mainly in comments. A few in documentation,
logging, test description, and SCSI ASC/ASCQ assignment descriptions.
 1.59 19-Dec-2021  andvar branches: 1.59.10;
fix various typos in bktr driver comments.
 1.58 23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.57 23-Feb-2020  skrll typo in comment
 1.56 03-Feb-2019  mrg branches: 1.56.6;
- add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
 1.55 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.54 14-Dec-2012  joerg branches: 1.54.36; 1.54.38;
bt848_format is only defined in a __FreeBSD__ section of bktr_os.c and
overriding the local (static) definition with extern is bogus.
 1.53 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.52 30-Jun-2011  wiz branches: 1.52.2; 1.52.12;
dependant -> dependent
 1.51 13-Nov-2010  uebayasi Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.50 18-Mar-2009  cegger branches: 1.50.4;
bzero -> memset
 1.49 24-Apr-2008  ad branches: 1.49.2; 1.49.10; 1.49.16;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
 1.48 10-Apr-2008  cegger branches: 1.48.2;
use aprint_*_dev and device_xname
 1.47 01-Mar-2008  rmind Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.46 16-Jan-2008  jmcneill branches: 1.46.2; 1.46.6;
Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.45 04-Jan-2008  ad Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
 1.44 19-Oct-2007  ad branches: 1.44.2; 1.44.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.43 09-Jul-2007  ad branches: 1.43.6; 1.43.8; 1.43.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.42 04-Mar-2007  christos branches: 1.42.2; 1.42.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.41 09-Feb-2007  ad branches: 1.41.2;
Merge newlock2 to head.
 1.40 16-Nov-2006  christos branches: 1.40.2; 1.40.4;
__unused removal on arguments; approved by core.
 1.39 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.38 03-Sep-2006  bouyer branches: 1.38.2; 1.38.4;
stop attaching when a bus_dma operation fails, instead of using bogus
addresses.
Remplace vtophys() with proper bus_dma(9) use.
This driver now works properly on Xen
 1.37 28-Aug-2006  christos remove unreachable code.
 1.36 11-Dec-2005  christos branches: 1.36.4; 1.36.8; 1.36.18;
merge ktrace-lwp.
 1.35 30-May-2005  wiz branches: 1.35.2;
Fix replaco in comment.
 1.34 30-May-2005  christos - avoid variable shadowing
- add const
 1.33 29-Jun-2003  fvdl branches: 1.33.2; 1.33.16;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.32 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.31 03-May-2003  wiz DMA, not dma nor Dma.
 1.30 28-Apr-2003  fvdl Quell a strict-alias warning by applying the same cast to '&target' as
already done in all other cases.
 1.29 12-Mar-2003  wiz Merge some more.
 1.28 12-Mar-2003  wiz Merge first bktr-sf import.
 1.27 10-Jan-2003  mjl Make this work on big endian platforms (mostly from OpenBSD):
Uploaded scripts work better if they are little endian, as the
card's engine expects, so convert to le first.

Also clean up attach routine a bit (use pa_id and PCI_REVISION
instead of fetching it ourselves).

This makes the driver work on my macppc G4, it can decode and
display video and tuner input. Sound does not seem to work, but
this may be my wonky formac bktr-for-macintosh card.
 1.26 25-Dec-2002  toshii Fix broken programming of VSCALE_HI registers in yuv422_prog.
 1.25 25-Dec-2002  toshii Consistently use BKTR_GEN_IRQ and BKTR_RESYNC instead of numbers.
Also, do some whitespace cleanup.
 1.24 25-Dec-2002  toshii Merge FreeBSD rev.1.122:
Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.
 1.23 26-Nov-2002  christos si_ -> sel_
 1.22 28-Aug-2002  toshii Remove a superfluous interrupt request bit in yuvpack_prog,
which confuses the state machine in common_bktr_intr.
This makes "mplayer -tv ..." work (but only with NTSC).
 1.21 22-May-2002  wiz bcmp -> memcmp.
 1.20 13-Nov-2001  lukem branches: 1.20.8;
add RCSIDs
 1.19 28-Sep-2001  chs don't depend on other headers to include sys/proc.h for us.
 1.18 18-Sep-2001  wiz Give initiali[sz]e all the "i"s it deserves.
 1.17 03-Mar-2001  mjl branches: 1.17.2; 1.17.4; 1.17.6;
Correct wrong error return in mmap fn.
 1.16 01-Mar-2001  mjl Fix typo to make this compile even w/ debug defines.
 1.15 18-Jan-2001  jdolecek constify
 1.14 30-Dec-2000  wiz Merge 2.18 to trunk.
 1.13 28-Oct-2000  wiz branches: 1.13.2;
Replace remaining vm_offset_t's in NetBSD code by vaddr_t; remove now
unnecessary casts added by thorpej in 1.11 of bktr_core.c. Strike one
from the TODO list.
 1.12 28-Oct-2000  wiz Merge 2.17 changes to trunk.
 1.11 06-Sep-2000  thorpej Cast the argument to vtophys() to vaddr_t.
 1.10 03-Sep-2000  wiz Use NetBSD's pcidevs file for vendors/cards as much as possible.
Recognize Pinnacle Studio PCTV Rave as Miro card, tested by rh@netbsd.org.
 1.9 01-Jul-2000  wiz remove unnecessary #ifdef __NetBSD__'s in #ifdef __FreeBSD__;
move one #include <vm/vm.h> into #ifndef __NetBSD__
 1.8 01-Jul-2000  wiz resolve conflicts.
 1.7 30-Jun-2000  veego Move the include of <vm/vm.h> into the ifndef __NetBSD__ part.
 1.6 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.5 22-May-2000  wiz branches: 1.5.4;
Replaced overlooked BROOKTREE_SYSTEM_DEFAULT with BKTR_SYSTEM_DEFAULT,
as noted by Roger Hardiman.
 1.4 21-May-2000  wiz Use bktr_softc.bktr_dev.dv_xname instead of "bktr0" when printf'ing as
requested by Klaus Klein in kern/10166.
Also add device instance name to all printf's that didn't have it.
 1.3 07-May-2000  veego It is a bad idea to declare a static bootverbose variable here. Remove it.
 1.2 07-May-2000  wiz Some NetBSD specific changes; also TODO, and import script, based
on bind2netbsd by Bernd Ernesti
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.5 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.4 30-Dec-2000  wiz Import release 2.18 of the bktr driver. Changes since 2.17:
o Add new ioctls to allow userland programs fuller access to the I2C
bus, BT848_MSP_READ BT848_MSP_WRITE and BT848_MSP_RESET.
o Add tuner type 0x2a. Remove 0x2c which was incorrect.
o Christian Gusenbauer <Christian.Gusenbauer@netway.at> added support
for audio on Hauppauge cards without the audio mux. The MSP is used
for audio selection. (the 44xxx models)
 1.1.1.3 28-Oct-2000  wiz Import release 2.17 of the bktr driver.
Changes: Integration of some NetBSD changes. (FreeBSD version now is also
usable as a KLD (~= LKM).)
 1.1.1.2 01-Jul-2000  wiz Import release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.
 1.1.1.1 07-May-2000  wiz Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.5.4.1 03-Jul-2000  wiz Pull up revision 1.9 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.
 1.13.2.6 12-Mar-2001  bouyer Sync with HEAD.
 1.13.2.5 11-Feb-2001  bouyer Sync with HEAD.
 1.13.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.13.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.13.2.2 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.2.1 28-Oct-2000  bouyer file bktr_core.c was added on branch thorpej_scsipi on 2000-11-20 22:35:46 +0000
 1.17.6.1 01-Oct-2001  fvdl Catch up with -current.
 1.17.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.17.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.17.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.17.2.8 15-Jan-2003  thorpej Sync with HEAD.
 1.17.2.7 29-Dec-2002  thorpej Sync with HEAD.
 1.17.2.6 11-Dec-2002  thorpej Sync with HEAD.
 1.17.2.5 17-Sep-2002  nathanw Catch up to -current.
 1.17.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.17.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.17.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.17.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.20.8.2 29-Aug-2002  gehenna catch up with -current.
 1.20.8.1 30-May-2002  gehenna Catch up with -current.
 1.33.16.2 18-Nov-2006  bouyer Apply patch (requested by aymeric in ticket #1587)
fix bug introduced by missing braces around a if() block in
ticket #1511
 1.33.16.1 16-Sep-2006  ghen branches: 1.33.16.1.2;
Pull up following revision(s) (requested by bouyer in ticket #1511):
sys/dev/pci/bktr/bktr_core.c: revision 1.38
sys/dev/pci/bktr/bktr_os.c: revision 1.43
sys/dev/pci/bktr/bktr_core.h: revision 1.8
stop attaching when a bus_dma operation fails, instead of using bogus
addresses.
Remplace vtophys() with proper bus_dma(9) use.
This driver now works properly on Xen
 1.33.16.1.2.1 18-Nov-2006  bouyer Apply patch (requested by aymeric in ticket #1587)
fix bug introduced by missing braces around a if() block in
ticket #1511
 1.33.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.33.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.33.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.35.2.7 17-Mar-2008  yamt sync with head.
 1.35.2.6 21-Jan-2008  yamt sync with head
 1.35.2.5 27-Oct-2007  yamt sync with head.
 1.35.2.4 03-Sep-2007  yamt sync with head.
 1.35.2.3 26-Feb-2007  yamt sync with head.
 1.35.2.2 30-Dec-2006  yamt sync with head.
 1.35.2.1 21-Jun-2006  yamt sync with head.
 1.36.18.1 14-Sep-2006  riz Pull up following revision(s) (requested by bouyer in ticket #151):
sys/dev/pci/bktr/bktr_core.c: revision 1.38
sys/dev/pci/bktr/bktr_os.c: revision 1.43
sys/dev/pci/bktr/bktr_core.h: revision 1.8
stop attaching when a bus_dma operation fails, instead of using bogus
addresses.
Remplace vtophys() with proper bus_dma(9) use.
This driver now works properly on Xen
 1.36.8.2 14-Sep-2006  yamt sync with head.
 1.36.8.1 03-Sep-2006  yamt sync with head.
 1.36.4.1 09-Sep-2006  rpaulo sync with head
 1.38.4.2 10-Dec-2006  yamt sync with head.
 1.38.4.1 22-Oct-2006  yamt sync with head
 1.38.2.2 19-Jan-2007  ad Acquire proclist_mutex before sending signals.
 1.38.2.1 18-Nov-2006  ad Sync with head.
 1.40.4.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.40.2.1 21-Jan-2008  bouyer Pull up following revision(s) (requested by jmcneill in ticket #1046):
sys/dev/pci/bktr/bktr_reg.h: revision 1.18
sys/dev/pci/bktr/bktr_audio.c: revision 1.18
sys/dev/pci/bktr/bktr_os.c: revision 1.49
sys/dev/pci/bktr/bktr_core.c: revision 1.46
sys/dev/ic/bt8xx.h: revision 1.9
sys/dev/pci/bktr/bktr_core.h: revision 1.10
Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.41.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.42.4.1 11-Jul-2007  mjf Sync with head.
 1.42.2.2 23-Oct-2007  ad Sync with head.
 1.42.2.1 10-Apr-2007  ad Changes to select/poll:

- Make them MP safe and decouple from the proc locks.
- selwakeup: don't call p_find, or traverse per-proc LWP lists (ouch).
- selwakeup: don't lock the sleep queue unless we need to.
 1.43.12.1 25-Oct-2007  bouyer Sync with HEAD.
 1.43.8.3 23-Mar-2008  matt sync with HEAD
 1.43.8.2 09-Jan-2008  matt sync with HEAD
 1.43.8.1 06-Nov-2007  matt sync with HEAD
 1.43.6.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.44.8.2 19-Jan-2008  bouyer Sync with HEAD
 1.44.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.44.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.46.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.46.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.46.2.1 24-Mar-2008  keiichi sync with head.
 1.48.2.1 18-May-2008  yamt sync with head.
 1.49.16.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.49.10.1 28-Apr-2009  skrll Sync with HEAD.
 1.49.2.1 04-May-2009  yamt sync with head.
 1.50.4.1 05-Mar-2011  rmind sync with head
 1.52.12.2 25-Feb-2013  tls resync with head
 1.52.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.52.2.2 23-Jan-2013  yamt sync with head
 1.52.2.1 30-Oct-2012  yamt sync with head
 1.54.38.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.54.38.1 10-Jun-2019  christos Sync with HEAD
 1.54.36.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.56.6.1 29-Feb-2020  ad Sync with head.
 1.59.10.1 02-Aug-2025  perseant Sync with HEAD
 1.12 22-May-2022  andvar fix various small typos, mainly in comments.
 1.11 19-Dec-2021  andvar fix various typos in bktr driver comments.
 1.10 16-Jan-2008  jmcneill Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.9 04-Mar-2007  christos branches: 1.9.16; 1.9.22; 1.9.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 03-Sep-2006  bouyer branches: 1.8.6; 1.8.8; 1.8.12;
stop attaching when a bus_dma operation fails, instead of using bogus
addresses.
Remplace vtophys() with proper bus_dma(9) use.
This driver now works properly on Xen
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.8; 1.7.18;
merge ktrace-lwp.
 1.6 29-Jun-2003  fvdl branches: 1.6.2; 1.6.16; 1.6.18;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.5 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.4 12-Mar-2003  wiz Merge first bktr-sf import.
 1.3 01-Jul-2000  wiz branches: 1.3.2;
resolve conflicts.
 1.2 21-May-2000  wiz branches: 1.2.4;
Use bktr_softc.bktr_dev.dv_xname instead of "bktr0" when printf'ing as
requested by Klaus Klein in kern/10166.
Also add device instance name to all printf's that didn't have it.
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.3 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.2 01-Jul-2000  wiz Import release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.
 1.1.1.1 07-May-2000  wiz Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.2.4.1 03-Jul-2000  wiz Pull up revision 1.3 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.
 1.3.2.2 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.3.2.1 01-Jul-2000  bouyer file bktr_core.h was added on branch thorpej_scsipi on 2000-11-20 22:35:47 +0000
 1.6.18.4 21-Jan-2008  yamt sync with head
 1.6.18.3 03-Sep-2007  yamt sync with head.
 1.6.18.2 30-Dec-2006  yamt sync with head.
 1.6.18.1 21-Jun-2006  yamt sync with head.
 1.6.16.1 16-Sep-2006  ghen Pull up following revision(s) (requested by bouyer in ticket #1511):
sys/dev/pci/bktr/bktr_core.c: revision 1.38
sys/dev/pci/bktr/bktr_os.c: revision 1.43
sys/dev/pci/bktr/bktr_core.h: revision 1.8
stop attaching when a bus_dma operation fails, instead of using bogus
addresses.
Remplace vtophys() with proper bus_dma(9) use.
This driver now works properly on Xen
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.7.18.1 14-Sep-2006  riz Pull up following revision(s) (requested by bouyer in ticket #151):
sys/dev/pci/bktr/bktr_core.c: revision 1.38
sys/dev/pci/bktr/bktr_os.c: revision 1.43
sys/dev/pci/bktr/bktr_core.h: revision 1.8
stop attaching when a bus_dma operation fails, instead of using bogus
addresses.
Remplace vtophys() with proper bus_dma(9) use.
This driver now works properly on Xen
 1.7.8.1 14-Sep-2006  yamt sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.12.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.8.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.6.1 21-Jan-2008  bouyer Pull up following revision(s) (requested by jmcneill in ticket #1046):
sys/dev/pci/bktr/bktr_reg.h: revision 1.18
sys/dev/pci/bktr/bktr_audio.c: revision 1.18
sys/dev/pci/bktr/bktr_os.c: revision 1.49
sys/dev/pci/bktr/bktr_core.c: revision 1.46
sys/dev/ic/bt8xx.h: revision 1.9
sys/dev/pci/bktr/bktr_core.h: revision 1.10
Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.9.28.1 19-Jan-2008  bouyer Sync with HEAD
 1.9.22.1 18-Feb-2008  mjf Sync with HEAD.
 1.9.16.1 23-Mar-2008  matt sync with HEAD
 1.5 18-Mar-2009  cegger bzero -> memset
 1.4 04-Mar-2007  christos branches: 1.4.40; 1.4.50; 1.4.56;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.3 12-Mar-2003  wiz branches: 1.3.18; 1.3.56;
Merge first bktr-sf import.
 1.2 13-Nov-2001  lukem add RCSIDs
 1.1 28-Oct-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.2 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.1 28-Oct-2000  wiz branches: 1.1.1.1.2; 1.1.1.1.4; 1.1.1.1.6;
Import release 2.17 of the bktr driver.
Changes: Integration of some NetBSD changes. (FreeBSD version now is also
usable as a KLD (~= LKM).)
 1.1.1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.1.1.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.1.1.1.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.1.1.1.2.1 28-Oct-2000  bouyer file bktr_mem.c was added on branch thorpej_scsipi on 2000-11-22 16:04:30 +0000
 1.3.56.1 12-Mar-2007  rmind Sync with HEAD.
 1.3.18.1 03-Sep-2007  yamt sync with head.
 1.4.56.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.50.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.40.1 04-May-2009  yamt sync with head.
 1.2 12-Mar-2003  wiz Merge first bktr-sf import.
 1.1 28-Oct-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.2 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.1 28-Oct-2000  wiz branches: 1.1.1.1.2;
Import release 2.17 of the bktr driver.
Changes: Integration of some NetBSD changes. (FreeBSD version now is also
usable as a KLD (~= LKM).)
 1.1.1.1.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.1.1.1.2.1 28-Oct-2000  bouyer file bktr_mem.h was added on branch thorpej_scsipi on 2000-11-22 16:04:31 +0000
 1.69 23-May-2022  rin Audit unload/unmap v.s. free against DMA buffer for sys/dev/pci;
make sure that bus_dmamap_unload(9) [or bus_dmamap_destroy(9)] or
bus_dmamem_unmap(9) are preceding to freeing DMA buffer, if it is
loaded or mapped, respectively.

This is mandatory for some archs. See, e.g.:

http://www.nerv.org/netbsd/?q=id:20210511T013030Z.013443cc790088147e4beed43f53dedabeaf9312
http://www.nerv.org/netbsd/?q=id:20220511T172220Z.561179f0b6fcc5b9cd73e274f69d74e2ce9e4c93

XXX XXX XXX
Compile test only (for amd64/ALL).

Thanks riastradh@ for double check.
 1.68 09-Dec-2018  jdolecek use pci_intr_establish_xname()
 1.67 14-Jul-2016  msaitoh branches: 1.67.16; 1.67.18;
- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.
 1.66 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.65 25-Jul-2014  dholland branches: 1.65.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.64 29-Mar-2014  christos branches: 1.64.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.63 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.62 10-Aug-2013  dholland Redo -r1.53 correctly.
 1.61 27-Oct-2012  chs branches: 1.61.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.60 30-Jun-2011  wiz branches: 1.60.2; 1.60.12;
dependant -> dependent
 1.59 23-Apr-2010  macallan don't try to print a bus_space_handle_t
now this at least compiles on sparc64
 1.58 22-Mar-2010  dyoung MI code must not printf() a bus_space_tag_t, so don't do that.
 1.57 06-May-2009  cegger branches: 1.57.2; 1.57.4;
struct device * -> device_t, no functional changes intended.
 1.56 06-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.55 15-Mar-2009  cegger ansify function definitions
 1.54 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.53 24-Jun-2008  gmcgarry branches: 1.53.4; 1.53.10;
Both legs of a digraph must return the same type. Therefore, replace digraph.
 1.52 08-Jun-2008  tsutsui branches: 1.52.2;
Use device_lookup_private() rather than using cd_devs[] directly to get softc.

XXX maybe we should change a type of cd_devs[] in struct cfdriver
from (void *) to device_t.
 1.51 10-Apr-2008  cegger branches: 1.51.2; 1.51.4; 1.51.6;
use aprint_*_dev and device_xname
 1.50 01-Mar-2008  rmind Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.49 16-Jan-2008  jmcneill branches: 1.49.2; 1.49.6;
Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.48 19-Oct-2007  ad branches: 1.48.2; 1.48.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.47 25-Sep-2007  ad branches: 1.47.2;
Use selinit() / seldestroy().
 1.46 04-Mar-2007  christos branches: 1.46.2; 1.46.14; 1.46.16; 1.46.18;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.45 16-Nov-2006  christos branches: 1.45.2; 1.45.4; 1.45.8;
__unused removal on arguments; approved by core.
 1.44 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.43 03-Sep-2006  bouyer branches: 1.43.2; 1.43.4;
stop attaching when a bus_dma operation fails, instead of using bogus
addresses.
Remplace vtophys() with proper bus_dma(9) use.
This driver now works properly on Xen
 1.42 28-Aug-2006  christos remove unreachable code.
 1.41 28-Aug-2006  christos add missing initializer.
 1.40 28-Mar-2006  thorpej branches: 1.40.6;
Use device_unit().
 1.39 11-Dec-2005  christos branches: 1.39.4; 1.39.6; 1.39.8; 1.39.10; 1.39.12;
merge ktrace-lwp.
 1.38 29-Oct-2004  yamt branches: 1.38.10; 1.38.12;
constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.37 29-Jun-2003  fvdl branches: 1.37.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.36 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.35 12-Mar-2003  wiz Merge first bktr-sf import.
 1.34 10-Jan-2003  mjl Make this work on big endian platforms (mostly from OpenBSD):
Uploaded scripts work better if they are little endian, as the
card's engine expects, so convert to le first.

Also clean up attach routine a bit (use pa_id and PCI_REVISION
instead of fetching it ourselves).

This makes the driver work on my macppc G4, it can decode and
display video and tuner input. Sound does not seem to work, but
this may be my wonky formac bktr-for-macintosh card.
 1.33 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.32 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.31 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 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.28 07-Jan-2002  jmcneill branches: 1.28.8;
Re-enable radio at bktr, only if NRADIO > 0 and an FM tuner is present.
 1.27 07-Jan-2002  tron Disable broken radio(4) support for bktr(4). The configuration code doesn't
even check if the TV card has a radio tuner.
 1.26 07-Jan-2002  tron Clean up preprocess handling of optional radio(4) support a little bit.
 1.25 06-Jan-2002  tron Compile in radio(4) only it is activated in the kernel configuration.
 1.24 06-Jan-2002  jmcneill Add missing definition of STATUSBIT_STEREO.
 1.23 06-Jan-2002  jmcneill Add basic support for the radio(4) interface.
 1.22 13-Nov-2001  lukem add RCSIDs
 1.21 18-Oct-2001  wiz Fix check in device open.
Patch by KUROSAWA Takahiro in kern/14289.
 1.20 18-Sep-2001  wiz Give initiali[sz]e all the "i"s it deserves.
 1.19 15-Mar-2001  ross branches: 1.19.2; 1.19.4;
LP64 a kprintf(9)
 1.18 03-Mar-2001  mjl branches: 1.18.2;
Correct wrong error return in mmap fn.
 1.17 30-Dec-2000  wiz Undo pci_intr_map change in non-NetBSD part of the file.
 1.16 30-Dec-2000  wiz Merge 2.18 to trunk.
 1.15 28-Dec-2000  sommerfeld Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
 1.14 28-Oct-2000  wiz branches: 1.14.2;
Replace remaining vm_offset_t's in NetBSD code by vaddr_t; remove now
unnecessary casts added by thorpej in 1.11 of bktr_core.c. Strike one
from the TODO list.
 1.13 28-Oct-2000  wiz Merge 2.17 changes to trunk.
 1.12 03-Sep-2000  wiz Use NetBSD's pcidevs file for vendors/cards as much as possible.
Recognize Pinnacle Studio PCTV Rave as Miro card, tested by rh@netbsd.org.
 1.11 01-Jul-2000  wiz remove unnecessary #ifdef __NetBSD__'s in #ifdef __FreeBSD__;
move one #include <vm/vm.h> into #ifndef __NetBSD__
 1.10 01-Jul-2000  wiz resolve conflicts.
 1.9 30-Jun-2000  veego Move the include of <vm/vm.h> into the ifndef __NetBSD__ part.
 1.8 27-Jun-2000  simonb Revert some of the previous mmap() changes that were in "#ifdef FreeBSD"
parts of this file.
 1.7 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.6 26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.5 21-May-2000  wiz branches: 1.5.4;
Use bktr_softc.bktr_dev.dv_xname instead of "bktr0" when printf'ing as
requested by Klaus Klein in kern/10166.
Also add device instance name to all printf's that didn't have it.
 1.4 07-May-2000  veego It is a bad idea to declare a static bootverbose variable here. Remove it.
 1.3 07-May-2000  wiz compilation fix
 1.2 07-May-2000  wiz Some NetBSD specific changes; also TODO, and import script, based
on bind2netbsd by Bernd Ernesti
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.5 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.4 30-Dec-2000  wiz Import release 2.18 of the bktr driver. Changes since 2.17:
o Add new ioctls to allow userland programs fuller access to the I2C
bus, BT848_MSP_READ BT848_MSP_WRITE and BT848_MSP_RESET.
o Add tuner type 0x2a. Remove 0x2c which was incorrect.
o Christian Gusenbauer <Christian.Gusenbauer@netway.at> added support
for audio on Hauppauge cards without the audio mux. The MSP is used
for audio selection. (the 44xxx models)
 1.1.1.3 28-Oct-2000  wiz Import release 2.17 of the bktr driver.
Changes: Integration of some NetBSD changes. (FreeBSD version now is also
usable as a KLD (~= LKM).)
 1.1.1.2 01-Jul-2000  wiz Import release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.
 1.1.1.1 07-May-2000  wiz Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.5.4.3 24-Oct-2001  jhawk Pull up revision 1.21 (requested by lukem):
Check unit count correctly (correct fencepost error)
on device open.
 1.5.4.2 03-Jul-2000  wiz Pull up revision 1.11 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.
 1.5.4.1 30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.14.2.6 27-Mar-2001  bouyer Sync with HEAD.
 1.14.2.5 12-Mar-2001  bouyer Sync with HEAD.
 1.14.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.14.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.14.2.2 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.2.1 28-Oct-2000  bouyer file bktr_os.c was added on branch thorpej_scsipi on 2000-11-20 22:35:47 +0000
 1.18.2.10 15-Jan-2003  thorpej Sync with HEAD.
 1.18.2.9 11-Nov-2002  nathanw Catch up to -current
 1.18.2.8 18-Oct-2002  nathanw Catch up to -current.
 1.18.2.7 17-Sep-2002  nathanw Catch up to -current.
 1.18.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.18.2.5 11-Jan-2002  nathanw More catchup.
 1.18.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.18.2.3 22-Oct-2001  nathanw Catch up to -current.
 1.18.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.18.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.19.4.3 01-Oct-2001  fvdl Catch up with -current.
 1.19.4.2 26-Sep-2001  fvdl * add a VCLONED vnode flag that indicates a vnode representing a cloned
device.
* rename REVOKEALL to REVOKEALIAS, and add a REVOKECLONE flag, to pass
to VOP_REVOKE
* the revoke system call will revoke all aliases, as before, but not the
clones
* vdevgone is called when detaching a device, so make it use REVOKECLONE
to get rid of all clones as well
* clean up all uses of VOP_OPEN wrt. locking.
* add a few VOPS to spec_vnops that need to do something when it's a
clone vnode (access and getattr)
* add a copy of the vnode vattr structure of the original 'master' vnode
to the specinfo of a cloned vnode. could possibly redirect getattr to
the 'master' vnode, but this has issues with revoke
* add a vdev_reassignvp function that disassociates a vnode from its
original device, and reassociates it with the specified dev_t. to be
used by cloning devices only, in case a new minor is allocated.
* change all direct references in drivers to v_devcookie and v_rdev
to vdev_privdata(vp) and vdev_rdev(vp). for diagnostic purposes
when debugging race conditions that still exist wrt. locking and
revoking vnodes.
* make the locking state of a vnode consistent when passed to
d_open and d_close (unlocked). locked would be better, but has
some deadlock issues
 1.19.4.1 07-Sep-2001  thorpej Commit my "devvp" changes to the thorpej-devvp branch. This
replaces the use of dev_t in most places with a struct vnode *.

This will form the basic infrastructure for real cloning device
support (besides being architecurally cleaner -- it'll be good
to get away from using numbers to represent objects).
 1.19.2.2 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.19.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.8.1 16-May-2002  gehenna Add the character device switch.
 1.37.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.37.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.37.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.37.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.38.12.6 17-Mar-2008  yamt sync with head.
 1.38.12.5 21-Jan-2008  yamt sync with head
 1.38.12.4 27-Oct-2007  yamt sync with head.
 1.38.12.3 03-Sep-2007  yamt sync with head.
 1.38.12.2 30-Dec-2006  yamt sync with head.
 1.38.12.1 21-Jun-2006  yamt sync with head.
 1.38.10.1 16-Sep-2006  ghen Pull up following revision(s) (requested by bouyer in ticket #1511):
sys/dev/pci/bktr/bktr_core.c: revision 1.38
sys/dev/pci/bktr/bktr_os.c: revision 1.43
sys/dev/pci/bktr/bktr_core.h: revision 1.8
stop attaching when a bus_dma operation fails, instead of using bogus
addresses.
Remplace vtophys() with proper bus_dma(9) use.
This driver now works properly on Xen
 1.39.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.39.10.1 19-Apr-2006  elad sync with head.
 1.39.8.3 14-Sep-2006  yamt sync with head.
 1.39.8.2 03-Sep-2006  yamt sync with head.
 1.39.8.1 01-Apr-2006  yamt sync with head.
 1.39.6.1 22-Apr-2006  simonb Sync with head.
 1.39.4.1 09-Sep-2006  rpaulo sync with head
 1.40.6.1 14-Sep-2006  riz Pull up following revision(s) (requested by bouyer in ticket #151):
sys/dev/pci/bktr/bktr_core.c: revision 1.38
sys/dev/pci/bktr/bktr_os.c: revision 1.43
sys/dev/pci/bktr/bktr_core.h: revision 1.8
stop attaching when a bus_dma operation fails, instead of using bogus
addresses.
Remplace vtophys() with proper bus_dma(9) use.
This driver now works properly on Xen
 1.43.4.2 10-Dec-2006  yamt sync with head.
 1.43.4.1 22-Oct-2006  yamt sync with head
 1.43.2.1 18-Nov-2006  ad Sync with head.
 1.45.8.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.45.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.45.2.1 21-Jan-2008  bouyer Pull up following revision(s) (requested by jmcneill in ticket #1046):
sys/dev/pci/bktr/bktr_reg.h: revision 1.18
sys/dev/pci/bktr/bktr_audio.c: revision 1.18
sys/dev/pci/bktr/bktr_os.c: revision 1.49
sys/dev/pci/bktr/bktr_core.c: revision 1.46
sys/dev/ic/bt8xx.h: revision 1.9
sys/dev/pci/bktr/bktr_core.h: revision 1.10
Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.46.18.1 06-Oct-2007  yamt sync with head.
 1.46.16.2 23-Mar-2008  matt sync with HEAD
 1.46.16.1 06-Nov-2007  matt sync with HEAD
 1.46.14.2 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.46.14.1 02-Oct-2007  joerg Sync with HEAD.
 1.46.2.2 23-Oct-2007  ad Sync with head.
 1.46.2.1 09-Oct-2007  ad Sync with head.
 1.47.2.1 25-Oct-2007  bouyer Sync with HEAD.
 1.48.8.1 19-Jan-2008  bouyer Sync with HEAD
 1.48.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.49.6.4 29-Jun-2008  mjf Sync with HEAD.
 1.49.6.3 02-Jun-2008  mjf Sync with HEAD.
 1.49.6.2 05-Apr-2008  mjf - add "file-system DEVFS" and "pseudo-device devfsctl" to conf/std seeing
as these are always needed.

- convert many, many drivers over to the New Devfs World Order. For a
list of device drivers yet to be converted see,
http://www.netbsd.org/~mjf/devfs-todo.html.

- add a new device_unregister_all(device_t) function to remove all device
names associated with a device_t, which saves us having to construct
device names when the driver is detached.

- add a DEV_AUDIO type for devices.
 1.49.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.49.2.1 24-Mar-2008  keiichi sync with head.
 1.51.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.51.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.51.4.3 11-Aug-2010  yamt sync with head.
 1.51.4.2 16-May-2009  yamt sync with head
 1.51.4.1 04-May-2009  yamt sync with head.
 1.51.2.1 17-Jun-2008  yamt sync with head.
 1.52.2.1 27-Jun-2008  simonb Sync with head.
 1.53.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.53.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.57.4.1 30-May-2010  rmind sync with head
 1.57.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.60.12.3 03-Dec-2017  jdolecek update from HEAD
 1.60.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.60.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.60.2.2 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.60.2.1 30-Oct-2012  yamt sync with head
 1.61.2.2 18-May-2014  rmind sync with head
 1.61.2.1 28-Aug-2013  rmind sync with head
 1.64.2.1 10-Aug-2014  tls Rebase.
 1.65.4.2 05-Oct-2016  skrll Sync with HEAD
 1.65.4.1 09-Jul-2016  skrll Sync with HEAD
 1.67.18.1 10-Jun-2019  christos Sync with HEAD
 1.67.16.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.7 30-Jun-2011  wiz dependant -> dependent
 1.6 12-Mar-2003  wiz Merge first bktr-sf import.
 1.5 16-Mar-2001  ross Sigh.

Revert the revert. Naturally, I considered OpenBSD and FreeBSD when I fixed
the incorrect use of the spl*() interface. The change I made is _required_
for both NetBSD _and_ OpenBSD, or the code won't even COMPILE except on
i386, and it is acceptable on FreeBSD. Your revert and mod rebroke it on
OpenBSD and tangled things up on NetBSD. It made no difference on FreeBSD.

In particular, there are 2,895 uses of splx() within the FreeBSD kernel,
and only a mere 21, that's "twenty one" uses of intrmask_t, and those are
almost exclusively in the guts of the interrupt implementation, _not_ in
the _use_ of the exported spl*() functions. It's perfectly OK to `int s
= spltty()' in a portable driver in FreeBSD.

For that matter, FreeBSD (-current at least) does not even *use* spl*()
any more and stubs them all out with inlines that do _nothing_ except return
0, making intrmask_t vs int _even less_ important there than it already
was.

I think it's great that you want to start hacking on the kernel, but do
note that this is certainly the most simple of the kernel interfaces. It
just gets worse from here. Be careful out there!
 1.4 16-Mar-2001  wiz Restore non-NetBSD parts -- we're still sharing this code.
 1.3 15-Mar-2001  ross Do critical sections a better way.
 1.2 28-Oct-2000  wiz branches: 1.2.2; 1.2.4;
Replace remaining vm_offset_t's in NetBSD code by vaddr_t; remove now
unnecessary casts added by thorpej in 1.11 of bktr_core.c. Strike one
from the TODO list.
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.3 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.2 01-Jul-2000  wiz Import release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.
 1.1.1.1 07-May-2000  wiz branches: 1.1.1.1.4;
Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.1.1.1.4.1 03-Jul-2000  wiz Pull up revision 1.1.1.2 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.
 1.2.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.2.2.4 27-Mar-2001  bouyer Sync with HEAD.
 1.2.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.2.2.2 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.2.2.1 28-Oct-2000  bouyer file bktr_os.h was added on branch thorpej_scsipi on 2000-11-20 22:35:47 +0000
 1.22 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.21 26-Jan-2011  dyoung branches: 1.21.4; 1.21.14;
unifdef -U__bsdi__ -U__FreeBSD__ -D__NetBSD__. No functional change
intended.
 1.20 06-May-2009  cegger branches: 1.20.4; 1.20.6; 1.20.8;
struct device * -> device_t, no functional changes intended.
 1.19 24-Apr-2008  ad branches: 1.19.2; 1.19.16;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
 1.18 16-Jan-2008  jmcneill branches: 1.18.6; 1.18.8;
Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.17 19-Oct-2007  ad branches: 1.17.2; 1.17.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.16 30-Dec-2005  mjl branches: 1.16.24; 1.16.30; 1.16.38; 1.16.44; 1.16.46; 1.16.50;
This part got lost during merging with the sourceforge bktr
driver: "Also make those variables int instead of char so it
can actually hold 454...".
 1.15 11-Dec-2005  christos merge ktrace-lwp.
 1.14 30-May-2005  christos branches: 1.14.2;
- avoid variable shadowing
- add const
 1.13 12-Mar-2003  wiz branches: 1.13.2;
Merge first bktr-sf import.
 1.12 10-Jan-2003  mjl Make this work on big endian platforms (mostly from OpenBSD):
Uploaded scripts work better if they are little endian, as the
card's engine expects, so convert to le first.

Also clean up attach routine a bit (use pa_id and PCI_REVISION
instead of fetching it ourselves).

This makes the driver work on my macppc G4, it can decode and
display video and tuner input. Sound does not seem to work, but
this may be my wonky formac bktr-for-macintosh card.
 1.11 23-Oct-2002  christos remove duplicate cpp defs.
 1.10 18-Sep-2001  wiz Give initiali[sz]e all the "i"s it deserves.
 1.9 30-Dec-2000  wiz branches: 1.9.2; 1.9.4; 1.9.6;
Merge 2.18 to trunk.
 1.8 28-Oct-2000  wiz branches: 1.8.2;
Merge 2.17 changes to trunk.
 1.7 24-Sep-2000  jdolecek use new generic bootverbose instead of local definition
 1.6 03-Sep-2000  wiz Use NetBSD's pcidevs file for vendors/cards as much as possible.
Recognize Pinnacle Studio PCTV Rave as Miro card, tested by rh@netbsd.org.
 1.5 01-Jul-2000  wiz resolve conflicts.
 1.4 07-May-2000  veego branches: 1.4.4;
Change one 0 for bootverbose to 1 if DEBUG is defined.
 1.3 07-May-2000  veego Add a dummy bootverbose.
 1.2 07-May-2000  wiz Some NetBSD specific changes; also TODO, and import script, based
on bind2netbsd by Bernd Ernesti
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.5 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.4 30-Dec-2000  wiz Import release 2.18 of the bktr driver. Changes since 2.17:
o Add new ioctls to allow userland programs fuller access to the I2C
bus, BT848_MSP_READ BT848_MSP_WRITE and BT848_MSP_RESET.
o Add tuner type 0x2a. Remove 0x2c which was incorrect.
o Christian Gusenbauer <Christian.Gusenbauer@netway.at> added support
for audio on Hauppauge cards without the audio mux. The MSP is used
for audio selection. (the 44xxx models)
 1.1.1.3 28-Oct-2000  wiz Import release 2.17 of the bktr driver.
Changes: Integration of some NetBSD changes. (FreeBSD version now is also
usable as a KLD (~= LKM).)
 1.1.1.2 01-Jul-2000  wiz Import release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.
 1.1.1.1 07-May-2000  wiz Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.4.4.1 03-Jul-2000  wiz Pull up revision 1.5 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.
 1.8.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.8.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.8.2.2 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.8.2.1 28-Oct-2000  bouyer file bktr_reg.h was added on branch thorpej_scsipi on 2000-11-20 22:35:47 +0000
 1.9.6.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.3 15-Jan-2003  thorpej Sync with HEAD.
 1.9.2.2 11-Nov-2002  nathanw Catch up to -current
 1.9.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.13.2.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.3 21-Jan-2008  yamt sync with head
 1.14.2.2 27-Oct-2007  yamt sync with head.
 1.14.2.1 21-Jun-2006  yamt sync with head.
 1.16.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.16.46.2 23-Mar-2008  matt sync with HEAD
 1.16.46.1 06-Nov-2007  matt sync with HEAD
 1.16.44.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.16.38.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.16.30.1 23-Oct-2007  ad Sync with head.
 1.16.24.1 21-Jan-2008  bouyer Pull up following revision(s) (requested by jmcneill in ticket #1046):
sys/dev/pci/bktr/bktr_reg.h: revision 1.18
sys/dev/pci/bktr/bktr_audio.c: revision 1.18
sys/dev/pci/bktr/bktr_os.c: revision 1.49
sys/dev/pci/bktr/bktr_core.c: revision 1.46
sys/dev/ic/bt8xx.h: revision 1.9
sys/dev/pci/bktr/bktr_core.h: revision 1.10
Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64.
 1.17.8.1 19-Jan-2008  bouyer Sync with HEAD
 1.17.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.18.8.1 18-May-2008  yamt sync with head.
 1.18.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.19.16.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.2.1 16-May-2009  yamt sync with head
 1.20.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.20.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.20.4.1 05-Mar-2011  rmind sync with head
 1.21.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.21.4.1 30-Oct-2012  yamt sync with head
 1.13 19-Dec-2021  andvar fix various typos in bktr driver comments.
 1.12 19-Oct-2007  ad machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.11 28-Dec-2005  wiz branches: 1.11.30; 1.11.44; 1.11.46; 1.11.50;
Sync with SourceForge 1.5:
revision 1.5
date: 2003/03/13 22:21:04; author: emsi; state: Exp; lines: +17 -18
Fill in band switch crosspoints and use that instead of hardcoded
values in the band switching code. For now fill in the formerly
hard-coded values 160 and 454 until we can find out the real values
for each tuner. Also make those variables int instead of char
so it can actually hold 454...
 1.10 12-Mar-2003  wiz branches: 1.10.18;
Merge first bktr-sf import.
 1.9 13-Nov-2001  lukem add RCSIDs
 1.8 18-Jan-2001  jdolecek branches: 1.8.2; 1.8.4;
constify
 1.7 30-Dec-2000  wiz Merge 2.18 to trunk.
 1.6 28-Oct-2000  wiz branches: 1.6.2;
Merge 2.17 changes to trunk.
 1.5 01-Jul-2000  wiz resolve conflicts.
 1.4 25-Jun-2000  wiz printf argument was in wrong position. Noted by Roger Hardiman
<roger@cs.strath.ac.uk>. (This code was ifdef'd out by default.)
 1.3 21-May-2000  wiz branches: 1.3.4;
Use bktr_softc.bktr_dev.dv_xname instead of "bktr0" when printf'ing as
requested by Klaus Klein in kern/10166.
Also add device instance name to all printf's that didn't have it.
 1.2 07-May-2000  wiz Some NetBSD specific changes; also TODO, and import script, based
on bind2netbsd by Bernd Ernesti
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.5 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.4 30-Dec-2000  wiz Import release 2.18 of the bktr driver. Changes since 2.17:
o Add new ioctls to allow userland programs fuller access to the I2C
bus, BT848_MSP_READ BT848_MSP_WRITE and BT848_MSP_RESET.
o Add tuner type 0x2a. Remove 0x2c which was incorrect.
o Christian Gusenbauer <Christian.Gusenbauer@netway.at> added support
for audio on Hauppauge cards without the audio mux. The MSP is used
for audio selection. (the 44xxx models)
 1.1.1.3 28-Oct-2000  wiz Import release 2.17 of the bktr driver.
Changes: Integration of some NetBSD changes. (FreeBSD version now is also
usable as a KLD (~= LKM).)
 1.1.1.2 01-Jul-2000  wiz Import release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.
 1.1.1.1 07-May-2000  wiz Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.3.4.1 03-Jul-2000  wiz Pull up revision 1.5 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.
 1.6.2.5 11-Feb-2001  bouyer Sync with HEAD.
 1.6.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.6.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.6.2.2 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.6.2.1 28-Oct-2000  bouyer file bktr_tuner.c was added on branch thorpej_scsipi on 2000-11-20 22:35:47 +0000
 1.8.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.10.18.2 27-Oct-2007  yamt sync with head.
 1.10.18.1 21-Jun-2006  yamt sync with head.
 1.11.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.11.46.1 06-Nov-2007  matt sync with HEAD
 1.11.44.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.11.30.1 23-Oct-2007  ad Sync with head.
 1.2 12-Mar-2003  wiz Merge first bktr-sf import.
 1.1 07-May-2000  wiz branches: 1.1.1;
Initial revision
 1.1.1.2 12-Mar-2003  wiz Import of current state of bktr(4) in sourceforge repository.
Changes since last import:
. lots of whitespace cleanups
. typo fixes (e.g. hz, compatibilty)
. fix brightness ioctl return value
. wait for int ready using DELAY() instead of tight loop
 1.1.1.1 07-May-2000  wiz branches: 1.1.1.1.6;
Import of (finally busspaced) bktr-driver from FreeBSD (part 1).
This version is from the location specified in the README, modified
by bktr2netbsd, to be committed later.
 1.1.1.1.6.2 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.1.1.1.6.1 07-May-2000  bouyer file bktr_tuner.h was added on branch thorpej_scsipi on 2000-11-20 22:35:47 +0000

RSS XML Feed