Commit Graph

53 Commits

Author SHA1 Message Date
John-Mark Gurney
d13fc3e62d don't require a buffer if all we are doing is manipulating the GPIO pins...
MFC after:	3 weeks
2006-05-26 07:36:50 +00:00
John-Mark Gurney
bb80263411 if we are compiling with smbus support, properly depend upon the iic and
smbus modules, otherwise as a module you can't kldload bktr...

MFC after:	3 days
2006-01-27 08:42:48 +00:00
Yoshihiro Takahashi
d4fcf3cba5 Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)
2005-05-29 04:42:30 +00:00
Warner Losh
53ee71735f Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
Warner Losh
e36e54501e Remove support for FreeBSD < 4.recent from this driver. 2005-01-08 22:52:00 +00:00
Warner Losh
8080d4d196 Remove vnode.h and adjust includes to compensate for pollution. 2005-01-08 22:43:33 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Alan Cox
b647e8ab58 Use contigmalloc() instead of vm_page_alloc_contig(). 2004-01-14 00:52:53 +00:00
David E. O'Brien
3333c398da Move the bktr(4) <arch>/include/ioctl_{bt848,meteor}.h files to dev/bktr
as these ioctl's aren't MD.  This also means they are installed in
/usr/include/dev/bktr now.  Also provide compatability wrappers for
where these headers lived in 4.x.
2003-12-08 07:59:18 +00:00
Don Lewis
da6f8233bc Use a mutex to synchronize the driver top and bottom halves instead of
using critcal_enter() and critical_exit() to attempt to replace spl*()
calls.  The critical section was calling selrecord(), which locks an
MTX_DEF mutex, which is not legal in a critical section.

Tested by: Stefan Ehmann <shoesoft@gmx.net> and "make universe"
Approved by: re (scottl)
2003-12-01 19:03:50 +00:00
John Baldwin
e27951b29c Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by:	imp, gibbs
Tested by:		i386 LINT
2003-09-02 17:30:40 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
4fbd232c86 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 05:54:52 +00:00
Alexander Langer
30e27d9623 Add a overhaul of the soundchip initialization for the MSP34xx chipsets
found only many tv-cards.

We currently use more ore less evil hacks (slow_msp_audio sysctl) to
configure the various variants of these chips in order to have
stereo autodetection work.  Nevertheless, this doesn't always work
even though it _should_, according to the specs.
This is, for example, the case for some popular Hauppauge models sold
sold in Germany.

However, the Linux driver always worked for me and others.  Looking at
the sourcecode you will find that the linux-driver uses a very much
enhanced approach to program the various msp34xx chipset variants,
which is also found in the specs for these chips.

This is a port of the Linux MSP34xx code, written by Gerd Knorr
<kraxel@bytesex.org>, who agreed to re-release his code under a
BSD license for this port.

A new config option "BKTR_NEW_MSP34XX_DRIVER" is added, which is required
to enable the new driver.  Otherwise the old code is used.

The msp34xx.c file is diff-reduced to the linux-driver to make later
modifications easier, thus it doesn't follow style(9) in most cases.

Approved by:	roger (committing this, no time to test/review),
		keichii (code review)
2003-08-12 09:45:34 +00:00
Poul-Henning Kamp
00999c80d8 Eliminate mostly unused local variable.
Found by:       FlexeLint
2003-05-31 20:41:52 +00:00
Jake Burkholder
227f9a1c58 - Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
  with PAE.
- Use this to represent physical addresses in the MI vm system and in the
  i386 pmap code.  This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
  detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by:	DARPA, Network Associates Laboratories
Discussed with:	re, phk (cdevsw change)
2003-03-25 00:07:06 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Maxime Henrion
07159f9c56 Cleanup of the d_mmap_t interface.
- Get rid of the useless atop() / pmap_phys_address() detour.  The
  device mmap handlers must now give back the physical address
  without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
  int.  Now we properly pass a vm_offset_t * and expect it to be
  filled by the mmap handler when the mapping was successful.  The
  mmap handler must now return 0 when successful, any other value
  is considered as an error.  Previously, returning -1 was the only
  way to fail.  This change thus accidentally fixes some devices
  which were bogusly returning errno constants which would have been
  considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
  no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with:		alc, phk, jake
Reviewed by:		peter
Compile-tested on:	LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on:	i386
2003-02-25 03:21:22 +00:00
Roger Hardiman
2cfff6e8ef Fix a panic unloading the bktr driver when devfs is in use.
PR:	kern/36413
2002-12-09 09:04:09 +00:00
Poul-Henning Kamp
37c841831f Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by:    FlexeLint warning #512
2002-09-28 17:15:38 +00:00
Peter Wemm
05e5542d97 Remove abuse of NBKTR - this was always a NOP on freebsd. We never
compiled this stuff if NBKTR was zero.
2002-07-21 05:19:03 +00:00
Warner Losh
df9c943ac9 Remove __FreeBSD__ version abuse, also de-orbit support for FreeBSD 2
and FreeBSD 3.
2002-07-21 04:18:20 +00:00
Nicolas Souchu
ea4122d2bf Fix bktr and pcf compilation with LINT 2002-03-25 21:22:35 +00:00
Nicolas Souchu
c17d43407f Major rework of the iicbus/smbus framework:
- VIA chipset SMBus controllers added
	- alpm driver updated
	- Support for dynamic modules added
	- bktr FreeBSD smbus updated but not tested
	- cleanup
2002-03-23 15:49:15 +00:00
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00
Poul-Henning Kamp
efd1585a7a Don't call cdevsw_add(). 2001-11-04 11:50:08 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
Garrett Wollman
0a2c3d48c6 select() DKI is now in <sys/selinfo.h>. 2001-01-09 04:33:49 +00:00
Roger Hardiman
b02fea74af Add missing 'unit' code
Submitted by:	Brad L. Chisholm <blc@bsdwins.com>
2000-10-20 08:16:53 +00:00
Roger Hardiman
97e1cf9c1b Update to driver 2.17
Fixes bugs in devfs when unloading and reloading
Syncs with NetBSD changes

Submitted by:	Alexander Langer <alex@big.endian.de>
Submitted by:	Thomas Klausner <wiz@netbsd.org>
Submitted by:	Daniel O'Connor" <doconnor@gsoft.com.au>
2000-10-19 07:33:28 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Roger Hardiman
5c8dc2dd0d Add MODULE_VERSION and MODULE_DEPENDS to make the bktr module load the
bktr_mem module
2000-09-11 07:14:43 +00:00
Roger Hardiman
dd11af6637 Update to driver 2.15.
Main change is the addition of the bktr_mem module.

This holds onto the bktr driver's contiguously allocated memory
when the bktr driver is unloaded and reloaded.

This has to be done because it is virtually impossible to get
contiguous memory once a system is running.

Also tidied up the use of SMBUS, added a new Hauppauge tuner type (0x2c)
and a new Flyvideo vendor ID.
2000-09-10 14:34:08 +00:00
Peter Wemm
ab1f00b960 Replace previous change by a move of a #include since something else
#includes "smbus.h".    There is still some bogus (but harmless) stuff
here surrounding the #include <sys/bus.h> includes here and elsewhere in
the bktr code.
2000-09-03 05:54:40 +00:00
Peter Wemm
e96d838a6a If we are going to test NSMBUS, we had better #include the file that
defines it.  This creates more warnings rather than less though. These
had gone undetected until now. :-(
2000-09-03 05:44:33 +00:00
Poul-Henning Kamp
db90128160 Avoid the modules madness I inadvertently introduced by making the
cloning infrastructure standard in kern_conf.  Modules are now
the same with or without devfs support.

If you need to detect if devfs is present, in modules or elsewhere,
check the integer variable "devfs_present".

This happily removes an ugly hack from kern/vfs_conf.c.

This forces a rename of the eventhandler and the standard clone
helper function.

Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include
like <sys/queue.h>

Remove all #includes of opt_devfs.h they no longer matter.
2000-09-02 19:17:34 +00:00
Roger Hardiman
dae49011e7 Fix newbus resource allocations
PR:		kern/18744
Submitted by:	Alexander Langer <alex@cichlids.com>
2000-08-24 14:17:06 +00:00
Poul-Henning Kamp
3f54a085a6 Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)
Remove old DEVFS support fields from dev_t.

  Make uid, gid & mode members of dev_t and set them in make_dev().

  Use correct uid, gid & mode in make_dev in disk minilayer.

  Add support for registering alias names for a dev_t using the
  new function make_dev_alias().  These will show up as symlinks
  in DEVFS.

  Use makedev() rather than make_dev() for MFSs magic devices to prevent
  DEVFS from noticing this abuse.

  Add a field for DEVFS inode number in dev_t.

  Add new DEVFS in fs/devfs.

  Add devfs cloning to:
        disk minilayer (ie: ad(4), sd(4), cd(4) etc etc)
        md(4), tun(4), bpf(4), fd(4)

  If DEVFS add -d flag to /sbin/inits args to make it mount devfs.

  Add commented out DEVFS to GENERIC
2000-08-20 21:34:39 +00:00
Roger Hardiman
231b1f331e Update to driver 2.14. Adds new Tuner types for Hauppauge WinTV cards 2000-06-28 15:09:12 +00:00
Roger Hardiman
4dcedbebe2 Update to driver 2.13.
This merges in changes from NetBSD which ensure bktr0
(actually bktr%d) is printed at the start of any output lines.

Submitted by:	Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
2000-06-26 09:41:32 +00:00
Peter Wemm
717f014e45 Use the correct register names. s/PCI_MAP_REG_START/PCIR_MAPS/ 2000-05-28 15:48:48 +00:00
Roger Hardiman
f88d1687fb Fix typo in interrupt handling code and fix bug in setting of adelay 2000-04-16 07:50:09 +00:00
Roger Hardiman
2767d675a6 Update to driver 2.11.
Driver now compiles on FreeBSD/Alpha, but still requires testing.
Remove a printf, submitted by Chris D. Faulhaber <jedgar@fxp.org>
2000-04-15 07:46:19 +00:00
Roger Hardiman
24cf43ae21 Upgrade the bktr driver from 2.07 to 2.10.
- The driver now uses bus_space() and runs on NetBSD 1.4.2
   Submitted by Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>

 - Remove startup quirks for video and vbi capture for PAL users.
   PAL TV users can now run FXTV and Alevt in any order.

 - Add support for cable channels >100
   Submitted by Scott Presnell <srp@zgi.com>

 - New MSP3410/3415 setup code added. This is experimental.
   Please set the sysctl hw.bt848.slow_msp_audio to 1 for this.
   Submitted by Frank Nobis<fn@radio-do.de>
2000-04-04 16:54:13 +00:00
Peter Wemm
8cd932769f No need to use DEV_DRIVER_MODULE() since the bktr driver calls make_dev().
Roger: Feel free to change or spam this as you please.
1999-11-08 07:20:07 +00:00