Commit Graph

2180 Commits

Author SHA1 Message Date
yamt
70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
cegger
f8e41c4991 make this compile 2009-01-11 10:40:27 +00:00
mlelstv
0f2eef0070 fdcintr1 requires the mutex to be held. 2008-12-29 12:16:52 +00:00
tsutsui
3cf9bfd3aa Set all default geometry parameters (not only secpercyl and secsize)
before readdisklabel(9) on DIOCGDINFO so that we can get correct
media size via the ioctl. (usually floppy doesn't have a real disklabel)

Tested on i386 with 1.44M floppy.
2008-12-24 16:56:28 +00:00
cegger
9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
cegger
ad15153381 make this compile with IYDEBUG 2008-12-17 15:41:24 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
ad
0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
dyoung
de87fe677d *** Summary ***
When a link-layer address changes (e.g., ifconfig ex0 link
02🇩🇪ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address.  (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior.  Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability.  KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR.  In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr.  That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR.  In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR.  For example, pull ..._init() out of any switch
statement that looks like this:

        switch (...->sa_family) {
        case ...:
                ..._init();
                ...
                break;
        ...
        default:
                ..._init();
                ...
                break;
        }

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

        switch (x & (IFF_UP|IFF_RUNNING)) {
        case 0:
                ...
                break;
        case IFF_RUNNING:
                ...
                break;
        case IFF_UP:
                ...
                break;
        case IFF_UP|IFF_RUNNING:
                ...
                break;
        }

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure.  Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls.  In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source.  In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively.  Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset.  Delete unnecessary casts to void *.  Use
sockaddr_in_init() and sockaddr_in6_init().  Compare pointers with
NULL instead of "testing truth".  Replace some instances of (type
*)0 with NULL.  Change some K&R prototypes to ANSI C, and join
lines.
2008-11-07 00:20:01 +00:00
pgoyette
72ef407c2a Consistent use of softc member name - fixes build breakage from previous. 2008-10-12 23:07:32 +00:00
pgoyette
eacec974a3 Add an i2c attachment for the LM78 family of temp sensor/fan control
Tested by Martin Husemann
2008-10-12 13:17:28 +00:00
martin
dab198261c Apply patch from Dave Huang in PR kern/39642: catch up on com(4)'s
device_t/softc split.
2008-09-28 15:39:40 +00:00
christos
91ca465c78 device_t changes, pmf, minor knf. 2008-08-27 05:33:47 +00:00
drochner
cc29fcf8b9 constify the pcmcia/cardbus method tables 2008-06-26 12:33:17 +00:00
tsutsui
1f459d82b5 Replace device_lookup() with device_lookup_private() on getting softc
for future device_t/softc spilt.
2008-06-08 12:43:51 +00:00
jmcneill
ce25e3c5e1 lpt(4): register NULL pmf handler. 2008-05-31 14:07:03 +00:00
martin
5faa185ff6 Pass the com softc to comintr, not the device_t.
Fixes PR kern/38776.
2008-05-30 10:59:42 +00:00
jmcneill
21629183b8 Add pmf support. 2008-05-25 16:19:12 +00:00
plunky
fcf1772a80 after the "struct disk" is finished with, it should be
destroyed with disk_destroy(9) to stave off LOCKDEBUG
panics.
2008-05-03 08:23:41 +00:00
ad
39f45b13ce - If x86, trust the nvram and elminate long probe delays.
- Update for amd64.
2008-04-30 23:02:43 +00:00
martin
3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
garbled
fcdfd014d7 Minor fixes to some of these files:
Add recognition for the CS4232C revision chip. (0xa2)
Make ic/ad1848.c compile with AUDIO_DEBUG
Add a needed machine/bus.h include to ic/cs4231.c
Add a few additional register defines to ic/cs4231reg.h
2008-04-28 18:49:27 +00:00
xtraeme
9f6e54935c Also attach in the IT8726F Super I/O. 2008-04-26 19:01:53 +00:00
xtraeme
27a6b8b36a Fixup the negative VINs, they were inverted and conversion was wrong. 2008-04-26 12:59:24 +00:00
xtraeme
fc4443a49b Set the ENVSYS_FCHANGERFACT flag in voltage sensors, so that we
can use the 'rfact' property in /etc/envsys.conf to change the
resistor factor (in case the converted data is not correct).
2008-04-22 13:33:38 +00:00
cegger
376411d2dd device_t / softc split. From Hans Rosenfeld. 2008-04-16 09:39:01 +00:00
cegger
b849cd90e5 device_t / softc split. From Hans Rosenfeld 2008-04-15 15:02:28 +00:00
tsutsui
78a1d236b6 Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
2008-04-13 04:55:52 +00:00
tsutsui
7c06c0a3e8 Split device_t/softc for MI mb86960, with misc cosmetics. 2008-04-12 06:27:01 +00:00
tsutsui
bdd6dadf75 Fix a botch (inverted test) in rev 1.4. 2008-04-12 04:33:48 +00:00
cegger
09b1b08c50 make this build with FD_DEBUG 2008-04-11 19:16:44 +00:00
cegger
8a19ab6bca convert to pmf(9)
ok jmcneill
2008-04-11 13:00:47 +00:00
cegger
cf417aad7e use aprint_*_dev and device_xname 2008-04-08 20:08:49 +00:00
xtraeme
bea13694d3 Add the autoconf(9) detach method; useful for the LKM. 2008-04-05 18:32:14 +00:00
tsutsui
d637b91d45 Split device_t/softc for more ncr5380sbc variants, with related changes. 2008-04-04 16:19:51 +00:00
xtraeme
6e993e74bb Fix fallout from previous commit. 2008-04-04 13:10:41 +00:00
tsutsui
d9941582bf Split device_t/softc for le(4) and variants and misc cosmetic changes. 2008-04-04 12:25:06 +00:00
xtraeme
74fc6cf06c Split device_t/softc and other related cosmetic changes. 2008-04-04 09:49:49 +00:00
xtraeme
315a851ae4 Don't forget to unmap I/O space in the error paths.
Split device_t/softc and other related cosmetic changes.
2008-04-04 09:41:40 +00:00
xtraeme
6f1c8ce653 Don't forget to unmap I/O space in the error paths. 2008-04-04 09:30:55 +00:00
xtraeme
6137f9f2a1 Don't forget to unmap the I/O space in the error paths. 2008-04-04 08:44:22 +00:00
xtraeme
1b00b10fa6 Remove an unused softc member. 2008-04-03 23:16:23 +00:00
xtraeme
a68cbff5b2 Add the finsio(4) driver. This driver supports the Hardware Monitor
device in the Fintek LPC Super I/O chips, this includes the following
list:

- F71805F
- F71806F
- F71862FG
- F71872F
- F71882
- F71883F

This has been adapted from the fins(4) driver available in OpenBSD, which
only supported F71805F.

Tobias Nygren <tnn> and myself added support for the other chips; thanks go
to Tobias for testing the driver with a Fintek F71882 chip.
2008-04-03 22:46:22 +00:00
xtraeme
5cc216e9bb Add support for the SCH5307-NS and SCH5317 Super I/Os. They are
compatible with LPC47B397, only the device ID is changed.

Simplify and improve the code, and split device_t/softc.
2008-04-03 13:36:33 +00:00
dyoung
d3627477d7 Certain misguided people have complained, NetBSD only runs rare or
"retro" computers, but NetBSD also runs a growing number of rare
and retro add-on cards.  With this patch, NetBSD supports the IDEC
Supervision/16, a black&white image capture board for the 16-bit
ISA bus.  Approximate date of manufacture: 1991.  Total instances
known to be in use throughout the world: one.

Coming soon; isvctl(8), the utility program for capturing 8-bit,
512x480 images at speeds of up to 6 frames per second.
2008-04-02 01:34:36 +00:00
xtraeme
92d36024a5 Fix fallout from device_t/softc split to mpu(4):
always pass the mpu_softc to mpu_intr(). Found by Takeshi Nakayama.
2008-04-01 20:44:29 +00:00
xtraeme
8530f5047d Fix fallout from device_t/softc split to mpu(4):
always pass the mpu_softc to mpu_intr(). Found by Takeshi Nakayama.
2008-04-01 13:35:39 +00:00
ad
584864fcf7 This driver's probe routine is particularly slow, so disable it if the
system is known to have no ISA expansion slots. XXX
2008-03-30 15:27:24 +00:00
ad
cad7ab7809 Add isa_get_slotcount/isa_set_slotcount to get/set the number of ISA
compatible expansion slots in a system.
2008-03-30 15:24:08 +00:00