Commit Graph

118104 Commits

Author SHA1 Message Date
Warner Losh
3ba88ec464 o Expose ed_probe_Novel_generic, it is useful for pccard case.
o Fix a now stale comment.  There are likely many others like them, but this
  one definitely hasn't been true since DELAY was introduced into the tree.
2005-09-07 03:20:33 +00:00
Alan Cox
57b5187b16 Eliminate an incorrect cast. 2005-09-07 01:42:30 +00:00
Warner Losh
56013d44db Fix DL100xx based cards. Don't drop resources. It was approrpiate in
the probe code that this used to be part of, but as part of the
attach, we shouldn't be dropping the resources here.

Also, allocate the proper rid in the ax88x90 setup.
2005-09-07 00:00:16 +00:00
Warner Losh
6942fac077 move away from K&R function definitions 2005-09-06 23:15:21 +00:00
Warner Losh
79e277f155 Work around a bug I've seen on Linksys EC2T cards. For some reason,
as yet unknown, those cards report their MAC address a byte at a time.
However, other AX88x90 cards report the MAC address a word at a time.
Add a heuristic which looks at the high order bytes of the first 6
words.  If they are all '0', assume the card is behaving like the
Linksys EC2T card.  Since the default prefix for these cards appears
to be 00:e0:98, this appears to be a safe heuristic.  While some cards
have been observed with different prefixes, they all work with this
heuristic.

I'm unsure if this is a bug in the EC2T card, or if it is a bug in the
initialization of the card.  No other OS has this heuristic (although
w/o it, the MAC address that is used works).
2005-09-06 22:55:32 +00:00
Warner Losh
e10a8107c6 Go ahead and | in ED_CR_PAGE_0, even though this doesn't change things
at all.  It makes the code clearer.

fix a comment comments about why we need to write i/o address to certain
registers.
2005-09-06 22:46:41 +00:00
Warner Losh
15a38fff14 It turns out that many of the ambicom cards have their CIS resources
listed in different orders.  Since it is easy to identify the Modem
resources vs the Ethernet resources by looking at the size, use that
rather than hard coded rids.  For such parts, go ahead and guess which
rid we should use based on the size.  This guess appears reliable for
the two example cards that I have with different CIS info.
2005-09-06 22:44:26 +00:00
Andrew Thompson
4f3cfcc12b Clarify that any firewall that has pfil(9) hooks can be used.
Suggested by:	sam
Approved by:	mlaier (mentor)
MFC after:	3 days
2005-09-06 22:38:40 +00:00
Andrew Thompson
59280079d3 Add support for multicast to the bridge and allow inet6 addresses to be
assigned to the interface.

IPv6 auto-configuration is disabled. An IPv6 link-local address has a
link-local scope within one link, the spec is unclear for the bridge case and
it may cause scope violation.

An address can be assigned in the usual way;
  ifconfig bridge0 inet6 xxxx:...

Tested by:	bmah
Reviewed by:	ume (netinet6)
Approved by:	mlaier (mentor)
MFC after:	1 week
2005-09-06 21:11:59 +00:00
Craig Rodrigues
4506b763e0 In sc_set_text_mode(), reset fontwidth if it is <= 0.
Eliminates division by zero errors in syscons driver.

Reported by:	keramida, Slawa Olhovchenkov <slw at zxy dot spb dot ru>,
		Kyryll Mirnenko <mirya at matrix dot kiev dot ua>
Tested by:	keramida, rodrigc
2005-09-06 20:38:39 +00:00
Gleb Smirnoff
ba5b359aef Fix build. 2005-09-06 20:36:38 +00:00
Ralf S. Engelschall
f93a0797e0 fix typos: decribed -> described, preceeded -> preceded 2005-09-06 20:14:39 +00:00
Ralf S. Engelschall
f7d95a075c Various small code cleanups resulting from a code reviewing
and linting procedure:

1. Remove useless sub-expression:

   - if (*start || (!ifsspc && start > string && (nulonly || 1))) {
   + if (*start || (!ifsspc && start > string)) {

   The sub-expression "(nulonly || 1)" always evaluates to true and
   according to CVS logs seems to be just a left-over from some
   debugging and introduced by accident. Removing the sub-expression
   doesn't change semantics and a code inspection showed that the
   variable "nulonly" is also not necessary here in any way (and the
   expression would require fixing instead of removing).

2. Remove dead code:

   -                if (backslash && c == '\\') {
   -                        if (read(STDIN_FILENO, &c, 1) != 1) {
   -                                status = 1;
   -                                break;
   -                        }
   -                        STPUTC(c, p);
   -                } else if (ap[1] != NULL && strchr(ifs, c) != NULL) {
   +                if (ap[1] != NULL && strchr(ifs, c) != NULL) {

   Inspection of the control and data flow showed that variable
   "backslash" is always false (0) when the "if"-expression is
   evaluated, hence the whole block is effectively dead code.
   Additionally, the skipping of characters after a backslash is already
   performed correctly a few lines above, so this code is also not
   needed at all. According to the CVS logs and the ASH 0.2 sources,
   this code existed in this way already since its early days.

3. Cleanup Style:

   - ! trap[signo][0] == '\0' &&
   + ! (trap[signo][0] == '\0') &&

   The expression wants to ensure the trap is not assigned the empty
   string. But the "!" operator has higher precedence than "==", so the
   comparison should be put into parenthesis to form the intended way of
   expression. Nevertheless the code was effectively not really broken
   as both particular NUL comparisons are semantically equal, of course.
   But the parenthesized version is a lot more intuitive.

4. Remove shadowing variable declaration:

   - char *q;

   The declaration of symbol "q" hides another identical declaration of
   "q" in the same context. As the other "q" is already reused multiple
   times and also can be reused again without negative side-effects,
   just remove the shadowing declaration.

5. Just small cosmetics:

   - if (ifsset() != 0)
   + if (ifsset())

   The ifsset() macro is already coded by returning the boolean result
   of a comparison operator, so no need to compare this boolean result
   again against a numerical value. This also aligns the macros usage to
   the remaining existing code.

Reviewed by: stefanf@
2005-09-06 19:30:00 +00:00
Colin Percival
ff69e5b71e Teach portsnap how to ignore unwanted parts of the ports tree. A line
of the form "REFUSE foo" in portsnap.conf will result in parts of the
tree matching "^foo" being (a) not extracted by "portsnap extract", (b)
not updated by "portsnap update", and (c) not having any patches or new
ports downloaded by "portsnap fetch" or "portsnap cron". The example
shown in portsnap.conf demonstrates ignoring all the language categories.

As mentioned in portsnap.conf.5, the use of an imcomplete ports tree is
not officially supported; but this is something which many users have
requested, so I'm adding it anyway.

PR:		bin/85619 (but not the patch provided therein)
MFC after:	1 month
2005-09-06 19:28:37 +00:00
Søren Schmidt
fba8a154bd Fix problem with finding the still working disk in a broken mirror on VIA. 2005-09-06 19:17:48 +00:00
Gleb Smirnoff
e71fefbe21 When we read data from socket buffer using soreceive() the socket layer
does not clear m_nextpkt for us. The mbufs are sent into netgraph and
then, if they contain a TCP packet delivered locally, they will enter
socket code again. They can pass the first assert in sbappendstream()
because m_nextpkt may be set not in the first mbuf, but deeper in the
chain. So the problem will trigger much later, when local program
reads the data from socket, and an mbuf with m_nextpkt becomes a
first one.

This bug was demasked by revision 1.54, when I made upcall queueable.
Before revision 1.54 there was a very small probability to have 2
mbufs in GRE socket buffer, because ng_ksocket_incoming2() dequeued
the first one immediately.

 - in ng_ksocket_incoming2() clear m_nextpkt on all mbufs
   read from socket.
 - restore rev. 1.54 change in ng_ksocket_incoming().

PR:			kern/84952
PR:			kern/82413
In collaboration with:	rwatson
2005-09-06 17:15:42 +00:00
Gleb Smirnoff
016e62123a In soreceive(), when a first mbuf is removed from socket buffer use
sockbuf_pushsync(). Previous manipulation could lead to an inconsistent
mbuf.

Reviewed by:	rwatson
2005-09-06 17:05:11 +00:00
Gleb Smirnoff
b32cfb3228 In INVARIANTS case also check that nodes do not pass queues of mbufs
each other.
2005-09-06 17:02:13 +00:00
Gleb Smirnoff
c6118fcc1c Raise one more bit in READER_MASK. I believe that before this change
it was possible to have 1 reader and 1 writer thread working on
a node simultaneously.

Reviewed by:	julian
2005-09-06 16:58:25 +00:00
Ralf S. Engelschall
7b14d37fb1 fix typo: ommitted -> omitted 2005-09-06 16:08:37 +00:00
Wilko Bulte
e37345c1c6 Notable quote by Theodore Roosevelt.
MFC after: 3 days
2005-09-06 14:59:55 +00:00
Gleb Smirnoff
f46ab10c02 Document flags of a pollrec. 2005-09-06 11:09:18 +00:00
David E. O'Brien
3da722dad7 Remove WANT_FORCE_OPTIMIZATION_DOWNGRADE and out dated warnings about
libalias(3) exposing compiler bugs.
2005-09-06 09:01:18 +00:00
Sam Leffler
aa2fce50a2 updates:
o note all pci/cardbus parts are supported (modulo hal updates)
o use ath_rate_sample instead of ath_rate_onoe
o note SuperG support is missing
o note WPA not supported on 5210
o remove stuff about needing a better tx rate control algorithm

MFC after:	3 days
2005-09-06 03:59:22 +00:00
Christian S.J. Peron
d1dfd92177 Convert the primary ACL allocator from malloc(9) to using a UMA zone instead.
Also introduce an aclinit function which will be used to create the UMA zone
for use by file systems at system start up.

MFC after:	1 month
Discussed with:	rwatson
2005-09-06 00:06:30 +00:00
Christian S.J. Peron
fa973e67a4 Now that the PID is constantly refreshed, introduce a pidname function which
when given a PID consults the kern.proc.pid sysctl variable to pull out the
pcomm data.
2005-09-05 23:13:05 +00:00
Christian S.J. Peron
b75a24a075 Instead of caching the PID which opened the bpf descriptor, continuously
refresh the PID which has the descriptor open. The PID is refreshed in various
operations like ioctl(2), kevent(2) or poll(2). This produces more accurate
information about current bpf consumers. While we are here remove the bd_pcomm
member of the bpf stats structure because now that we have an accurate PID we
can lookup the via the kern.proc.pid sysctl variable. This is the trick that
NetBSD decided to use to deal with this issue.

Special care needs to be taken when MFC'ing this change, as we have made a
change to the bpf stats structure. What will end up happening is we will leave
the pcomm structure but just mark it as being un-used. This way we keep the ABI
in tact.

MFC after:	1 month
Discussed with:	Rui Paulo < rpaulo at NetBSD dot org >
2005-09-05 23:08:04 +00:00
Tor Egge
d536ff2edb Retain generation count when writing zeroes instead of an inode to disk.
Don't free a struct inodedep if another process is allocating saved inode
memory for the same struct inodedep in initiate_write_inodeblock_ufs[12]().

Handle disappearing dependencies in softdep_disk_io_initiation().

Reviewed by:	mckusick
2005-09-05 22:14:33 +00:00
Marcel Moolenaar
cca2e0f1cc Milestone: enable SMP by default. 2005-09-05 21:36:28 +00:00
Marcel Moolenaar
ab870058d7 o In pmap_remove_pte: always invalidate the page. Previously the page
was not invalidated if the PTE was not actually being removed.  In
   an UP kernel this didn't cause problems, because the new mapping
   would preempt the old one. In an SMP kernel this could lead to the
   use of stale translations when processes move between CPUs at the
   "right" moment.  This fixes the last of the obvious SMP problems
   and it should be safe to enable SMP by default now.
o  In pmap_remove_pte: minor code refactoring to avoid duplication.
o  Test all PTE pointers against NULL. Don't use implicit boolean
   tests.
2005-09-05 21:32:02 +00:00
Joseph Koshy
4525db8c52 Improve an error message.
MFC after:	3 days
2005-09-05 18:31:09 +00:00
Stefan Farfeleder
9957cb23dd Print pointers with %p rather than casting them to long. 2005-09-05 17:57:19 +00:00
Christian Brueffer
093f85195e Reword nic driver MPSAFEness entries to be in line with earlier release notes. 2005-09-05 17:16:50 +00:00
Joel Dahl
56b1eaf645 Remove reference to el(4).
Approved by:	brueffer (mentor)
2005-09-05 17:09:59 +00:00
R. Imura
884a8db7a8 Fix panic when loading libiconv.ko on sparc64.
It seems that this issue only become obvious when compiled with -O2
on sparc64.

Since each struct iconv_converter_class has been initialized by
DEFINE_CLASS macro, not all members of struct iconv_converter_class
has been allocated on memory and cc_link member has not been
initialized, while iconv_register_converter() wanted to access it
with TAILQ.
Now we modify KICONV_CONVERTER macro and fix this bug.

Problem reported on:	freebsd-sparc64
Pointed out by:		yongari
Discussed with:		yongari
Tested by:		yongari
MFC after:		3 days
2005-09-05 17:03:40 +00:00
Gleb Smirnoff
16901c0186 Remove Giant mutex from polling(4) and use a separate poll_mtx(4)
instead. Detailed changelist:

o Add flags field to struct pollrec, to indicate that
  are particular entry is being worked on.
o Define a macro PR_VALID() to check that a pollrec
  is valid and pollable.
o Mark ISRs as mpsafe.

o ether_poll()
  - Acquire poll_mtx while traversing pollrec array.
  - Skip pollrecs, that are being worked on.
  - Conditionally acquire Giant when entering handler.

o netisr_pollmore()
  - Conditionally assert Giant.
  - Acquire poll_mtx while working with statistics.

o netisr_poll()
  - Conditionally assert Giant.
  - Acquire poll_mtx while working with statistics
    and traversing pollrec array.

o ether_poll_register(), ether_poll_deregister()
  - Conditionally assert Giant.
  - Acquire poll_mtx while working with pollrec array.

o poll_idle()
  - Remove all strange manipulations with Giant.

In collaboration with:	ru, pjd
In collaboration with:	Oleg Bulyzhin <oleg rinet.ru>
In collaboration with:	dima <_pppp mail.ru>
2005-09-05 16:02:11 +00:00
Doug Barton
9e8bc8bf11 In accordance with my intentions announced (and not objected to)
on -arch, and RFC 4159 (http://www.rfc-editor.org/rfc/rfc4159.txt)
which officially deprecates all usage of IP6.INT, remove the
reference to that zone from the example named.conf file.
2005-09-05 13:42:22 +00:00
Robert Watson
e9cc9cec0c Add a regression test to test two variations on the same bug: joining a
multicast group using a raw socket, then removing the interface on which
the group is found, and joining a multicast group using a udp socket,
then removing the interface on which the group is found.  An if_disc
interface is used as the interface on which to attach.

NB: A panic currently results from running this regression test, so do
so with caution.

PR:		77665
Reported by:	Gavin Atkinson <gavin dot atkinson at ury dot york dot ac dot uk>
Reported by:	Brooks Davis <brooks at FreeBSD dot org>
2005-09-05 13:23:01 +00:00
Tim Kientzle
731f6a1690 Terminate metadata restore early only on failure, not success.
In particular, this bug was preventing the restore of fflags.
2005-09-05 10:23:55 +00:00
Tim J. Robbins
d667076bb2 Remove all references to nonexistent FreeBSD Security Architecture
document.
2005-09-05 10:03:07 +00:00
Tim J. Robbins
6595b51a7f Remove references to nonexistent "FreeBSD Security Architecture" document. 2005-09-05 09:49:33 +00:00
Stefan Farfeleder
e594c724ee - Add tests for hash and return and more tests for set -e.
- Simplify regress.sh, sort tests.
2005-09-05 09:42:10 +00:00
Christian S.J. Peron
9b4261c9b4 Attempt to complete the userspace integration of POSIX.1e extended ACLs.
This includes adding support for ACLs into cp(1) and mv(1) userspace
utilities.

For mv(1), if _PC_ACL_EXTENDED is in effect for the source AND destination
operands, the destination file's ACLs shall reflect the source.

For cp(1), if _PC_ACL_EXTENDED is in effect for both source and destination
operands, and -p has been specified, the ACLs from the source shall be
preserved on the destination.

MFC after:	1 month
2005-09-05 04:36:08 +00:00
Giorgos Keramidas
5340ff6caa Remove duplicate "at" from comment. 2005-09-04 21:57:23 +00:00
Stefan Farfeleder
7784798d1b Simplify and add PR 77067 which addresses the same bug. 2005-09-04 21:29:09 +00:00
Poul-Henning Kamp
e4da09c03f Remove a race condition that could result in processes being stuck
waiting for geom events to happen:

Instead of maintaining a count of outstanding events, simply look if
the queue is empty.  Make sure to not remove events from the queue
until they are executed in order to not open a new race.

Much work by:	pjd
Tested by:	kris
MT6:		yes, should be.
2005-09-04 19:14:19 +00:00
Alan Cox
3be99ffc1a Eliminate unnecessary TLB invalidations by pmap_enter(). Specifically,
eliminate TLB invalidations when permissions are relaxed, such as when a
read-only mapping is changed to a read/write mapping.  Additionally,
eliminate TLB invalidations when bits that are ignored by the hardware,
such as PG_W ("wired mapping"), are changed.

Reviewed by:	tegge
2005-09-04 19:06:27 +00:00
Stefan Farfeleder
e4562fb6e8 Fix syntax error that crept in somehow. 2005-09-04 18:12:21 +00:00
Xin LI
5248ef8a3c When padding with zero, do pad after prefixes rather than padding
before prefixes.

Use cases:
	printf("%05d", -42);   -->   "00-42"   (should be "-0042")
	printf("%#05x", 12);   -->   "000xc"   (should be "0x00c")

Submitted by:	Oliver Fromme
PR:		kern/85520
MFC After:	1 week
2005-09-04 18:03:45 +00:00
Sam Leffler
245c31ccaf clear lock on error in O_LIMIT case of install_state
Submitted by:	Ted Unangst
MFC after:	3 days
2005-09-04 17:33:40 +00:00