Commit Graph

19011 Commits

Author SHA1 Message Date
Sam Leffler
a00b852cab add support for the Beacon Not Ready (BNR) interrupt
(available on 5211 and later)
2009-05-06 23:09:26 +00:00
Andrew Thompson
b9c81a5dce Make sure the frame list base address is re-programmed after stopping the USB
schedule, in case the hardware clears the frame list base address.

Submitted by:	Hans Petter Selasky
Reported by:	Chao Shin
2009-05-05 15:41:30 +00:00
Andrew Thompson
6b1bca02b9 Remove USB shutdown methods from device drivers as its the host controllers
responsibility to detach the bus.

PR:		usb/133896
Submitted by:	Hans Petter Selasky
2009-05-05 15:39:29 +00:00
Andrew Thompson
ec8f31275d Revert part of r191494 which used the udev state to mark suspending, this needs
to be set via two variables (peer_suspended and self_suspended) and can not be
merged into one.

Submitted by:	Hans Petter Selasky
Pointy hat:	me
2009-05-05 15:36:23 +00:00
Marko Zec
21ca7b57bd Change the curvnet variable from a global const struct vnet *,
previously always pointing to the default vnet context, to a
dynamically changing thread-local one.  The currvnet context
should be set on entry to networking code via CURVNET_SET() macros,
and reverted to previous state via CURVNET_RESTORE().  Recursions
on curvnet are permitted, though strongly discuouraged.

This change should have no functional impact on nooptions VIMAGE
kernel builds, where CURVNET_* macros expand to whitespace.

The curthread->td_vnet (aka curvnet) variable's purpose is to be an
indicator of the vnet context in which the current network-related
operation takes place, in case we cannot deduce the current vnet
context from any other source, such as by looking at mbuf's
m->m_pkthdr.rcvif->if_vnet, sockets's so->so_vnet etc.  Moreover, so
far curvnet has turned out to be an invaluable consistency checking
aid: it helps to catch cases when sockets, ifnets or any other
vnet-aware structures may have leaked from one vnet to another.

The exact placement of the CURVNET_SET() / CURVNET_RESTORE() macros
was a result of an empirical iterative process, whith an aim to
reduce recursions on CURVNET_SET() to a minimum, while still reducing
the scope of CURVNET_SET() to networking only operations - the
alternative would be calling CURVNET_SET() on each system call entry.
In general, curvnet has to be set in three typicall cases: when
processing socket-related requests from userspace or from within the
kernel; when processing inbound traffic flowing from device drivers
to upper layers of the networking stack, and when executing
timer-driven networking functions.

This change also introduces a DDB subcommand to show the list of all
vnet instances.

Approved by:	julian (mentor)
2009-05-05 10:56:12 +00:00
Alexander Motin
2500b6d96d Make dev.cpu.X.cx_usage sysctl also report current average of sleep time. 2009-05-03 06:25:37 +00:00
Alexander Motin
bb1d6ad5b3 Remove unused variable and fix spelling in comment. 2009-05-03 04:58:44 +00:00
Warner Losh
12e36acb09 Bring in Andrew Thompson's port of Sepherosa Ziehau's bwi driver for
Broadcom BCM43xx chipsets.  This driver uses the v3 firmware that
needs to be fetched separately.  A port will be committed to create
the bwi firmware module.

The driver matches the following chips: Broadcom BCM4301, BCM4307,
BCM4306, BCM4309, BCM4311, BCM4312, BCM4318, BCM4319

The driver works for 802.11b and 802.11g.

Limitations:
	This doesn't support the 802.11a or 802.11n portion of radios.
	Some BCM4306 and BCM4309 cards don't work with Channel 1, 2 or 3.
	Documenation for this firmware is reverse engineered from
		 http://bcm.sipsolutions.net/
	V4 of the firmware is needed for 11a or 11n support
		 http://bcm-v4.sipsolutions.net/
	Firmware needs to be fetched from a third party, port to be committed

# I've tested this with a BCM4319 mini-pci and a BCM4318 CardBus card, and
# not connected it to the build until the firmware port is committed.

Obtained from:	DragonFlyBSD, //depot/projects/vap
Reviewed by:	sam@, thompsa@
2009-05-03 04:01:43 +00:00
Alexander Motin
b0baaaaecf Avoid comparing negative signed to positive unsignad values. It was
leading to a bug, when C-state does not decrease on sleep shorter then
declared transition latency. Fixing this deprecates workaround for broken
C-states on some hardware.

By the way, change state selecting logic a bit. Instead of last sleep
time use short-time average of it. Global interrupts rate in system is a
quite random value, to corellate subsequent sleeps so directly.
2009-05-02 22:30:33 +00:00
Sam Leffler
04f19fd699 make superg/fast-frames state dynamically-allocated (and indirect off
the com structure instead of embedded); this reduces the overhead when
not configured and reduces visibility of the contents
2009-05-02 20:16:55 +00:00
Andrew Thompson
5efea30f03 Create a taskqueue for each wireless interface which provides a serialised
sleepable context for net80211 driver callbacks. This removes the need for USB
and firmware based drivers to roll their own code to defer the chip programming
for state changes, scan requests, channel changes and mcast/promisc updates.
When a driver callback completes the hardware state is now guaranteed to have
been updated and is in sync with net80211 layer.

This nukes around 1300 lines of code from the wireless device drivers making
them more readable and less race prone.

The net80211 layer has been updated as follows
 - all state/channel changes are serialised on the taskqueue.
 - ieee80211_new_state() always queues and can now be called from any context
 - scanning runs from a single taskq function and executes to completion. driver
   callbacks are synchronous so the channel, phy mode and rx filters are
   guaranteed to be set in hardware before probe request frames are
   transmitted.

Help and contributions from Sam Leffler.

Reviewed by:	sam
2009-05-02 15:14:18 +00:00
Alexander Motin
b1d1fff76c Improve kernel dumping reliability for busy ATA channels:
- Generate fake channel interrupts even if channel busy with previous
request to let it finish. Without this, dumping requests were just queued
and never processed.
 - Drop pre-dump requests queue on dumping. ATA code, working in dumping
(interruptless) mode, unable to handle long request queue. Actually, to get
coherent dump we anyway should do as few unrelated actions as possible.
2009-05-01 08:03:46 +00:00
Pyun YongHyeon
59dffaa088 Separate multicast filtering of SysKonnect GENESIS and Marvell
Yukon from common multicast handling code. Yukon uses hash-based
multicast filtering(big endian form) but GENESIS uses perfect
multicast filtering as well as hash-based one(little endian form).
Due to the differences of multicast filtering there is no much
sense to have a common code.
 o Remove sk_setmulti() and introduce sk_rxfilter_yukon(),
   sk_rxfilter_yukon() that handles multicast filtering setup.
 o Have sk_rxfilter_{yukon, genesis} handle promiscuous mode and
   nuke sk_setpromisc(). This simplifies ioctl handler as well as
   giving a chance to check validity of Rx control register of
   Yukon.
 o Don't reinitialize controller when IFF_ALLMULTI flags is changed.
 o Nuke sk_gmchash(), it's not needed anymore.
 o Always reconfigure Rx control register whenever a new multicast
   filtering condition is changed. This fixes multicast filtering
   setup on Yukon.

PR:	kern/134051
2009-05-01 03:24:03 +00:00
Andrew Thompson
6fca021096 We need to ref the bss node when sending the beacon since it goes through the
normal tx path and will be decremented on the mbuf free.
2009-04-30 22:30:01 +00:00
Jung-uk Kim
54b43614e7 Fix off-by-one bug. S5 state must be checked as well. 2009-04-30 18:00:53 +00:00
Jung-uk Kim
19682c4826 Fix style(9). 2009-04-30 17:45:43 +00:00
Jung-uk Kim
2d0c82e8cf Prefer device_printf() over printf() where ever possible. 2009-04-30 17:42:11 +00:00
Jung-uk Kim
a0e73a122d General sleep state change clean up.
- Probe supported sleep states from acpi_attach() just once and do not
call AcpiGetSleepTypeData() again.  It is redundant because
AcpiEnterSleepStatePrep() does it any way.
- Treat UNKNOWN sleep state as NONE, i.e., "do nothing", and remove obscure
NONE state (ACPI_S_STATES_MAX + 1) to avoid confusions.
- Do not set unsupported sleep states as default button/switch events.
If the default sleep state is not supported, just set it as UNKNOWN/NONE.
- Do not allow sleep state change if the system is not fully up and running.
This should prevent entering S5 state multiple times, which causes strange
behaviours later.
- Make sleep states case-insensitive when they are used with sysctl(8).
For example,

	sysctl hw.acpi.lid_switch_state=s1
	sysctl hw.acpi.sleep_button_state=none

are now legal and equivalent to the uppercase ones.
2009-04-30 17:35:44 +00:00
Alexander Motin
4c10f2e605 Add experimental support for SATA interface power management.
Feature is controlled by hint.ata.X.pm_level tunable:
 0 - PM disabled, old behaviour, default.
 1 - device is allowed to initiate PM state change, host is passive.
 2 - host initiates PARTIAL state transition every time port is idle.
 3 - host initiates SLUMBER state transition every time port is idle.

PARTIAL state has up to 100us (50us for me) wakeup latency, but for my
ICH8M saves 0.5W of power per drive. SLUMBER state has up to 10ms (3.5ms
for me) wakeup latency, but saves 0.8W of power.

Modes 2 and 3 are implemented only for AHCI driver now.

Interface power management is incompatible with device presence detection
(host receives no signal from drive, so unable to monitor it), so later is
disabled when PM is used.
2009-04-29 21:17:18 +00:00
Marius Strobl
db6bbcd2dc - Change some softc members to be unsigned where more appropriate.
- Add some missing const.
- Move the size of the window spun by the registers to the softc
  as neither using va_mem_size for this nor va_mem_base for the
  start of the bus addresses is appropriate.

MFC after:	1 week
2009-04-28 20:49:47 +00:00
Andriy Gapon
33c70d417e acpi: do not run resume/backout code when entering S0/S5 states
This change adds (possibly redundant) early check for invalid
state input parameter (including S0). Handling of S5 request
is reduced to simply calling shutdown_nice(). As a result
control flow of acpi_EnterSleepState is somewhat simplified
and resume/backout half of the function is not executed
for S5 (soft poweroff) request and invalid state requests.

Note: it seems that shutdown_nice may act as nop when initproc
is already initialized (to grab pid of 1), but init process is in
"pre-natal" state.

Tested by:	Fabian Keil <fk@fabiankeil.de>
Reviewed by:	njl, jkim
Approved by:	rpaulo
2009-04-28 11:56:54 +00:00
Kip Macy
8f781951eb fix typo in conditional 2009-04-27 23:43:28 +00:00
Kip Macy
b3e6cec7b3 collapse the two em_start_locked routines in to one 2009-04-27 22:55:48 +00:00
Kip Macy
bf541f371e simplify by removing dead code 2009-04-27 22:54:30 +00:00
Kip Macy
cb2ff24c38 remove dead code with reference to IFQ_HANDOFF 2009-04-27 22:53:35 +00:00
Jung-uk Kim
c39437eb46 Use cached progif instead of reading it again. 2009-04-27 21:45:05 +00:00
Jung-uk Kim
c6b8ee96f6 - Give generic AHCI driver lower priority than device-specific drivers.
- Consistently use BUS_PROBE_GENERIC instead of -100.
2009-04-27 21:34:15 +00:00
Jung-uk Kim
7267edac39 Reduce code duplication and excessive pci_get_slot() calls.
Reviewed by:	mav
2009-04-27 19:39:18 +00:00
Jack F Vogel
eb60d22100 Correct fat finger mistake 2009-04-27 18:35:06 +00:00
Jung-uk Kim
3388ca6b71 Reduce excessive pci_get_devid() and pci_get_revid() calls
on the same PCI device while device probing.
2009-04-27 18:10:42 +00:00
Jack F Vogel
aecaefee25 igb_txeof also has a case where the watchdog may not
get reset when it should be

MFC after: 2 weeks
2009-04-27 17:36:41 +00:00
Jung-uk Kim
f71ac6d60a - Always force AHCI mode on a ATI/AMD SB600/700/800 SATA controller. These
controllers may be configured as legacy IDE mode by modifying subclass and
progif without actually changing PCI device IDs.  Instead of complicating
code, we always force AHCI mode while probing.  Also we restore AHCI mode
while resuming per ATI/AMD register programming/requirement guides.
- Fix SB700/800 "combined" mode.  Unlike SB600, this PATA controller can
combine two SATA ports and emulate one PATA channel as primary or secondary
depending on BIOS configuration.  When the combined mode is disabled, this
channel disappears and it works just like SB600 PATA controller, however.
- Add more PCI device IDs for SB700/800 and adjust device descriptions.
SB800 shares the same PCI device IDs and added two more SATA IDs.
2009-04-27 17:29:51 +00:00
Andrew Gallatin
950f22e38d Fix build: Make forgotten IFNET_MULTIQUEUE to IFNET_BUF_RING
ifdef change.
2009-04-27 17:24:47 +00:00
Jack F Vogel
baf2572c76 Thanks for Michael Tuexen for tracking down a path where
the watchdog timer was not being rearmed in txeof, and also
a missing case in the new code.

MFC after:	2 weeks
2009-04-27 17:22:14 +00:00
Doug Ambrisko
a18c284294 Start to convert this over to the new tty layer. These changes allow
this driver to compile and limp along with the new layer.  These changes
do not deal with proper locking around access to the HW.  This is only
a starting point.  I have not tested modem control but tip seems to work
okay and I can send and receive characters which I needed for one of my
-current boxes.  I have not tied this driver back up to the build since
I don't want people to think it is ready for prime time.  If anyone
else has some cycles to work on this feel free to!

Also add support for a 16 port PCI interface I have at work.

Glanced at by:	ed
2009-04-27 15:58:38 +00:00
Andrew Gallatin
c6cb3e3fe8 Updates to mxge for multiple tx/rx rings:
- Update mxge to use if_transmit(), and the new buf_ring
  interfaces, so as to enable multiple transmit queues.
  Use of if_transmit() is conditional on IFNET_BUF_RING,
  and is enabled by default (as in if_em).

- Record a flow id on receive if receive hashing is active.
  I currently only record the rx ring id (0..8) rather than
  the 32-bit topelitz hash result, as doing the latter would
  require shifting the driver to use a larger rx return ring.

Sponsored by:  Myricom, Inc.
2009-04-27 15:45:54 +00:00
Ed Schouten
e439bf9ccc Remove unneeded device index from unit number.
We only use the unit number to determine whether we should rewind the
device upon closure.
2009-04-26 09:21:37 +00:00
Andrew Thompson
4d4fa6edd4 Make the state string descriptions public. 2009-04-25 21:25:52 +00:00
Andrew Thompson
bd21677868 Track the usb device state as its powered on, addressed and configured. This helps
to avoid touching the device when it is not going to respond and would otherwise
timeout.

Implement the suspend tracking as a udev state too.
2009-04-25 21:10:06 +00:00
Warner Losh
1c51765e41 Add Surecom EP-427X. 2009-04-24 17:28:12 +00:00
Warner Losh
a5a8a1c8fe Another PC Card that needs the CIS strings for the Surecom EP-427X,
which really is just a rebadged OEM card...  Plus a tiny whitespace
nit.
2009-04-24 17:27:45 +00:00
Kip Macy
1af1902295 fix typo 2009-04-23 21:27:06 +00:00
Kip Macy
4b4945b673 fix panic when using msix
Pointed out by Nate Whitehorn
2009-04-23 21:23:19 +00:00
Kip Macy
173ff3e204 Make sure the ALTQ case is handle correctly by using drbr_dequeue 2009-04-23 21:19:35 +00:00
Robert Watson
530ee5c971 Two ifnet misuse fixes for if_nve:
(1) Don't manually configure if_output(), ether_ifattach() will do that
    for us as part of link-layer setup.

(2) Call if_detach() before stopping nve in order to prevent calls into
    the device driver after the driver has started shutting down.

Reviewed by:	jhb
MFC after:	2 weeks
2009-04-23 19:29:45 +00:00
Andrew Thompson
459d369ee2 MFp4 //depot/projects/usb@160930
Change the roothub exec functions to take the usb request and data pointers
directly rather than placing them on the parent bus struct.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:16 +00:00
Andrew Thompson
c1911c1b7c MFp4 //depot/projects/usb@160708
Need to check Read/Write allowed before writing any data for non-control
transfers.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:13 +00:00
Andrew Thompson
672c9965ef MFp4 //depot/projects/usb@160706
Resolve possible device side mode deadlock by creating another thread.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:10 +00:00
Andrew Thompson
39063699e6 MFp4 //depot/projects/usb@160678
Remove unused field.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:07 +00:00
Andrew Thompson
9469c92974 MFp4 //depot/projects/usb@160655
Fix possible issue with clear-stall and set-config happening at the same time.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:04 +00:00
Andrew Thompson
88b4e0abcf MFp4 //depot/projects/usb@160614
Fix errornous printout.

Submitted by:	Hans Petter Selasky
2009-04-22 17:07:59 +00:00
Andrew Thompson
8ac0864630 MFp4 //depot/projects/usb@160485
Fix a bug in the USB power daemon code where connection of multiple HUBs in
series would result in incorrect device suspend.

Reported by:	Nicolas xxx@wanadoo.fr
Submitted by:	Hans Petter Selasky
2009-04-22 17:07:56 +00:00
Andrew Thompson
495f25cedc MFp4 //depot/projects/usb@160413
Use direct reference to parent high-speed HUB instead of indirect, due to
pointer clearing race at detach of parent USB HUB.

Reported by:	kientzle
Submitted by:	Hans Petter Selasky
PR:		usb/133545
2009-04-22 17:07:53 +00:00
Warner Losh
1d00d5ed3c A couple of older Melco cards that missed the transition to newcard 2009-04-22 16:51:01 +00:00
Warner Losh
9ca9ddabfd A couple of older Melco cards that missed the transition to newcard 2009-04-22 16:50:44 +00:00
Warner Losh
9ac15d8cea Add Billionton LNT10TB 2009-04-22 15:57:22 +00:00
Warner Losh
194842b5c3 Add Billionton LNT-10TB variant 2009-04-22 15:56:00 +00:00
Warner Losh
52641d220c Add a few more models of AMBICOM cards from data from linux driver and
pccard.conf.
2009-04-22 15:13:20 +00:00
Warner Losh
ffef988b76 Add AmbiCom AMB8002, AMB8010 (2 variants) and AMB8610. These were
inferred from data in the linux driver.
2009-04-22 15:11:27 +00:00
Warner Losh
eba0fd149d These were a placeholder and don't belong here. Remove them. 2009-04-22 15:01:08 +00:00
Warner Losh
ffed9ec58d Kill stray bootverbose debug tool.
Submitted by:	juli@
2009-04-22 06:33:26 +00:00
Warner Losh
31de65dd02 Turns out the code improvements I did for the TC5299J support were
anti-improvements and broke support for this part.  Revert the part of
the improvement at fault.
2009-04-22 06:30:24 +00:00
Stanislav Sedov
97958cafc8 - Rename ds1672 and ds133x devices to "ds1672_rtc" and "ds133x_rtc"
respectivly. This will allow one to have a kernel with both devices
  present and use it for multiple boards with different types of RTC
  sitting on a bus.

Discussed with:	imp
2009-04-21 22:48:12 +00:00
Takanori Watanabe
450a309dfe Add another FTDI serial converter. 2009-04-21 05:06:31 +00:00
Pyun YongHyeon
2b574f3152 To make it easy whether xl(4) missed Tx completion interrupt check
number of queued packets in watchdog timeout handler. If there are
no queued packets just print a informational message and return
without resetting controller. Also fix to invoke correct Tx
completion handler as 3C905B needs different handler.
2009-04-21 00:42:11 +00:00
Pyun YongHyeon
ba65e0cc90 Clear IFF_DRV_OACTIVE flag if one of queued packets was transmitted.
Previously it used to clear the flag only when the transmit queue
is empty which may slow down Tx performance.
While I'm here check whether driver is running and whether we can
queue more packets in if_start handler. This fixes occasional
watchdog timeouts.

Reported by:	xer < xernet <> hotmail dot it >
Tested by:	xer < xernet <> hotmail dot it >
2009-04-21 00:34:31 +00:00
Stanislav Sedov
50aababbfb - Give a warning and start the oscillator if it was not previously
runned.
- Rename ds1672 -> rtc to follow the other drivers.
- Refactor/simplify the code a bit.

MFC after:	2 weeks
2009-04-20 15:47:06 +00:00
Warner Losh
98f751cd4b Sometimes we can call ed_detach() before the mtx has been initialized.
Avoid it if it hasn't been initialized.
2009-04-20 15:19:54 +00:00
Ed Schouten
2034e6a11f Make mse(4) use si_drv1, instead of using unit numbers.
Discussed with:	imp
2009-04-20 15:15:24 +00:00
Stanislav Sedov
219c5a5a96 - Unlock softc mutex on failure.
MFC after:	1 week
2009-04-20 13:15:25 +00:00
Stanislav Sedov
852761c216 - Properly unlock mutex on failure in channel_trigger. Before this
the function just returned with the mutex held.

MFC after:	1 week
2009-04-20 12:43:07 +00:00
Pyun YongHyeon
f2e491c9c5 For RTL8139C+ controllers, have controller handle padding short
checksum offload frames. Software workaround used for broken
controllers(RTL8169, RTL8168, RTL8168B) seem to cause watchdog
timeouts on RTL8139C+.
Introduce a new flag RL_FLAG_AUTOPAD to mark automatic padding
feature of controller and set it for RTL8139C+ and controllers that
use new descriptor format. This fixes watchdog timeouts seen on
RTL8139C+.

Reported by:	Dimitri Rodis < DimitriR <> integritasystems dot com >
Tested by:	Dimitri Rodis < DimitriR <> integritasystems dot com >
2009-04-20 07:13:04 +00:00
Warner Losh
472dfd2aeb Cleanup resource allocation code a bit. Store the rids on the
resources rather than on the softc.  When we allocate resources for PC
Card, if we only get 16 ports, try again to get the others.
2009-04-20 01:19:59 +00:00
Robert Noland
8f6d3bf7a2 Don't try to setup interrupts for drivers that don't support them.
This causes sis and probably a couple of other driver to panic and fail.

Tested by:	cpghost <cpghost@cordula.ws>
PR:		133554
MFC after:	3 days
2009-04-19 16:54:33 +00:00
Ed Schouten
e78a5a3f2f Convert mlx(4) and mly(4) to si_drv1 instead of dev2unit(). 2009-04-18 07:36:38 +00:00
Warner Losh
77944b3551 Make sure that the data in the ROM with a valid signature isn't all
0's.  At least one PC Card ASIC does this...
2009-04-18 04:45:02 +00:00
Warner Losh
f2731d8565 Add GVP NIC 2000P and New Media Livewire. Also New Media LanSurfer
doesn't have a function type of network, so add a quirk for that...
2009-04-18 04:37:53 +00:00
Warner Losh
74677fb82b Establish the interrupt handler AFTER we successfully attach. We need
to do this in case we have a shared interrupt that fires during the
attach process....
2009-04-18 03:10:28 +00:00
Warner Losh
77a6714a6d Remove debug write accidentally left in. 2009-04-18 03:02:44 +00:00
John Baldwin
a28b3fc741 - Add a few more register defintions for the PCI express capability
registers.
- Cleanup PCI-X capability printf to not leave a dangling "supports" for
  some PCI-X bridges.
- Display additional PCI express details including the negotiated and max
  link width and the actual and maximum supported max payload.

MFC after:	1 month
2009-04-17 19:07:44 +00:00
Andrew Thompson
0c512ce8ee Drain the driver tasks on the same taskqueue in which they were enqueued. 2009-04-17 16:07:13 +00:00
Maksim Yevmenkin
018cd707c0 Prevent atkbd(4) interrupt handler from calling keyboard callback function
when polled mode is enabled. This should help with duplicated/missing
characters problem at mountroot, geli, etc. prompts on multi CPU systems
while kbdmux(4) is enabled.

Tested by:	Tobias Grosser <grosser -at- fim -dot- uni-passau -dot- de>
Tested by:	Fabian Keil <freebsd-listen -at- fabiankeil -dot- de>
MFC after:	3 days
2009-04-17 00:30:56 +00:00
Andrew Thompson
a0c4317cc2 Only call ieee80211_start_all() if its a 80211 device.
Submitted by:	Paul B. Mahol
2009-04-16 23:42:00 +00:00
Kip Macy
db90f94b85 call base if_qflush routine to flush if_snd 2009-04-16 23:08:02 +00:00
Kip Macy
279aa3d419 Change if_output to take a struct route as its fourth argument in order
to allow passing a cached struct llentry * down to L2

Reviewed by:	rwatson
2009-04-16 20:30:28 +00:00
Rafal Jaworowski
5817716faf mge(4): fix two bugs, which were leading to crash/hang under very heavy
network load.

1. Leave the RX interrupt routine if there is no mbuf available.

2. Properly initialize and track tx_desc_used_count counter so as not to
leak mbuf while traversing used descriptors.

Obtained from:	Semihalf
2009-04-16 11:38:06 +00:00
Rafal Jaworowski
bc26e2e38f Adjust Marvell Discovery (MV78xxx) support to recognize newest chip revisions,
handle Z0 revision (early silicon) explicitly due to its quirks.

Obtained from:	Marvell, Semihalf
2009-04-16 11:20:18 +00:00
Robert Watson
6cf6d55734 Garbage collect unbuildable and unusable non-MPSAFE network device
drivers that depended on the historic IFF_NEEDSGIANT compatibility
mechanism:

  ar(4)
  ray(4)
  sr(4)

Discussed on:	arch@
2009-04-16 11:09:13 +00:00
Marius Strobl
ecbd3f3a29 Fix whitespace. 2009-04-14 20:51:58 +00:00
Marius Strobl
f880062633 - Remove the second license as I'm also fine with the first one.
- Remove redundant softc members for RIDs.
- Change some softc members to be unsigned where more appropriate.
- Add some missing const.
- Remove support for mmap(2)'ing VGA I/O as it was broken [1] and
  not required by X.Org anyway.
- Fix some confusion between bus, physical and virtual addresses
  which mostly consisted in using members of struct video_adapter
  inappropriately but wasn't fatal except for the regular framebuffer
  mmap(2)'ing.
- Remove redundant bzero(9)'ing of the softc.
- Don't map the framebuffer twice in case the firmware has already
  mapped it as besides wasting resources this isn't possible with
  all MMUs. This is a bit tricky as a) just because the firmware
  provides a property with a virtual address doesn't mean it's
  actually mapped (but typically is when the framebuffer is the
  console) and b) the firmware doesn't necessarily map the it with
  the same byteorder as we do. This make machfb(4) work on machines
  with cheetah-class MMUs (including X.Org).

Reported by:	Michael Plass [1]
MFC after:	3 days
2009-04-14 20:23:47 +00:00
Marius Strobl
6c9f0f2124 Fix whitespace. 2009-04-14 19:11:02 +00:00
John Baldwin
bfee0576cb - Consolidate duplicated code for reading and sizing BARs and writing base
addresses to BARs into new pci_read_bar() and pci_write_bar() routines.
  pci_add_map(), pci_alloc_map(), and pci_delete_resource() now use these
  routines to work with BARs.
- Just pass the device_t for the new PCI device to various routines instead
  of passing the device, bus, slot, and function.

Reviewed by:	imp
2009-04-14 18:32:37 +00:00
Jack F Vogel
b3096a0430 Thanks to Michael Tuexen and Randall Scott for providing a
few important bug fixes found while they were doing SCTP
development, and that I somehow lost during the scramble.

Thanks guys!!
2009-04-14 17:14:35 +00:00
Ed Schouten
0de5b9b0f0 Use si_drv1 instead of dev2unit() in twe(4) and twa(4)
Reviewed by:	scottl
2009-04-14 14:02:43 +00:00
Ed Schouten
9078597210 Use si_drv1 instead of dev2unit() in powermac_nvram.
Reviewed by:	nwhitehorn
2009-04-14 13:18:39 +00:00
Ed Schouten
b7d9e67c45 Use si_drv1 instead of dev2unit() inside agp(4).
Reviewed by:	rnoland
2009-04-14 13:11:34 +00:00
Ed Schouten
9555aafab2 Let tdfx(4) use si_drv1 instead of using dev2unit(). 2009-04-14 11:57:26 +00:00
Ed Schouten
9ef0e425f3 Use si_drv1 to store joy(4)'s softc.
There are still some calls to dev2unit() left, but I guess we should
take care of those another time.
2009-04-14 11:23:09 +00:00
Kip Macy
f2502470b5 - define em_transmit and em_qflush
- make buF_ring usage conditional but enabled by default

Reviewed by:	jfv
2009-04-14 03:36:59 +00:00
Warner Losh
f133918640 Another NE-2000 clone. The GVC NIC-2000P Ethernet adapter. Based on
the MN5017 chipset.  There's no vendor/product pair on this card, so
it needs to be matched by the CIS strings.
2009-04-14 03:13:05 +00:00