jhb [Mon, 14 Aug 2006 15:39:41 +0000 (15:39 +0000)]
Don't try to preserve PAT bits in pmap_enter(). We currently on pages that
aren't mapped via pmap_enter() (KVA). We will eventually support PAT bits
on user pages, but those will require some sort of MI caching mode stored
in the vm_page.
ru [Mon, 14 Aug 2006 15:35:43 +0000 (15:35 +0000)]
Fix alignment of RX bufs DMA map to be realistic. Maybe it works on
i386 (I don't know) but on amd64 at hand here, it paniced early at
boot.
(I'm pretty sure that PAGE_SIZE here was miscopied from another place
during porting, where in OpenBSD bus_dmamem_alloc() is used, but there
PAGE_SIZE means completely different thing.)
des [Mon, 14 Aug 2006 13:28:53 +0000 (13:28 +0000)]
Don't use touch when what is really meant is :> (create an empty file, or
truncate it if it exists) or :>> (ensure the file exists, but don't change
it if it already does)
dd [Mon, 14 Aug 2006 08:21:27 +0000 (08:21 +0000)]
Improve the wording. Remove the appositive about strcmp, putting the
first sentence back to the way it was. Add a second sentence that
explains the case when strcmp is called.
dd [Mon, 14 Aug 2006 07:54:17 +0000 (07:54 +0000)]
Print packet loss figures with one decimal place. ping6 already does
this, and OpenBSD and NetBSD pings do it too. This is primarily useful
for comparing low levels of packet loss.
alc [Mon, 14 Aug 2006 06:15:16 +0000 (06:15 +0000)]
It's not entirely obvious that PGEX_I must be zero if no-execute is neither
supported nor enabled. Just to be sure, verify that no-execute is enabled
before passing VM_PROT_EXECUTE to vm_fault().
mjacob [Mon, 14 Aug 2006 05:42:46 +0000 (05:42 +0000)]
Fix 2KLOGIN code to specify *ibits* (not *obits*) so that the
options field in register 10 will be deterministic, not random.
Correct the number of input bits for EXECUTE_FIRMWARE 0..1 to
0..2- the 2322 and 24XX cards use mailbox register 2 to specify
whether the f/w being executed is freshly loaded or not.
Correct the number of input bits for {READ,WRITE}_RAM_WORD_EXTENDED
so that register 8 gets picked up.
Fix the indexing and offset for the 2322 f/w download so that it
correctly puts the different code segments where they belong.
Move VERIFY_CHECKSUM to be the 'else' clause to 2322 f/w downloads-
the EXECUTE_FIRMWARE command for 2322 and 24XX cards will tell you
if the f/w checksum is incorrect and VERIFY_CHECKSUM only works for
RISC SRAM address < 64K so you can only do a VERIFY_CHECKSUM on the
first of the 3 f/w segments for the 2322.
Shorten the delay for the continuation mailbox commands- 1ms is
ridiculous (100us is more likely).
All of the more or less is really only for the 2322/6322 cards.
yongari [Mon, 14 Aug 2006 02:21:26 +0000 (02:21 +0000)]
Make em(4) handle too many fragmented frame with m_defrag(9).
Previously em(4) requeued the failed mbuf chains from
bus_dmamap_load_mbuf_sg(9) failure to resend it later. However,
bus_dmamap_load_mbuf_sg(9) may never complete its request as the
fragmented frames can have more than EM_MAX_SCATTER segments.
To handle the above EFBIG case, defragment the frame with m_defrag(9)
and free the mbuf chain if it can't deframent the chain due to
resource shortage.
yongari [Mon, 14 Aug 2006 01:50:54 +0000 (01:50 +0000)]
Overhaul Rx path to recover from mbuf cluster allocation failure.
o Create one more spare DMA map for Rx handler to recover from
bus_dmamap_load_mbuf_sg(9) failure.
o Make sure to update status bit in Rx descriptors even if we failed
to allocate a new buffer. Previously it resulted in stuck condition
and em_handle_rxtx task took up all available CPU cycles.
o Don't blindly unload DMA map. Reuse loaded DMA map if received
packet has errors. This would speed up Rx processing a bit under
heavy load as it does not need to reload DMA map in case of error.
(bus_dmamap_load_mbuf_sg(9) is the most expensive call in driver
context.)
o Update if_iqdrops counter if it can't allocate a mbuf cluster.
With this change it's now possible to see queue dropped packets
with netstat(1).
o Update mbuf_cluster_failed counter if fixup code failed to
allocate mbuf header.
o Return ENOBUFS instead of ENOMEM in case of Rx fixup failure.
o Make adapter->lmp NULL in case of Rx fixup failure. Strictly
specking it's not necessary for correct operation but it makes
the intention clear.
o Remove now unused dropped_pkts member in softc.
With these changes em(4) should survive mbuf cluster allocation
failure on Rx path.
yongari [Mon, 14 Aug 2006 00:36:53 +0000 (00:36 +0000)]
Apply alignment fixup only when programmed frame size is greater than
MCLBYTES - ETHER_ALIGN. Previously it applied the alignment fixup code
for oversized frames which would result in reduced performance on
strict alignment archs.
cperciva [Sun, 13 Aug 2006 21:54:47 +0000 (21:54 +0000)]
Correctly handle the case in calloc(num, size) where
(size_t)(num * size) == 0
but both num and size are nonzero.
Reported by: Ilja van Sprundel
Approved by: jasone
Security: Integer overflow; calloc was allocating 1 byte in
response to a request for a multiple of 2^32 (or 2^64)
bytes instead of returning NULL.
des [Sun, 13 Aug 2006 08:47:41 +0000 (08:47 +0000)]
Revert previous commit. Pre-Nehemiah C3 CPUs do have 3DNow!; it doesn't
show up in dmesg because identcpu.c only looks for it on Intel and AMD
processors.
cperciva [Sun, 13 Aug 2006 05:32:10 +0000 (05:32 +0000)]
Undefine __DATE__ in order to avoid placing a build timestamp into
/usr/sbin/{named, lwresd}. Note that POSIX / C99 doesn't technically
allow __DATE__ to be (un|re)defined, but gcc does what we mean anyway.
alc [Sun, 13 Aug 2006 00:11:09 +0000 (00:11 +0000)]
Reimplement the page's NOSYNC flag as an object-synchronized instead of a
page queues-synchronized flag. Reduce the scope of the page queues lock in
vm_fault() accordingly.
Move vm_fault()'s call to vm_object_set_writeable_dirty() outside of the
scope of the page queues lock. Reviewed by: tegge
Additionally, eliminate an unnecessary dereference in computing the
argument that is passed to vm_object_set_writeable_dirty().
pjd [Sat, 12 Aug 2006 15:34:15 +0000 (15:34 +0000)]
Handle MSDOS file systems properly. Before the change file systems
created on Windows XP (and others maybe) were not detected.
We detected only those created with newfs_msdos(8).
des [Sat, 12 Aug 2006 09:46:43 +0000 (09:46 +0000)]
I don't know where I got the idea that the VIA C3 has 3DNow!; it doesn't.
It does have MMX (though MMX support is reputed to be incomplete in early
generations), and later generations have SSE.
imp [Sat, 12 Aug 2006 09:06:55 +0000 (09:06 +0000)]
Batch of changes:
o when turning off the socket for a 16-bit card, write 0 to INTR register
rather than just tying to just clear the rest bit. this seems to fix
card insert detection after an eject on TI bridges (ricoh bridges work
either way, apparently). This is a MFp4.
o Cope better with TOPIC95 bridges on powerup. According to NetBSD driver,
these bridges don't set POWER_STATE, so cope accordingly in our power
code. They also need a little extra time to settle, so do that as well.
o It appears that we need to turn on/off one of the clocks to the card
when we power up/down that socket on a TOPIC97, also from NetBSD.
o TOPIC97 bridges need to specifically enable LV card support. Unconditionally
do this in the hopes that all laptops that have these chips support LV
voltages (they should, since they are required for CardBus).
o TOPIC register name regularization. Registers specific to models of TOPIC
are now called out as such.
imp [Sat, 12 Aug 2006 08:53:54 +0000 (08:53 +0000)]
The TOPIC97 and TOPIC100 seem to have a special register in the exca
space that enables low voltage operation (and maybe other stuff).
Enable the bits in this register so low voltage 16-bit cards may work.
yongari [Sat, 12 Aug 2006 02:05:13 +0000 (02:05 +0000)]
Don't reset Tx threshold value whenever xl_init_locked() is called.
Instead the threshould is initialized in device attach. Later the
threshold could be increased in Tx underrun error and the new
threshold should be used in xl_init_locked().
yongari [Sat, 12 Aug 2006 01:38:49 +0000 (01:38 +0000)]
Due to the poor PHY documentation from RealTek I can't sure but I
think the RealTek PHY needs driver to set RGEPHY_BMCR_AUTOEN bit of
RGEPHY_MII_BMCR register and proper ANAR register setting for manual
media type selection.
This fixes long standing manual media type selection bug in rgephy(4).
Reported by: Jelte Jansen <jelte AT NLnetLabs DOT nl>
Tested by: Jelte Jansen <jelte AT NLnetLabs DOT nl>
thomas [Fri, 11 Aug 2006 21:44:53 +0000 (21:44 +0000)]
(sm_mon_1_svc): Fix debugging output: when establising a monitoring
request, correctly report the location (usually localhost) to which
a callback will be made when a notification is received for the
monitored host. Previsouly, the name of the monitored host was
reported instead.
mohans [Fri, 11 Aug 2006 21:15:23 +0000 (21:15 +0000)]
Fixes an edge case bug in timewait handling where ticks rolling over causing
the timewait expiry to be exactly 0 corrupts the timewait queues (and that entry).
Reviewed by: silby
jhb [Fri, 11 Aug 2006 19:22:57 +0000 (19:22 +0000)]
First pass at allowing memory to be mapped using cache modes other than
WB (write-back) on x86 via control bits in PTEs and PDEs (including making
use of the PAT MSR). Changes include:
- A new pmap_mapdev_attr() function for amd64 and i386 which takes an
additional parameter (relative to pmap_mapdev()) specifying the cache
mode for this mapping. Note that on amd64 only WB mappings are done with
the direct map, all other modes result in a private mapping.
- pmap_mapdev() on i386 and amd64 now defaults to using UC (uncached)
mappings rather than WB. Previously we relied on the BIOS setting up
MTRR's to enforce memio regions being treated as UC. This might make
hw.cbb_start_memory unnecessary in some cases now for example.
- A new pmap_mapbios()/pmap_unmapbios() API has been added to allow places
that used pmap_mapdev() to map non-device memory (such as ACPI tables)
to do so using WB as before.
- A new pmap_change_attr() function for amd64 and i386 that changes the
caching mode for a range of KVA.
pjd [Fri, 11 Aug 2006 19:09:12 +0000 (19:09 +0000)]
Before using byte offset for IV creation, covert it to little endian.
This way one will be able to use provider encrypted on eg. i386 on
eg. sparc64. This doesn't really buy us much today, because UFS isn't
endian agnostic.
We retain backward compatibility by setting G_ELI_FLAG_NATIVE_BYTE_ORDER
flag on devices with version number less than 2 and not converting the
offset.
des [Fri, 11 Aug 2006 17:28:59 +0000 (17:28 +0000)]
Reintroduce CSTD, which allows a Makefile to specify the precise dialect
of C in which the program or library is written.
Note that this is *not* intended to be used across the whole tree. It
is intended to be used for individual libraries or programs which use
specific language features which the compiler must know about in order
to produce correct warnings at high WARNS levels.
yar [Fri, 11 Aug 2006 17:09:27 +0000 (17:09 +0000)]
Optionally pad outgoing frames to the minimum of 60 bytes (excl. FCS)
before tagging them. This can help to work around brain-damage in some
switches that fail to pad a frame after untagging it if its length drops
below the minimum. This option is blessed by IEEE Std 802.1Q (2003 Ed.),
paragraph C.4.4.3.b. It's controlled by sysctl net.link.vlan.soft_pad.
glebius [Fri, 11 Aug 2006 10:58:24 +0000 (10:58 +0000)]
Merge in new driver from Intel, version 6.1.4. It adds support for 82571EB quad port copper NIC and has few minor fixes.
Details:
- if_em.c. Merged manually, viewing diff between new vendor
driver and previous one.
- if_em_hw.c. Dropped in from vendor, and then restored
revision 1.15.
imp [Thu, 10 Aug 2006 18:11:22 +0000 (18:11 +0000)]
MFp4: Numerous changes from p4 to try to improve tftp downloading,
reduce code footprint, etc. While some problems still remain, the
reliability of tftp is much improved.
imp [Thu, 10 Aug 2006 17:54:51 +0000 (17:54 +0000)]
MFp4: Increase character timeout to 10. Make it a #define for easier
changes in the future. This helps with getting started and to
overcome the really sucky level of granuality this timeout has in
getc. A timeout of 1 means 'wait until top of next second' rather
than 'wait for at least a second'.
sam [Thu, 10 Aug 2006 16:31:37 +0000 (16:31 +0000)]
o add noise floor to stats
o include current tx rate in stats so athstats gets a consistent
snapshot and doesn't have to make an extra ioctl
o record tx rate for raw frames
njl [Thu, 10 Aug 2006 06:32:16 +0000 (06:32 +0000)]
The acpi module is no different from others. If it is loaded while the kernel
has it compiled in, it will be rejected with "module acpi already present!"
and no strange behavior.
sam [Thu, 10 Aug 2006 06:06:13 +0000 (06:06 +0000)]
fixup list station support:
o add sanity check to avoid possible looping
o use intended api for IEEE80211_IOC_STA_INFO
o when operating in sta mode get the sta info for the ap
sam [Thu, 10 Aug 2006 06:04:00 +0000 (06:04 +0000)]
More statistics fixups:
o change rssi to be signed in ieee80211_nodestats
o add noise floor in ieee80211_nodestats (use an implicit hole to
preserve layout); return it as zero until we can update the api's
so the driver can provide noise floor data
o add a bandaid so IEEE80211_IOC_STA_STATS works for sta mode; when
all nodes are in the station table this will no longer be needed
o fix braino in IEEE80211_IOC_STA_INFO implementation; was supposed
to take a mac address and return info for that sta or all stations
if ff:ff:ff:ff:ff was supplied--but somehow this didn't get implemented;
implement the intended semantics and leave a compat shim at the old
ioctl number for the previous api
sam [Thu, 10 Aug 2006 05:54:36 +0000 (05:54 +0000)]
minor fixups:
o add some missing stats to the global stat structure
o move accounting work for data frame rx into ieee80211_deliver_data
o add per-sta stats for rx ucast/mcast frames
o set rcvif in ieee80211_deliver_data so callers don't need to