Commit Graph

81162 Commits

Author SHA1 Message Date
Alan Cox
7ded42ba28 tmpfs_remove() isn't modifying the file's data, so it shouldn't set
TMPFS_NODE_MODIFIED on the node.

PR:		152488
Submitted by:	Anton Yuzhaninov
Reviewed by:	kib
MFC after:	1 week
2011-02-19 21:04:36 +00:00
Martin Wilke
c7fd2483c5 - Add support for MosChip 9865 Single 1284 Printer port
PR:		kern/152663
Submitted by:	Jonathan Chen <jonc@chen.org.nz>
Approved by:	rwatson (mentor)
2011-02-19 17:38:51 +00:00
Jaakko Heinonen
da2e368f70 Don't restore old mount options and flags if VFS_MOUNT(9) succeeds but
vfs_export() fails. Restoring old options and flags after successful
VFS_MOUNT(9) call may cause the file system internal state to become
inconsistent with mount options and flags. Specifically the FFS super
block fs_ronly field and the MNT_RDONLY flag may get out of sync.

PR:		kern/133614
Discussed on:	freebsd-hackers
2011-02-19 14:27:14 +00:00
Yoshihiro Takahashi
9f0f6d5fd7 Add support to set a slice name. 2011-02-19 11:09:38 +00:00
Yoshihiro Takahashi
377015fc6a MFi386: revision 218744
To avoid excessive code duplication create wrapper for fill regs
  from stack frame.
2011-02-19 10:36:05 +00:00
Yoshihiro Takahashi
709f6be098 MFi386: revision 218745
Remove reading of symbols from a.out loaded files.
2011-02-19 10:32:12 +00:00
Konstantin Belousov
c30c6a2311 v_mountedhere is a member of the union. Check that the vnodes have
proper type before using the member.

Reported and tested by:	Michael Butler <imb protected-networks net>
2011-02-19 07:47:25 +00:00
Pyun YongHyeon
ee320f98a9 s/u_intXX_t/uintXX_t/g 2011-02-19 03:32:10 +00:00
Pyun YongHyeon
e4eb0f2e15 Consistently use a tab character instead of space after #define.
No functional changes.
2011-02-19 03:23:19 +00:00
Pyun YongHyeon
26b40a6592 Count how many frames driver lost in interrupt handler. This
register is cleared on read so make sure to clear it in driver
initialization phase.
2011-02-19 03:01:24 +00:00
Pyun YongHyeon
5f14ee2363 Split common TX/RX descriptor DMA tag to TX and RX DMA tags
respectively and fix all bus_dma(9) issues seen when bounce buffers
are used.
 o Setup frame handling had no bus_dmamap_sync(9) which prevented
   driver from configuring RX filter. Add missing bus_dmamap_sync(9)
   in both dc_setfilt_21143()/dc_setfilt_xircom() and dc_txeof().
 o Use bus_addr_t for DMA segment instead of using u_int32_t.
 o Introduce dc_dma_alloc()/dc_dma_free() functions to allocate/free
   DMA'able memory.
 o Create two DMA descriptor list for each TX/RX lists. This change
   will minimize the size of bounce buffers that would be used in
   each TX/RX path.  Previously driver had to copy both TX/RX lists
   when bounce buffer is active.
 o 21143 data sheet says descriptor list requires 4 bytes alignment.
   Remove PAGE_SIZE alignment restriction and use
   sizeof(struct dc_dec).
 o Setup frame requires 4 bytes alignment.  Remove PAGE_SIZE
   alignment restriction and use sizeof(struct dc_dec).
 o Add missing DMA map unload for both setup frame and TX/RX
   descriptor list.
 o Overhaul RX handling logic such that make driver always allocate
   new RX buffer with dc_newbuf(). Previously driver allowed to
   copy received frame with m_devget(9) after passing the
   descriptor ownership to controller. This can lead to passing
   wrong frame to upper stack.
 o Introduce dc_discard_rxbuf() which will discard received frame
   and reuse loaded DMA map and RX mbuf.
 o Correct several wrong bus_dmamap_sync(9) usage in dc_rxeof and
   dc_txeof. The TX/RX descriptor lists are updated by both driver
   and HW so READ/WRITE semantics should be used.
 o If driver failed to allocate new RX buffer, update if_iqdrops
   counter instead of if_ierrors since driver received the frame
   without errors.
 o Make sure to unload loaded setup frame DMA map in dc_txeof and
   clear the mark of setup frame of the TX descriptor in dc_txeof().
 o Add check for possible TX descriptor overruns in dc_encap() and
   move check for free buffer to caller, dc_start_locked().
 o Swap the loaded DMA map and the last DMA map for multi-segmented
   frames. Since dc_txeof() assumes the last descriptor of the
   frame has the DMA map, driver should swap the first and the last
   DMA map in dc_encap(). Previously driver tried to unload
   not-yet-loaded DMA map such that the loaded DMA map was not
   unloaded at all for multi-segmented frames.
 o Rewrite DC_RXDESC/DC_TXDESC macro to simpler one.
 o Remove definition of ETHER_ALIGN, it's already defined in
   ethernet.h.

With this changes, dc(4) works with bounce buffers and it shall
also fix issues which might have shown in PAE environments.

Tested by:	marius
2011-02-19 02:47:10 +00:00
Pyun YongHyeon
a84b4e80ca Rearrange interrupt handler a bit and remove forever loop.
Previously dc(4) always checked whether there is pending interrupts
and this consumed a lot of CPU cycles in interrupt handler. Limit
the number of processing for TX/RX frames to 16. Also allow sending
frames in the loop not to starve TX under high RX load.
Reading DC_ISR register should be protected with driver lock,
otherwise interrupt handler could be run(e.g. link state change)
before the completion of dc_init_locked().

While I'm here remove unneeded code.
2011-02-19 01:37:28 +00:00
Pyun YongHyeon
76d40c8593 Send frames only when there is a valid link and driver is running
as well as controller has enough free TX descriptors.
Remove check for number of queued frames before attempting to
transmit. I guess it was added to allow draining queued frames
even if there is no link. I'm under the impression this type of
check should be done in upper layer. No other drivers in tree do
that.
2011-02-19 00:00:32 +00:00
Pyun YongHyeon
a5db292f7b Fix a long standing bug where driver handed over RX descriptor
ownership to controller before completion of access to the
descriptor. Driver is faking up status word so it should not give
ownership to controller until it completes RX processing.
2011-02-18 23:18:08 +00:00
Pyun YongHyeon
24507bc168 There is no need to execute filter configuration when driver is not
running. Remove wrong driver state change in dc_setfilt_xircom().
While I'm here nuke unnecessary assignments.
2011-02-18 23:08:05 +00:00
Pyun YongHyeon
52c43a473e Make sure to clear status word of TX descriptor in dc_list_tx_init().
Do not update if_opackets if the transmission had failed.
2011-02-18 22:58:46 +00:00
Matthew D Fleming
3a5d36716f Modify kdb_trap() so that it re-calls the dbbe_trap function as long as
the debugger back-end has changed.  This means that switching from ddb
to gdb no longer requires a "step" which can be dangerous on an
already-crashed kernel.

Also add a capability to get from the gdb back-end back to ddb, by
typing ^C in the console window.

While here, simplify kdb_sysctl_available() by using
sbuf_new_for_sysctl(), and use strlcpy() instead of strncpy() since the
strlcpy semantic is desired.

MFC after:	1 month
2011-02-18 22:25:11 +00:00
Nathan Whitehorn
79c77d726e Turn off default generation of userland dot symbols on powerpc64 now that
we have a binutils that supports it. Kernel dot symbols remain on to assist
DDB.
2011-02-18 21:44:53 +00:00
Dimitry Andric
ce8fb93178 Merge binutils 2.17.50 to head. This brings a number of improvements to
x86 CPU support, better support for powerpc64, some new directives, and
many other things.  Bump __FreeBSD_version, and add a note to UPDATING.

Thanks to the many people that have helped to test this.

Obtained from:	projects/binutils-2.17
2011-02-18 20:54:12 +00:00
Pyun YongHyeon
06d23883e7 For controllers that have TX interrupt moderation capability,
request TX completion interrupt for every 8-th frames. Previously
dc(4) requested TX completion interrupt if number of queued TX
descriptors is greater than 64. This caused a lot of TX completion
interrupt under high TX load once driver queued more than 64 TX
descriptors. It's quite normal to see more than 64 queued TX
descriptors under high TX load.
This change reduces the number of TX completion interrupts to be
less than 17k under high TX load. Because this change does not
generate TX completion interrupt for each frame, add reclaiming
transmitted buffers in dc_tick not to generate false watchdog
timeouts.
While I'm here add check for queued descriptors in dc_txeof() since
there is no more work to do when there is no pending descriptors.
2011-02-18 20:38:05 +00:00
Michael Tuexen
f0878bdcc5 Bugfix: Get per vnet sysctl variables and statistics working.
MFC after:3 months.
2011-02-18 20:30:58 +00:00
Daniel Gerzo
8d2cbd0a1a - add missing if_ devices which were missing and are available as loadable
modules too

Reviewed by:	brucec
2011-02-18 17:43:22 +00:00
Kenneth D. Merry
550e2acdfc Fix several issues with the mps(4) driver.
When the driver ran out of DMA chaining buffers, it kept the timeout for
the I/O, and I/O would stall.

The driver was not freezing the device queue on errors.

mps.c:		Pull command completion logic into a separate
		function, and call the callback/wakeup for commands
		that are never sent due to lack of chain buffers.

		Add a number of extra diagnostic sysctl variables.

		Handle pre-hardware errors for configuration I/O.
		This doesn't panic the system, but it will fail the
		configuration I/O and there is no retry mechanism.
		So the device probe will not succeed.  This should
		be a very uncommon situation, however.

mps_sas.c:	Freeze the SIM queue when we run out of chain
		buffers, and unfreeze it when more commands
		complete.

		Freeze the device queue when errors occur, so that
		CAM can insure proper command ordering.

		Report pre-hardware errors for task management
		commands.  In general, that shouldn't be possible
		because task management commands don't have S/G
		lists, and that is currently the only error path
		before we get to the hardware.

		Handle pre-hardware errors (like out of chain
		elements) for SMP requests.  That shouldn't happen
		either, since we should have enough space for two
		S/G elements in the standard request.

		For commands that end with
		MPI2_IOCSTATUS_SCSI_IOC_TERMINATED and
		MPI2_IOCSTATUS_SCSI_EXT_TERMINATED, return them
		with CAM_REQUEUE_REQ to retry them unconditionally.
		These seem to be related to back end, transport
		related problems that are hopefully transient.  We
		don't want to go through the retry count for
		something that is not a permanent error.

		Keep track of the number of outstanding I/Os.

mpsvar.h:	Track the number of free chain elements.

		Add variables for the number of outstanding I/Os,
		and I/O high water mark.

		Add variables to track the number of free chain
		buffers and the chain low water mark, as well as
		the number of chain allocation failures.

		Add I/O state flags and an attach done flag.

MFC after:	3 days
2011-02-18 17:06:06 +00:00
Kenneth D. Merry
9866848a62 In the MPS driver, during device removal processing, don't assume that
the controller firmware will return all of our commands.  Instead, keep
track of outstanding I/Os and return them to CAM once device removal
processing completes.

mpsvar.h:	Declare the new "io_list" in the mps_softc.

mps.c:		Initialize the new "io_list" in the mps softc.

mps_sas.c:	o Track SCSI I/O requests on the io_list from the
		  time of mpssas_action() through mpssas_scsiio_complete().
		o Zero out the request structures used for device
		  removal commands prior to filling them out.
		o Once the target reset task management function completes
		  during device removal processing, assume any SCSI I/O
		  commands that are still oustanding will never return
		  from the controller, and process them manually.

Submitted by:	gibbs
MFC after:	3 days
2011-02-18 17:01:57 +00:00
VANHULLEBUS Yvan
442da28aeb Fixed IPsec's HMAC_SHA256-512 support to be RFC4868 compliant.
This will break interoperability with all older versions of
FreeBSD for those algorithms.

Reviewed by:	bz, gnn
Obtained from:	NETASQ
MFC after:	1w
2011-02-18 09:40:13 +00:00
Navdeep Parhar
54e4ee7163 cxgbe(4) - NIC driver for Chelsio T4 (Terminator 4) based 10Gb/1Gb adapters.
MFC after:	3 weeks
2011-02-18 08:00:26 +00:00
Hans Petter Selasky
6f068a4313 - Make an enum for all the umidi USB transfers.
- Use the USB stack's builtin clear-stall feature.
- Wrap some long lines.
- Use memcpy() instead of bcopy().
- Use memset() instead of bzero().
- Tested applications:
	/usr/ports/audio/fluidsynth

MFC after:	7 days
Approved by:	thompsa (mentor)
2011-02-18 07:37:30 +00:00
Pyun YongHyeon
93856bdece Remove use case of DC_TX_ONE. It was used to limit queue just 1 TX
frame in DM910x controllers. In r67595(more than 10 years ago) it
was replaced to use "Store and Forward" mode and made controller
generate TX completion interrupt for every frame.
2011-02-18 03:37:53 +00:00
Pyun YongHyeon
d314ebf548 Apply special PHY initialization code for 21143 controllers before
any other media configuration. Otherwise some 21143 controller
cannot establish a link. While I'm here remove the PHY
initialization code in dc_setcfg(). Since dc_setcfg() is called
whenever link state is changed, having the PHY initialization code
in dc_setcfg() resulted in continuous link flips.
After driver resets SIA, use default SIA transmit/receive
configuration instead of disabling autosense/autonegotiation.
Otherwise, controller fails to establish a link as well as losing
auto-negotiation capability. For manual media configuration, always
configure 21143 controller with specified media to ensure media
change. This change makes ANA-6922 establish link with/without
auto-negotiation.

While I'm here be more strict on link UP/DOWN detection logic.

Many thanks to marius who fixed several bugs in initial patch and
even tested the patch on a couple of dc(4) controllers.

PR:		kern/79262
Reviewed by:	marius
Tested by:	marius
2011-02-18 02:58:09 +00:00
Pyun YongHyeon
b289c60720 When driver have to use base softc due to lack of SROM on second
port, copy SROM information from base softc as well and run SROM
parser again.  This change is necessary for some dual port
controllers to make dc(4) correctly detect PHY media based on first
port configuration table.
While I'm here add a check for validity of the base softc before
duplicating SROM contents from base softc. If driver failed to
attach to the first port it can access invalid area.

PR:		kern/79262
Reviewed by:	marius
2011-02-18 02:14:53 +00:00
Pyun YongHyeon
abe4e86598 Always check memory allocation failure. If driver encounter memory
allocation error, do not attach driver.

Reviewed by:	marius
2011-02-18 01:56:25 +00:00
Marcel Moolenaar
b2983d3006 Fix the R_ARM_ABS32 relocation implementation. The memory address
contains the addend that we need to include.

Obtained from: Juniper Networks.
Fixed by: Santhanakrishnan Balraj <sbalraj@juniper.net>
2011-02-17 19:31:21 +00:00
Adrian Chadd
7842451a3a Just be double-sure short-gi isn't being enabled in 20mhz mode. 2011-02-17 17:35:09 +00:00
Adrian Chadd
cf8d6b64e5 Disable short-GI in 20mhz mode - the hardware doesn't support this. 2011-02-17 17:31:36 +00:00
Alan Cox
e6ffa21488 Remove pmap fields that are either unused or not fully implemented.
Discussed with:	kib
2011-02-17 15:36:29 +00:00
Hans Petter Selasky
26fdf1e8b6 - Fix build of manual page and inclusion of mos driver into kernel config file.
- Fix style compliancy by wrapping some long lines in if_mos.c

Approved by:	thompsa (mentor)
2011-02-17 07:39:53 +00:00
Adrian Chadd
b7f1862c26 Add in ANI parameters for the AR9280. These aren't enabled by default
as they're likely not entirely correct, but they give people something
to toy with to compare behaviour/performance.

Disable the anti-noise part, as this apparently interferes with
RIFS. I haven't verified this.
2011-02-17 05:56:03 +00:00
Adrian Chadd
744996fcf1 Add a new parameter to selectively enable/disable the ANI operations.
This was inspired by ath9k, which disables ANI anti-noise immunity
parameter tweaking (but leaves the rest of the ANI operations alone.)
2011-02-17 05:52:53 +00:00
Adrian Chadd
4f343ec80f Call the right function. 2011-02-17 05:30:38 +00:00
Adrian Chadd
e09c8c4cd4 Properly propagate whether the channel is HT40 or not when calculating
packet duration for the ath_rate_sample module.

This doesn't affect the packet TX at all; only how much time the
sample rate module attributes to a completed TX.
2011-02-17 05:16:59 +00:00
Pyun YongHyeon
39e692013a Add initial support for RTL8401E PCIe Fast Ethernet.
PR:	154789
2011-02-16 21:59:42 +00:00
Bjoern A. Zeeb
1fb51a12f2 Mfp4 CH=177274,177280,177284-177285,177297,177324-177325
VNET socket push back:
  try to minimize the number of places where we have to switch vnets
  and narrow down the time we stay switched.  Add assertions to the
  socket code to catch possibly unset vnets as seen in r204147.

  While this reduces the number of vnet recursion in some places like
  NFS, POSIX local sockets and some netgraph, .. recursions are
  impossible to fix.

  The current expectations are documented at the beginning of
  uipc_socket.c along with the other information there.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: CK Software GmbH
  Reviewed by:  jhb
  Tested by:    zec

Tested by:	Mikolaj Golub (to.my.trociny gmail.com)
MFC after:	2 weeks
2011-02-16 21:29:13 +00:00
Adrian Chadd
917721a495 Modify the spi flash driver to allow smaller read IO sizes, but enforce
the larger, aligned write+erase sizes the driver currently implements.

This preserves write behaviour but makes the flash driver usable for things
like a read-only FFS or a geom_uzip/geom_compress .

Note that since GEOM will now return the sector size as being smaller,
writes of sector size/alignment will now fail with an EIO. Code which
writes to the flash device will have to be (for now) manually taught
about the flash write blocksize.
2011-02-16 20:07:44 +00:00
Warner Losh
33c45e47f4 Remove reading of symbols from a.out loaded files. Since we are tight
on space for clang and a.out support is only needed for /boot/loader,
they are excess bytes that serve no useful purpose other than to
support really old kernels (FreeBSD < 3.2 or so).  Prefer clang
support over support for these old kernels and remove this code.  We
gain about 100 bytes of space this way.

Reviewed by:	rdivacky@
2011-02-16 18:05:10 +00:00
Dmitry Chagin
dc4f0a9e11 To avoid excessive code duplication create wrapper for fill regs
from stack frame. Change the trap() code to use newly created function
instead of explicit regs assignment.
2011-02-16 17:50:21 +00:00
Sergey Kandaurov
4fd8408ae7 Bump dummynet module version to meet dummynet schedulers' requirements,
and thus unbreak loading dummynet.ko via /boot/loader.conf.

Reported by:	rihad <rihad att mail.ru> on freebsd-net
Approved by:	kib (mentor)
2011-02-16 15:43:35 +00:00
Yoshihiro Takahashi
894cbf138e MFi386: revision 218713
Apply a few small optimizations to boot2's code, to make it shrink a
  little further.
2011-02-16 15:20:37 +00:00
Hans Petter Selasky
1ee72beb56 Fix build breakage in if_mos.c when USB_DEBUG option is set.
Approved by:	thompsa (mentor)
2011-02-16 09:26:56 +00:00
Hans Petter Selasky
b2dce55fe9 Add support for new USB to ethernet controller:
Moschip MCS7730/MCS7830

Submitted by:	Rick van der Zwet <info@rickvanderzwet.nl>
Approved by:	thompsa (mentor)
2011-02-16 08:33:30 +00:00
Dmitry Chagin
09d6cb0a23 For realtime signals fill the sigval value. 2011-02-15 21:46:36 +00:00