Ian Dowse [Mon, 14 Feb 2005 01:51:51 +0000 (01:51 +0000)]
Add a new function usbd_abort_default_pipe() that aborts any transfers
on the default pipe. This is helpful in device detach routines to
stop any active control transfers.
Tim Kientzle [Sun, 13 Feb 2005 23:29:54 +0000 (23:29 +0000)]
Fix a buffer overflow in the "none" decompression handler that
occurred with large read-ahead requests. This only affected
formats that incorrectly make large requests (ZIP did this until
recently) or with block sizes over 32k.
Alan Cox [Sun, 13 Feb 2005 21:51:50 +0000 (21:51 +0000)]
Request a CPU private mapping from sf_buf_alloc(). If the swap-backed
memory disk is larger than the number of available sf_bufs, this improves
performance on SMPs by eliminating interprocessor TLB shootdowns. For
example, with 6656 sf_bufs, the default on my test machine, and a 256MB
swap-backed memory disk, I see the command
"dd if=/dev/md0 of=/dev/null bs=64k" achieve ~489MB/sec with the default,
shared mappings, and ~587MB/sec with CPU private mappings.
Ian Dowse [Sun, 13 Feb 2005 21:38:34 +0000 (21:38 +0000)]
When attached to a high-speed device, report a more appropriate
base transfer speed to CAM. The actual value used (40MB/s) is fairly
arbitrary, but assumes the same 33% overhead as was implied by the
1MB/s figure we used for USB1 devices.
Nate Lawson [Sun, 13 Feb 2005 18:49:48 +0000 (18:49 +0000)]
Add support for the CPUFREQ_FLAG_INFO_ONLY flag. Devices that report this
are not added to the list(s) of available settings. However, other drivers
can call the CPUFREQ_DRV_SETTINGS() method on those devices directly to
get info about available settings.
Update the acpi_perf(4) driver to use this flag in the presence of
"functional fixed hardware." Thus, future drivers like Powernow can
query acpi_perf for platform info but perform frequency transitions
themselves.
Nate Lawson [Sun, 13 Feb 2005 17:31:56 +0000 (17:31 +0000)]
Set levels on all CPUs and attach a cpufreq device to each one. Sysctl
on dev.cpu.0 will affect all of the CPUs together. In the future,
independent control will be supported but this is good enough for now.
Check that the timecounter isn't TSC before switching (from Colin Percival.)
Maxim Sobolev [Sun, 13 Feb 2005 16:42:08 +0000 (16:42 +0000)]
Split out kill(2) syscall service routine into user-level and kernel part, the
former is callable from user space and the latter from the kernel one. Make
kernel version take additional argument which tells if the respective call
should check for additional restrictions for sending signals to suid/sugid
applications or not.
Make all emulation layers using non-checked version, since signal numbers in
emulation layers can have different meaning that in native mode and such
protection can cause misbehaviour.
As a result remove LIBTHR from the signals allowed to be delivered to a
suid/sugid application.
Nate Lawson [Sun, 13 Feb 2005 05:37:19 +0000 (05:37 +0000)]
Add the new CPUFREQ_FLAG_INFO_ONLY flag for drivers which can attach to
read info about the possible settings for a CPU but cannot control them
directly.
Nate Lawson [Sun, 13 Feb 2005 05:34:52 +0000 (05:34 +0000)]
Be sure to register with cpufreq(4). On systems that only supported
throttling, neglecting to do this kept the sysctls from appearing.
Attach an acpi_throttle device to each CPU that supports it.
Don't add a device if the P_BLK is invalid or if _PTC is not present.
This removes extraneous probe/attach failure messages on some machines.
Make the cpu throttle state local to the softc to account for partial
successes when changing the clock rate on MP machines.
Tim Kientzle [Sat, 12 Feb 2005 23:00:31 +0000 (23:00 +0000)]
Performance optimization, code clarification, and bug workaround.
When reading the bodies of Zip archive entries, request a minimum of 1
byte, rather than a minimum of the full entry size. This is faster
(since it does not force the decompression layer to combine reads) and
works around a bug in the "none" decompression handler (which I'm
testing a separate fix for now). I've also renamed "bytes_read" to
"bytes_avail" in several places to more accurately reflect that the
value returned from (a->compression_read_ahead) is the number of bytes
available, not necessarily the number of bytes requested.
Tim Kientzle [Sat, 12 Feb 2005 22:48:38 +0000 (22:48 +0000)]
Fill in some more Rockridge details in ISO9660 support: Ignore PD
(padding) entries, extract inode value from PX entry, recognize SP and
ST (start/end of SUSP extensions).
I don't enforce SP yet, as I've seen CDROMs which use Rockridge
extensions but don't have the SP record (which is officially
required).
The ISO9660 support is now mature enough to extract FreeBSD
distribution CDROMs created with mkisofs.
Tim Kientzle [Sat, 12 Feb 2005 22:44:50 +0000 (22:44 +0000)]
Flush input when reading from pipe to avoid "broken pipe" warnings.
For example, when using 'gunzip | tar' to decompress.
Also, fix some style issues (write null character as '\0').
Marius Strobl [Sat, 12 Feb 2005 19:13:51 +0000 (19:13 +0000)]
- Re-write OF_decode_addr() with a bus-neutral approach, adding support
for nodes hanging off of Central (untested), FireHose (untested) and
PCI (tested) busses.
- Add an additional parameter to OF_decode_addr() which specifies the
index of the register bank to decode.
These should allow to eventually add support for the Z8530 hanging off of
FireHose to uart(4) and to write support for PCI-based graphics adapters.
Marius Strobl [Sat, 12 Feb 2005 19:12:17 +0000 (19:12 +0000)]
Merge revision 1.5 from NetBSD: Fix a typo in a comment.
NetBSD rev. 1.4 (addition of the OFW_PCI_PHYS_HI_BUS macro) had already
been merged prior to adding this file to FreeBSD (with the 1.3 tag though).
Warner Losh [Sat, 12 Feb 2005 16:44:15 +0000 (16:44 +0000)]
Improve the mining of MAC address from the card:
o Add a fallback location for the MAC address. Most of the early ne2000
PC Cards were built from the same parts, so most of them have the same
address in the CIS to grab the MAC from. Use this address as our
fallback if we don't find anything better.
o Add printf, in bootverbose, noting the MAC addresses that we find along
the way.
# Better sanity checking of the MAC address is needed. Will have to
# investigate using/creating a centralized function to do this as a number
# of other PC Card drivers each have their own ad-hoc tests.
Gleb Smirnoff [Sat, 12 Feb 2005 14:54:19 +0000 (14:54 +0000)]
When netgraph(4) was converted to use mbuf_tags(9) instead of meta-data
a definite setup was broken: two ng_ksockets are connected to each other,
connect()ed to different remote hosts, and bind()ed to different local
interfaces. In this case one ng_ksocket is fooled with tag from the other
one.
Put node id into tag. In rcvdata method utilize tag only if it has our
own id inside or id equals zero. The latter case is added to support
packets send by some third, not ng_ksocket node.
David Schultz [Sat, 12 Feb 2005 13:19:11 +0000 (13:19 +0000)]
Bump __FreeBSD_version for removal of matherr() from libm. (matherr()
went out of fashion when the third edition of SVID de-supported it
nearly 20 years ago, and it has never actually worked in FreeBSD.)
Gleb Smirnoff [Sat, 12 Feb 2005 11:41:32 +0000 (11:41 +0000)]
Add two new netgraph messages NGM_ETHER_ADD_MULTI and NGM_ETHER_DEL_MULTI,
to join and leave Ethernet multicast membership, respectively. Messages
take MAC address as argument.
Add much needed descriptions for a number of the IPC related sysctl OIDs.
This information will be very useful for people who are tuning applications
which have a dependence on IPC mechanisms.
Warner Losh [Sat, 12 Feb 2005 00:45:22 +0000 (00:45 +0000)]
Really old PCMCIA cards stored the MAC address in the attribute memory
at some offset. Unlike newer cards, the MAC address wasn't part of
the CIS as a specific FUNCE. These older cards were having their MAC
address show up as 0:2:4:6:8:a because that's what's in the ROM
locations that would be there in a real ne2000.
This patch allows one to specify the offset for the MAC address for
these cards. Specify one for the IBM Ethernet II card, as it is one
that has this problem. One shouldn't specify this unless the MAC
address really isn't in the CIS at all.
Side note: The novell probe likely shouldn't read the MAC address, and
that should be moved to the bus specific attach routine(s), maybe as a
convenience function in if_ed_novell.c.
My IBM Ethernet II (aka Info Mover) now has a believable MAC address.
Gleb Smirnoff [Fri, 11 Feb 2005 20:53:41 +0000 (20:53 +0000)]
Packets from ipfw come with IP header in host byte order. Netgraph works
with net byte order. Change byte order to net in ng_ipfw_input(), change
byte order to host before ip_output(), do not change before ip_input().
Hartmut Brandt [Fri, 11 Feb 2005 17:03:18 +0000 (17:03 +0000)]
Stylistic fixes: push variable into a local context (this part is going
to be split out into a function soon). Also there is no need to write
back the colon that we have NUL-ed - the string is going to be freed
anyway.