marius [Sat, 13 Jan 2007 17:18:44 +0000 (17:18 +0000)]
- Allow multiple (external) PHYs with Am79C97{2,6}, which actually
only support external PHYs (besides not connectable internal ones
which respond at the usual addresses, but which don't hurt if we
let them show up) and don't wedge when isolating PHYs. Actually,
this change special cases limiting PHYs to Am79C97{3,5,8}, for
which this driver doesn't implement swiching between the internal
and external PHYs, yet, and Am79C971, where isolating the external
PHY (at least in case it's a DP83840A) wedges the chip. Together
with sys/dev/mii/acphy.c rev. 1.21 this adds support for the
100baseFX port of AT-2700 series adaptors, which use two AC101,
one for the copper and one for the fibre port (there might be
variants which only use one PHY though).
- Fix a bug in the previous revision that prevented the address of
the used (external) PHY to be actually recorded.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
bde [Sat, 13 Jan 2007 11:00:56 +0000 (11:00 +0000)]
Fixed a panic in the probe. The memory resource was accessed after
releasing it. This seems to have worked until a few days ago, but
now the memory is unmapped.
jhb [Sat, 13 Jan 2007 04:57:37 +0000 (04:57 +0000)]
- Add a new flag to the PCI-PCI driver to disable MSI on devices behind the
bridge if it doesn't pass MSI messages up correctly. We set the flag
in pcib_attach() if the device ID is disabled via a PCI quirk.
- Disable MSI for devices behind the AMD 8131 HT-PCIX bridge. Linux has
the same quirk.
Tested by: no one despite repeated calls for testers
jhb [Sat, 13 Jan 2007 04:35:15 +0000 (04:35 +0000)]
- Add a locked variant of bce_ifmedia_upd() for use within the driver and
add missing locking to bce_ifmedia_upd().
- While I'm here, unexpand an instance of LIST_FOREACH().
marius [Sat, 13 Jan 2007 00:06:41 +0000 (00:06 +0000)]
- Take advantage of mii_phy_dev_probe() and mii_phy_setmedia().
- Set MIIF_NOLOOP as loopback doesn't work with this PHY. The MIIF_NOLOOP
flag currently triggers nothing but hopefully will be respected by
mii_phy_setmedia() later on.
- Use MII_ANEGTICKS instead of 5.
- Remove an unused macro.
- Fix some whitespace nits.
marius [Fri, 12 Jan 2007 23:17:43 +0000 (23:17 +0000)]
- Take advantage of mii_phy_dev_probe().
- In exphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- Remove #if 0'ed unapplicable code.
- Fix some whitespace nits.
marius [Fri, 12 Jan 2007 22:59:38 +0000 (22:59 +0000)]
Set MIIF_HAVE_FIBER and add IFM_100_FX media when the AC_MCTL_FX_SEL
and thus the FX_DIS pin indicates fibre media. This is part 1/2 of
adding support for the 100baseFX interface/port of AT-2700 series
adaptors.
marius [Fri, 12 Jan 2007 22:27:46 +0000 (22:27 +0000)]
Use mii_phy_add_media()/mii_phy_setmedia()-compatible media table
indices when manually adding media. Some of these I've missed while
converting drivers to take advantage of said fuctions recently,
others where longstanding bugs.
rwatson [Fri, 12 Jan 2007 22:17:31 +0000 (22:17 +0000)]
Ignore EINPROGRESS error on TCP connect(), and pick up the result of the
non-blocking connect later using select(). This case didn't trigger on
my UP test box, but did on Peter's SMP test box.
rwatson [Fri, 12 Jan 2007 21:49:36 +0000 (21:49 +0000)]
Add a regression test for sending and writing zero bytes to sockets of
various types, as well as pipes and fifos for good measure. RELENG_6
currently passes all of these tests, but 7-CURRENT fails 0-byte writes
and sends on all stream socket types (and fifos, as they are based on
stream sockets).
Bumped into by: peter
Diagnosed by: jhb
Problem of: andre
rwatson [Fri, 12 Jan 2007 13:18:08 +0000 (13:18 +0000)]
Cleanup of netatalk atalk layer includes, protocol definitions, and
routing:
- style(9) cleanup -- white space, braces, etc.
- Make include guards consistent with our more general naming
convention.
- Rearrange and complete forward structure declarations in at_extern.h,
remove testing of guards of various other include files to protect
function declarations.
This leaves an ifdef _KERNEL in at_var.h, but from inspection it seems
likely that this file is not actually safe for inclusion in user space
still. However, since it's not included from within src/ so this does
not appear to be an issue (ifconfig, etc, have migrated to the generic
cross-protocol ioctls for address operations).
imp [Fri, 12 Jan 2007 07:40:30 +0000 (07:40 +0000)]
When ntp_gettime() was converted from a sysctl + wrapper to a system
call, its semantics were unintentionally changed. It went from
returning the time state to returning 0 or -1. Since 0 means time
normal, and non-zero effectively only shows up around leap seconds,
this went unnoticed until now. At least unnoticed until someone was
trying to run a binary they didn't have source for and it was
misbehaving...
imp [Fri, 12 Jan 2007 07:23:31 +0000 (07:23 +0000)]
Marking this as __packed was needed to get the alignment and offset of
members right. However, it also said it was aligned(1), which meant
that gcc generated really bad code. Mark this as aligned(4). This
makes things a little faster on arm (a couple percent), but also saves
about 30k on the size of the kernel for arm.
I talked about doing this with bde, but didn't check with him before
the commit, so I'm hesitant say 'reviewed by: bde'.
jhb [Thu, 11 Jan 2007 19:56:24 +0000 (19:56 +0000)]
Various updates to most of the smbus(4) drivers:
- Use printf() and device_printf() instead of log() in ichsmb(4).
- Create the mutex sooner during ichsmb(4) attach.
- Attach the interrupt handler later during ichsmb(4) attach to avoid
races.
- Don't try to set PCIM_CMD_PORTEN in ichsmb(4) attach as the PCI bus
driver does this already.
- Add locking to alpm(4), amdpm(4), amdsmb(4), intsmb(4), nfsmb(4), and
viapm(4).
- Axe ALPM_SMBIO_BASE_ADDR, it's not really safe to write arbitrary values
into BARs, and the PCI bus layer will allocate resources now if needed.
- Merge intpm(4) and intsmb(4) into just intsmb(4). Previously, intpm(4)
attached to the PCI device and created an intsmb(4) child. Now,
intsmb(4) just attaches to PCI directly.
- Change several intsmb functions to take a softc instead of a device_t
to make things simpler.
jhb [Thu, 11 Jan 2007 19:40:19 +0000 (19:40 +0000)]
Remove magic from rman_activate_resource() that uses the direct map at
KERNBASE for the first 1 MB of RAM instead of calling pmap_mapdev().
pmap_mapdev() knows how to handle the first 1 MB (and has known for a
while now) and properly maps the memory as UC to boot.
jhb [Thu, 11 Jan 2007 19:13:27 +0000 (19:13 +0000)]
Wrap propagate_priority() in a critical section to prevent unwanted
preemptions when adjusting the priority of a thread that is on a run
queue. This was only observed when FULL_PREEMPTION was enabled.
delphij [Thu, 11 Jan 2007 03:17:28 +0000 (03:17 +0000)]
- Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on bce_tick() callout.
- Instead of unconditionally resetting the controller, try to
skip the reset in case we got a pause frame, like em(4) did.
- Lock bce_tick() using callout_init_mtx().
stefanf [Thu, 11 Jan 2007 00:19:00 +0000 (00:19 +0000)]
Return an error status (127) from the builtins 'type' and 'command' (with
either -v or -V) if a file with a slash in the name doesn't exist (if there is
no slash we already did that).
Additionally, suppress the error message for command -v for files with a slash.
jeff [Thu, 11 Jan 2007 00:17:02 +0000 (00:17 +0000)]
- Use the correct test in the ipi bitmask handler for IPI_PREEMPT so that
we actually issue preemptions.
- Remove the #ifdef IPI_PREEMPTION so it is always compiled in. Leave
the option which optionally enables support in sched_4bsd. sched_ule.c
will soon use this functionality as a run time rather than compile time
option.
- Compare against the idlethread rather than the priority. There are some
idle prio tasks that we can preempt.
rwatson [Wed, 10 Jan 2007 21:04:43 +0000 (21:04 +0000)]
Remove uma_zalloc_arg() hack, which coerced M_WAITOK to M_NOWAIT when
allocations were made using improper flags in interrupt context.
Replace with a simple WITNESS warning call. This restores the
invariant that M_WAITOK allocations will always succeed or die
horribly trying, which is relied on by many UMA consumers.
marius [Wed, 10 Jan 2007 18:45:18 +0000 (18:45 +0000)]
Add missing SC_NO_MODE_CHANGE option. Disable it in the powerpc
NOTES though, as ofw_syscons(4) doesn't properly interface with
syscons(4) regarding loading the font specified with SC_DFLT_FONT,
causing a kernel with both options SC_OFWFB and SC_NO_MODE_CHANGE
to not link.
brueffer [Wed, 10 Jan 2007 12:57:46 +0000 (12:57 +0000)]
Sync the hardware list with the driver and with what I could find on
the Areca website.
Also remove the module from the FILES section, it's already covered in
the SYNOPSIS.
jhb [Tue, 9 Jan 2007 17:50:05 +0000 (17:50 +0000)]
Add various utrace's for use with ktrace to the ELF runtime linker. To
activate the traces, set the LD_UTRACE (or LD_32_UTRACE) environment
variable. This also includes code in kdump(8) to parse the traces.
kientzle [Tue, 9 Jan 2007 08:05:56 +0000 (08:05 +0000)]
Fix the copyright notice; it was always intended to be
a vanilla 2-clause BSD license, but somehow some confusing
extra verbage get copied from somewhere.
Also, update the copyright dates to 2007 for all of the files.
Prompted by: several questions about what those extra words really mean
alfred [Mon, 8 Jan 2007 23:21:06 +0000 (23:21 +0000)]
Add the following functions to abstract away the creation of task threads
for usb. I hope that this will eventually be used for generic devices
that need full fledged blocking threads for event processing.
Create a taskqueue:
void usb_ether_task_init(device_t, int, struct usb_taskqueue *);
Enqueue a task:
void usb_ether_task_enqueue(struct usb_taskqueue *, struct task *);
Wait for all tasks queued to complete:
void usb_ether_task_drain(struct usb_taskqueue *, struct task *);
Destroy the taskqueue:
void usb_ether_task_destroy(struct usb_taskqueue *);
rwatson [Mon, 8 Jan 2007 22:30:39 +0000 (22:30 +0000)]
Factor out my copyrights + licenses from Charles D. Cranor and
University of Washington copyrights, which include the
advertising clause. Move $NetBSD$ into standard location for
FreeBSD source files, and normalize formatting.
rwatson [Mon, 8 Jan 2007 22:14:00 +0000 (22:14 +0000)]
Factor out UCB and my copyrights from copyrights of Mike Mitchell;
the former use a three-clause BSD license (per UCB authorization
letter), whereas he uses a four-clause BSD license.
imp [Mon, 8 Jan 2007 21:21:45 +0000 (21:21 +0000)]
Replace (name) with Henric Vestergaard Draboel since it was clear that
this was just cut N paste and '(name)' doesn't make any sense. If
someone knows how to contact Mr. Draboel, please let me know.
rwatson [Mon, 8 Jan 2007 20:35:13 +0000 (20:35 +0000)]
Resort copyrights and licenses in kern_acct.c: per UCB letter,
the UCB license now excludes the advertising clause. I'm not
interested in it either, so move my copyright. This leaves
only a CGD copyright with the advertising clause.
imp [Mon, 8 Jan 2007 18:25:58 +0000 (18:25 +0000)]
Per Olivier Houchard, use the proper license for this file. He
bogusly used the kvm_powerpc.c file as a template for the license, but
then either wrote the code himself, or cribbed it from the kvm_i386
file. The only thing from the kvm_powerpc.c file was the license.
Correct this mistake with his blessing.
sam [Mon, 8 Jan 2007 18:23:43 +0000 (18:23 +0000)]
Fix potential node refcnt leak. If mbufs are q'd on ic_mgtq when
the state machine clocks to INIT, node references are not reclaimed.
Add a new routine ieee80211_drain_ifq that does this and use it
instead of IF_DRAIN.
rwatson [Mon, 8 Jan 2007 17:49:59 +0000 (17:49 +0000)]
Canonicalize copyrights in some files I hold copyrights on:
- Sort by date in license blocks, oldest copyright first.
- All rights reserved after all copyrights, not just the first.
- Use (c) to be consistent with other entries.
sam [Mon, 8 Jan 2007 17:24:51 +0000 (17:24 +0000)]
Correct several issues with rate set negotiation:
o add IEEE80211_F_JOIN flag to ieee80211_fix_rate to indicate a station
is joining a BSS; this is used to control whether or not we over-write
the basic rate bit in the calculated rate set
o fix ieee80211_fix_rate to honor IEEE80211_F_DODEL when IEEE80211_F_DONEGO
is not specified (e.g. when joining an ibss network)
o on sta join always delete unusable rates from the negotiated rate set,
this was being done only ibss networks but is also needed for 11g bss
with mixed stations
o on sta join delete unusable rates from the bss node's rate set, not the
scan table entry's rate set
o when calculating a rate set for new neighbors in an ibss caculate a
negotiated rate set so drivers are not presented with rates they should
not use
marius [Mon, 8 Jan 2007 01:26:47 +0000 (01:26 +0000)]
o Changes to psycho_attach(): [1]
- Clear the PCI AFSR and status error bits as previous errors still
might be indicated.
- Set up the PCI control and diagnostic registers according to the
capabilities, workarounds, etc of/for specific revisions of the
supported bridges. This includes no longer setting Hummingbird-/
Sabre-specific bits in the PCI control register but preserving
what the firmware has initialized them to like OpenSolaris does.
Previously we were setting these bits according to the example in
the Sabre documentation, which I doubt is appropriate for all
Sabre based designs and especially not for Hummingbirds. This
also includes not enabling bus parking unless the firmware tells
us to.
- Set the PCI latency timer register as this isn't always done by
the firmware.
o Remove a redundant argument from psycho_set_intr() and in this
function check the return value of bus_setup_intr(). [2]
o Let psycho_setup_intr() return ENOMEM instead of 0 when it can't
allocate memory for the interrupt wrapper stub and EINVAL instead
of 0 if it can't find the interrupt vector in the interrupt map.
o Add a workaround for a bug of the Sabre-APB-combination where it
doesn't drain DMA write data for devices behind additional PCI-PCI
bridges underneath the APB PCI-PCI bridge. This workaround (do
things necessary in order to achieve a manual drain when coherency
is required) is currently implemented in psycho_setup_intr() and
psycho_intr_stub() (for easy MFC'ing) and therefore is only applied
for interrupt handlers. This should be moved to psycho(4)-specific
bus_dma_tag_create() and bus_dmamap_sync() methods, respectively,
once this driver is converted to make use of BUS_GET_DMA_TAG(), so
the workaround is also applied for polling(4) callbacks. [3]
o Fix some minor style issues.
marius [Mon, 8 Jan 2007 01:08:24 +0000 (01:08 +0000)]
In ofw_pcibus_attach() skip dupe PCI devices reported by the
firmware (mainly 'pmu' and its 'lomp' dupe found in a couple of
later USII{e,i}-based machines) by checking whether a device with
the same triple of bus number, slot and function already has been
added. This is the simple yet effective approach introduced in
OpenBSD some time ago, but which has the flaw that it assumes
that the device and its dupe(s) found in the OFW device tree are
equal or at least the one encountered first is in some way the
more important one (this is the case with 'pmu' and 'lomp'; the
'pmu' node has couple of properties and children while the 'lomp'
one misses most of these). If there's ever a device/dupe pair
where we don't encounter the more important node first, we'll
probably need to introduce a quirk list in order to add the
desired device but prevent its dupe(s) from being added.