Commit Graph

1689 Commits

Author SHA1 Message Date
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
Brooks Davis
5c88c82cf3 Update tx(4) to always enable vlan(4) support.
Approved by:		semenu
2001-09-05 23:04:53 +00:00
Brooks Davis
9d4fe4b2b0 Make vlan(4) loadable, unloadable, and clonable. As a side effect,
interfaces must now always enable VLAN support.

Reviewed by:	jlemon
MFC after:	3 weeks
2001-09-05 21:10:28 +00:00
Bill Paul
1af8bec768 Add support for Conexant LANfinity miniPCI controllers. People who have
laptops with this chip should test this and report back as I don't have
access to this hardware myself. People with -stable systems should try
the patch at:

	http://www.freebsd.org/~wpaul/conexant.patch.gz

Submitted by:	Phil Kernick <Phil@Kernick.org>
2001-09-04 17:10:11 +00:00
Søren Schmidt
38090f05c2 Remove long overdue obsolete file ide_pcireg.h 2001-09-04 15:52:00 +00:00
Jonathan Lemon
cf9d4cbfc6 The fxp driver has lived in dev/fxp for some time, remove old files. 2001-08-31 02:21:03 +00:00
Doug Rabson
7e59bf6765 Recognise VIA Apollo KT133A bridge.
PR:	30061
Submitted by:	John Merryweather Cooper <jmcoopr@webmail.bmi.net>
MFC after:	1 week
2001-08-30 14:17:48 +00:00
Bill Paul
d93d282620 Add support for the 3c656B cardbus adapter. This is one half of a
dual function card. It needs pretty much the same flags as the 656C,
except that it seems to need both the INVERT_MII_PWR and INVERT_LED_PWR
flags set. Tested with cardbus in -current as of today.

Also added support for the 3c656, which looks to be the same as
the 656B, except it doesn't need the EEPROM_8BIT flag. I think. This
one is untested, but the added support should not break any of the
other cards.
2001-08-28 00:40:18 +00:00
Matt Jacob
38db9454de John Polstra
bogus additional write to WXREG_IMASK that enabled *all* interrupt causes
while I was trying to disable the chip. Oops.
2001-08-24 23:08:13 +00:00
Bill Paul
645ed1a78b Fix a bug in the ste_setmulti() routine. The NIC has 4 16-bit multicast
hash registers, not 2 32-bit ones. This would prevent the multicasr filter
from being programmed correctly in some cases.
2001-08-23 18:22:55 +00:00
Bill Paul
d3ab0d02cf After one more day of testing, make what I hope are the final tweaks to
prevent/workaround TX lockups in this driver. The secret seems to be to
not let the TX DMA queue become too full. If we have too many packets
in the queue, we should wait for them to drain a bit before trying to
queue more. This should prevent the lockup from occurring, and if it
does occur, there is special code in sf_start() to kick the NIC in the
head and get it going again.

Special thanks to Glen Neff for helping me test this fix.
2001-08-16 20:15:16 +00:00
Bill Paul
fa97ab323c Still more changes to try to prevent TX lockups. Will wait for one more
night of testing before merging to -stable.

Also added to code to detect TX underruns and automatically increase the
TX threshold to avoid them. Carefully placed diagnostig printf() about
this under #ifdef DIAGNOSTIC to avoid getting any panicky e-mails from
confused users, like I always do with the xl and dc drivers.
2001-08-16 00:32:20 +00:00
Bill Paul
0a4b345e9f Tweak the interrupt handler so that we call the txeof handler more often,
to hopefully prevent the TX DMA queue from filling up and never getting
flushed.
2001-08-15 17:46:57 +00:00
Bill Paul
0219a42155 Convert the if_sis and if_rl drivers to use the bus_dma API instead of
calling vtophys() and contigmalloc()/contigfree() directly. Hopefully,
I have shaken out all of the problems with busdma on the alpha now.
(Everything seems to work as expected.)

Also, change the max RX DMA limit to 1024 bytes instead of "unlimited,"
as the latter seems not to work correctly on the alpha that I tested.
(At 100Mbps, all attempts to receive frames yield RX errors.)
2001-08-15 17:38:43 +00:00
Semen Ustimenko
395a636fb2 Fix an bug in FreeBSD attach routine - attaching MII interfaces before doing
common_attach is wrong as common attach initialize some fileds used by
mediainit routine. This was hard to notify because loading driver as kld
lead to mediainit routine being called after common_attach, though probe_phy
is called before.

MFC after:	1 week
2001-08-13 18:37:31 +00:00
Semen Ustimenko
2c9067b16f Add support for 802.1Q VLAN and oversized ethernet frames.
PR:		kern/29235
Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
Reviewed by:	Yar Tikhiy <yar@FreeBSD.org>
MFC after:	1 week
2001-08-13 18:32:39 +00:00
Bill Paul
0a75b55602 Pacify users who get all bent out of shape when they see the "xl%d: command
never completed" message. The RX reset takes longer complete than it
used to, a lot longer in fact than xl_wait() is prepared to wait.
When we do the RX reset in xl_reset(), this cases xl_wait() to time out
and whine. We wait a little extra time now after the RX reset, which
should silence the warning.

Thanks to obrien for finally getting me a box with a NIC that
causes this problem for me to tinker with.
2001-07-27 20:55:45 +00:00
Brooks Davis
bbce7eba7f IFT_8021_VLAN -> IFT_L2VLAN per if_vlan_var.h rev 1.9. With this change
LINT compiles, but doesn't link.
2001-07-25 00:19:59 +00:00
Kris Kennaway
56bded8a29 s/adress/address/
Inspired by:    OpenBSD
MFC After:      1 week
2001-07-23 12:05:27 +00:00
Bill Paul
e7be9f9a1a Deal with the condition where we lose link in the middle of transmitting
a bunch of frames. In this case, the dc_link flag is cleared, and dc_start()
stops draining the if_snd send queue, which results in lots of 'no buffers
available' errors being reported to applications. The whole idea behind
not draining the send queue until the link comes up was to avoid having
the gratuitous ARP being lost while we're waiting for autoneg to complete
after the interface is first brought up. As an optimization, change the
test in dc_start() so that we only bail if dc_link is not set _and_ there
are less than 10 packets in the send queue. If the queue has many frames
in it, we need to drain them. If the queue has a small number of frames
in it, we can hold off on sending them until the link comes up.

MFC after: 1 week
2001-07-12 22:51:59 +00:00
Bill Paul
75ff968cd5 Apply patch supplied by Jonathan Chen: use the correct arguments to
pci_enable_io(). We need to use SYS_RES_IOPORT/SYS_RES_MEMORY instead
of PCIM_CMD_PORTEN/PCIM_CMD_MEMEN.
2001-07-09 17:58:42 +00:00
John Baldwin
52b3919d31 Make these compile again by adding proc.h include for GIANT_REQUIRED
that is in included vm headers.
2001-07-05 21:28:47 +00:00
Benno Rice
beefc79739 Set vendor string correctly for the Apple KeyLargo.
Forgotten by:	benno
Spotted by:	n_hibma
2001-07-05 12:04:19 +00:00
Benno Rice
e5a44502dd Add device ID for the OHCI controller in the Apple KeyLargo chip. 2001-07-02 14:03:25 +00:00
Semen Ustimenko
1d57ebcdbf Add initializetion of NVCTL register with EEPROM stored value.
This fix hazardous very slow work for one of my cards.

MFC after:	1 week
2001-06-23 19:30:26 +00:00
Bosko Milekic
f5eece3fb9 Change m_devget()'s outdated and unused `offset' argument to actually mean
something: offset into the first mbuf of the target chain before copying
the source data over.

Make drivers using m_devget() with a first argument "data - ETHER_ALIGN"
to use the offset argument to pass ETHER_ALIGN in. The way it was previously
done is potentially dangerous if the source data was at the top of a page
and the offset caused the previous page to be copied (if the
previous page has not yet been appropriately mapped).

The old `offset' argument in m_devget() is not used anywhere (it's always
0) and dates back to ~1995 (and earlier?) when support for ethernet trailers
existed. With that support gone, it was merely collecting dust.

Tested on alpha by: jlemon
Partially submitted by: jlemon
Reviewed by: jlemon
MFC after: 3 weeks
2001-06-20 19:48:35 +00:00
Peter Wemm
d43c883ddc Fix warning:
298: warning: assignment makes pointer from integer without a cast
2001-06-15 07:42:58 +00:00
Peter Wemm
a074038186 Fix warnings:
412: warning: long unsigned int format, unsigned int arg (arg 3)
418: warning: long unsigned int format, unsigned int arg (arg 3)
424: warning: long unsigned int format, unsigned int arg (arg 3)
2001-06-15 07:39:12 +00:00
Bill Paul
357dfe502a Fix mindo:
PCN_BCR_CLRBIT(sc, PCN_BCR_MIICTL, PCN_MIICTL_DANAS);

should be:

	PCN_BCR_SETBIT(sc, PCN_BCR_MIICTL, PCN_MIICTL_DANAS);

Turning this bit on is what disables MII autoneg, not turning it off.
Without this, manually setting the media doesn't work.

Noticed by: Jim Browne <jbrowne@jbrowne.com>
2001-06-05 20:51:17 +00:00
Bill Paul
80157f80cd Grrr. Fix PR 27742 correctly this time. (At least I got -stable right.) 2001-06-01 00:34:50 +00:00
Bill Paul
7d1b125b93 Close PR #27742: allow the xl driver to receive VLAN tagged frames by
setting the 'max packet size' register in window 3. This only
works for cards based on the cyclone or newer chipsets (i.e. it
won't work with the original 3c905/boomerang cards).

There is a trick which will work with the boomerang, which is to turn
on the 'large packets ok' bit in the MAC control register, however this
lets the chip accept any frame up to 4K in length, which is larger than
the mbuf cluster buffers we use to receive frames. If somebody sends us
such a frame and the chip DMAs it to us, it could write past the end
of the cluster buffer and clobber something.

PR: kern/27742
2001-05-31 22:08:45 +00:00
Poul-Henning Kamp
f73cf22ade Vlan tags are 12 bits, mask off anything above since the chip doesn't
seem to do so for us.

PR:		27567
Submitted by:	Koji HINO hino@ccm.cl.nec.co.jp
MFC after:	1 week
2001-05-23 19:25:14 +00:00
Jun Kuriyama
da76f18bc6 Add description for 82801BA controller.
MFC after:	1 week
2001-05-21 01:24:14 +00:00
Alfred Perlstein
2395531439 Introduce a global lock for the vm subsystem (vm_mtx).
vm_mtx does not recurse and is required for most low level
vm operations.

faults can not be taken without holding Giant.

Memory subsystems can now call the base page allocators safely.

Almost all atomic ops were removed as they are covered under the
vm mutex.

Alpha and ia64 now need to catch up to i386's trap handlers.

FFS and NFS have been tested, other filesystems will need minor
changes (grabbing the vm lock when twiddling page properties).

Reviewed (partially) by: jake, jhb
2001-05-19 01:28:09 +00:00
Bill Paul
11c2ec4153 Close PR 22208: bring chip out of suspend mode, because Windows might
have put the chip to sleep at shutdown. This is really only for the
VT6102, but it doesn't hurt the older chips.
2001-05-14 19:13:02 +00:00
Warner Losh
e7c00509d5 I'll be making some rather substantial changes to the pci attachment
of the pcic class of devices.  Go ahead and move it to the "usual"
place.  I say "usual" in quotes since it isn't exactly right (not in
dev/blah), but it is closer than before.
2001-05-13 01:52:55 +00:00
Bill Paul
84b86890ae Disable the 'stats counter overflow' interrupts since they can happen
much more often that expected and negatively impact performance when
running at 100mbps. I need to figure out if there's a better way to
handle this, but for now this shouldn't hurt anything.
2001-05-11 20:15:41 +00:00
Bill Paul
68e691b2ab The sk driver developed a bug when the multicast code was changed to
use TAILQ macros. The sk_attach_xmac() routine calls sk_init_xmac()
before doing the transceiver probe, but *before* ether_ifattach()
is called. This causes sk_init_xmac() to call sk_setmulti(), which
tries to do a TAILQ_FOREACH(), which it can't do because ether_ifattach()
hasn't done a TAILQ_INIT() yet. This causes a NULL pointer dereference
and panic in sk_setmulti() at driver load/initialization time.

Fixed by calling ether_ifattach() before the MII probe.

The code in RELENG_4 still uses the old way of enumerating the
multicast list and doesn't have this problem. Yet.
2001-05-09 18:22:42 +00:00
Warner Losh
84b00588d8 Ricoh RL5C46x cardbus bridges have the bits for 3E0 and 3E2. The
RL5C47x cards do not.  Only set them for that set of bridges.

Submitted by: shiba (Takeshi Shibagaki-san)
2001-05-08 02:28:41 +00:00
Warner Losh
bccfae2270 Add some additional register definitions for some work I have in progress. 2001-05-08 02:06:03 +00:00
Yoshihiro Takahashi
684ac05ae8 Move unused functions into #if 0 ... #endif. 2001-05-06 08:07:10 +00:00
Bill Paul
6263665f87 Fix the definitions for memory bank sizes, which I somehow got wrong.
The constant I was using was correct, but I mislabeled it as 256K when
it should have been 512K. This doesn't actually change the code, but
it clarifies things somewhat.

Submitted by:	Chuck Cranor <chuck@research.att.com>
2001-04-26 16:40:45 +00:00
Warner Losh
c18e19a64d Move setting of TI113X_PCI_CARD_CONTROL register sooner 2001-04-17 23:56:12 +00:00
Warner Losh
1f3da134c7 Minor comment that missed the last change 2001-04-17 23:50:24 +00:00
Warner Losh
82d3fe450d When booting, turn on the 3E0 compatibility address for ricoh cardbus
parts.  This is based on the newcard code that turns it off :-).  We
can now reboot after NEWCARD or Windows and have OLDCARD work.  Add
support for the RL5C466 while I'm at it.

Treat TI1031 the same as the CLPD6832.  It doesn't work yet, but sucks
less than it did before.

Also add a few #defines for other changes in the pipe.
2001-04-17 23:15:00 +00:00
Warner Losh
a9304a4eb5 Fix minor typo in comment. 112x -> 12xx 2001-04-11 22:49:00 +00:00
Matt Jacob
bab64fffde Several things:
1. Pick up MII/PHY support for Livengood copper part (10/100/1000) from
Parag Patel. It was a fairly complete but not quite platform independent
job.

2. Finish silly offset differences that LIVENGOOD vs. WISEMAN registers
have (so the !)$*!)$*!$ fiber LIVENGOOD now works too).

3. Ansify the source.

So- we now suppor tthe PRO1000F and PRO1000T adapters.
2001-04-09 21:54:15 +00:00
Matt Jacob
40be668926 Add in MII support for LICENGOOD copper part (10/100/1000). Add in some
more flags for verbose as well as debug printing.
2001-04-09 21:48:50 +00:00
Matt Jacob
91e6ce1b32 Pick up changes from Parag Patel and Kachun Lee, and self:
1. The offsets for some registers change in LIVENGOOD. Gratuitously.

2. Define LIVENGOOD and LIVENGOOD_CU part numbers. Add some more
specific LIVENGOOD defaults.

3. Add definitions for PHY support for the copper LIVENGOOD part
(10/100/1000).
2001-04-09 21:47:11 +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
Peter Wemm
b7a441ca87 Remove some unused stuff 2001-03-25 07:21:04 +00:00
Peter Wemm
5cf1e3c8c0 Add a placeholder for the ServerWorks OSB4 device id. The SMBus
interface on this chip is compatable with the PIIX4.  The catch is that
this interferes with isab0 which wants to attach to the same PCI node.
It seems to work, but we only tested it on systems with no ISA cards.
2001-03-15 06:56:51 +00:00
Bill Paul
73e89fa2d4 Remember to actually program the MAC address into the unicast filter
in vr_init(). The VIA Rhine chip happens to be able to automatically
read its station address from the EEPROM automatically when reset,
so you don't need to program the filter if you want to keep using the
factory default address, but if you want to change it with "ifconfig vr0
ether xx:xx:xx:xx:xx:xx" then we need to manually set it in the init
routine.
2001-03-07 18:52:22 +00:00
John Baldwin
19eb87d22a Grab the process lock while calling psignal and before calling psignal. 2001-03-07 03:37:06 +00:00
Mark Murray
ed34d0ade2 Turn on interrupt-entropy harvesting for all/any mass storage devices
I could find. I have no doubt missed a couple.

Interrupt entropy harvesting is still conditional on the
kern.random.sys.harvest_interrupt sysctl.
2001-03-01 17:09:09 +00:00
Matt Jacob
2a05a4eb2c A better mousetrap: use device hints, as in:
hint.fxp.0.prefer_iomap="1"

to set IO vs. Memory space mapping.
2001-02-27 22:57:32 +00:00
Bill Paul
e979bff557 Workaround to prevent VMware from melting down. The pseudo PCnet interface
in VMware reports 0x00000000 in the PCI subsystem ID register, but
0x10001000 when you read the mirror registers in I/O space. This causes
pcn_probe() to think it's found a card in 32-bit mode, and performing
a 32-bit I/O access makes on a 16-bit port makes VMware go boom. Special
case the 0x10001000 value until somebody at VMware grows a clue.

Finally discovered by: Andrew Gallatin
2001-02-26 22:23:55 +00:00
Bill Paul
d467c136d0 Apply patch to allow TX underrun handling without issuing a complete
chip reset. Just temporarily turn off the transmitter instead.

Submitted by:	Stephen McKay <mckay@freebsd.org>
2001-02-22 19:26:55 +00:00
Bill Paul
07f65363cd Big round of minor updates:
- Use pci_get_powerstate()/pci_set_powerstate() in all the other drivers
  that need them so we don't have to fiddle with the PCI power management
  registers directly.
- Use pci_enable_busmaster()/pci_enable_io() to turn on busmastering and
  PIO/memory mapped accesses.
- Add support to the RealTek driver for the D-Link DFE-530TX+ which has
  a RealTek 8139 with its own PCI ID. (Submitted by Jason Wright)
- Have the SiS 900/National DP83815 driver be sure to disable PME
  mode in sis_reset(). This apparently fixes a problem on some
  motherboards where the DP83815 chip fails to receive packets.
  (Submitted by Chuck McCrobie <mccrobie@cablespeed.com>)
2001-02-21 20:54:22 +00:00
Warner Losh
d2a1864b0a Take luigi's suggestion and move the check for nothing to do to before the
lock so we don't have lots of null lock/release pairs.
2001-02-20 04:43:59 +00:00
Warner Losh
0aa477423a Add DC_UNLOCK before first return. This caused returns when dc was on
a shared interrupt.

Pointed out by tegge.
2001-02-20 04:21:27 +00:00
Jeroen Ruigrok van der Werven
d7d97eb0aa Preceed/preceeding are not english words. Use precede and preceding. 2001-02-18 10:43:53 +00:00
Luigi Rizzo
d88a358c86 Add a check in the interrupt service routine to return quickly in
case there is nothing to do. This happens normally when the card shares
the interrupt line with other devices.

This code saves a couple of microseconds per interrupt even on a
fast CPU. You normally would not care, except under heavy tinygram
traffic where you can have some 50-100.000 interrupts per second...

On passing, correct a spelling error.
2001-02-18 07:21:28 +00:00
Bosko Milekic
9ed346bab0 Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)
2001-02-09 06:11:45 +00:00
Bill Paul
c27eb220c2 Apply patch to add support for the intergrated ethernet in the SiS630E
chipset. The MAC address is stored in the APC CMOS RAM and we have to
commit trememdous evil in order to read it. The code to do this is only
activated on the i386 platform. Thanks to Cameron Grant for providing
access to a test box for me to tinker with.

This will fix the problem where the sis driver ends up with a station
address of 00:00:00:00:00:00 on boards that use the 630E chipset.
2001-02-09 00:45:29 +00:00
Semen Ustimenko
67a9752835 Add support for SMC9432FTX card, possibly othe fiber optic SMC9432 family
cards will work too.
2001-02-07 20:11:02 +00:00
Warner Losh
b9f90e4ffc Move ti1031 to the 16-bit bridge section 2001-02-07 01:16:40 +00:00
Poul-Henning Kamp
6817526d14 Convert if_multiaddrs from LIST to TAILQ so that it can be traversed
backwards in the three drivers which want to do that.

Reviewed by:    mikeh
2001-02-06 10:12:15 +00:00
Poul-Henning Kamp
37d4006626 Another round of the <sys/queue.h> FOREACH transmogriffer.
Created with:   sed(1)
Reviewed by:    md5(1)
2001-02-04 16:08:18 +00:00
Poul-Henning Kamp
fc2ffbe604 Mechanical change to use <sys/queue.h> macro API instead of
fondling implementation details.

Created with: sed(1)
Reviewed by: md5(1)
2001-02-04 13:13:25 +00:00
Poul-Henning Kamp
ef9e85abba Use <sys/queue.h> macro API. 2001-02-04 12:37:48 +00:00
Poul-Henning Kamp
78d82c8c59 Use LIST_FOREACH() to traverse ifp->if_multiaddrs list, instead of
<sys/queue.h> implementation details.

Created with:   /usr/sbin/sed
Reviewed with:  /sbin/md5
2001-02-03 16:29:10 +00:00
Bruce Evans
c1ac98a632 Converted to new-bus.
Reviewed by:	imp
2001-02-01 09:49:57 +00:00
John Hay
8a6d185698 The ar and sr devices have moved to sys/dev/. 2001-01-30 10:05:44 +00:00
Peter Wemm
d42df83312 Disable cy - it is now completely broken and needs non-trivial work. 2001-01-25 01:56:27 +00:00
John Hay
b2952b0aa4 Newbusify ar(4). 2001-01-24 18:45:29 +00:00
Matt Jacob
9fa6ccfb5e Allow fxp to configure in I/O space if the user wants it and specifies
an override as a loader settable variable (fxp_iomap). fxp_iomap is
a bitmap of fxp units that should be configured to use PCI I/O space
in stead of PCI Memory space.

Reviewed by:	Kees Jan Koster <dutchman@tccn.cs.kun.nl>, dg@freebsd.org
2001-01-23 23:22:17 +00:00
Poul-Henning Kamp
18d5982009 Update these netgraph drivers in current so that these changes can be
MFC'ed i due time.  I can't test it under current right now because
netgraph seems to do unethical things with mutexes.

musycc:
	Add status per channel.
	Reduce printf chattyness
	Keep error counters line if_mn does.
	Increase descriptor count.

if_mn:
	Support experimental unframed E1 lines.

These two drivers should share more code relating to framed channelized
TDM media in general (T1/E1/E3/T3, Sonet).  Anyone interested email me.
2001-01-21 22:16:20 +00:00
Bill Paul
89689ecb7c Check the return value of sf_encap() and handle errors accordingly. 2001-01-20 00:50:51 +00:00
Bill Paul
db13b7118e Set the OACTIVE flag if vr_encap() fails. 2001-01-20 00:47:55 +00:00
Bill Paul
c85c46678d Silence compiler warnings. 2001-01-20 00:07:49 +00:00
Bill Paul
419146d944 Bug fixes that I've put together while working on a project in the office:
if_vr: handle the case where vr_encap() returns failure: bust out of the
       packet sending loop instead of panicking. Also add some missing
       newlines to some printf()s.

if_dc: The miibus_read and miibus_write methods keep swapping in and
       out of MII mode by fiddling with CSR6 for cards with MII PHYs.
       This is a hack to support the original Macronix 98713 card which
       has built-in NWAY that uses an MII-like management interface
       even though it uses serial transceivers. Conditionalize this
       so that we only do this on 98713 chips, since it does bad things
       to genuine tulip chips (and maybe other clones).
2001-01-19 23:55:07 +00:00
Bosko Milekic
08812b3925 Implement MTX_RECURSE flag for mtx_init().
All calls to mtx_init() for mutexes that recurse must now include
the MTX_RECURSE bit in the flag argument variable. This change is in
preparation for an upcoming (further) mutex API cleanup.
The witness code will call panic() if a lock is found to recurse but
the MTX_RECURSE bit was not set during the lock's initialization.

The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to
MTX_RECURSED, which is more appropriate given its meaning.

The following locks have been made "recursive," thus far:
eventhandler, Giant, callout, sched_lock, possibly some others declared
in the architecture-specific code, all of the network card driver locks
in pci/, as well as some other locks in dev/ stuff that I've found to
be recursive.

Reviewed by: jhb
2001-01-19 01:59:14 +00:00
Peter Wemm
a1c9b755a7 Use pci_get_revid() rather than groping around the PCI register space
using the removed compatability register names.  (this broke LINT)
2001-01-17 01:17:00 +00:00
Peter Wemm
8c2956e18d Special case for compiling LINT - just give a warning and continue on.
At least we have a chance at getting test compile coverage for the rest
of the kernel now.
2001-01-17 00:47:46 +00:00
Peter Wemm
f266172d25 Remove unneeded (and compile-breaking) #include "alpm.h" 2001-01-17 00:38:06 +00:00
Matt Jacob
b82286ac16 moved isp_pci.c from pci to dev/isp 2001-01-09 19:15:12 +00:00
Matt Jacob
3486bfe084 add missing length argument 2001-01-09 02:12:42 +00:00
Julian Elischer
30400f03aa Part 2 of the netgraph rewrite.
This is mostly cosmetic changes, (though I caught a bug or two while
makeing them)
Reviewed by:	archie@freebsd.org
2001-01-08 05:34:06 +00:00
Julian Elischer
069154d55f Rewrite of netgraph to start getting ready for SMP.
This version is functional and is aproaching solid..
notice I said APROACHING. There are many node types I cannot test
I have tested: echo hole ppp socket vjc iface tee bpf async tty
The rest compile and "Look" right.  More changes to follow.
DEBUGGING is enabled in this code to help if people have problems.
2001-01-06 00:46:47 +00:00
Warner Losh
a5eccf28a8 Add device id for the OZ Micro 6832. I didn't try to init it like the
Cirrus Logic parts that end in 6832, but maybe some machines will need
that in the future.
2001-01-02 21:42:48 +00:00
Nicolas Souchu
a4401cc62f Remove old PCI compatibility.
Submitted by:	Andrew Gallatin <gallatin@freebsd.org>
2001-01-02 21:19:32 +00:00
Matt Jacob
f09b192280 Set up to do a local interrupt fielding before calling common code-
allows us to grab lock as we should.
2000-12-29 19:10:16 +00:00
Bosko Milekic
2a0c503e7a * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.
This is because calls with M_WAIT (now M_TRYWAIT) may not wait
  forever when nothing is available for allocation, and may end up
  returning NULL. Hopefully we now communicate more of the right thing
  to developers and make it very clear that it's necessary to check whether
  calls with M_(TRY)WAIT also resulted in a failed allocation.
  M_TRYWAIT basically means "try harder, block if necessary, but don't
  necessarily wait forever." The time spent blocking is tunable with
  the kern.ipc.mbuf_wait sysctl.
  M_WAIT is now deprecated but still defined for the next little while.

* Fix a typo in a comment in mbuf.h

* Fix some code that was actually passing the mbuf subsystem's M_WAIT to
  malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the
  value of the M_WAIT flag, this could have became a big problem.
2000-12-21 21:44:31 +00:00
Assar Westerlund
315a164546 un-staticize M_AGP so that it can be used in agp*.c 2000-12-19 08:32:37 +00:00
Bill Paul
8d79969459 Add power state manipulation to the fxp driver. Some people have
claimed that their Intel NIC is comatose after a warm boot from Windoze.
This is most likely due to the card getting put in the D3 state. This
should bring it back to life.
2000-12-18 22:06:12 +00:00
Bill Paul
14a00c6c68 Use pci_get_powerstate()/pci_set_powerstate() which now exists in the
PCI code. This saves each driver from having to grovel around looking
for the right registers to twiddle.

I should eventually convert the other PCI drivers to do this; for now,
these three are ones which I know need power state handling.
2000-12-18 21:53:05 +00:00
Julian Elischer
589f6ed8ce Divorce the kernel binary ABI version number from the message
format version number. (userland programs should not need to be
recompiled when the netgraph kernel internal ABI is changed.

Also fix modules that don;t handle the fact that a caller may not supply
a return message pointer. (benign at the moment because the calling code
checks, but that will change)
2000-12-18 20:03:32 +00:00
Bosko Milekic
38d66a0de3 Make sure to check if MGET(HDR) returned NULL, even when called with M_WAIT.
This fixes the possibility of a NULL pointer dereference in the case where
there are no mbufs or mbuf clusters left.

Approved by: phk
2000-12-15 21:06:55 +00:00
Julian Elischer
e0752f9a73 I really hate it when part of a patch gets left out.
This was still sitting in my commit tree.
Luckily I always compare my before and after trees...
2000-12-13 15:42:37 +00:00