Commit Graph

456 Commits

Author SHA1 Message Date
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
Seigo Tanimura
512824f8f7 - Implement selwakeuppri() which allows raising the priority of a
thread being waken up.  The thread waken up can run at a priority as
  high as after tsleep().

- Replace selwakeup()s with selwakeuppri()s and pass appropriate
  priorities.

- Add cv_broadcastpri() which raises the priority of the broadcast
  threads.  Used by selwakeuppri() if collision occurs.

Not objected in:	-arch, -current
2003-11-09 09:17:26 +00:00
Mike Silbersack
184dcdc7c8 Change all SYSCTLS which are readonly and have a related TUNABLE
from CTLFLAG_RD to CTLFLAG_RDTUN so that sysctl(8) can provide
more useful error messages.
2003-10-21 18:28:36 +00:00
Warner Losh
0c15221610 More debug under boot verbose. 2003-08-29 23:25:00 +00:00
Warner Losh
b9baf113c1 Fix comment. 2003-08-29 23:24:41 +00:00
Warner Losh
a1e145b47d add debug to pcic memory mapping routine 2003-08-27 04:17:02 +00:00
Warner Losh
85d0333cd8 Add comment point o2micro people to NEWCARD 2003-08-01 16:10:48 +00:00
Warner Losh
d2cd166745 OLDCARD is OBSOLETE_IN_6. Tag it as such. 2003-06-12 04:46:43 +00:00
Warner Losh
9598fb9322 1. Allow drivers to query CIS strings from OLDCARD.
2. Include backwards compatibility good for the moment (eventually will
   be turned off in current, but allow for a short transition period).

PR:	51333
Submited by: Scott Mitchell (1)
MFC after:	2 weeks
2003-04-23 23:39:21 +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
Warner Losh
9cd41be1d0 pccard isn't picky about WHAT major it gets. 2003-02-28 05:56:06 +00:00
Warner Losh
3dc191a139 Add SMC 34C90. Not tested, but should be a no-op except for the id string.
Print the sockbase when we can't get the memory for debug.
2003-02-26 05:45:48 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alfred Perlstein
8deebb0160 Consolidate MIN/MAX macros into one place (param.h).
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
2003-02-02 13:17:30 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Warner Losh
42e5f2f287 Merge from P4:
o Update copyright.
o Add a tunable to allow the ti12xx to initialize the pci clock.  Some rare
  cards need it.
o rename 67xx -> 6729 since there's really only one chip in this family.
o from pcic_pci_pd6729_init call the routing code
o Fix some comments out routing on the TI-1130 class (1030, 1130 and 1131)

MFC: After RE@ says it is ok.
2003-01-04 17:26:35 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Warner Losh
53662117cc MFp4:
Fix a bug with the 3.3V code for the ricoh bridges.  I got the bit
detect backwards.  Also, we can only detect 3.3V cards when the GPI
interrupt is disabled.  So when it is enabled assume 5.0V card.

Obtained from: NetBSD (takemura-san from patches by ngc@ff.iij4u.or.jp)
Approved by: re (blanket)
2002-11-27 06:04:49 +00:00
Warner Losh
689ab99fb3 MFp4: Comment about not assuming INTA# for 6729 2002-10-07 07:02:48 +00:00
Warner Losh
559e54225b Make beep not depend on HZ setting.
PR: 25201
Submitted by: Akio Marita-san
# This is the last part of the PR uncommitted.
2002-09-29 23:41:25 +00:00
Warner Losh
521c179f7d SMIENB not needed, but maybe PCI_CLOCK is, so put it in #if 0'd out 2002-09-29 23:37:07 +00:00
Warner Losh
253b72896c Parens considered good. 2002-09-29 23:36:17 +00:00
Warner Losh
af656bf76b For boot verbose, print resources assigned in a more asthetically pleasing
way.

PR: 42745 (although done in a different way)
2002-09-13 16:23:41 +00:00
Warner Losh
223e8ce62d Change the order that we look for free memory windows from 0 -> MAX-1
to MAX-1 -> 0.  This should allow for less potential for conflict
between pccardd/pccardc and drivers.  As far as I can tell no drivers
try to use window 4, so this should be a no-op for them.
2002-09-08 22:18:06 +00:00
Warner Losh
db351cca83 Add 16-bit before bus to keep the words card and bus apart. 2002-07-31 20:01:11 +00:00
Warner Losh
4376ee32ba MFp4:
o reduce the extra-long ID names.
	o TI-1510, 1520 and 4510 support.
	o MFUNC is the name of the register on TI 1200 and newer chips (except
	  125x and 1450).  Initialize it in the func routine, but only
	  if NO_MFUNC isn't set.
	o better comments about above workaround
	o register definitions for MFUNC.
	o move zoom video disable to a better place.
2002-07-26 08:07:55 +00:00
Warner Losh
e6e2fdce18 Copy manufacturer and version string into the kernel, and copy it to
the slot info.  This brings OLDCARD's API much closer to NEWCARD and
will allow moving more information into the kernel from pccard.conf
for common drivers (ed).
2002-07-22 06:46:10 +00:00
Warner Losh
9f977fb187 Add support for writing to mapping high memory for pccard memory
windows.  Right now we only support pci chips that are memory mapped.
These are the most common bridges in use today and will help a large
majority of the users.

I/O mapped PCI chips support this functionality in a different way, as
do some of the ISA bridges (but only when mounted on a motherboard).
These chips are not supported by this change.
2002-07-20 22:29:23 +00:00
Warner Losh
67b455bda4 minor nit in comments 2002-07-20 18:59:58 +00:00
Warner Losh
1aa3e5415e Integrate the hw.pcic.pd6722_vsense tunable from the nomads list.
This allows one to select the method of 3.3V card detection from the
three possible choices (none (0), the "6710 way" (1) and the "6729
way" (2)).  The default is the 6710 way, since it works in the most
cases.  The datasheets for the 6722 suggest that the '29 way is more
correct, but experience has shown this method to cause some laptops to
hang solid.  See source code for details until I update the man page.

Submitted by: shibata-san (chiharu shibata <chi@bd.mbn.or.jp>)
2002-07-18 08:13:45 +00:00
Warner Losh
80a97bd996 Some strange hacks for the clpd6729:
o It needs to have pcic_isa_intr intrrupt handler
o for pci interrupts, in the func interrupt handler it needs to check the isa
  registers rather than the pci ones for card present.
o better commentary for some of the strangeness of the 6729 on pci
o fix some crunchy comments to better reflect reality.

With this I almost have the WL200 working, but an interrupt storm
after attach is causing problems for reasons unknown.  This code
doesn't seem to break the normal clpd6729 case, and I'd like others
with 6729 cards to try to test it (there were some that were used for
external pccard slots in pci only systems).
2002-07-18 08:05:00 +00:00
Warner Losh
1dc510f6ca Better verbage on hw.pcic sysctls, delete now obsolete comment 2002-07-17 06:29:35 +00:00
Warner Losh
d9619df632 o Remove workaround that I put in to mask the BadVcc problem.
o Add preliminary support for Cirrus Logic CL-PD6729 using PCI
  interrupts.  To use it you you need to set hw.pcic.pd6729_intr_path
  to 2.  This is allow us to still default to ISA intrrupt path for
  this part (which is found much more often in laptops using ISA IRQs).
  But some PCI cards have this part on them and this should allow them
  to be used.  It is untested on PCI, but it seems to not break the ISA
  case.
o Better sysctl descriptions (I hope).
2002-07-17 06:02:07 +00:00
Warner Losh
79d9b7534a Be more conservative about the address ranges we assign. Some
machines don't like the more liberal default, so be more conservative
about what we do by default.
2002-07-17 05:50:06 +00:00
Warner Losh
e42aa6d774 Add definitions for the Ext 1 register on cirrus logic PD-6729. 2002-07-17 05:43:39 +00:00
Warner Losh
8fe085c7ec Rearrange previous commit that passed the vendor id to the kernel in a way
that's binary compatible for -stable.  While binary compatibility doesn't
matter much in -current, it is critical for -stable.  This change requires
pccardd/pccardc to be recompiled.
2002-07-14 06:47:52 +00:00
Giorgos Keramidas
bab6337218 Typo: do do -> to do.
Reviewed by:	imp
2002-07-14 02:25:21 +00:00
Warner Losh
d65d5bbff5 Lots of people have had to hack around the fixed address for cardbus
bridges in modern hardware (that hardware w/ lots of RAM).  Raise the
address from 0x44000000 to 0x88000000 to match what we do with
NEWCARD.  However, this really should be done in the pci layer.
2002-06-27 19:56:22 +00:00
Warner Losh
eb486650ec Leave it to a non-native speaker of English to catch another typo: "do do" ->
"to do"

submitted by: marius@alchemy.franken.de
2002-06-27 18:16:16 +00:00
Warner Losh
9accf6a74a Spell less like a 'merkin and more like a speaker of English 2002-06-27 17:59:24 +00:00
Warner Losh
b75d2266b3 plxcard for OLDCARD isn't going to happen. 2002-06-23 07:32:33 +00:00
Warner Losh
1d88dfe265 What:
o ToPIC is happy with two cards now, even when the two cards are
	  modems.
	o Fix (all?) hangs on boot when power is applied to the card.  I
	  suspect that this will make the Ricoh bridges happier and also
	  make a lot of VAIO owners happy (confirm to me in private email
	  please :-).
	o All Cardbus bridges should now support 3.3V, X.XV and Y.YV cards,
	  to the extent that the underlying hardware supports such cards.
	  (X.X and Y.Y haven't been assigned values yet :-).
	o Better 3.3V support for Ricoh ISA bridges.

How:
	o Don't mess with the power register when scanning the cards.  It
	  is unnecessary and causes BADVcc conditions on many chipsets.  These
	  in turn can cause an interrupt storm.
	o Make pcic_disable reset the slot's voltage.
	o Move initializing voltage for the slot until after it has been
	  disabled.
	o Fix a lot of issues with the pcic_cardbus_power routine.  We
	  now properly enable the card and take it out of reset after
	  a power change.
	o When detecting the card's voltage, if we're in a BadVcc state,
	  direct the bridge to rescan the card for what it supports.
	  (we might need to in the future set the power register to 0
	   before doing this).
	o Don't preserve CLKSTOP.  need to revisit this.
	o Better support for Ricoh ISA bridges for 3.3V cards.
	o Don't write to PCIC_POWER directly as offten, but instead go
	  through the pcic_power interface.
	o All cardbus bridges now default to use cardbus power control.
	o Add misc register definitions.
	o remove some (now) bogus comments.

Extra Special Thanks To: Scott Lamber for his kind and generous loan
of a Toshiba laptop with a ToPIC 100 in it for my use.
2002-06-23 01:55:10 +00:00
Warner Losh
26101425e5 hw.pcic.ignore_pci
Set this to 1 to ignore cardbus bridges and work entirely in legacy
ISA mode.  This may help some folks.
2002-06-13 17:28:55 +00:00
Takanori Watanabe
154ce58548 Forget to change lookup function for oldcard side. 2002-05-30 18:48:44 +00:00
John Baldwin
44731cab3b Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
Warner Losh
91f60fd74f Better power code and better power diagnostics 2002-03-20 19:02:08 +00:00
Warner Losh
285ed29005 Define masks for the VCC an VPP voltages 2002-03-20 19:01:16 +00:00
Warner Losh
d26fb41443 Get the generic name right 2002-03-03 01:04:39 +00:00
Takeshi Shibagaki
9198b952b5 Add some code which is compatible for NEWCARD. It makes manufacturer
id transfer from pccardd.

Reviewed by: imp
2002-02-20 14:42:36 +00:00