Sam Leffler [Mon, 30 Mar 2009 19:23:49 +0000 (19:23 +0000)]
Remove ATH_SUPPORT_TDMA and use IEEE80211_SUPPORT_TDMA instead. It
doesn't make much sense to configure driver support w/o net80211.
Note this means ath now depends on opt_wlan.h.
Warner Losh [Mon, 30 Mar 2009 16:15:06 +0000 (16:15 +0000)]
This is a major reworking of the AX88x90 support.
o Introduce new chip_type AX88790. There's a few places we need to know the
exact chip for workaronds.
o Explain the AX88190 workaround for the ISR bits being stuck, and don't
apply them to the AX88790. The datasheet says the bits are fixed, and
experience confirms.
o Fix mii bit-bang read code to read and discard the 'floating' bit.
o Remove empty ed_pccard_ax88x90_mii_reset routine
o Report error from mii_phy_probe
o Don't use ed_probe_Novel_generic for ax88x90 chips. It puts them into
an odd state sometimes. Instead, use a more stream-lined version that
avoids the trouble spots. This was copied and tweaked from the original.
o Move chip reset into its own routine.
o Minor code optimiation on getting MAC address
o Add code for coping with AX88790 cards that are in power down state and
need to be kicked before the PHY registers for the internal phy read right.
o Remove ugly cap of PHYs at 17.
o For AX88790, we need to set a special bit for accessig phy 16 (the internal
phy) and clear it for all others according to a chip erratum.
o streamline the bit-bang code for AX88x90: the delays aren't needed according
to the datasheet timing diagrams and also the Linux driver
o Fix minor bit definition for direction bit.
o Generally: Some comments reformatted
o Only try the toshiba probe on cards labelled as toshiba
# From another Akihabara card (this one from a few years ago from a
# friend in Japan). Fix the Corega FEther II PCC-TXD. This one is
# still on sale new, as of a few weeks ago. should fix all other AX88x90
# based cards, but I have some testing left to finish on my collection...
Warner Losh [Mon, 30 Mar 2009 16:01:09 +0000 (16:01 +0000)]
New PHY driver for the internal PHY found in the AX88790. There's a
number of quirks for this device, and this implements just the basics.
The 2.5s powerdown recommended in the datasheet will be next...
Implement support for RTLD_NODELETE flag for dlopen() and -z nodelete
static linker option. Do it by incrementing reference count on the loaded
object and its dependencies.
Marcel Moolenaar [Mon, 30 Mar 2009 01:03:58 +0000 (01:03 +0000)]
Sharpen the saw:
o PC98 uses 32-bit block numbers. Limit the scheme to 2^32-1
blocks when the media is larger. The 32-bit block numbers
are implicit (16-bit cylinder * 8-bit head * 8-bit sector).
Marcel Moolenaar [Mon, 30 Mar 2009 00:48:42 +0000 (00:48 +0000)]
Sharpen the saw:
o EBR uses 32-bit block numbers. Limit the scheme to 2^32-1
blocks when the media is larger.
o Calculate the number of entries based on the rounded media
size, rather than the raw media size.
Alexander Kabaev [Sun, 29 Mar 2009 21:25:40 +0000 (21:25 +0000)]
Replace v_dd vnode pointer with v_cache_dd pointer to struct namecache
in directory vnodes. Allow namecache dotdot entry to be created pointing
from child vnode to parent vnode if no existing links in opposite
direction exist. Use direct link from parent to child for dotdot lookups
otherwise.
This restores more efficient dotdot caching in NFS filesystems which
was lost when vnodes stoppped being type stable.
Sam Leffler [Sun, 29 Mar 2009 21:17:08 +0000 (21:17 +0000)]
o add ic_rt to track the rate table for the current channel; this enables
calculation of packet transmit times to do things like check txop limits
o remove equivalent driver code and convert to use net80211 state
Ed Schouten [Sun, 29 Mar 2009 20:09:51 +0000 (20:09 +0000)]
Emulate the FIODGNAME ioctl in our 32-bit emulator.
It's quite strange that nobody reported this issue before. It turns out
functions like ttyname(), ptsname() and fdevname() don't work in
compat32. This means it't not even possible to run applications like
script(1) inside a 32-bit FreeBSD jail.
Fix this by converting 32-bit fiodgname_arg structures to their 64-bit
equivalent.
Sam Leffler [Sun, 29 Mar 2009 17:59:14 +0000 (17:59 +0000)]
Eliminate ic_myaddr so changing the mac address of a device works correctly:
o remove ic_myaddr from ieee80211com
o change ieee80211_ifattach to take the mac address of the physical device
and use that to setup the lladdr.
o replace all references to ic_myaddr in drivers by IF_LLADDR
o related cleanups (e.g. kill dead code)
Robert Watson [Sun, 29 Mar 2009 03:30:15 +0000 (03:30 +0000)]
Add SDT DTrace probes for VFS vnode operations in the vfs:vop
provider namespace. These are inserted dynamically into the
VOP_..._AP() functions created from vnode_if.src. Each VOP has
entry and return probes, as arg0 the primary vnode, arg1 the
vnode operation argument structure pointer, providing access to
IN and OUT arguments, and for return probes, arg2 the return
value.
Bjoern A. Zeeb [Sat, 28 Mar 2009 23:24:34 +0000 (23:24 +0000)]
Mark the declaration of bus_space_map 'static' as the implementation is.
Follow one of the two most common indent schemes in this file.
This unbreaks a few mips kernel builds.
Bjoern A. Zeeb [Sat, 28 Mar 2009 23:17:18 +0000 (23:17 +0000)]
For kernel builds reduce the impact of svnversion, just scanning
src/sys and not the entire src/ tree.
An earlier solution by peter had been comitted in r183528 and backed out
in r183566 due to problems with newvers.sh also called from other places
during world build. With the extra test this survived a make universe.
Warner Losh [Sat, 28 Mar 2009 20:59:25 +0000 (20:59 +0000)]
Update to include Toshiba LANCT00A card being supported, as well as a
caution that while the Mitsubishi M8895 has a DP83902, its ASIC is
undocumented and doens't work with either the NE2000 or the WD80x3
drivers.
Ulf Lilleengen [Sat, 28 Mar 2009 17:20:08 +0000 (17:20 +0000)]
Import the gvinum work that have been done during and after Summer of Code 2007.
The work have been under testing and fixing since then, and it is mature enough
to be put into HEAD for further testing.
A lot have changed in this time, and here are the most important:
- Gvinum now uses one single workerthread instead of one thread for each
volume and each plex. The reason for this is that the previous scheme was
very complex, and was the cause of many of the bugs discovered in gvinum.
Instead, gvinum now uses one worker thread with an event queue, quite
similar to what used in gmirror.
- The rebuild/grow/initialize/parity check routines no longer runs in
separate threads, but are run as regular I/O requests with special flags.
This made it easier to support mounted growing and parity rebuild.
- Support for growing striped and raid5-plexes, meaning that one can extend the
volumes for these plex types in addition to the concat type. Also works while
the volume is mounted.
- Implementation of many of the missing commands from the old vinum:
attach/detach, start (was partially implemented), stop (was partially
implemented), concat, mirror, stripe, raid5 (shortcuts for creating volumes
with one plex of these organizations).
- The parity check and rebuild no longer goes between userland/kernel, meaning
that the gvinum command will not stay and wait forever for the rebuild to
finish. You can instead watch the status with the list command.
- Many problems with gvinum have been reported since 5.x, and some has been hard
to fix due to the complicated architecture. Hopefully, it should be more
stable and better handle edge cases that previously made gvinum crash.
- Failed drives no longer disappears entirely, but now leave behind a dummy
drive that makes sure the original state is not forgotten in case the system
is rebooted between drive failures/swaps.
- Update manpage to reflect new commands and extend it with some examples.
Sponsored by: Google Summer of Code 2007
Mentored by: le
Tested by: Rick C. Petty <rick-freebsd2008 -at- kiwi-computer.com>
Pyun YongHyeon [Sat, 28 Mar 2009 07:39:35 +0000 (07:39 +0000)]
o Don't access VPD even if hardware advertised the capability.
It seems that some revision of controller hang while accessing
the VPD. Because VPD access routine are unused, nuke it.
o Let TWSI reload EEPROM if VPD capability is detected. Reloading
EEPROM will also set ethernet address so age(4) now reads AGE_PAR0
and AGE_PAR1 register to get ethernet address. This removes a lot
of hack and enhance readability a lot.
o Double PHY reset timeout as it takes more time to take PHY out of
power-saving state.
o Explicitly check power-saving state by checking undocumented PHY
registers. If link is not up, poke undocumented registers to take
PHY out of power-saving state. This is the same way what Linux
does. On resume, make sure to wake up PHY.
o Don't rely on auto-clearing feature of master reset bit, just wait
1ms and check idle status of MAC.
o Add PCI device revision information in bootverbose mode.
This should fix occasional controller hang in device attach phase.
Reported by: barbara < barbara.xxx1975 at libero DOT it >
Tested by: barbara < barbara.xxx1975 at libero DOT it >
Xin LI [Sat, 28 Mar 2009 07:31:02 +0000 (07:31 +0000)]
Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD.
This does not include the new hash routines since they will cause problems
when reading old hash files.
Since mpool(3) has been changed, provide a compatibility shim for older
binaries.
Xin LI [Sat, 28 Mar 2009 07:09:51 +0000 (07:09 +0000)]
Simplify the logic when determining whether to zero out a db file to after
open(). The previous logic only initializes the database when O_CREAT is
set, but as long as we can open and write the database, and the database
is empty, we should initialize it anyway.
Xin LI [Sat, 28 Mar 2009 06:47:05 +0000 (06:47 +0000)]
- If (keysize+datasize)%(bsize=14)==0, insertion of a `big key' would cause
an invariant (actually, an ugly hack) to fail, and all Hell would break
loose.
When deleting a big key, the offset of an empty page should be bsize, not
bsize-1; otherwise an insertion into the empty page will cause the new key to
be elongated by 1 byte.
Make the packing more dense in a couple of cases.
- fix NULL dereference exposed on big bsize values;
Warner Losh [Sat, 28 Mar 2009 06:22:11 +0000 (06:22 +0000)]
When reading via memory, read in (amount + 1) / 2 (to properly round
up) rather than amount + 1 / 2, which is the same as amount, or 2x too
many words which leads to data corruption.
# This fixes the sbdrop panics I was seeing with the Toshiba LANCT00A.
Warner Losh [Sat, 28 Mar 2009 04:56:56 +0000 (04:56 +0000)]
It turns out that the Toshiba LANCT00A PC Card is really like the
Toshiba PCETC ISA card, and even has the same board type code in the
card ID (0x14). So, for this card, call ed_probe_WD80x3_generic after
setting things up apropriately. This makes the card attach and kinda
work (I'm seeing panics in sbdrop). Since history has shown that the
WD80x3 probe routine is dangerous, only do it for this card. Also,
disable the memory range check to make sure it is an valid ISA memory.
I think that it is bogus, but I'm not 100% sure, for these cards.
I removed probing for the WD80x3 in 2005 when I added support for the
AX88x90 and DL100xx cards since none of my cards had ever matched it
and PAO3 removed it and none of the cards in their database died.
It is possible there are other quirks about this card too, since no
other open source OS supports it, or even claims to support it. But
it was a fun half hour hack...
Xin LI [Sat, 28 Mar 2009 04:00:46 +0000 (04:00 +0000)]
When allocating memory, zero out them if we don't intend to overwrite them
all; before freeing memory, zero out them before we release it as free
heap. This will eliminate some potential information leak issue.
While there, remove the PURIFY option. There is a slight difference between
the new behavior and the old -DPURIFY behavior, with the latter initializes
memory with 0xff's. The difference between old and new approach does not
generate observable difference.
Warner Losh [Fri, 27 Mar 2009 19:15:28 +0000 (19:15 +0000)]
Add bromax axnet based cards to the mix. This was harvested from the linux
driver. Not sure who sold it/rebadged it.
Add stub entries for Mitsubishi B8895 and Toshiba LANCT00A to the
driver with a comment that they don't work /* NG */.[*] These are
DP83902A based cards, which should work, but don't seem to. Likely
they are from the days before the ne2000 roamed the earth and use a
non-standard hookup (see if_ed_isa or if_ed_cbus for some examples).
Unless I happen to stumble into the right one, these may never work,
but I'm tired of omitting them from commits.
[*] The Japanese adopted OK from English, but also use NG for its
opposite.
Ed Schouten [Fri, 27 Mar 2009 19:13:36 +0000 (19:13 +0000)]
Don't strip TTY device name to the last '/'.
We've seen this bug in other applications before: we have some
applications that use strrchr(tty, '/') on the TTY device name. This
isn't valid when using pts(4), because the device name will be stripped
to "0" instead of "pts/0".
This fixes issues with login(1) ignoring /etc/ttys and missing utmp
records.
Doug Ambrisko [Fri, 27 Mar 2009 17:00:49 +0000 (17:00 +0000)]
Revert 190445 change to this file restoring:
typedef l_long l_off_t;
Change l_mmap_argv's to l_ulong for pgoff. This restores prior behaviour
to consumers of l_off_t but allows mmap to mmap a 32bit position which a
Linux application requires to access SMBIOS data via /dev/mem.
Juli Mallett [Fri, 27 Mar 2009 05:44:53 +0000 (05:44 +0000)]
Put the "%d retries" debug message in the transmit path behind WPI_DEBUG_TX
rather than behind a seemingly accidental constant likely left over from one of
the related drivers which uses log levels rather than per-facility debugging
flags. This should get rid of contextless messages on the console for people
who have not set (or cleared the default) debugging flags.
Marcel Moolenaar [Fri, 27 Mar 2009 05:35:12 +0000 (05:35 +0000)]
Sharpen the saw:
o Don't create an APM scheme underneath another scheme when
the probe doesn't allow it.
o APM uses 32-bit block numbers. Limit the scheme to 2^32-1
blocks when the media is larger.
Juli Mallett [Fri, 27 Mar 2009 03:17:25 +0000 (03:17 +0000)]
o) Check that no overrun or CRC errors were encountered in receiving a
packet. Linux, OpenBSD and our iwn(4) all do this. It also results in
a huge performance improvement (and the rejection of a fair number of
apparently-bad packets on receive) on my hardware.
o) Like the wpi(4) driver in OpenBSD, and like our iwn(4), also drop runt
packets.
o) Don't bother doing IFQ_POLL and then IFQ_DRV_DEQUEUE, just do
IFQ_DRV_DEQUEUE outright. This is more similar to how OpenBSD and our
iwn(4) work.
Sam Leffler [Thu, 26 Mar 2009 21:29:03 +0000 (21:29 +0000)]
o move tdma+superg protocol defs out of public view
o add #ifdef _KERNEL to superg+tdma include files so they can be used
by user code to get the protocol defs
John Baldwin [Thu, 26 Mar 2009 21:10:35 +0000 (21:10 +0000)]
Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe() and
into acpi_cpu_startup() which is where all the other code to update this
global variable lives. This fixes a bug where cpu_cx_count was not updated
correctly if acpi_cpu_generic_cx_probe() returned early.
PR: kern/108581
Debugged by: Bruce Cran
Reviewed by: avg, njl, sepotvin
MFC after: 3 days
Sam Leffler [Thu, 26 Mar 2009 19:13:11 +0000 (19:13 +0000)]
Fix enough bits so that fast frames work again:
o include ath ie in beacon frames
o fix probe response check for including ath ie
o add ieee80211_add_athcap shorthand for ap-side ie additions
Doug Ambrisko [Thu, 26 Mar 2009 17:14:22 +0000 (17:14 +0000)]
Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
via the Linux tool.
- Add Linux shim to ipmi(4)
- Create a partitions file to linprocfs to make Linux fdisk see
disks. This file is dynamic so we can see disks come and go.
- Convert msdosfs to vfat in mtab since Linux uses that for
msdosfs.
- In the Linux mount path convert vfat passed in to msdosfs
so Linux mount works on FreeBSD. Note that tasting works
so that if da0 is a msdos file system
/compat/linux/bin/mount /dev/da0 /mnt
works.
- fix a 64it bug for l_off_t.
Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
/compat/linux/etc/mtab and then some careful unpacking of the Linux bmc
update tool and hacking makes it work on newer Dell boxes. Note, probably
if you can't figure out how to do this, then you probably shouldn't be
doing it :-)