Commit Graph

15653 Commits

Author SHA1 Message Date
Maxim Konovalov
91d7721c0b o ciss.ko depends on cam and pci.
PR:		kern/105989
Submitted by:	nork
MFC after:	1 month
2006-11-30 15:14:17 +00:00
Gleb Smirnoff
df79d5278f - Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on fxp_tick() callout.
2006-11-30 14:58:01 +00:00
Gleb Smirnoff
b74e67fbfb - Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on bge_tick() callout.
- Lock bge_tick() using callout_init_mtx().
2006-11-30 13:40:39 +00:00
Christian Brueffer
b3ef1381d4 Remove pre-5.3 compatibility ifdefs.
Approved by:	rwatson (mentor)
MFC after:	5 days
2006-11-29 21:42:48 +00:00
Alfred Perlstein
06a061cef3 Stop INVARIANTS panics in if_aue with a stopgap.
aue_tick calls several synchronous usb functions from a timeout(9),
this is very broken since a timeout(9) is run as an interrupt
and the usb functions tsleep.

A stopgap fix is to schedule a taskqueue task from the timeout
and defer work to that taskqueue task.
2006-11-29 19:19:44 +00:00
Andrew Gallatin
a1480dfbad Fix mxge_submit_8rx() to behave like the comments says it does,
and ensure that it copies at most 32 bytes at a time.
2006-11-29 15:30:39 +00:00
Ariff Abdullah
57d90e7fbe Fix support for Medion MD MD95257 (GPIO2 quirk).
Reported by:	Chris Tophe <cohika@gmail.com>
2006-11-29 15:15:30 +00:00
Warner Losh
674a914028 MFp4:
Preliminary support for Atmel AT45D series of DataFlash on the
	SPI bus (ok, not really a hardware bus, but a logical
	connection).  This works only for the 8MB version of the part
	due to hard coding.  Both read and write are supported.
2006-11-29 08:05:55 +00:00
Florent Thoumie
454cb2de5b Add a quirk for devices recognized as usb keyboards not to be hooked by
ukbd(4).

PR:		usb/105669
Submitted by:	Henrik Brix Andersen <henrik@brixandersen.dk>
MFC after:	1 week
2006-11-28 21:13:07 +00:00
Warner Losh
46ca0665fd Add a fake flag for write. Many drivers have started to use it and it
seems like a good idea.

Submitted by: sam
2006-11-28 06:51:36 +00:00
Marius Strobl
38ee137b26 - In rlphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
  doesn't need to be kicked anyway.
- In rlphy_status() just use if_dname instead of determining the name
  of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
  be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits and remove commented out code that just can't
  be used with RealTek PHYs.

MFC after:	2 weeks
2006-11-28 01:14:09 +00:00
Marius Strobl
f8f3badf74 - In qsphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
  doesn't need to be kicked anyway.
- Don't set MIIF_NOISOLATE so qsphy(4) can be used in configurations
  with multiple PHYs. There doesn't seem to be a problem with isolating
  QS6612 per se nor in combination with the NICs they're used with.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
  be eventually retired.
- Take advantage of mii_phy_setmedia().

Obtained from:	NetBSD (except for the first item)
MFC after:	2 weeks
2006-11-28 01:08:45 +00:00
Marius Strobl
fb58dc87ca - Don't add IFM_NONE when used in combination with pcn(4) as for MII
loopback to work PCnet chips additionally need to be placed into
  external loopback mode which pcn(4) doesn't do so far.
- In nsphy_service() just use if_dname instead of determining the name
  of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Don't set MIIF_NOISOLATE, except for when used in combination with a
  NIC that wedges when isolating the PHYs, so nsphy(4) can be used in
  configurations with multiple PHYs.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
  be eventually retired.
- Take advantage of mii_phy_setmedia() (requires the MIIF_FORCEANEG
  added in sys/dev/mii/mii_physubr.c 1.26, sys/dev/mii/miivar.h 1.19).
- Implement a separate nsphy_reset(). There are two reasons for this:
  1) This PHY can take an inordinate amount of time to reset if media
     is attached; under fairly normal circumstances up to nearly one
     second. This is because it appears to go through an implicit auto-
     negotiation cycle as part of the reset.
  2) During reset and auto-negotiation, the BMCR will clear the reset
     bit before the process is complete. It will return 0 until the
     process is complete and it's safe to access the PHY again.

  This is the first of two changes required to make the combination of
  Am79c971 and DP83840A found on certain HP cards and on-board in IBM
  machines work.
- Fix some whitespace nits.

Based on:	NetBSD (except for the first and second item)
MFC after:	2 weeks
2006-11-28 01:01:02 +00:00
Marius Strobl
1f4308521e - Rely on mii_phy_add_media() setting mii_anegticks as appropriate.
- Fix some whitespace nits.

MFC after:	2 weeks
2006-11-28 00:47:54 +00:00
Marius Strobl
79c8bb63d4 - Don't set MIIF_NOISOLATE so lxtphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
  LXT970 per se nor in combination with the NICs they're used with and
  lxtphy(4) was already adding IFM_NONE anyway.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
  be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits.

Obtained from:	NetBSD
MFC after:	2 weeks
2006-11-28 00:45:48 +00:00
Marius Strobl
19e9da2099 - Remove a dupe $FreeBSD$.
- Fix some whitespace nits.
2006-11-28 00:43:38 +00:00
Warner Losh
7c8a068553 Remove unused leftovers. 2006-11-28 00:05:04 +00:00
Marius Strobl
9475e904d6 Analogous to mii_add_media(), factor out the code for checking whether
the BMSR contains any media at all to mii_phy_add_media(). The majority
of the drivers currently using mii_phy_add_media() were missing such a
check anyway though.

MFC after:	2 weeks
2006-11-27 23:50:19 +00:00
Marius Strobl
0c3e319244 - Add a MIIF_FORCEANEG flag which forces an auto-negotiation to always
take place if IFM_AUTO is selected. This allows drivers like nsphy(4),
  which need to force writing the ANAR according to the BMSR, to take
  advantage of mii_phy_setmedia(). [1]
- In mii_phy_reset() once the current media is set don't isolate the PHY
  corresponding to the instance of the currently selected media rather
  than unconditionally not isolating the PHY corresponding to instance 0.
  This saves a isolation-unisolation-cycle of the PHY corresponding to
  the currently selected media for the case were it isn't instance 0.
- Fix some whitespace nits. [1]

Obtained from:	NetBSD [1]
MFC after:	2 weeks
2006-11-27 23:37:59 +00:00
Doug Barton
ea69d32d60 Write the short vendor name in ALL CAPS, since it will become
a #define.

Submitted by:	brooks
2006-11-27 20:33:13 +00:00
Marius Strobl
10d8cebc7a Refine the previous change to only call bus_dmamap_sync() in case of
an URQ_REQUEST when DMA segments are passed to usbd_start_transfer();
when the request doesn't include the optional data buffer the size of
the transfer (xfer->length) is 0, in which case usbd_transfer() won't
create a DMA map but call usbd_start_transfer() with no DMA segments.
With the previous change this could result in the bus_dmamap_sync()
implementation dereferencing the NULL-pointer passed as the DMA map
argument.
While at it fix what appears to be a typo in usbd_start_transfer();
in order to determine wheter usbd_start_transfer() was called with
DMA segments check whether the number of segments is > 0 rather than
the pointer to them being > 0.

OK'ed by:	imp
2006-11-27 18:39:02 +00:00
Ariff Abdullah
a799d1cd22 - LNV -> LENOVO
- Fix support for Samsung Q1 UltraMobile PC (inverted EAPD).

Reported by:	benno
2006-11-27 06:16:36 +00:00
David E. O'Brien
7597761a50 Fix TX/RX checksum offload.
Submitted by:	Peer Chen at nVIDIA
2006-11-27 04:47:27 +00:00
David E. O'Brien
30ce3a1229 Reformat to KNF after revision 1.12. 2006-11-27 00:23:59 +00:00
David E. O'Brien
6124fe214e Fix the jumbo frame support.
Submitted by:	Peer Chen at nVIDIA (reworked by me)
2006-11-27 00:16:47 +00:00
David E. O'Brien
a0f9e922a7 Grrr. new .vimrc file is really giving me trouble.. get the whitespace right. 2006-11-27 00:10:00 +00:00
David E. O'Brien
96058696ac Fix editor fatfingering in rev 1.9. 2006-11-27 00:05:18 +00:00
David E. O'Brien
9565e1fac5 nfe_stop() requires lock to be held when calling. 2006-11-26 23:11:53 +00:00
Ariff Abdullah
a580b31a54 Welcome to Once-a-year Sound Mega-Commit. Enjoy numerous updates and fixes
in every sense.

General
-------

- Multichannel safe, endian safe, format safe
   * Large part of critical pcm filters such as vchan.c, feeder_rate.c,
     feeder_volume.c, feeder_fmt.c and feeder.c has been rewritten so that
     using them does not cause the pcm data to be converted to 16bit little
     endian.
   * Macrosses for accessing pcm data safely are defined within sound.h in
     the form of PCM_READ_* / PCM_WRITE_*
   * Currently, most of them are probably limited for mono/stereo handling,
     but the future addition of true multichannel will be much easier.

- Low latency operation
  * Well, this require lot more works to do not just within sound driver,
    but we're heading towards right direction. Buffer/block sizing within
    channel.c is rewritten to calculate precise allocation for various
    combination of sample/data/rate size. As a result, applying correct
    SNDCTL_DSP_POLICY value will achive expected latency behaviour simmilar
    to what commercial 4front driver do.
  * Signal handling fix. ctrl+c of "cat /dev/zero > /dev/dsp" does not
    result long delay.
  * Eliminate sound truncation if the sound data is too small.
    DIY:
      1) Download / extract
         http://people.freebsd.org/~ariff/lowlatency/shortfiles.tar.gz
      2) Do a comparison between "cat state*.au > /dev/dsp" and
         "for x in state*.au ; do cat $x > /dev/dsp ; done"
         - there should be no "perceivable" differences.
    Double close for PR kern/31445.

  CAVEAT: Low latency come with (unbearable) price especially for poorly
          written applications. Applications that trying to act smarter
	  by requesting (wrong) blocksize/blockcount will suffer the most.
	  Fixup samples/patches can be found at:
	  http://people.freebsd.org/~ariff/ports/

- Switch minimum/maximum sampling rate limit to "1" and "2016000" (48k * 42)
  due to closer compatibility with 4front driver.
  Discussed with: marcus@ (long time ago?)

- All driver specific sysctls in the form of "hw.snd.pcm%d.*" have been
  moved to their own dev sysctl nodes, notably:
  hw.snd.pcm%d.vchans -> dev.pcm.%d.vchans
  Bump __FreeBSD_version.

Driver specific
---------------

- Ditto for sysctls.

- snd_atiixp, snd_es137x, snd_via8233, snd_hda
  * Numerous cleanups and fixes.
  * _EXPERIMENTAL_ polling mode support using simple callout_* mechanisme.
   This was intended for pure debugging and latency measurement, but proven
   good enough in few unexpected and rare cases (such as problematic shared
   IRQ with GIANT devices - USB). Polling can be enabled/disabled through
   dev.pcm.0.polling. Disabled by default.

- snd_ich
  * Fix possible overflow during speed calibration. Delay final
    initialization (pcm_setstatus) after calibration finished.
    PR: kern/100169
    Tested by: Kevin Overman <oberman@es.net>
  * Inverted EAPD for few Nec VersaPro.
    PR: kern/104715
    Submitted by: KAWATA Masahiko <kawata@mta.biglobe.ne.jp>

Thanks to various people, notably Joel Dahl, Yuriy Tsibizov, Kevin Oberman,
those at #freebsd-azalia @ freenode and others for testing.

Joel Dahl will do the manpage update.
2006-11-26 12:24:06 +00:00
Alexander Leidinger
4bc4dc4c4b MFP4 (109713):
Add OSS_GETVERSION ioctl for compatibility.

Some ports expect this and fail to compile on -current ATM.

Submitted by:	ryanb
2006-11-26 11:55:48 +00:00
Poul-Henning Kamp
a5d7a1aed7 Add entry and no-UHID quirk for I-tuner networks USB-LCD 2x20 as found
in http://www.mini-box.com/Mini-Box-M200-LCD
2006-11-26 11:07:37 +00:00
Sam Leffler
0553a01f53 mark tx/rx descriptors COHERENT; we do not sync changes so on
architectures like arm this is necessary

MFC after:	1 month
2006-11-24 22:45:26 +00:00
Doug Barton
4b15724254 I mistakenly committed the wrong version of my patch (sorry).
s/O2/O2Micro, as that's how they seem to prefer it, and remove
what is now one blank line too many.
2006-11-24 06:51:49 +00:00
Kip Macy
3d229d50ab remove no longer correct comment above em_read_pcie_cap_reg 2006-11-23 05:48:13 +00:00
Kip Macy
21e3069792 Move magic PCIe workaround constant to header - add appropriate comment
Suggested by: jfvogel
2006-11-23 05:43:39 +00:00
Doug Barton
e3e0cf8246 Add a vendor ID for O2Micro, obtained from
http://www.usb.org/developers/tools

Add a product ID for the Dell TrueMobile 350 Bluetooth USB Adapter
obtained from NetBSD's usbdevs file.
2006-11-23 00:58:40 +00:00
Kip Macy
af088c45e8 Fix TSO support on sun4v
- incorporate csjp's fix for a mishandled endian conversion
- convert PAGE_SIZE to 4096 for PCIe adapter workaround (my page size is not 4k)
- implement em_read_pcie_cap_reg where we set the max read size on pcie to 4k (taken from mxge)

Reviewed by: scottl and jfvogel
2006-11-23 00:52:52 +00:00
Sam Leffler
0a0b5b012d add codes for Atheros USB devices; shuffle one ural code to
avoid conflict

Obtained from:	openbsd
MFC after:	1 month
2006-11-23 00:50:48 +00:00
Andrew Gallatin
a8ebcb1bc0 Fix transposition of width and value arguments to pci_config_write()
when setting up the read request size.

Pointed out by: kmacy
2006-11-22 18:47:24 +00:00
Warner Losh
5128f7357c Fix coherency issue. From submitter:
I have been debugging the usb problems some more. Your were
	right in your assumption (thanks for the pointer) about lack
	of calls to bus_dmamap_sync().  In usbdi.c bus_dmamap_sync()
	does get used for transfers that move data from PC to USB and
	it is used for transfers that move data from USB to PC. But
	someone forgot that control transfers consist of possibly two
	data chunks : the request itself and optionally a buffer of
	data that should be transfered to or from the USB device.  On
	requests to the control endpoint without additional data
	bus_dmamap_sync() didn't get called. For some reason my first
	tests with umass worked (due to enough cache poisening I
	guess).  The attached patch adds a call to bus_dmamap_sync()
	to usbdi.c and now all devices I have tried work out of the
	box.  I have successfully transfered large files using the
	if_axe driver and I have mounted several different umass
	devices.

submitted by: Daan Vreeken
sponsored by: Vitsch Electronics
reviewed by: cognet@
2006-11-22 17:56:36 +00:00
Andrew Gallatin
d91b1b4976 Initialization bugfixes and enhancements:
- Fix bug preventing adoption of running firmware
- Set PCIe max read request size to 4KB
- Read PCIe link width from config space
- Assume aligned completions from the southbridge ports
  of intel E5000 chips
- Use aligned firmware when link width is x4 or less
- Add hw.mxge.force_firmware tunable to allow user to force
  selection of aligned (or unaligned) firmware
2006-11-22 16:33:40 +00:00
Warner Losh
0fdb9239c4 MFp4: Add ixpiic bit-bang driver.
Submitted by: sam@
2006-11-22 06:41:37 +00:00
Warner Losh
64e043166e <blush> copyout on read, not write.
Tweak a comment while I'm here.
2006-11-22 06:03:39 +00:00
Doug Barton
79506f19fb Acknowledge (dearly) departed files 2006-11-21 22:29:06 +00:00
Andrew Gallatin
dc8731d4d2 Added MSI support.
Sponsored by: Myricom Inc.
2006-11-21 15:55:01 +00:00
John-Mark Gurney
b318e84967 don't mark the cksum as invalid here... off is incorrect when we get
here, it's either unset, or it's valid, so we don't need to do anything
different...

Reported by:	Neterion (via rwatson)
2006-11-21 05:46:09 +00:00
Pyun YongHyeon
b61178a956 Fix typo. 2006-11-21 05:41:11 +00:00
Pyun YongHyeon
dc74159da6 Add TSO support.
Tested by:	wilko,  Pieter de Goeje < pieter AT degoeje DOT nl >
2006-11-21 04:40:30 +00:00
Pyun YongHyeon
960fd5b3d0 o Correctly set IFCAP_VLAN_HWCSUM as re(4) can do VLAN tagging/checksum
offloading in hardware.
o Correctly set media header length for VLAN.
2006-11-21 04:23:52 +00:00
Pyun YongHyeon
19ecd2310c Don't set RL_CFG1_FULLDUPLEX bit. The RL_CFG1_FULLDUPLEX bit in
config register 1 is only valid on 8129.
2006-11-21 04:14:44 +00:00
John Baldwin
6daee769f4 Add suspend/resume support. Unlike many other NIC drivers,
bfe_init_locked() wasn't sufficient to bring the chip back to life, it also
required a call to bfe_chip_reset() during resume.

Tested by:	Stepan Zastupov +redchrom at gmail+
MFC after:	1 week
2006-11-20 23:30:07 +00:00
Marius Strobl
61e5f5471e - Make rp(4) 64-bit- and endian-clean as well as work on strict alignment
archs. [1]
- Instead of bus_space_{read,write}*(rman_get_bustag(), rman_get_bushandle())
  use bus_{read,write}*() for efficiency.

Reported by:	Peter Losher [1]
Tested on:	i386, sparc64
MFC after:	2 weeks
2006-11-20 12:59:27 +00:00
Sam Leffler
7ca00fac3a o define transfer method
o attach ds1672 and ad7418, to be cleaned up

MFC after:	1 month
2006-11-19 23:42:32 +00:00
Sam Leffler
10cb662ae4 i2c and clock driver for Dallas Semiconductor DS1672 RTC
MFC after:	1 month
2006-11-19 23:40:58 +00:00
Sam Leffler
6931296a79 i2c driver for Analog Devices AD7418
MFC after:	1 month
2006-11-19 23:39:54 +00:00
Matt Jacob
96dc1a5335 Pointy hat handed to me by Andrew: had msi_enable on as a default. 2006-11-19 23:24:52 +00:00
Matt Jacob
804625ee9c Play it safe and make MSI and MSI-X an option you have to turn on for MPT. 2006-11-19 23:15:42 +00:00
Matt Jacob
21167708e8 If a TMF request fails to start, make sure that we pull it off the
pending list and set the state back to free prior to calling mpt_reset
so we don't panic at a later point.
2006-11-19 23:13:12 +00:00
Christian S.J. Peron
90d4d36094 Implement new ETHER_BPF_MTAP macro. Roll back the various changes
made to accommodate the chip being in promiscuous mode while
offloading VLAN tag processing to the hardware.  We can now
properly handle the absence of VLAN tags from hardware stripping.

Reviewed by:	rwatson, andre
MFC after:	1 month
2006-11-18 23:18:43 +00:00
Scott Long
3c77cee1ba Change the internal API for polled commands. Calling mfi_polled_command
after calling mfi_mapcmd is no longer needed, so long as the MFI_CMD_POLLED
flag is set.  This change eliminates the possibility of a polled command
getting posted twice to the driver.  This is turn fixes panics on shutdown
when INVARIANTS is set.

Sponsored by: Ironport
2006-11-18 07:33:53 +00:00
Matt Jacob
04697f7aa3 Make the SAN login/logout stuff more common between different chipsets
and provied an isp_control entry point so that the outer layers can
do PLOGI/LOGO explicitly. Add MS IOCB support. This completes the cycle
for base support for SMI-S.
2006-11-18 03:53:16 +00:00
Matt Jacob
6301ffe515 Disable code to set max read byte count on the 2400.
It caused a panic in writing the config register on a system. Turn
it off until we take the time to understand it.

Reported by and Testing by: Anton
2006-11-17 17:32:45 +00:00
David E. O'Brien
9ae2249db2 Missed two nits in rev 1.7. 2006-11-17 16:49:40 +00:00
Søren Schmidt
72a426ba26 Deal more generically with the byteswap needed on !littleendian HW.
Account for the odd layout on ARM bigendian HW.
2006-11-17 11:13:47 +00:00
Matt Jacob
52c008534d *smack* - forgot to do i386 compile, so last
commit broke things.
2006-11-17 00:19:55 +00:00
Matt Jacob
757cabc30b Finally fix local command responses to set residual correctly.
This allows us to play nicely on SANs when we have target mode
enabled in f/w but have neither the scsi_targbh enabled or
scsi_targ with a target enabled.
2006-11-16 23:47:16 +00:00
John Baldwin
3bea4efeb1 Look for capabilities in PCI-PCI bridges using the same CAP PTR register
as for type 0 devices.

Submitted by:	grehan
MFC after:	1 week
2006-11-16 17:31:33 +00:00
Ruslan Ermilov
5a66b66324 Replace magic numbers for console bell types with defines. 2006-11-16 12:27:51 +00:00
Scott Long
46222d084a Due to an incorrect macro, it appears that this driver has always been
accidentally truncating off the VLAN tag field in the TX descriptor.  Fix
this by splitting up the vlan_tag and flags fields into separate fields,
and handling them appropriately.

Sponsored by: Ironport
MFC After: 3 days
2006-11-16 06:28:54 +00:00
John Polstra
6e7b2160a4 In bce_start_locked, check the used_tx_bd count rather than the
descriptor's mbuf pointer to see if the transmit ring is full.  The
mbuf pointer is set only in the last descriptor of a
multi-descriptor packet.  By relying on the mbuf pointers of the
earlier descriptors, the driver would sometimes overwrite a
descriptor belonging to a packet that wasn't completed yet.  Also,
tx_chain_prod wasn't updated inside the loop, causing the wrong
descriptor to be checked after the first iteration.  The upshot of
all this was the loss of some transmitted packets at medium to high
packet rates.

In bce_tx_encap, remove a couple of old statements that shuffled
around the tx_mbuf_map pointers.  These now correspond 1-to-1 with
the transmit descriptors, and they are not supposed to be changed.

Correct a couple of inaccurate comments.

MFC after:	1 month
2006-11-16 04:04:07 +00:00
Matt Jacob
eba891af5b After tests on 2 different AMD platforms with several
different cards (SAS, 4Gb FC), MSI seems to work with
the cards.

This was of some concern because some  PCI cards
claim to work with MSI but don't.
2006-11-16 02:40:18 +00:00
Matt Jacob
2cad1d9857 Increase the timeout for some SAN commands.
Only complain about FC Reponse errors if they're nonzero.

Shorten some PortID printouts for local loop.

Add an internal isp_xcmd_t data structure which we'll use for some
CT-Passthru support as part of adding SMI-S.
2006-11-16 00:39:56 +00:00
Matt Jacob
e49f99cd9f minor change to reduce some diff noise 2006-11-16 00:31:46 +00:00
John Birrell
3f970273b1 Add big endian support.
Submitted by:	scottl
Reviewed by:	mjacob
2006-11-15 21:46:36 +00:00
John Birrell
c686bf2237 Get the parent dma tag if one exists. This is required on sun4v. Other
arches will default to NULL if they have no parent.

Reviewed by: mjacob
2006-11-15 21:41:59 +00:00
Matt Jacob
4f914ffd1d Turn off MSI until some testing is done. 2006-11-15 20:18:09 +00:00
John Baldwin
280388afe5 Add MSI support to em(4), bce(4), and mpt(4). For now, we only support
devices that support a maximum of 1 message, and we use that 1 message
instead of the INTx rid 0 IRQ with the same interrupt handler, etc.
2006-11-15 20:04:57 +00:00
Maxim Konovalov
9aab0d96da o Add uark(4), a driver for Arkmicro Technologies ARK3116 based serial
adapters.

Submitted by:	Alex Rodin
Obtained from:	OpenBSD
Reviewed by:	-usb
MFC after:	6 weeks
2006-11-15 09:13:25 +00:00
Rink Springer
597d4fe47d Added yet another extra fxp(4) PCI ID.
PR:		kern/104896
Submitted by:	Yoshihiko Sarumaru <mistral@imasy.or.jp>
Reviewed by:	imp (mentor), jfv
Approved by:	imp (mentor)
MFC after:	3 days
2006-11-14 18:54:31 +00:00
John Baldwin
60b9b19721 Fix a couple of comment typos.
Reported by:	ru
2006-11-14 17:54:55 +00:00
Doug Ambrisko
c2be47f25f - Add in FreeBSD native ioctl that models the Linux version.
- Add a translation so the Linux ioctl's don't conflict with
  the FreeBSD definition.
- Assume Linux 32bit emulation on amd64.
This was tested on i386 and amd64 with the 32bit Linux MegaCli.
Eventually we should do a 32bit native FreeBSD translation app.
2006-11-14 16:48:00 +00:00
Matt Jacob
f7c631bcf0 Push things closer to path failover by implementing loop down and
gone device timers and zombie state entries. There are tunables
that can be used to select a number of parameters.

loop_down_limit - how long to wait for loop to come back up before
declaring
all devices dead (default 300 seconds)

gone_device_time- how long to wait for a device that has appeared
to leave the loop or fabric to reappear (default 30 seconds)

Internal tunables include (which should be externalized):

quick_boot_time- how long to wait when booting for loop to come up

change_is_bad- whether or not to accept devices with the same
WWNN/WWPN that reappear at a different PortID as being the 'same'
device.

Keen students of some of the subtle issues here will ask how
one can keep devices from being re-accepted at all (the answer
is to set a gone_device_time to zero- that effectively would
be the same thing).
2006-11-14 08:45:48 +00:00
John Baldwin
9bf4c9c1b0 First cut at MI support for PCI Message Signalled Interrupts (MSI):
- Add 3 new functions to the pci_if interface along with suitable wrappers
  to provide the device driver visible API:
  - pci_alloc_msi(dev, int *count) backed by PCI_ALLOC_MSI().  '*count'
    here is an in and out parameter.  The driver stores the desired number
    of messages in '*count' before calling the function.  On success,
    '*count' holds the number of messages allocated to the device.  Also on
    success, the driver can access the messages as SYS_RES_IRQ resources
    starting at rid 1.  Note that the legacy INTx interrupt resource will
    not be available when using MSI.  Note that this function will allocate
    either MSI or MSI-X messages depending on the devices capabilities and
    the 'hw.pci.enable_msix' and 'hw.pci.enable_msi' tunables.  Also note
    that the driver should activate the memory resource that holds the
    MSI-X table and pending bit array (PBA) before calling this function
    if the device supports MSI-X.
  - pci_release_msi(dev) backed by PCI_RELEASE_MSI().  This function
    releases the messages allocated for this device.  All of the
    SYS_RES_IRQ resources need to be released for this function to succeed.
  - pci_msi_count(dev) backed by PCI_MSI_COUNT().  This function returns
    the maximum number of MSI or MSI-X messages supported by this device.
    MSI-X is preferred if present, but this function will honor the
    'hw.pci.enable_msix' and 'hw.pci.enable_msi' tunables.  This function
    should return the largest value that pci_alloc_msi() can return
    (assuming the MD code is able to allocate sufficient backing resources
    for all of the messages).
- Add default implementations for these 3 methods to the pci_driver generic
  PCI bus driver.  (The various other PCI bus drivers such as for ACPI and
  OFW will inherit these default implementations.)  This default
  implementation depends on 4 new pcib_if methods that bubble up through
  the PCI bridges to the MD code to allocate IRQ values and perform any
  needed MD setup code needed:
  - PCIB_ALLOC_MSI() attempts to allocate a group of MSI messages.
  - PCIB_RELEASE_MSI() releases a group of MSI messages.
  - PCIB_ALLOC_MSIX() attempts to allocate a single MSI-X message.
  - PCIB_RELEASE_MSIX() releases a single MSI-X message.
- Add default implementations for these 4 methods that just pass the
  request up to the parent bus's parent bridge driver and use the
  default implementation in the various MI PCI bridge drivers.
- Add MI functions for use by MD code when managing MSI and MSI-X
  interrupts:
  - pci_enable_msi(dev, address, data) programs the MSI capability address
    and data registers for a group of MSI messages
  - pci_enable_msix(dev, index, address, data) initializes a single MSI-X
    message in the MSI-X table
  - pci_mask_msix(dev, index) masks a single MSI-X message
  - pci_unmask_msix(dev, index) unmasks a single MSI-X message
  - pci_pending_msix(dev, index) returns true if the specified MSI-X
    message is currently pending
- Save the MSI capability address and data registers in the pci_cfgreg
  block in a PCI devices ivars and restore the values when a device is
  resumed.  Note that the MSI-X table is not currently restored during
  resume.
- Add constants for MSI-X register offsets and fields.
- Record interesting data about any MSI-X capability blocks we come
  across in the pci_cfgreg block in the ivars for PCI devices.

Tested on:	em (i386, MSI), bce (amd64/i386, MSI), mpt (amd64, MSI-X)
Reviewed by:	scottl, grehan, jfv
MFC after:	2 months
2006-11-13 21:47:30 +00:00
Florent Thoumie
a47ca15be9 Fix USB printer Xerox WorkCentre M15 adding a quirk to bypass
reported bidirectional functionality.

PR:		usb/104704
Submitted by:	Eygene <rea-fbsd@codelabs.ru>
X-MFC after:	6.2-RELEASE
2006-11-11 23:53:25 +00:00
John-Mark Gurney
ee03a332df fix hanging on invalid data... (This doesn't fix hanging due to broken
hardware)...

Tested by:	Ian Dowse, Adam K Kirchhoff and Vladimir Kushnir
2006-11-09 21:05:32 +00:00
John Baldwin
2604383634 Don't try to print a NULL string during boot. If a device doesn't have a
valid name yet, just omit the name during the bootverbose printfs.

MFC after:	1 week
2006-11-09 18:04:53 +00:00
John Baldwin
67b712deec Reformat the bootverbose messages that dump out the status of pci_link
devices during attach to be more compact.

MFC after:	1 week
2006-11-09 18:01:20 +00:00
Gleb Smirnoff
c1a9c63621 Instead of using the legacy if_timer/if_watchdog interface create
our own watchdog that piggybacks on the em_local_timer() routine.

We suppose that the if_timer/if_watchdog interface should be
obsoleted, since it doesn't fit the modern SMP network stack.
NIC drivers should create their own watchdogs, that check and
clear the timers always holding driver's lock.

In collaboration with:	jfv, scottl
2006-11-09 16:00:18 +00:00
Kevin Lo
afe898bca2 Remove unused structures.
Reviewed by: cognet and imp
Approved by: cognet and imp
2006-11-09 02:19:30 +00:00
John Baldwin
fa6f748fe3 Fix some edge cases in detach (including attach failures):
- Only call iwi_stop() if we got far enough along in iwi_attach() to
  alloc an ifnet.
- Release the firmware after stopping the interface and detaching the
  ifnet.

MFC after:	1 month
Reviewed by:	sam
2006-11-07 19:03:42 +00:00
John Baldwin
d65926888d Various whitespace cleanups. 2006-11-07 18:55:51 +00:00
Ruslan Ermilov
4f32adad48 Sometimes the vty switching has to be delayed; the vty
to be switched to is saved in sc->delayed_next_scr and
the actual switch is performed later.  It was possible
to get into the endless loop when attempting to switch
to a closed vty (which is not allowed and beep-alerted
when attempted) and when the visual beep was in effect.
This caused sc->delayed_next_scr to never be reset and
endless attempts to switch to a closed vty and endless
visual beeping.  How to repeat:

- boot into single-user
- run "kbdcontrol -b visual"
- quickly press Alt+F2 two times

PR:		kern/68016
X-MFC after:	6.2-RELEASE
2006-11-06 19:06:07 +00:00
Robert Watson
43593547a3 Add missing includes of priv.h. 2006-11-06 17:43:10 +00:00
Robert Watson
acd3428b7d Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges.  These may
require some future tweaking.

Sponsored by:           nCircle Network Security, Inc.
Obtained from:          TrustedBSD Project
Discussed on:           arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
                        Alex Lyashkov <umka at sevcity dot net>,
                        Skip Ford <skip dot ford at verizon dot net>,
                        Antoine Brodin <antoine dot brodin at laposte dot net>
2006-11-06 13:42:10 +00:00
Rink Springer
42a4336a90 Added PCI ID's for:
- 0x1065: Intel 82562ET/EZ/GT/GZ PRO/100 VE Ethernet [1], as found on
  Tyan GS14 barebones.
- 0x1094: Intel Pro/100 946GZ (ICH7) Network Connection [2], as found on
  Intel 946GZis motherboards.

[1] Submitted by:	myself
[2] Submitted by:	Mike Tancsa <mike@sentex.net>
Reviewed by:		imp (mentor), jfv
Approved by:		imp (mentor)
MFC after:		3 days
2006-11-06 12:19:43 +00:00
Takanori Watanabe
7687221959 Prevent freeing wild pointer when bailing out. 2006-11-06 12:14:27 +00:00
Warner Losh
8e6c8e8c0c Doh! Actually commit checking against NULL for res.
Noticed by: dougb@
2006-11-04 06:56:51 +00:00
Scott Long
eae94b6727 Add PCI Id for ServeRAID 8k.
Submitted by: Danny Braniss
2006-11-03 04:57:23 +00:00
Matt Jacob
162eef1f09 Fix some negotiation issues (like not being able to negotiate async) 2006-11-02 23:19:00 +00:00
Matt Jacob
d993cb4daf add some missing MPT<>CAM and CAM<>MPT bogolocks 2006-11-02 23:18:25 +00:00
Matt Jacob
98981e638f Use 2K Login f/w. 2006-11-02 03:23:01 +00:00
Matt Jacob
10365e5a68 Add 4Gb (24XX) support and lay the foundation for a lot of new stuff. 2006-11-02 03:21:32 +00:00
Matt Jacob
bd3fd815a7 2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default.

Reviewed by multitudes.
2006-11-02 00:54:38 +00:00
Marius Strobl
9e264172bd Remove <sys/types.h>; including both <sys/param.h> and <sys/types.h>
violates style(9).
2006-11-02 00:05:15 +00:00
Marius Strobl
65deb9d947 - In sunkbd_probe_keyboard() don't bother to determine the keyboard layout
as we have no use for that info. Instead let this function return the
  keyboard ID and verify at its invocation in sunkbd_configure() that we're
  talking to a Sun type 4/5/6 keyboard, i.e. a keyboard supported by this
  driver.
- Add an option SUNKBD_EMULATE_ATKBD whose code is based on the respective
  code in ukbd(4) and like UKBD_EMULATE_ATSCANCODE causes this driver to
  emit AT keyboard/KB_101 compatible scan codes in K_RAW mode as assumed by
  kbdmux(4). Unlike UKBD_EMULATE_ATSCANCODE, SUNKBD_EMULATE_ATKBD also
  triggers the use of AT keyboard maps and thus allows to use the map files
  in share/syscons/keymaps with this driver at the cost of an additional
  translation (in ukbd(4) this just is the way of operation).
- Implement an option SUNKBD_DFLT_KEYMAP, which like the equivalent options
  of the other keyboard drivers allows to specify the default in-kernel
  keyboard map. For obvious reasons this made to only work when also using
  SUNKBD_EMULATE_ATKBD.
- Implement sunkbd_check(), sunkbd_check_char() and sunkbd_clear_state(),
  which are also required for interoperability with kbdmux(4).
- Implement K_CODE mode and FreeBSD keypad compose.
- As a minor hack define KBD_DFLT_KEYMAP also in the !SUNKBD_EMULATE_ATKBD
  case so we can obtain fkey_tab from <dev/kbd/kbdtables.h> rather than
  having to duplicate it and #ifdef some more code.
- Don't use the TX-buffer for writing the two command bytes for setting the
  keyboard LEDs as this consequently requires a hardware FIFO that is at
  least two bytes in depth, which the NMOS-variant of the Zilog SCCs doesn't
  have. Thus use an inlined version of uart_putc() to consecutively write
  the command bytes (a cleaner approach would be to do this via the soft
  interrupt handler but that variant wouldn't work while in ddb(4)). [1]
- Fix some minor style(9) bugs.

PR:		90316 [1]
Reviewed by:	marcel [1]
2006-11-02 00:01:15 +00:00
Pawel Jakub Dawidek
a777323904 Style nits. 2006-11-01 18:59:06 +00:00
Pawel Jakub Dawidek
5541f25ec7 Fix md(4) panic which occurs when I/O request different than
BIO_READ/BIO_WRITE is sent to vnode-backed provider (BIO_DELETE or
BIO_FLUSH).

Reported by:	ceri

Add support for BIO_FLUSH to vnode-backed md(4) devices based on
VOP_FSYNC().
2006-11-01 18:56:18 +00:00
John Baldwin
186d340f75 Fix compile botch in the last panic botch fix. :(
Pointy hat:	jhb
Reported by:	brueffer
2006-11-01 18:24:12 +00:00
John Baldwin
8d7b3b9566 Fix botch in last commit (I tested on 6.x which doesn't have TSO):
- Test the mac_type rather than if_hwassist (since ifp doesn't exist yet)
  to determine if the adapter supports TSO and thus to change the sizes
  for the bus_dma tag.

Reviewed by:	glebius
2006-11-01 15:36:47 +00:00
Kevin Lo
c0348f2e02 Document the cdp for controlling CD power.
Approved by: cognet
2006-11-01 03:45:24 +00:00
Pawel Jakub Dawidek
9cd394ea96 Implement BIO_FLUSH handling for da(4), amr(4), ata(4) and ataraid(4).
Sponsored by:	home.pl
2006-10-31 21:19:25 +00:00
John Baldwin
77cae244f8 Allocate receive and transmit data structures during attach() and free them
during detach() similar to other NIC drivers rather than allocating them
during init() and freeing them during stop():
- Move creation of tx bus_dma tag amd maps and tx_buffer_area from
  em_setup_transmit_structures() to em_allocate_transmit_structures().
- Call em_allocate_xxx_structures() in em_attach().
- Only call em_free_xxx_structures() in em_detach().
- Change em_setup_xxx_structures() to free any existing tx or rx buffers
  and in the case of rx repopulate the ring with newer buffers.

Reviewed by:	jfv
2006-10-31 17:21:14 +00:00
John Baldwin
7b2d1aabb1 - Use callout_init_mtx() to close various callout-related races.
- Drain the two timers in detach.
- Check IFF_DRV_RUNNING in the link task and bail w/o doing anything if
  it is clear.

Reviewed by:	jfv, scottl
2006-10-31 17:05:02 +00:00
Gleb Smirnoff
72f0301fef Rework the transmit register handling. In em_encap() store index of
the EOP descriptor in the first descriptor of the packet. And then
in em_txeof() search for DD bits set only in the EOP descriptors,
embedding the cleanup of all packet's descriptors into inner loop.

This change is important for future chips, where DD bit is going
to be set only on the EOP descriptors.

Submitted by:	jfv
2006-10-31 16:19:21 +00:00
John Baldwin
223eee05e4 Remove unused softc pointer variable from the probe routine.
CID:		1560
Found by:	Coverity Prevent (tm)
2006-10-31 16:13:38 +00:00
Gleb Smirnoff
7c007dd329 Merge new vendor release - 6.2.9.
Details:
o if_em.c changes:
  - Added several new PCI ids.
  - Check em_check_phy_reset_block() before doing SIOCSIFMEDIA ioctl.
  - Don't touch TARC registers, they are now handled in shared
    code in if_em_hw.c.
  - Move RDH and RDT setting to the end of
    em_initialize_receive_unit().
  - Declare em_read_pcie_cap_reg(), now empty.
o if_em_hw.c dropped in from vendor, then restored rev. 1.15.
o if_em_hw.h dropped in from vendor, then modified:
  - Added RX overrun interrupt flag to interrupt enable mask.
  - Remove declarations of em_io_read(), em_io_write().

Approved by:	jfv
2006-10-31 15:00:14 +00:00
Matt Jacob
fa9ed86506 The first of 3 major steps to move the CAM layer forward to using
the CAM_NEW_TRAN_CODE that has been in the tree for some years now.

This first step consists solely of adding to or correcting
CAM_NEW_TRAN_CODE pieces in the kernel source tree such
that a both a GENERIC (at least on i386) and a LINT build
with CAM_NEW_TRAN_CODE as an option will compile correctly
and run (at least with some the h/w I have).

After a short settle time, the other pieces (making
CAM_NEW_TRAN_CODE the default and updating libcam
and camcontrol) will be brought in.

This will be an incompatible change in that the size of structures
related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change
in both size and content. However, basic system operation and
basic system utilities work well enough with this change.

Reviewed by:	freebsd-scsi and specific stakeholders
2006-10-31 05:53:29 +00:00
Scott Long
9df92bda76 Fix a typo in the device ID table that prevented 5708S chips from being
detected.

Submitted by: pyun
2006-10-31 03:28:25 +00:00
Kevin Lo
127ce9bca0 Add support for Option GT 3G/3G quad datacard in ubsa.
Approved by: cognet
2006-10-31 02:27:24 +00:00
Warner Losh
a12fb4e632 Assign start to the value we were able to allocate and use that to
write out the BAR.  Otherwise, we were trying to shift a 32-bit
quantity on 32-bit platforms.  Also, 'start' check sanity to where it
is known.
2006-10-30 22:46:33 +00:00
Warner Losh
b0a2d4b8a9 More fully support 64-bit bars. Prior to this commit, we supported
only those bars that had addresses assigned by the BIOS and where the
bridges were properly programmed.  Now even unprogrammed ones work.
This was needed for sun4v.  We still only implement up to 2GB memory
ranges, even for 64-bit bars.  PCI standards at least through 2.2 say
that this is the max (or 1GB is, I only know it is < 32bits).

o Always define pci_addr_t as uint64_t.  A pci address is always 64-bits,
  but some hosts can't address all of them.
o Preserve the upper half of the 64-bit word during resource probing.
o Test to make sure that 64-bit values can fit in a u_long (true on some
  platforms, but not others).  Don't use those that can't.
o minor pedantry about data sizes.
o Better bridge resource reporting in bootverbose case.
o Minor formatting changes to cope with different data types on different
  platforms.

Submitted by: jmg, with many changes by me to fully support 64-bit
addresses.
2006-10-30 19:18:46 +00:00
Takanori Watanabe
e4ab9f19d7 Driver for some ASUS desktop motherboard extras.
Though it is named after overclocking tool for ASUS motherboards,
it is not capable to change clock ratio or CPU core voltage.

This driver exports Templature, Power output voltage, Fan RPM under
dev.acpi_aiboost.0.*.

Descriptions for these values are set to sysctl describe, which can be
get by sysctl -d.
2006-10-30 05:38:48 +00:00
Marius Strobl
432120f2bb - Wrap code optimized for architectures without alignment constraints
in #ifdef __NO_STRICT_ALIGNMENT rather than #ifdef __i386__. This
  means that amd64 now also uses the optimized code. [1]
  While at it, fix a nearby style(9) bug.
- Remove the hw.dc_quick SYSCTL, which allowed to turn off the above
  mentioned optimization, as like the equivalent and already removed
- In dc_setcfg() suppress printing a warning when forcing the receiver
  and transceiver to idle state times out for chips where the status
  bits in question just never change (observed in detail with DM9102A)
  and therefore the warning would be highly likely false positive. [2]
- In dc_ifmedia_sts() add a missing DC_UNLOCK().

Tested by:	Hans-Joerg Sirtl on amd64 [1]
PR:		82681 [2]
Obtained from:	NetBSD tlp(4) [2]
MFC after:	1 week
2006-10-29 20:24:27 +00:00
Alexander Leidinger
394ebd352c MFP4:
Rename MAX_SAMPLE_RATES macro to OSS_MAX_SAMPLE_RATES.  The old
	macro clashed with those used in other applications and libaries
	(ex: RtAudio).  4Front responded by updating their spec, so we
	will follow suit.

Submitted by:	ryanb
Noticed by:	pointyhat/kris
2006-10-28 09:51:10 +00:00
Jack F Vogel
9251ddbfe7 Backout bogus checkin to HEAD
Approved by: scottl
2006-10-28 08:11:07 +00:00
Jack F Vogel
52f92a311c This is the merge of the Intel 6.2.9 driver. It provides all new shared code,
new device support, and it is hoped a more stable driver for 6.2. RELEASE.
This checkin was discussed and approved today by RE, scottl, jhb, and pdeuskar
2006-10-28 00:47:55 +00:00
Ruslan Ermilov
ac3912b020 Fix LEDs not working when atkbd is an active keyboard and the physical
keyboard is attached only after the system has already booted.

If USB keyboard is also present, and there's no kbdmux(4), the problem
has been hiding itself because as soon as we get to multi-user, the
USB keyboard becomes an active keyboard (see devd.conf), thus marking
atkbd inactive and letting the old code initialize the keyboard.

With kbdmux(4), or if there's no USB keyboard, the atkbd keyboard is
always active, whether it's physically attached or not, thus it never
initialized itself properly on a physical attach.

To fix this, move block that initialized the keyboard on attach upper
so it doesn't depend on the (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd))
condition.  Also move KBD_FOUND_DEVICE() a few lines upper so that
KDSETLED and KDSETREPEAT that follow it propagate to the controller.

MFC after:	3 days
2006-10-25 13:35:42 +00:00
Ruslan Ermilov
f280a8fbd3 Fix non-working CAPS LED under X by applying fix from atkbd.c,v 1.27:
: revision 1.27
: date: 2000/05/28 12:43:24;  author: ache;  state: Exp;  lines: +3 -2
: Manipulate with AltGR Led (really CapsLock Led) only in K_XLATE mode, because
: all other modes not set ALKED flag and it means that CapsLock always turned
: off for them.
: Real bug example is X11 which never turn on CapsLock with Russian keyboard.
:
: PR:             18651
: Submitted by:   "Mike E. Matsnev" <mike@po.cs.msu.su>

MFC after:	3 days
2006-10-25 12:22:19 +00:00
Ruslan Ermilov
9a583dc7ae Switch to using STAILQ_REMOVE_HEAD() instead of STAILQ_REMOVE_HEAD_UNTIL().
Submitted by:	Stepan A. Baranov

This corresponds to OpenBSD rev. 1.134:

: revision 1.134
: date: 2004/05/04 16:59:31;  author: grange;  state: Exp;  lines: +10 -10
: Remove useless ``elm'' argument from the SIMPLEQ_REMOVE_HEAD macro.
: This matches our SLIST behaviour and NetBSD's SIMPLEQ as well.
:
: ok millert krw deraadt
2006-10-24 11:17:46 +00:00
Scott Long
4eaefb8160 Refine the checksum hack a little. It appears that the chip can handle UDP
and TCP checksum offloading fine, it only has a problem with IP checksums on
IP fragments..  Barring a fix or workaround available from the hardware, the
real solution would be to have finer grained control in the stack over what
can and cannot be assisted in hardware.
2006-10-24 08:24:31 +00:00
Max Laier
aaae09da87 net80211 seems to give us more rates than specified via ic_sup_rates under
yet to be investigated circumstances. If that happens truncate to the number
of rates that the firmware supports.

Found by:	Jeremie Le Hen
Obtained from:	OpenBSD (w/ changes)
MFC after:	3 days
2006-10-23 00:34:07 +00:00
Alan Cox
2a53696fb8 The page queues lock is no longer required by vm_page_busy() or
vm_page_wakeup().  Reduce or eliminate its use accordingly.
2006-10-22 21:18:48 +00:00
Scott Long
49caa8a9f8 There seems to be a problem with txcsum and UDP. Turn it off until it is
understood better.  This fixes timeout problems with NFS.
2006-10-21 20:41:08 +00:00
Scott Long
61a1e7e66d Be more like the BGE driver. Ensure that at least 16 TX descriptors are
kept unused in the ring.  This check should probably be moved up to
bce_start_locked at some point, as it'll make the loop up there slightly
more efficient, and will eliminate a costly set of busdma operations when
the ring is full.  But this works for now.

This makes all of my UDP torture tests work.  I'll cautiously say that
it might even work for other users now.  Feedback is appreciated.
2006-10-21 07:54:39 +00:00
John-Mark Gurney
8946c28270 fix tab indentation for CP and RV...
If the length is zero, catch this early, instead of making dflen go negative
and letting bad things happen...  We also check to see if RV (checksum) is
0, and handle that has a checksum failure...

Properly handle checksum failures by not processing read-write VPD data,
and removing all the found read-only data...

Tested by:	oleg (dflen going negative)
2006-10-20 21:28:11 +00:00
Warner Losh
86663fabdd MFp4: when passing the transfer up the foodchain, make sure we go up
the food chain.  devi == NULL is the error condition.  Treat it as such.
2006-10-20 07:11:52 +00:00
Warner Losh
114b4164dd Preliminary MMC stack. This stack supports SD 1.0 cards only, but
should be easily adapted to SD 2.0 (aka SDHC), SDIO, MMC and MMCplus
cards.  At the present time, there's only one bridge driver for the
ARM9 based Atmel AT91RM9200.
2006-10-20 06:39:59 +00:00
David E. O'Brien
f220c6a2f9 style(9) 2006-10-19 10:04:46 +00:00
David E. O'Brien
2c3adf6127 style(9) cleanup. 2006-10-19 10:01:26 +00:00
Scott Long
706620f05b There is no reason to have a PAGE_SIZE alignment enforced on all DMA by the
parent tag.
2006-10-19 08:03:22 +00:00
Scott Long
e06c706542 I can't find any reason why an 8 byte alignment should be enforced on rx
and tx buffers.  Fix it there, and also don't have it be overridden by the
parent tag.
2006-10-19 08:01:43 +00:00
Scott Long
ae4991a54c Remove some spurious debugging, and use more complete error handling for
tx load and fragmentation problems.
2006-10-19 06:58:01 +00:00
Warner Losh
ea3e117aaf tweak comments about OLDCARD workarounds 2006-10-19 05:25:53 +00:00
Warner Losh
eac85b1fe3 tweak comment 2006-10-19 05:25:29 +00:00
Ian Dowse
9145721957 Use a different task queue for host controller and peripheral driver
tasks. Since the host controllers rely on tasks to process transfer
timeouts, if a synchronous transfer from a driver was invoked from
a task and timed out, it would never complete because the single
task thread was stuck performing the synchronous transfer so couldn't
process the timeout.

This affected the axe, udav and ural drivers.

Problem hardware provided by:	guido
2006-10-19 01:15:58 +00:00
Andrew Gallatin
b4db900931 Fix a driver bug which could result in frames MHLEN or (MHLEN - 1) bytes
long being DMA'ed 2 (or 1) bytes past the end of the mbuf and corrupting
random kernel memory.  I had forgotten about the 2 bytes of implict
padding the firmware assumes.

Sponsored by: Myricom Inc.
2006-10-17 14:39:19 +00:00
David E. O'Brien
3cb32d8ab3 Correct the WOL magic value.
Submitted by:	Peer Chen at nVIDIA
2006-10-16 20:33:23 +00:00
David E. O'Brien
6bec396750 Try to be more precise in identifying the various nForce networking adapters. 2006-10-16 16:36:29 +00:00
Ariff Abdullah
55be51bf55 - Inverted EAPD quirk for ASUS A8Jc.
- Take the literal meaning of eapdbtl, but do the inversion during
  write.

Tested by:	Chung-liang Wei <idreamer@gmail.com>
2006-10-16 14:43:22 +00:00
Scott Long
6d678f8ee7 Remove some debugging code that accidentally crept in. 2006-10-16 04:30:09 +00:00
Scott Long
441f6d5dca - Add a command validator for use in debugging.
- Fix the locking protocol to eliminate races between normal I/O and AENs.
- Various small improvements and usability tweaks.

Sponsored by: IronPort
Portions Submitted by: Doug Ambrisko
2006-10-16 04:18:38 +00:00
Scott Long
c5a01a410c Overhaul the transmit and dma paths:
- Use bus_dmamap_load_mbuf_sg() to eliminate the need for the callback and
all of the extra bookkeeping associated with it.
- Eliminate the bce_dmamap_arg structure and streamline the memory allocation
routines to not need it.  This does change some of the debugging messages.
- Refactor the loop that fills the buffer descriptor so that it can be done
with a single set of logic in a single loop instead of two sets of logic.
- Eliminate the need to cache and pass descriptor indexes between the start
loop and the encap function.
- Change the start loop to always check the ifnet sendq for more work.

This significantly helps the driver withstand large UDP workloads, though
it's still not perfect.  I suspect the remaining work lies with handling
the OACTIVE flag, and also in possibly streamlining the interrupt handler
some.  It is, however, nearly on par with the other popular gigabit drivers
in terms of stability now.
2006-10-15 23:42:56 +00:00
Ariff Abdullah
503ee05bc3 Wrap debug printfs into SEQ_DEBUG() to avoid kernel messages clutter
during module unload.
2006-10-15 08:23:48 +00:00
Seigo Tanimura
7370bc7770 Fix the wraparound of memsize >=2GB. 2006-10-15 05:04:06 +00:00
Scott Long
f77d2d79f1 Simplify the arguments to bce_tx_encap. 2006-10-14 05:30:12 +00:00
Scott Long
a1f63be099 More small whitespace cleanups 2006-10-14 04:28:23 +00:00
Scott Long
ec6887f825 Don't copy the bd_chain head pointers into temporary objects, they are
available globally.
2006-10-14 03:58:59 +00:00
Scott Long
2711d96ad4 Fix some whitespace 2006-10-13 05:18:03 +00:00
John Baldwin
5283d39b98 ipmi_polled_enqueue_request() is already called with the lock held, just
assert it rather than recursing.

Reported by:	mjacob
Pointy hat:	jhb
MFC after:	3 days
2006-10-12 16:26:42 +00:00
Ariff Abdullah
1409858b3b - Fix support for ASUS U5F laptop. This laptop (and possibly others)
need a special inverted EAPD quirk.
- Add "eapdinv" config for future testing purposes.

Tested by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
          	#freebsd-azalia @ irc.freenode.net
2006-10-12 15:37:43 +00:00
Ariff Abdullah
0b414ccace Fix support for IBM/Lenovo Thinkcentre M52 series. Its vendorid / 0x1014
accidentally match with HP vendorid / 0x103c.

Reported by:	Robert Noland <rnoland@2hip.net>
2006-10-12 04:19:37 +00:00
Warner Losh
413d6375d7 Remove redundant casts. The casts inside the macros should be
sufficient (or fixed if not).
2006-10-12 03:05:45 +00:00
Kip Macy
e8bc49d761 Using the ptr defines broke the powerpc build - convert set_mmfsa to the same
convention as the rest of openfirm.c
2006-10-11 02:52:46 +00:00
Max Laier
0c341cb296 Remind firmware of the ESSID to use in a directed scan. This fixes scanning
for hidden APs when we are not comming from iwi_config.

Reported by:	Andrew N. Below
MFC after:	3 days
2006-10-10 18:02:22 +00:00
Sam Leffler
10b6de5e58 correct diag request to fetch isr state on fatal interrupts
MFC after:	1 week
2006-10-09 23:45:26 +00:00
Jung-uk Kim
2a9dc1317c Fix style(9) nits. 2006-10-09 20:26:32 +00:00
Jung-uk Kim
b5d9e49dcc Fix 32-bit PTE in the GART table.
Noticed by:	jmg
2006-10-09 20:24:49 +00:00
John-Mark Gurney
667dc26e71 provide routines to access VPD data at the PCI layer...
remove sk's own implementation, and use the new calls to get the data...

Reviewed by:	-arch
2006-10-09 16:15:56 +00:00
Kip Macy
25e328499c kernel clean up to make the sun4v kernel build
Reviewed by: jmg
Approved by: rwatson (mentor)
2006-10-09 04:45:19 +00:00
Ariff Abdullah
bfb06714ec Added few more pci ids for Intel, ATI, NVidia, VIA and SiS. 2006-10-08 18:51:58 +00:00
Alexander Leidinger
0f85b689a5 Remove unnecessary test case. (As written, that branch will never
be followed.)

Submitted by:	ryanb
Found with:	Coverity Prevent
CID:		239860
2006-10-08 17:13:54 +00:00
Søren Schmidt
1830897634 Add missing PCI ID for the acer m5288 2006-10-08 09:58:00 +00:00
Florent Thoumie
f45164d8b1 Add a USB umass(4) quirk for Panasonic KXL-840AN CD-R drive.
PR:		usb/81073
Submitted by:	James E. Flemer <jflemer@alum.rpi.edu>
MFC after:	3 days
2006-10-07 20:08:37 +00:00
Florent Thoumie
bff4edd817 Add a USB quirk for CMOTECH CDMA USB modem.
PR:		usb/97948
Submitted by:	Alexei Volkov <kot@kotzone.ru>
MFC after:	3 days
2006-10-07 19:42:45 +00:00
Florent Thoumie
b804b1868e Add a USB quirk for Motorola A41x/V32x USB phones.
PR:		usb/97512
Submitted by:	Mark Diekhans <markd@kermodei.com>
MFC after:	3 days
2006-10-07 19:27:53 +00:00
Florent Thoumie
bd4029713f Add support for Novatech NV902 wireless NIC in ural(4).
PR:		usb/102852
Submitted by:	Jonathan Fosburgh <jonathan@fosburgh.org>
MFC after:	3 days
2006-10-07 18:18:40 +00:00
Florent Thoumie
774b7afefb Add support for Epson Stylus CX4200 in uscanner(4).
PR:		usb/102851
Submitted by:	Jonathan Fosburgh <jonathan@fosburgh.org>
MFC after:	3 days
2006-10-07 18:09:27 +00:00
Florent Thoumie
cfa3f4d8ab Add support for Psion Gold Port Ethernet USB NIC.
PR:		usb/102296
Submitted by:	Volker <volker@vwsoft.com>
MFC after:	3 days
2006-10-07 18:03:39 +00:00
Florent Thoumie
d25cbeac2c Add support for Netgear FA101 ethernet USB NIC.
PR:		usb/102286
Submitted by:	Volker <volker@vwsoft.com>
MFC after:	3 days
2006-10-07 17:58:50 +00:00
Florent Thoumie
be1bd380c5 Add a quirk for the Belkin FC6550-AVR UPS.
PR:		usb/102260
Submitted by:	David Grochowski <grocho98@students.rowan.edu>
MFC after:	3 days
2006-10-07 17:47:16 +00:00
Florent Thoumie
0c56f2bcd6 Add support for Familiar Linux powered iPaq handhelds to cdce(4).
PR:		usb/103865
Submitted by:	Alexey Roslyakov <internetworking@mail.ru>
MFC after:	3 days
2006-10-07 17:35:37 +00:00
Florent Thoumie
6d28d23bb9 Add quirk for Logitech iFeel MouseMan USB mouse.
PR:		usb/101066
Submitted by:	Heiko Przybyl <zuxez@uni.de>
MFC after:	3 days
2006-10-07 17:16:48 +00:00
Florent Thoumie
da9b42184b - Add support for Epson USB Scanners (3590 [1] and 4990 [2]).
- Add entries in the uscanner.4 man page (along with missing 3500).

PR:		usb/100957 [1], usb/100992 [2]
Submitted by:	Jim Teresco <terescoj@teresco.org> [1],
		Walter C. Pelissero <walter.pelissero@iesy.net> [2]
MFC after:	3 days
2006-10-07 16:00:59 +00:00
John-Mark Gurney
5aa0cdf46d fix fxp so that it will reset the link when you change the speed... This
will fix a problem where you boot w/ the default of autoselect, but then
set the speed to 100/full, the switch will keep the autoselect/100/full
negotiation...  This will continue to work till someone resets the switch
or unplugs the cable resulting in the switch failing to autoneg and falling
back to 100/half, causing a hard to track down duplex mismatch..

Submitted by:	nCircle Network Security, Inc.
MFC after:	1 week
2006-10-06 20:53:01 +00:00
Ariff Abdullah
8d999aa8a1 - Fix wrong id for ALC882, add ALC883 id.
- Add support for the Conexant Waikiki/CX20551-22, found
  in most Toshiba P100 series laptops. Despite of growing
  urban legend of "unsupported Conexant", this codec is fully
  supported in this driver.
  Note: Toshiba P100 has broken (acpi) BIOS, thus rendering
        its soundchip useless. Please disable ACPI, or get
        BIOS updates (if any).

  Found/tested by: Vulpes Velox <v.velox@vvelox.net>
  URL: http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-September/004896.html

- Parser cleanups to handle possible oss/mixer collision. Found
  after parsing Conexant Waikiki nodes.

- Increase resilient against resource failure during attach/detach.

- Implement simple config through hint.pcm.<unit>.config. Supported
  options:
    gpio0 (default on Acer), gpio1, gpio2, softpcmvol,
    fixedrate (default), forcestereo (default)
  * Option prefixed with "no" (such as "nofixedrate") will do
    the opposite.
  * Options can be separated using space " " or comma ",".
  * The "no" option will take precedence over anything else.
  Example:
    hint.pcm.0.config="gpio2,nofixedrate,noforcestereo,nogpio0,softpcmvol"
    hint.pcm.0.config="softpcmvol noforcestereo"
2006-10-06 18:59:27 +00:00
Ruslan Ermilov
40ed3f472a Actually make bounds checking for PCIOCREAD and PCIOCWRITE work. 2006-10-06 14:31:32 +00:00
John Baldwin
fab2d1adf6 The IPMI spec is ambiguous (or rather, it contradicts itself) about whether
or not the OS has to wait for RX_RDY or TX_RDY to be set before the OS sets
the control code in the control/status register.  Looking at the interface
design, it seems that RX_RDY and TX_RDY are probably there to protect
access to the data register and have nothing to do with the control/status
register.  Nevertheless, try to take what I think is the more conservative
approach and always wait for the appropriate [TR]X_RDY flag to be set
before writing any of the WR_NEXT, WR_END, RD_START, or RD_NEXT control
codes to the control/status register.
2006-10-05 15:38:59 +00:00
John Baldwin
b4828cc1dd Add detailed debugging printf's for SMIC under SMIC_DEBUG. 2006-10-05 15:35:11 +00:00
John Baldwin
c95e8ccc74 Oops, don't toss the last character read during an SMIC transaction with
at least 1 data byte beyond the completion code.

Tested by:	Terry Kennedy <terry at tmk dot com>
2006-10-05 15:33:43 +00:00
Maxim Konovalov
bd4fb874ac o Add Adaptec ServeRAID 7x IDs. IDs taken from Linux.
PR:		kern/90012
Submitted by:	Andrey V. Elsukov
MFC after:	1 month
2006-10-05 07:28:43 +00:00
Gleb Smirnoff
9a3fc40a26 Remove 3Com 985 deviceid that is really ti(4).
Submitted by:	erwin
2006-10-03 09:31:49 +00:00
Ian Dowse
dff926577b Fix compile in non-debug case. 2006-10-03 08:38:08 +00:00
Warner Losh
61db6a13b0 aic_pccard_products can be static.
Noticed by: cscope
2006-10-03 04:51:18 +00:00
Ian Dowse
9c63c3f400 When changing the device address and max packet size in usbd_new_device(),
close and re-open the default pipe instead of relying on the host
controller driver to notice the changes. Remove the unreliable code
that attempted to update these fields while the pipe was active.
This fixes a case where the hardware could cache and continue to
use the old address, resulting in a "getting first desc failed"
error.

PR:		usb/103167
2006-10-03 01:13:26 +00:00
Ian Dowse
a55e16f4f7 Don't attempt to insert the transfer in an error case where it has
already been inserted.
2006-10-03 01:04:11 +00:00
Ariff Abdullah
3f630febba Backout remaining changes that make most AD1981B users unhappy.
The exact situation is understood, and proper solution will follow
sooner.
2006-10-02 20:46:34 +00:00
Poul-Henning Kamp
e5037a18a9 Use utc_offset() where applicable, and hide the internals of it
as static variables.
2006-10-02 18:23:37 +00:00
John Baldwin
948170b7d4 Trim trailing whitespace. 2006-10-02 18:16:29 +00:00
Ariff Abdullah
0f219a5803 - Streamline quirks management for a better future.
- Fix support for ASUS M5200ae (buggy BIOS)
- Fix few problems, reported by Coverity Prevent (TM).

CID:		246991, 246676, 246675, 246674, 246477
Found by:	Coverity Prevent (TM)
2006-10-02 16:30:04 +00:00
Ruslan Ermilov
1997f96b85 Ignore the UKBD_DFLT_KEYMAP option when compiling as a module.
The parallel LINT build sometimes broke if kernel-depend wasn't
fast enough in generating ukbdmap.h.  If someone thinks this
option would still be useful for the module, a proper fix is
to add the code generating ukbdmap.h into modules/ukbd/Makefile
and backing this change out.
2006-10-02 16:02:41 +00:00