Commit Graph

165 Commits

Author SHA1 Message Date
Gary Jennejohn
ebb5694a4b Based on an excellent suggestion from tanimura@ define I4BPRI and use it
in place of TTIPRI.
2003-11-10 14:20:34 +00:00
Gary Jennejohn
84df55b1f4 Fix breakage cuased by the selwakeuppri commit by defining TTIPRI for
recent versions of FreeBSD (based on __FreeBSD_version check).
2003-11-10 14:02:22 +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
Brooks Davis
9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)
2003-10-31 18:32:15 +00:00
Brooks Davis
915897a895 Initialize if_softc and use it in favor of &ipr_softc[ifp->if_unit] to
get the softc.
2003-10-31 00:44:56 +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
Warner Losh
2eeb7c30dc 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 15:06:24 +00:00
Poul-Henning Kamp
b67a8a2c5e Undo agressive inlining which GCC previously wisely ignored.
The this eliminates 67% of the text segment (relative to respected
inline requests).
2003-07-23 17:58:41 +00:00
Scott Long
f6b1c44d1f Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
David E. O'Brien
be07195a60 Use __FBSDID(). 2003-06-11 00:01:05 +00:00
David E. O'Brien
3b16f7d7fe Use __FBSDID(). 2003-06-10 23:48:55 +00:00
David E. O'Brien
d7a26ce64c Use __FBSDID(). 2003-06-10 23:39:45 +00:00
David E. O'Brien
a75fe74844 Use __FBSDID(). 2003-06-10 23:23:33 +00:00
Poul-Henning Kamp
04d0f26703 Fix off-by-one errors in range checks of state machine states & events.
Found by:       FlexeLint
2003-05-31 18:54:02 +00:00
Poul-Henning Kamp
8e5d2c7eca Fix systematic off-by-one errors in unit number range checks.
Found by:       FlexeLint
2003-05-31 16:57:01 +00:00
Hiten Pandya
b77c32a07e Rename BUS_DMAMEM_NOSYNC to BUS_DMA_COHERENT.
The current name is confusing, because it indicates to
the client that a bus_dmamap_sync() operation is not
necessary when the flag is specified, which is wrong.

The main purpose of this flag is to hint the underlying
architecture that DMA memory should be mapped in a coherent
way, but the architecture can ignore it.  But if the
architecture does supports coherent mapping of memory, then
it makes bus_dmamap_sync() calls cheap.

This flag is the same as the one in NetBSD's Bus DMA.

Reviewed by: gibbs, scottl, des (implicitly)
Approved by: re@ (jhb)
2003-05-30 20:40:33 +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
Jonathan Lemon
1cafed3941 Update netisr handling; Each SWI now registers its queue, and all queue
drain routines are done by swi_net, which allows for better queue control
at some future point.  Packets may also be directly dispatched to a netisr
instead of queued, this may be of interest at some installations, but
currently defaults to off.

Reviewed by: hsu, silby, jayanth, sam
Sponsored by: DARPA, NAI Labs
2003-03-04 23:19:55 +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
Dag-Erling Smørgrav
521f364b80 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
Poul-Henning Kamp
73f936c5ac NODEVFS cleanup:
Don't call cdevsw_{add,remove}()
Remove remnants of the previous DEVFS.
2003-02-26 21:10:04 +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
Gary Jennejohn
b54c65a9b7 Fix another typo in a comment which I noticed while doing the MFC. 2003-02-06 14:52:47 +00:00
Gary Jennejohn
6a622ac3a3 Fix some typos in 3 comments.
Reported by: marius@alchemy.franken.de
2003-02-01 14:43:24 +00:00
Gary Jennejohn
68e12ba37e Add a fix for the case where the dialout fails. In this case the isp
interface was left in an active, but not connected, state, which resulted
in data being sent to it and the transmit queue filling up. This happened
because the driver never informed sppp that it shoulkd clean up the
connection. This fix informs sppp that it should clean things up.

The fix was actually developed and tested under -stable, so a short MFC
period seems appropriate, say 2 days.

Contributed by: Ari Suutari <ari.suutari@syncrontech.com>
2003-01-30 14:19:58 +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
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
Sam Leffler
6fc32a2495 network interface and link layer changes:
o on input don't strip the Ethernet header from packets
o input packet handling is now done with if_input
o track changes to ether_ifattach/ether_ifdetach API
o track changes to bpf tapping
o call ether_ioctl for default handling of ioctl's
o use constants from net/ethernet.h where possible

Reviewed by:	many
Approved by:	re
2002-11-15 00:00:15 +00:00
Brooks Davis
a5066cff3a Don't include the depricated "bpf.h" and always compile in bpf support
as per current practice.
2002-10-21 05:05:43 +00:00
Poul-Henning Kamp
6df6552a3d Be consistent about marking functions static.
Found by:	FlexeLint.
2002-10-15 20:32:45 +00:00
Poul-Henning Kamp
85fee3197a It's bad enough people can't figure out to use the same code, or in
this case, ugly macros, but the data tables can be reused:

Put one copy of the software HDLC tables in its own file.
2002-09-11 12:44:58 +00:00
Poul-Henning Kamp
695aa14fe2 Add missing calls to mtx_init().
It seems counter-intuitive that all drivers have to do this.

Pointed in right direction by:	gj
2002-09-10 16:41:08 +00:00
Brooks Davis
5906e69ac2 Continue de-counting i4b. Devices i4bctl, i4bcapi, iavc, i4bq921,
i4bq931, i4b, isic, iwic, ifpi, ifpi2, ifpnp, ihfc, and itjc are
no longer count devices.  Also remove a few other instances of N<DEVICE>
being used to control compilation of whole files.

Reviewed by:    hm
2002-09-02 00:52:11 +00:00
Hellmuth Michaelis
52b5377d2f Bugfix to enable dialer "connected" response. 2002-08-27 14:19:28 +00:00
Philippe Charnier
93b0017f88 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:23:09 +00:00
Hellmuth Michaelis
866a3fa2bf add support properly displaying and logging incoming telephone numbers (MSNs)
by looking at the "type of number" field and providing configurable hooks
to correct the numbers accordingly. See keywords add-prefix, prefix-national
and prefix-international in isdnd.rc(5).
This feature was implemented by Christian Ullrich <chris@chrullrich.de>
2002-08-12 07:53:55 +00:00
Hellmuth Michaelis
9ed6ae76c7 add experimental support for Data over Voice (DoV) outgoing calls.
based on patches received from Guy Ellis (guy@traverse.com.au),
Chris Collins (xfire@xware.cx) and Phillip Musumeci (phillip@cs.jcu.edu.au).
2002-08-11 15:47:26 +00:00
Brooks Davis
22afbb6bb0 Remote pci.h/NPCI usage from i4b code.
Approved by:	hm
2002-06-13 06:04:28 +00:00
Jens Schweikhardt
21dc7d4f57 Fix typo in the BSD copyright: s/withough/without/
Spotted and suggested by:	des
MFC after:	3 weeks
2002-06-02 20:05:59 +00:00
Alfred Perlstein
7e743e3a41 Unbreak LINT by compensating for the
ng_parse_struct_info -> ng_parse_struct_field change.
2002-06-01 19:54:21 +00:00
Bruce Evans
e788f79698 Fixed printf format errors which apparently crept in while -Wformat was
disabled for gcc-3.
2002-05-25 11:18:03 +00:00
Peter Wemm
b01d78f42f Oops, I missed this warning. Comment out extra junk after #endif 2002-05-24 06:22:48 +00:00
Peter Wemm
fe8ae4dd13 Fix some low hanging fruit warnings. There are problems in i4b_ing.c
still, but they are due due to some bogosity in netgraph.
2002-05-24 05:46:50 +00:00
Gary Jennejohn
c0a06166a0 Fix a problem which could cause some machines to hang after a warm boot.
This should be in 4.6.

Submitted by:	Ari Suutari <ari.suutari@syncrontech.com>
2002-05-10 12:04:04 +00:00
Gary Jennejohn
3573a23fa1 Change instances of avma1pp2- to ifpi2- in printf's since the name
of the driver should be emitted.

This was already changed in the code committed to RELENG_4.
2002-04-28 11:47:10 +00:00
Gary Jennejohn
bb83e7583e On slow machines interrupts could be lost, so check for pending
interrupts in a loop.

Tested by: Andrew Gordon <arg-bsd@arg1.demon.co.uk>
2002-04-23 10:25:35 +00:00
John Baldwin
6008862bc2 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +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
Hellmuth Michaelis
3c1d185c2a Add support for Q.931 subaddresses.
Submitted by: Steven Looman <fsteevie@wish.net>
2002-03-26 15:13:54 +00:00
Alfred Perlstein
89c9a48352 Remove __P. 2002-03-20 07:51:46 +00:00