Commit graph

67472 commits

Author SHA1 Message Date
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
Kevin Lo 974d3a246e Add device IDs for Ricoh R5U870-based OEM cameras 2008-06-04 10:36:24 +00:00
Peter Grehan aecb44179b Add link register to fatal trap printout to better diagnose NULL
function pointer derefs.
2008-06-04 07:32:49 +00:00
Warner Losh 9018f9625d o Improve the probe code dealing with interrupts.
o When forced to be 10baseT, don't require that the 10baseT interface
  have link to succeed.  Still require it for IFM_AUTO, however, since it
  appears that there's no way to tell if a specific type of interface
  worked.  I'm doing a web search for a datasheet now to see if there's
  anything obvious.
o Minor incidental formatting nits, including collapsing code of the form
	if (foo) {
		bar();
	} else {
		if (baz)
			bing();
	}
  into:
	if (foo) {
		bar();
	} else if (baz) {
		bing();
	}
  to save an indentation level.
o Remove stray reference to 3.x config file syntax.

# I believe John's patches still apply after this...
2008-06-04 06:07:13 +00:00
John Baldwin b307ca883c - Change the watchdog timer logic to match other drivers that use their own
timer by keeping a once-a-second timer running that decrements a counter
  similar to if_timer and reset the chip if it gets down to zero via the
  decrement.
- Use IFQ_SET_MAXLEN().
2008-06-03 20:40:33 +00:00
Roman Divacky a47444d525 Switch to emulating Linux 2.6 on default.
Approved by:	kib (mentor)
2008-06-03 17:50:13 +00:00
Ed Schouten 5db88944ac Remove unneeded Giant locking of /dev/tty.
The Giant lock is acquired in two places in tty_tty.c. In both places,
it is unneeded.

There is no reason to specify D_NEEDGIANT on this device node. The
device node has only been designed to return ENXIO when opened. It
doesn't make any sense to lock/unlock Giant, just to return this error.
D_TTY is also unneeded. The unimplemented functions don't need to be
patched by devfs.

We don't need to lock Giant when we want to lookup the proper TTY vnode.
s_ttyvp is already protected by proctree_lock (see devfs_vnops.c).

Approved by:	philip (mentor)
2008-06-03 12:38:00 +00:00
Robert Watson 4e95375678 Add an XXX comment regarding a bug I introduced when modifying the behavior
of audit log vnode rotation: on shutdown, we may not properly drain all
pending records, which could lead to lost records during system shutdown.
2008-06-03 11:06:34 +00:00
Doug Rabson a91d170832 Back out the nlm_global_lock part of the last change - I forgot that only
exists in my perforce branch :(

Pointy hat:	dfr
2008-06-03 08:10:58 +00:00
Warner Losh b56700df65 Correct logic error that would prevent cs pccards from working on
systems where the CardBus bridge was connected to a APIC.  The case
where the probe routine is told to not setup the IRQ was mishandled
but the error was masked in the case where the IRQ was a valid one
for the card.

MFC after:	1 week
2008-06-03 05:47:28 +00:00
Alexander Kabaev e476ebf3d5 Add device ID for AnyDATA ADU-500A EV-DO modem.
Submitted by: Oleksandr Tatmanyants
PR: 118479
2008-06-03 03:31:53 +00:00
Alexander Kabaev 721234d1f6 Add vendor/device IDs for Novatel U740 repackaged by Dell.
Submitted by: David Gilbert
PR: 122803
2008-06-03 03:13:57 +00:00
Coleman Kane e97f228a10 Update if_ndis to remove the legacy if_watchdog interface and
bring it more up to date. The watchdog timer, and its
associated code, is all collapsed into the ndis_tick function
that was implemented for the NDIS-subsystem watchdog. This
implementation is similar to what numerous other drivers use
to implement the watchdog.

Reviewed by:	thompsa, jhb
MFC after:	2 weeks
2008-06-03 00:55:48 +00:00
John Baldwin 36d05d0ebc Make fe(4) MPSAFE:
- Add a mutex to the softc to protect the softc and device hardware.
- Don't leak bus resources if if_alloc() fails during attach.
- Setup the interrupt handler after calling ether_ifattach().
- Use a private timer to manage the transmit watchdog.

Tested by:	 WATANABE Kazuhiro  CQG00620 of nifty.ne.jp
2008-06-02 19:58:48 +00:00