Commit Graph

91 Commits

Author SHA1 Message Date
he bd8aa5583f Use a local temporary struct gt_softc* so we don't try to
de-reference void*.  Restores buildability of this file.
2008-06-17 22:41:30 +00:00
cegger 4795ee76a4 use device_lookup_private to get softc 2008-06-12 22:28:26 +00:00
cegger 5819fc04b4 use device_lookup_private to get softc 2008-06-11 20:52:14 +00:00
he 26a302aa36 Avoid the effects of name space pollution caused by <sys/rb.h>,
which defines rb_data, by instead naming the struct field rxb_data.
2008-06-10 22:44:07 +00:00
he 04446152e8 Put back a %s so that the format matches again. Fixes build for evbppc. 2008-04-11 06:25:25 +00:00
cegger 1ef783cb7b use aprint_*_dev and device_xname 2008-04-08 20:40:42 +00:00
dyoung 2ccede0a9c Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs.  This will ease extending the kernel and sharing of code
between drivers.

First steps:  Make the signature of ifioctl_common() match struct
ifinet->if_ioctl.  Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.
2008-02-07 01:21:52 +00:00
dyoung b480b62270 Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange().  Check for
a non-ENXIO error return from mii_mediachg().  (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines.  There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
        on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run.  I have compiled macppc, sparc64, i386.  I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
2008-01-19 22:10:14 +00:00
he 5ccc78e887 Remove a local variable which is no longer used. 2007-12-16 14:21:43 +00:00
ad 6874e511b7 lockmgr -> mutex 2007-12-05 07:58:29 +00:00
ad 4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
ad dc26833bb6 - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
2007-11-19 18:51:36 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
garbled 56452ceddd Fix a missing include noted by Gerald Lee on tech-kern 2007-10-17 00:43:51 +00:00
ad 46ed8f7d77 Use the softint API. 2007-10-08 16:18:02 +00:00
dyoung dcd8923429 Change a bazillion occurrences of code resembling this,
error = (cmd == SIOCADDMULTI) ?
	    ether_addmulti(ifr, &sc->sc_ec) :
	    ether_delmulti(ifr, &sc->sc_ec);

	if (error == ENETRESET) {

to this,

	if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number.  This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
2007-09-01 07:32:22 +00:00
dyoung 71e77a61b4 Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).
2007-08-26 22:45:55 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
he 4e894df92a Cast to char* and int before doing pointer arithmetic. 2007-03-07 09:15:21 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
hubertf eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
elad bdc51baebb Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!
Also, add forgotten splx() calls in some places.
2006-10-01 19:28:43 +00:00
ad 3029ac48c7 - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
2006-07-21 16:48:45 +00:00
drochner a3464e1d27 use the "i2cbus" interface attribute rather than putting a string name
into the i2cbus attach args
2006-06-26 18:21:38 +00:00
mrg 27fdcc3d32 'volatile' is not a valid return type qualifier - remove it. 2006-05-24 21:22:36 +00:00
he aa1b731e45 Include now needed <sys/kauth.h>, and fold a long line. 2006-05-16 16:49:41 +00:00
elad 2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
thorpej 838ee1e0d9 Use device_private(). 2006-03-29 06:51:47 +00:00
thorpej 2be6494fc9 Use device_cfdata(). 2006-03-29 04:16:44 +00:00
thorpej 39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
thorpej 6e53f1366a Use device_parent(). 2006-03-25 23:14:58 +00:00
lukem a1f606d3fd Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
2006-03-08 23:46:22 +00:00
he fbe2f1783f Remove another instance of the SET/CLR/ISSET macro triplet, now found
in <sys/types.h>.
2006-03-06 08:13:58 +00:00
perry fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
perry 00d6acb4b6 bare asm -> __asm 2005-12-24 22:59:39 +00:00
perry 93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
kleink aece7a90fd Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges.  Noted by David Holland in PR kern/31126.
2005-09-06 21:40:37 +00:00
drochner 46ed4b50c4 s/locdesc_t/int/g 2005-08-26 12:42:11 +00:00
scw 5d1801d88f Use underscores to prefix local variables in macros. 2005-06-03 11:22:08 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
perry 18db93c7f6 de-__P 2005-02-04 02:10:35 +00:00
matt 411c843baa Add entry for gti2c.c 2005-02-01 20:59:15 +00:00
matt 57b77a8963 Add a i2c driver for the onboard i2c/twsi controller on the GT642x0 2005-02-01 20:58:46 +00:00
matt b3eef3bb0b Allow the driver to allocate needs resources on attach and not free
depending on cf_flags (instead of on interface up / down).
2005-02-01 20:47:02 +00:00
matt 61b5c08265 Add I2C child hooks. 2005-02-01 20:37:09 +00:00
thorpej 53eac4d6eb Eliminate use of M_HASFCS. 2005-01-30 19:15:41 +00:00
jmc 25287474ca Put back a few locators.h includes that are still needed here. Now evbppc
kernels build clean once again
2004-11-26 05:10:31 +00:00
drochner 96b589fc18 a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
 config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
 on "locators.h"
2004-09-13 12:55:47 +00:00