Don't unbusy the devfs mount in vfs_mountroot_try() as it gets accessed
and unbusied in devfs_fixup(), which assumes that the devfs mount is
still locked.
At some point in the past, we read the PROM by words. Now we read
PROM by bytes. Adjust the extraction of the MAC address from this data
to reflect this change.
This gets the AX88x90 based PC Cards MAC address working again (my
UMAX Ethernet and Linksys EC2T cards now work).
Only write the dispatch table function prototypes to the header if the -h
flag was specified. If all files are generated at once, those functions are
static and shouldn't appear in the header.
Improve POSIX conformance:
- Don't pollute the namespace by including <sys/types.h>, <sys/time.h>,
<sys/signal.h> and <limits.h>. Use __MINSIGSTKSZ and __ULONG_MAX from
<machine/_limits.h>, __sigset_t from <sys/_sigset.h> instead.
- Include <time.h> because POSIX says we have to.
PTHREAD_{DESTRUCTOR_ITERATIONS,KEYS_MAX,STACK_MIN,THREADS_MAX} should
eventually move to <limits.h> but are left here for now.
Add support for setting GPT partition labels. The partitions to be
labeled are selected in the same way as with the remove command.
Update the manpage to have the selection options described for the
label command and referenced to it from the remove command.
The label can be specified on the command line with the -l option
or read from a file with the -f option. In both cases, the label
is assumed to be encoded in UTF-8.
Add a comment before the statement that is responsible for the
removal of the GPT entry. There's a bit of code around that one
statement that it's good to have it stand out a bit more.
emax [Wed, 31 Aug 2005 18:13:23 +0000 (18:13 +0000)]
Fix dangling callout problem in the Bluetooth L2CAP code that leads to
panic. The panic happens when outgoing L2CAP connection descriptor is
deleted with the L2CAP command(s) pending in the queue. In this case when
the last L2CAP command is deleted (due to cleanup) and reference counter
for the L2CAP connection goes down to zero the auto disconnect timeout
is incorrectly set. pjd gets credit for tracking this down and committing
bandaid.
Reported by: Jonatan B <onatan at gmail dot com>
MFC after: 3 days
jhb [Wed, 31 Aug 2005 18:09:54 +0000 (18:09 +0000)]
- Only call txp_release_resources() once if attach fails.
- Set errno to ENXIO instead of 0 in several attach failure cases.
- Setup the interrupt handler at the very end of txp_attach() after
ether_ifattach().
- Various whitespace fixes in function prototypes.
keramida [Wed, 31 Aug 2005 15:02:11 +0000 (15:02 +0000)]
Add a short description of how a literal colon ':' can be inlined in the
value of capability databases, since it's not really obvious how a colon
can be escaped, and a pointer to the getcap(3) manpage for more details.
yar [Wed, 31 Aug 2005 11:36:50 +0000 (11:36 +0000)]
Use VLAN_TAG_VALUE() not only to read a dot1q tag
value from an m_tag, but also to set it. This reduces
complex code duplication and improves its readability.
Alas, we shouldn't rename the macro to VLAN_TAG_LVALUE()
globally because that would cause pain for kernel module
port maintainers and vendors using FreeBSD as their codebase.
Added a clarifying comment instead.
Discussed with: ru, glebius
X-MFC-After: 6.0-RELEASE (MFC is good just to reduce the diff)
jmallett [Wed, 31 Aug 2005 08:36:05 +0000 (08:36 +0000)]
Remove getino(3) manpage. It doesn't document what is here, what is here should
not get documented, and what it does document isn't going to come to CVS any
time in the immediate future.
marcel [Wed, 31 Aug 2005 05:40:41 +0000 (05:40 +0000)]
o Replace unicode16() by utf8_to_utf16().
o Introduce utf16_to_utf8().
o Add option -l to the show command to display the GPT label instead
of the friendly partition type.
o Add option -u to the show command to suppress the friendly output
and print th raw UUIDs instead.
brueffer [Tue, 30 Aug 2005 22:25:22 +0000 (22:25 +0000)]
Document the following:
- VIA PadLock support + merge
- dc, my, pcn, sf MPSAFE + merge
- de, ed, ste MPSAFE
- de converted to busdma(9)
- el removed
- geli(8) committed + merge
- libmemstat(9) merge
andre [Tue, 30 Aug 2005 21:31:42 +0000 (21:31 +0000)]
Changes and cleanups to m_sanity():
o for() instead of while() looping over mbuf chain
o paren's around all flag checks
o more verbose function and purpose description
o some more style changes
jhb [Tue, 30 Aug 2005 20:35:08 +0000 (20:35 +0000)]
Various locking fixes and mark MPSAFE:
- Add locked variants of start(), init(), ifmedia_upd(), and poll() and stop
recursing on the driver lock.
- Add locking to ifmedia_upd() and ifmedia_sts().
- Use callout_*() instead of timeout/untimeout.
- Fix locking in ioctl().
Tested by: Bob Bishop rb at gid dot co dot uk
MFC after: 3 days
andre [Tue, 30 Aug 2005 20:07:49 +0000 (20:07 +0000)]
o Remove the 'all' flag from m_demote(). Users can simply call it with
m_demote(m->m_next) if they wish to start at the second mbuf in chain.
o Test m_type with == instead of &.
o Check m_nextpkt against NULL instead of implicit 0.
rodrigc [Tue, 30 Aug 2005 18:58:17 +0000 (18:58 +0000)]
Prevent division by zero errors in sc_mouse_move()
by explicitly setting sc->font_width, in the same
places where sc->font_size is set, instead of
relying on the default initialized value of 0 for sc->font_width.
PR: kern/84836
Reported by: Andrey V. Elsukov <bu7cher at yandex dot ru>
MFC after: 2 days
brooks [Tue, 30 Aug 2005 18:20:46 +0000 (18:20 +0000)]
Introduce a new helper function check_search() derived for res_hnok to
check the domain-name parameter according to the rules for "search"
strings as documented in resolv.conf(5). Specifically, the string must
be no more than 256 bytes long and contain no more than six valid domain
names separated by white space.
The previous unchecked values could result in a mangled resolv.conf
file which could effectively deny access to local sites. This is not
a security issue as rogue dhcp servers could already do this without
sending invalid strings.
csjp [Tue, 30 Aug 2005 16:45:32 +0000 (16:45 +0000)]
When using files as backing stores for devices, and the user has requested the
device be created read+write, check to see if the backing store is read only
through the use of the access(2) system call. If this check fails returning
EACCES, EPERM or EROFS then gracefully downgrade the access to read only. Also
print a warning message to stderr, informing the user that the access mode
they requested is not available.
This behavior used to be handled by md(4) but was changed in revision 1.154
avatar [Tue, 30 Aug 2005 14:27:47 +0000 (14:27 +0000)]
Properly set ic_curchan before calling back to device driver to do channel
switching(ifconfig devX channel Y). This fix should make channel changing
works again in monitor mode.
Submitted by: sam
X-MFC-With: other ic_curchan changes
glebius [Tue, 30 Aug 2005 09:51:54 +0000 (09:51 +0000)]
Lock down PPTP node, since it has many data structures, that won't survive
parallel ng_pptp_rcvdata():
- Add a per-node mutex.
- Acquire mutex during all ng_pptp_rcvdata() method.
- Make callouts protected by mutex. Now callouts count as
netgraph writers, but there are plans to allow reader callouts
for nodes, that have internal locking.
- Acquire mutex in ng_pptp_reset(), which can be triggered
by a message or node shutdown.
marcel [Tue, 30 Aug 2005 06:16:31 +0000 (06:16 +0000)]
Don't print the total number of partitions removed now that we print
the name of the partitions that we remove. A summary is unnecessary
and even makes parsing of the output more difficult.
njl [Tue, 30 Aug 2005 04:45:32 +0000 (04:45 +0000)]
Eliminate cpufreq levels for two cases that are less than optimal:
1. Walk the absolute list in reverse to prefer duplicated levels that have
a lower absolute setting, i.e. 800 Mhz/50% is better than 1600 Mhz/25% even
though both have the same actual frequency. This also removes the need to
check for already-modified levels since by definition, those will be added
later in the sorted list.
2. Compare the absolute settings for derived levels and don't use the new
level if it's higher. For example, a level of 800 Mhz/75% is preferable to
1600 Mhz/25% even though the latter has a lower total frequency.
This work is based on a patch from the submitter but reworked by myself.
andre [Mon, 29 Aug 2005 20:15:33 +0000 (20:15 +0000)]
Add m_copymdata(struct mbuf *m, struct mbuf *n, int off, int len,
int prep, int how).
Copies the data portion of mbuf (chain) n starting from offset off
for length len to mbuf (chain) m. Depending on prep the copied
data will be appended or prepended. The function ensures that the
mbuf (chain) m will be fully writeable by making real (not refcnt)
copies of mbuf clusters. For the prepending the function returns
a pointer to the new start of mbuf chain m and leaves as much
leading space as possible in the new first mbuf.
andre [Mon, 29 Aug 2005 19:58:56 +0000 (19:58 +0000)]
Add m_sanity(struct mbuf *m, int sanitize) to do some heavy sanity
checking on mbuf's and mbuf chains. Set sanitize to 1 to garble
illegal things and have them blow up later when used/accessed.
m_sanity()'s main purpose is for KASSERT()'s and debugging of non-
kosher mbuf manipulation (of which we have a number of).
andre [Mon, 29 Aug 2005 19:45:39 +0000 (19:45 +0000)]
Add m_demote(struct mbuf *m, int all) to clean up mbuf (chain) from
any tags and packet headers. If "all" is set then the first mbuf
in the chain will be cleaned too.
This function is used before an mbuf, that arrived as packet with
m->flags & M_PKTHDR, is appended to an mbuf chain using m->m_next
(not m->m_nextpkt).
imp [Mon, 29 Aug 2005 15:46:41 +0000 (15:46 +0000)]
Eliminate bogus seatbelt in wi_cmd. This may have been appropriate
for the spl-era locking, but now that we can have multiple, concurrent
interrupts for multiple wi devices, having a global check to make sure
at most one of them was in wi_cmd no longer makes sense.
pjd [Mon, 29 Aug 2005 11:34:08 +0000 (11:34 +0000)]
Add 'depth' argument to CTRSTACK() macro, which allows to reduce number
of ktr slots used. If 'depth' is equal to 0, the whole stack will be
logged, just like before.
glebius [Mon, 29 Aug 2005 10:23:46 +0000 (10:23 +0000)]
- Document the fact that the real length of listen queue is 1.5 more
than the value of backlog argument.
- Document the fact that a subsequent listen(2) calls on the listening
socket change the backlog argument.
- Note that current listen queue lengths can be queried using netstat(1).
Submitted by: Igor Sysoev <is rambler-co.ru>
Wording by: gnn
imp [Sun, 28 Aug 2005 23:56:25 +0000 (23:56 +0000)]
Finish conversion to bus space and make ed MP safe.
o Lock ed
o Fix extra newline in probe messages
o Eliminate gone.
o Make detach less-racy.
o Eliminate spl*
o Switch from timeout/untimeout to callout interface.
o Read/write card memory using bus_space calls.
o generalize readmem so that we don't need ifs in the code.
o Fix memory stuff to be consistant.
o Remove OLDCARD compat stuff.
o Mark interrupt as MPSAFE.
# sic, hpp not tested at all
# ISA and PCI attachments lightly tested