Commit Graph

67585 Commits

Author SHA1 Message Date
Randall Stewart
97a7b90ff3 More prep for Vimage:
- only one functino to destroy an SCTP stack sctp_finish()
 - Make it so this function also arranges for any threads
   created by the image to do a kthread_exit()
2008-06-15 12:31:23 +00:00
Robert Watson
a0faacaa38 When NETATALK is compiled into the kernel, at_rmx.c is required regardless
of whether NETATALKDEBUG is enabled, so make building it conditional on
NETATALK instead.  This problem appears to have been present from the time
that the netatalk implementation was imported.

PR:		124456
Submitted by:	Nathan Whitehorn <whitehorn at wisc dot edu>
MFC after:	3 days
2008-06-14 15:17:02 +00:00
Randall Stewart
9b02321796 - Fixes foobar on my part. Some missing virtualization macros from
specific logging cases.
2008-06-14 13:24:49 +00:00
Wojciech A. Koszek
53a609f064 Remove obselete PECOFF image activator support.
PRs assigned at the time of removal:    kern/80742

Discussed on:   freebsd-current (silence), IRC
Tested by:      make universe
Approved by:    cognet (mentor)
2008-06-14 12:51:44 +00:00
Ed Schouten
45792eb9b8 Turn sgtty into a binary-only compatibility interface.
sgtty was the original interface to configure terminal attributes on my
UNIX-like operating systems. It has been deprecated by the POSIX termios
interface, which is implemented in almost any modern system.

An advantage of turning this into a binary compatibility interface, is
that we can now eventually remove the COMPAT_43TTY switch from kernel
configurations. This removes many ioctl()'s from the TTY layer.

While there, increase the __FreeBSD_version, which may be useful for the
people working on the Ports tree.

Reviewed by:	kib
Approved by:	philip (mentor)
2008-06-14 10:42:18 +00:00
Randall Stewart
b3f1ea41fd - Macro-izes the packed declaration in all headers.
- Vimage prep - these are major restructures to move
  all global variables to be accessed via a macro or two.
  The variables all go into a single structure.
- Asconf address addition tweaks (add_or_del Interfaces)
- Fix rwnd calcualtion to be more conservative.
- Support SACK_IMMEDIATE flag to skip delayed sack
  by demand of peer.
- Comment updates in the sack mapping calculations
- Invarients panic added.
- Pre-support for UDP tunneling (we can do this on
  MAC but will need added support from UDP to
  get a "pipe" of UDP packets in.
- clear trace buffer sysctl added when local tracing on.

Note the majority of this huge patch is all the vimage prep stuff :-)
2008-06-14 07:58:05 +00:00
Robert Watson
37f44cb428 The TrustedBSD MAC Framework named struct ipq instances 'ipq', which is the
same as the global variable defined in ip_input.c.  Instead, adopt the name
'q' as found in about 1/2 of uses in ip_input.c, preventing a collision on
the name.  This is non-harmful, but means that search and replace on the
global works less well (as in the virtualization work), as well as indexing
tools.

MFC after:	1 week
Reported by:	julian
2008-06-13 22:14:15 +00:00
Alan Cox
f9a4e9e4a9 Tweak the promotion test in pmap_promote_pde(). Specifically, test PG_A
before PG_M.  This sometimes prevents unnecessary removal of write access
from a PTE.  Overall, the net result is fewer demotions and promotion
failures.
2008-06-13 19:33:56 +00:00
John Baldwin
ef58e744a3 Make ex(4) MPSAFE:
- Add a mutex to the softc to protect the softc and device hardware.
- Use a private watchdog timer.
- Setup interrupt handler after ether_ifattach().
- Use bus_foo() rather than bus_space_foo() and remove bus space tag and
  handle from softc.

Tested by:	imp
2008-06-13 12:14:22 +00:00
Kevin Lo
34b07c0273 Add the D-Link DWA-111 2008-06-13 02:02:21 +00:00
David Christensen
d75672d1c4 - Added support for BCM5709 and BCM5716.
MFC after:	2 weeks
2008-06-13 01:20:29 +00:00
David Christensen
7752e34d05 - Added support for BCM5709 and BCM5716 controllers.
MFC after:	2 weeks
2008-06-13 01:16:37 +00:00
Benno Rice
6e48215925 Use callout_init_mtx to simplify locking somewhat. While we're here, rearrange
some operations in smc_detach to remove the need for the smc_shutdown variable.

Suggested by:	jhb
2008-06-13 00:48:09 +00:00
Stephan Uphoff
11be8415c9 Fix vm object creation locking to allow SHARED vnode locking for vnode_create_vobject.
(Not currently used)

Noticed by: kib@
2008-06-12 20:46:47 +00:00
Marcel Moolenaar
d3532631de Finish the support for partition labels and add it to the XML. 2008-06-12 19:34:07 +00:00
Ed Schouten
3f7eea97fd Remove the $FreeBSD$ tag again, now I know fbsd:nokeywords exists.
Requested by:	pjd
Approved by:	philip (mentor)
2008-06-12 08:53:54 +00:00
Ed Schouten
0f03ce1bb8 Turn dev2unit(), minor(), unit2minor() and minor2unit() into macro's.
Now that we got rid of the minor-to-unit conversion and the constraints
on device minor numbers, we can convert the functions that operate on
minor and unit numbers to simple macro's. The unit2minor() and
minor2unit() macro's are now no-ops.

The ZFS code als defined a macro named `minor'. Change the ZFS code to
use umajor() and uminor() here, as it is the correct approach to do
this. Also add $FreeBSD$ to keep SVN happy.

Approved by:	philip (mentor), pjd
2008-06-12 08:30:54 +00:00
Marcel Moolenaar
9a764aac3f Add the raw partition type to the XML. 2008-06-12 06:34:14 +00:00
Marcel Moolenaar
eab484f822 Add the raw partition type to the XML. 2008-06-12 06:26:36 +00:00
Marcel Moolenaar
a3354bb4a7 Add the raw partition type to the XML. 2008-06-12 05:56:03 +00:00
Marcel Moolenaar
0c132595dd Add the raw partiton type to the XML. 2008-06-12 05:28:47 +00:00
Marcel Moolenaar
40b075d366 Add the raw partition type to the XML. 2008-06-12 05:27:23 +00:00
Alan Cox
9d1b7fa31f Reverse the direction of pmap_promote_pde()'s traversal over the specified
page table page.  The direction of the traversal can matter if
pmap_promote_pde() has to remove write access (PG_RW) from a PTE that hasn't
been modified (PG_M).  In general, if there are two or more such PTEs to
choose among, it is better to write protect the one nearer the high end of
the page table page rather than the low end.  This is because most programs
access memory in an ascending direction.  The net result of this change is a
sometimes significant reduction in the number of failed promotion attempts
and the number of pages that are write protected by pmap_promote_pde().
2008-06-12 05:18:09 +00:00
Marcel Moolenaar
ab1e8f04c8 Add the partition label and the raw partition type to the XML. 2008-06-12 04:43:34 +00:00
Marcel Moolenaar
26371d590e Define APM_ENT_NAMELEN and APM_ENT_TYPELEN for general use. 2008-06-12 04:37:37 +00:00
Kevin Lo
bda386db88 Return an error code rather than ENXIO when both rman_init() and
rman_manage_region() failed.

Reviewed by:	marcel
2008-06-12 02:28:58 +00:00
Kevin Lo
57deb21ad4 Fix a typo: i80321_pci_probe -> i81342_pci_probe 2008-06-12 01:46:06 +00:00
Benno Rice
764e058a5b Make sure we drain our taskqueues and stop our callouts in detach. 2008-06-12 00:38:54 +00:00
Jack F Vogel
45cfd29bb8 Change include to reflect tcp_lro.h move. 2008-06-11 22:29:47 +00:00
Jack F Vogel
1af020f6ec Remove the tcp_lro.[ch] files as they are now in netinet. 2008-06-11 22:26:27 +00:00
Jack F Vogel
796c8b3758 Remove compile of tcp_lro since its now in netinet 2008-06-11 22:18:50 +00:00
Jack F Vogel
6c5087a818 Add generic TCP LOR into netinet 2008-06-11 22:12:50 +00:00
Jack F Vogel
667641261e Add LRO into kernel build 2008-06-11 22:10:10 +00:00
Jack F Vogel
a6baad0eaa Duh, wrong directory, needed to be in netinet 2008-06-11 22:08:13 +00:00
Jack F Vogel
1159a15627 Add generic TCP LRO code, moved from the ixgbe driver into net 2008-06-11 22:00:29 +00:00
Wojciech A. Koszek
b390a5baf8 Fix a typo in a comment. 2008-06-11 20:05:25 +00:00
Ed Schouten
29d4cb241b Don't enforce unique device minor number policy anymore.
Except for the case where we use the cloner library (clone_create() and
friends), there is no reason to enforce a unique device minor number
policy. There are various drivers in the source tree that allocate unr
pools and such to provide minor numbers, without using them themselves.

Because we still need to support unique device minor numbers for the
cloner library, introduce a new flag called D_NEEDMINOR. All cdevsw's
that are used in combination with the cloner library should be marked
with this flag to make the cloning work.

This means drivers can now freely use si_drv0 to store their own flags
and state, making it effectively the same as si_drv1 and si_drv2. We
still keep the minor() and dev2unit() routines around to make drivers
happy.

The NTFS code also used the minor number in its hash table. We should
not do this anymore. If the si_drv0 field would be changed, it would no
longer end up in the same list.

Approved by:	philip (mentor)
2008-06-11 18:55:19 +00:00
Coleman Kane
21a6592999 Convert ndis_spinlock to ndis_mtx and start using the sleepable
mtx interface for NDIS_LOCK/UNLOCK. This should result in less
CPU utilization on behalf of the ndis driver. Additionally, this
commit also fixes a potential LOR in the ndis_tick code, by
not locking inside the ndis_tick function, but instead delegating
that work to the helpers called through IoQueueWorkItem. The
way that this is currently set up for NDIS prevents us from
simply implementing a callout_init_mtx mechanism.

However, the helper functions that handle the various timeout
cases implement fine-grained locking using the spinlocks provided
by the NDIS-compat layer, and using the mtx that is added with
this commit. This leaves the following ndis_softc members operated
on in ndis_tick in an unlocked context:

  * ndis_hang_timer - Only modified outside of ndis_tick once, before
                      the first callout_reset to schedule ndis_tick
  * ifp->if_oerrors - Only incremented in two places, which should be
                      an atomic op
  * ndis_tx_timer   - Assigned to 5 (when guaranteed to be 0) or 0
                      (in txeof), to indicate to ndis_tick what to
                      do. This is the only member of which I was
                      suspicious for needing the NDIS_LOCK here. My
                      testing (and another's) have been fine so far.
  * ndis_stat_callout - Only uses a simple set of callout routines,
                        callout_reset only called by ndis_tick after
                        the initial reset, and then callout_drain is
                        used exactly once in shutdown code.

The benefit is that ndis_tick doesn't acquire NDIS_LOCK unless one of
the timeout conditions is flagged, and it still obeys the locking
order semantics that are dictated by the NDIS layer at the moment. I
have been investigating a more thorough s/spinlock/mtx/ of the NDIS
layer, but the simplest naive approach (replace KeAcquireSpinLock
with an mtx implementation) has anti-succeeded for me so far. This
is a good first step though.

Tested by:	onemda@gmail.com
Reviewed by:	current@, jhb, thompsa
Proposed by:	jhb
2008-06-11 13:40:15 +00:00
Konstantin Belousov
ac8b6edd89 In cd9660_readdir vop, always initialize the idp->uio_off member.
The while loop that is assumed to initialize the uio_off later, may
be not entered at all, causing uninitialized value to be returned in
uio->uio_offset.

PR:  122925
Submitted by:	Jaakko Heinonen <jh saunalahti fi>
MFC after:	1 weeks
2008-06-11 12:46:09 +00:00
Søren Schmidt
81b910389d Wait up to 1S for the TFD data to signal un-busy before fetching the signature.
This at least helps a few slow devices out there.

Submitted by:	Andrey V. Elsukov
2008-06-11 08:48:25 +00:00
Weongyo Jeong
1f22fabdfb fix a page fault that it occurred during ifp is NULL. This bug happens
when NDIS driver's initialization is failed and NDIS driver's trying to
call NdisWriteErrorLogEntry().
2008-06-11 07:55:07 +00:00
Benno Rice
3c463a49eb Switch to using a normal mutex instead of a spin mutex.
We still use the interrupt filter due to performance problems that show up if
we don't.  The main problem seen is that, due to the interrupt being edge
triggered, we occasionally miss interrupts which leads us to not notice that
we can transmit more packets.  Using the new approach, which just schedules
a task on a taskqueue, we are guaranteed to have the task run even if the
interrupt arrived while we were already executing.  If we were to use an
ithread the system would mask the interrupt while the handler is run and we'd
miss interrupts.
2008-06-11 07:26:02 +00:00
Benno Rice
269a069678 Convert bus_space_{read,write}_* calls to bus_{read,write}_* calls.
Suggested by:	jhb
2008-06-11 06:53:55 +00:00
Søren Schmidt
082b99a8b9 Rearrange how to call dma.alloc() so that we have resources alloc'd when need but also late enough to know how many to create. 2008-06-11 06:44:58 +00:00
Oleksandr Tymoshenko
c9688a603b Keep proper track of nsegs counter: sem_free is called for all
allocated semaphores, so it's wrong to increase it conditionally,
  in this case for every over-the-limit semaphore nsegs is decreased
  without being previously increased.

  PR:	kern/123685
  Approved by:	cognet (mentor)
2008-06-10 20:55:10 +00:00
Simon L. B. Nielsen
3bff0167b9 When the file-system containing the audit log file is running low on
disk space a warning is printed.  Make this warning a bit more
informative.

Approved by:	rwatson
2008-06-10 20:05:32 +00:00
Warner Losh
d368012659 Add Belkin F5U257 to the mix.
Submitted by:	wilko@
2008-06-10 19:31:09 +00:00
John Baldwin
d993ea4271 Make tx(4) MPSAFE
- Add a mutex to the softc to protect the softc and device hardware.
- Use a private timer to implement a watchdog for tx timeouts and drive
  the timer for auto negotiation.
- Use bus_foo() rather than bus_space_foo() and remove the bus space
  tag & handle from the softc.
- Call bus_setup_intr() after ether_ifattach().

Tested by:	Florian Smeets  flo of kasimir.com
2008-06-10 17:59:43 +00:00
Paul Saab
160b4e6bfc Add support for the P212, P410, P410i, P411, and P812 HP Smart Array
controllers.

Submitted by:  Scott Benesh at HP
2008-06-10 17:51:51 +00:00
Kevin Lo
45c08eec9a Add the pxa_teardown_intr() bus method function to de-associate the
interrupt handler
2008-06-10 06:06:15 +00:00
Kevin Lo
43d8707e0f Pull all the code to deal with bus space methods into a shared set of
routines.
2008-06-10 03:44:14 +00:00
Kevin Lo
49d3c1f416 >From NetBSD:
Remove the code which disables port status change interrupts for 1s
when one occured -- this makes that events get lost or delayed until
the next change.

Obtained from:	NetBSD
2008-06-10 02:41:36 +00:00
David Christensen
680ece5918 - Fixed kern/123696 by increasing firmware timeout value from 100 to 1000.
- Fixed a problem on i386 architecture when using split header/jumbo frame
  firmware caused by hardware alignment requirements.
- Added #define BCE_USE_SPLIT_HEADER to allow the feature to be enabled/
  disabled.  Enabled by default.

PR:		kern/123696
MFC after:	2 weeks
2008-06-10 02:19:11 +00:00
Wojciech A. Koszek
10170e4559 Since we create a DMA tag "mtag" for TX map with bus_dmamap_create(),
we must synchronize such a map against "mtag" with bus_dmamap_sync(),
not the tag designated for RX map.

Fix it.

Approved by:	cognet
2008-06-09 21:51:48 +00:00
Konstantin Belousov
a70537835f Provide the mutual exclusion between the nfs export list modifications
and nfs requests processing. Lockmgr lock provides the shared locking for
nfs requests, while exclusive mode is used for modifications. The writer
starvation is handled by lockmgr too.

Reported by:	kris, pho, many
Based on the submission by:	mohan
Tested by:	pho
MFC after:	2 weeks
2008-06-09 10:31:38 +00:00
Ed Schouten
2ae1fdab5a Remove sicontrol(8)'s "ttystat".
In the FreeBSD base system, there are only two utilities that use struct
tty, namely pstat and sicontrol. The sicontrol utility calls the
TCSI_TTY ioctl(), which copies struct tty back to userspace.

sicontrol should not have this functionality. The same data is already
provided by pstat. If we really want to be able to export these numbers
through a file descriptor to userspace, we can export struct xtty, which
should provide a better abstraction. The ttystat option was only used as
a debugging aid.

This makes sicontrol compile in the mpsafetty branch.

Reviewed by:	peter
Approved by:	philip (mentor)
2008-06-09 08:43:27 +00:00
John Birrell
89020621fd Remove some sparc-specific stuff from my earlier sun4v work in p4.
It never belonged in current.

Pointed out by: marius
2008-06-09 06:31:17 +00:00
Kevin Lo
247ac1530d Remove sa1_cache_clean_addr 2008-06-09 05:53:04 +00:00
Kevin Lo
6799ed5dd8 Unify arminit() and clean up 2008-06-09 05:50:42 +00:00
Wojciech A. Koszek
2e75877f12 Remove checks against DDB, which isn't used in this file.
My intention is to bring no functional change.

Discussion on:	IRC
Reviewed by:	ed, kan, rink,
2008-06-08 20:43:27 +00:00
Doug Barton
e0976d1a55 The change to add subversion ID has two problems. The first is that when
newvers.sh is run pwd is actually the obj directory, so "../../.svn"
doesn't exist and the test always fails. The second is that buildkernel
is executed with a restrictive PATH, so unless you have svnversion in
/bin or /usr/bin it can't run.

Fix this by looking for svnversion in /bin, /usr/bin, and /usr/local/bin
in that order. If found, store the location and derive the value of the
source directory. Then run svnversion in the appropriate directory.

There is one possible refinement which would be to add a test for
LOCALBASE!=/usr/local if we don't find svnversion the first time, but
IMO that's not necessary at this time.
2008-06-08 19:46:23 +00:00
Rui Paulo
5a9555b9aa Fix typo in comment. 2008-06-08 14:42:43 +00:00
Roman Divacky
2e1a489300 d_ino member of linux_dirent structure should be unsigned long.
Submitted by:	Chagin Dmitry <chagin.dmitry@gmail.com>
Approved by:	kib (mentor)
2008-06-08 11:09:25 +00:00
Wojciech A. Koszek
70e83c4514 Fix spelling of "virtual".
There should be no visible change.

Reviewed by:	rink
2008-06-08 08:56:46 +00:00
Pyun YongHyeon
2e3d4b798b Ethernet hardware address stored in DC_AL_PAR0/DC_AL_PAR1 register
is in little endian form. Likewise setting DC_AL_PAR0/DC_AL_PAR1
register expect the address to be in little endian form. For big
endian architectures the address should be swapped to get correct
one.
Change setting/getting ethernet hardware address to big endian
architecture frendly.

Reported by:	Robert Murillo ( billypilgrim782001 at yahoo dot com )
Tested by:	Robert Murillo ( billypilgrim782001 at yahoo dot com )
2008-06-08 02:52:26 +00:00
Marcel Moolenaar
d0767c77a9 Move bm(4) from the sys/conf/NOTES to sys/powerpc/conf/NOTES.
The driver applies to PowerPC only.
2008-06-08 01:58:11 +00:00
Marcel Moolenaar
cf99524aed Add support for the Apple Big Mac (BMAC) Ethernet controller,
found on various Apple G3 models.

Submitted by:	Nathan Whitehorn
2008-06-07 22:58:32 +00:00
Marcel Moolenaar
7d8ccad797 Add support for Apple's Descriptor-Based DMA (DBDMA) engine. The DMA
engine is usful to various  existing drivers, such as ata(4) and scc(4),
and is used bhy the soon to be added bm(4).

Submitted by:	Nathan Whitehorn
2008-06-07 21:56:48 +00:00
Sam Leffler
38c208f876 Change the calling convention for ic_node_alloc to deal with
some longstanding issues:
o pass the vap since it's now the "coin of the realm" and required
  to do things like set initial tx parameters in private node
  state for use prior to association
o pass the mac address as cards that maintain outboard station
  tables require this to create an entry (e.g. in ibss mode)
o remove the node table reference, we only have one node table
  and it's unlikely this will change so this is not needed to
  find the com structure
2008-06-07 18:38:02 +00:00
Sam Leffler
2dc4d8dc89 Split ieee80211_notify_erp into locked and unlocked variants
and use the locked version to handle the hostap input path
case where the com lock is not already held.

Noticed by:	Jared Go
2008-06-07 17:51:41 +00:00
Sam Leffler
37e9743a00 Fix node cleanup issues when the last reference is held by
the driver (e.g. in the tx q); ni_vap may not be valid, we
must carefully check before using it.
2008-06-07 17:50:24 +00:00
Sam Leffler
13f91245d2 correct code returned in AsssocResp; the previous code is spec'd for use
only in deauth+disassoc frames

Submitted by:	Chris Zimmermann
MFC after:	1 month
2008-06-07 17:43:41 +00:00
Poul-Henning Kamp
1125f273e5 If we can find it, include SVN version number in kernel version strings.
See also: http://www.bikeshed.org/
2008-06-07 09:49:57 +00:00
Konstantin Belousov
7e44e88a84 Fix the incorrect calculation of a block address within a single indirect
block.

PR:	108215
Submitted by:	Yuichiro Goto, y7goto gmail com
MFC after:	2 weeks
2008-06-07 05:49:24 +00:00
John Baldwin
894e70e80d Workaround a bug in the BIOS of Dell R900 machines. Specifically, each
entry in the SMAP is a 20 byte structure and they are queried from the
BIOS via sucessive BIOS calls.  Due to an apparent bug in the R900's
BIOS, for some SMAP requests the BIOS overflows the 20 byte buffer
trashing a few bytes of memory immediately after the SMAP structure.  As
a workaround, add 8 bytes of padding after the SMAP structure used in
the loader for SMAP queries.

PR:		i386/122668
Submitted by:	Mike Hibler  mike flux.utah.edu, silby
MFC after:	3 days
2008-06-07 03:07:32 +00:00
John Baldwin
697218c9b6 - Store the device_t of the smbX device in the softc.
- Store the softc of the device in the 'si_drv1' of the cdev.
- Lookup the softc via 'si_drv1' in cdev methods rather than using the
  minor number as a unit for devclass_get_softc().
- Lookup the device_t via the softc field in cdev methods rather than
  using the minor number as a unit for devclass_get_device().
- Add a mutex to the softc to protect 'sc_opened'.
- Remove D_NEEDGIANT as all the smbus drivers are now MPSAFE and this driver
  is now MPSAFE.
- Remove some checks for NULL softc pointers that can't happen and don't
  bzero the softc during attach.
2008-06-06 18:45:32 +00:00
John Baldwin
0df8f0815a Explicitly lock Giant in smbus_if methods in the bktr_i2c and iicsmb
drivers for now.  This can be replaced with driver locks when these
drivers are locked.
2008-06-06 18:40:38 +00:00
Alan Cox
8bcd3b1998 Essentially, neither madvise(..., MADV_DONTNEED) nor madvise(..., MADV_FREE)
work.  (Moreover, I don't believe that they have ever worked as intended.)
The explanation is fairly simple.  Both MADV_DONTNEED and MADV_FREE perform
vm_page_dontneed() on each page within the range given to madvise().  This
function moves the page to the inactive queue.  Specifically, if the page is
clean, it is moved to the head of the inactive queue where it is first in
line for processing by the page daemon.  On the other hand, if it is dirty,
it is placed at the tail.  Let's further examine the case in which the page
is clean.  Recall that the page is at the head of the line for processing by
the page daemon.  The expectation of vm_page_dontneed()'s author was that
the page would be transferred from the inactive queue to the cache queue by
the page daemon.  (Once the page is in the cache queue, it is, in effect,
free, that is, it can be reallocated to a new vm object by vm_page_alloc()
if it isn't reactivated quickly enough by a user of the old vm object.)  The
trouble is that nowhere in the execution of either MADV_DONTNEED or
MADV_FREE is either the machine-independent reference flag (PG_REFERENCED)
or the reference bit in any page table entry (PTE) mapping the page cleared.
Consequently, the immediate reaction of the page daemon is to reactivate the
page because it is referenced.  In effect, the madvise() was for naught.
The case in which the page was dirty is not too different.  Instead of being
laundered, the page is reactivated.

Note: The essential difference between MADV_DONTNEED and MADV_FREE is
that MADV_FREE clears a page's dirty field.  So, MADV_FREE is always
executing the clean case above.

This revision changes vm_page_dontneed() to clear both the machine-
independent reference flag (PG_REFERENCED) and the reference bit in all PTEs
mapping the page.

MFC after:	6 weeks
2008-06-06 18:38:43 +00:00
John Baldwin
32d8ea8423 - Use bus_foo() rather than bus_space_foo() and remove bus space tag/handle
from softc.
- Mark interrupt handlers MPSAFE as these drivers have been locked for a
  while.
2008-06-06 18:29:56 +00:00
Warner Losh
aa754333fc Tweak a comment and a constant to restore old 30ms upper bound.
cs_readreg takes ~2us not ~1us to run.
2008-06-06 17:27:19 +00:00
Warner Losh
194dffc052 o Remove unused cs_debug tunable. I think I added it and then nothing with
it.  Bad imp.  Removing us dips us under 10,000 in size too.
o Replace an unconditional 30ms DELAY (yes, busy wait) with a check of the
  SIBUSY bit in the SelfST register before accessing the eeprom.  This changes
  the time to read the EEPROM from 2 * 20 * 30ms (1.2s) to < 20*25us (.0005s)
  and make the attach of the card tolerable when ethernet media is present.
  Include data from the datasheet about why this works.  While this is a 2500x
  speed increase, it doesn't really matter at all once the card is probed...
o set dev earlier in softc.
2008-06-06 17:22:07 +00:00
Warner Losh
836fbcb341 Forgot to commit these files too :-( 2008-06-06 16:10:10 +00:00
Warner Losh
29f92ad3d3 Minor clean up to shave about 1.5k off the size of the driver:
o remove unused fields from softc and args from cs_alloc_irq
o remove some commented code that will never be implemented.
o Don't try to send a packet and see if it worked.  We don't
  need this anymore, and it doesn't add any value.
o tweaks for BNC and AUI.
o limit possible time hung in the kernel to 4s rather than 40s.
2008-06-06 05:25:24 +00:00
Benno Rice
9722a61504 Support for the XScale PXA255 SoC as found on the Gumstix Basix and Connex
boards.  This is enough to net-boot to multiuser.

Also supported is the SMSC LAN91C111 parts used on the netCF, netDUO and netMMC
add-on boards.

I'll be putting some instructions on how to boot this on the Gumstix boards
online soon.

This is still fairly rough and will be refined over time but I felt it was
better to get this out there where other people can help out.
2008-06-06 05:08:09 +00:00
Warner Losh
71de0324d9 Simplify error checking when reading the function.... 2008-06-06 05:02:36 +00:00
Warner Losh
97a7fcc1d9 cs has detach, remove bogus ifdef.
Remove dedundant initialization of error to 0.
2008-06-06 05:02:01 +00:00
Benno Rice
694c651803 This is a rewritten driver for the SMSC LAN91C111. It's based in part on the
sn(4) driver and also looking at newer drivers.  The reason for the rewrite is
to support MII and to try and resolve some performance issues found when trying
to use the sn(4) driver on the Gumstix network boards.

For reference, the SMSC LAN91C111 is a non-PCI ethernet part whose lineage
dates back to Ye Olde Days of ISA.  It seems to get some use in the embedded
space these days on parts lacking on-board MACs or on-board PCI controllers,
such as the XScale PXA line of ARM CPUs.

This also includes a driver for the SMSC LAN83C183 10/100 PHY.

Man page to follow.
2008-06-06 05:00:49 +00:00
Warner Losh
b893c8d09d Remove unused fields in softc. If they are ever really needed again,
they can re-added.  Remove CS_NAME.  Don't whine when there's an
ignored checksum error: User has said STFU, so we should S the FU.
(remove mandated properties).
2008-06-06 04:56:27 +00:00
Peter Wemm
7fb2535f5c Checkpoint what I've been running for the last year. Tidy up a
bunch of loose ends that "can't happen" any more, if they ever could.
2008-06-06 03:21:59 +00:00
Max Laier
b18b4dabe6 Fix range check for rtable id. 2008-06-05 19:30:20 +00:00
Ed Schouten
22e9c72afd Fix faulty character to control-character conversion for CTRL().
The CTRL() macro seems to perform character to control-character
conversion (i.e. 'A' to 0x01) to lowercase characters. This is actually
not valid. If we use lowercase characters, conversions such as
CTRL('\\') and CTRL('?') will result to invalid conversions.

Because we must still support old source code that uses CTRL() (bad!),
we make CTRL() accept both forms. When the character is a lowercase
character, we perform the old style conversion.

Approved by:	philip (mentor)
2008-06-05 17:44:18 +00:00
Attilio Rao
a177319618 Add the support for the Globetrotter Max 3.6 HSDPA Modem.
PR:		usb/118374
Submitted by:	Greg Rivers <gcr at tharned dot org>
2008-06-05 16:56:56 +00:00
John Baldwin
5d5028e774 Make the cs(4) driver MPSAFE:
- Add a mutex to the softc to protect the softc and the device hardware.
- Add a private timer to manage transmit watchdogs rather than using
  if_timer/if_watchdog.
- Setup the interrupt handler after ether_ifattach().

Tested by:	imp
2008-06-05 14:49:35 +00:00
John Baldwin
9ceedf231b Rename the ie_EE16 module to just 'ie' so that at least one of the modules
for this driver is called 'ie'.  Otherwise, ifconfig(8) doesn't recognize
any of the modules as being the ie(4) driver and will always try to kldload
the driver even when it is already present in the kernel.

Reported by:	Thierry Herbelot
2008-06-05 14:45:32 +00:00
John Baldwin
d98e0a2859 - Fix two calls to ieinit() in ieioctl() to call ieinit_locked() instead to
avoid recursing on the lock.
- Use IFQ_SET_MAXLEN().
2008-06-05 14:43:55 +00:00
Konstantin Belousov
9e40a5f827 When devfs_allocv() committed to create new vnode, since de_vnode is NULL,
the dm_lock is held while the newly allocated vnode is locked. Since no
other threads may try to lock the new vnode yet, the LOR there cannot
result in the deadlock.

Shut down the witness warning to note this fact.

Tested by:	pho
Prodded by:	attilio
2008-06-05 09:15:47 +00:00
Warner Losh
c6ac76ad73 Fix the media auto code by breaking it :-). Auto now just means 'use
10BaseT' since it required 10BaseT to have carrier to switch to it.
This chip makes it hard to do proper auto, so we don't do it.  We
can't test carrier on things easily.

Don't insist on carrier when we set the media.  Don't report failures.
Remove a 1s! delay that appears to not be needed.

With these patches, and John Baldwin's patches, I'm able to pass
packets on my IBM EtherJet card again.
2008-06-05 05:51:19 +00:00
John Baldwin
214b852cd9 Style(9) xe(4). The MD5 sums are different, but comparing the dissassemblies
the only changes are from gcc moving some global variables around slightly.
2008-06-04 20:26:57 +00:00
John Baldwin
69d39da3c0 Gah, always reset the timer for the watchdog check. 2008-06-04 19:33:23 +00:00
John Baldwin
d0b2ae8f20 - Split the interrupt handler up into separate subroutines for rx, tx, and
MAC events.
- Use bus_*() rather than bus_space_*() and remove the bus space tag and
  handle from the softc.
- Retire unused macros for examining CIS tuples.
2008-06-04 15:19:58 +00:00