Commit Graph

18040 Commits

Author SHA1 Message Date
Andrew Thompson
64b9d31df9 The TWINKLECAM entry is under CHICONY2, remove MICRODIA.
Obtained from:	NetBSD
2008-12-12 18:34:27 +00:00
Andrew Thompson
5a8bb87f45 Use correct AIPTEK2 name for vendor 0x04fc, now that the PENCAM_MEGA_1_3
product is paired with it.

Obtained from:	NetBSD
2008-12-12 18:26:08 +00:00
Doug Ambrisko
bd97b1f46a Add in some more device ID's and a generic catch-all.
Submitted by:	LSI
2008-12-12 16:41:12 +00:00
Pyun YongHyeon
4a51e7bfd5 It seems there are still issues on multicast perfect filtering.
Disable it until I find spare time to analyze the issue.

Reported by:	Goran Lowkrantz <glz <> hidden-powers DOT com>
MFC after:	3 days
2008-12-12 01:26:11 +00:00
Andrew Thompson
dc41cd35e3 Remove superfluous return statements from the end of void functions. 2008-12-11 23:17:48 +00:00
Andrew Thompson
a05d77141c Format and wrap function declarations. 2008-12-11 23:13:02 +00:00
Andrew Thompson
3d2e6ad8b6 Add entries for some Option, Sierra and Stelera 3G cards. 2008-12-11 21:08:14 +00:00
Warner Losh
d0493c85a6 Update to the interrupt handling code:
o Try to be smarter about reading the ExCA CSC register.  Now, we only
  do it for 16-bit cards.  Add some experimental code to treat it like
  a power interrupt, but I'm not 100% sure that I like it.  It may be
  removed upon further testing.  It seemed to help in one test case, but
  the evidence may be inconclusive.  This may be beneficial for cleaning up
  exca_reset and exca_wait_ready.
o Check for CSTS events on the socket event register.  We ask for it when
  we're powering up a card, but I don't think we're otherwise using
  it.  Just ACK the interrupt for now.  In theory, we can use it
  instead of the busy wait we do in cbb_cardbus_reset.  More research
  is necessary to see if we can optimize things there when we're
  waiting for the DEVVENDOR register to become valid.
o Rework the comments a bit.  Minor tidying up.  Etc.
2008-12-11 06:27:18 +00:00
Sam Leffler
13f209a354 add missing break
Coverity ID:	4159
2008-12-11 04:03:50 +00:00
Sam Leffler
eef5acf25e add missing break
Coverity ID:	4151
2008-12-11 04:03:13 +00:00
Pyun YongHyeon
886ff602f2 Make WOL work on RTL8168B. This controller seems to require
explicit command to enable Rx MAC prior to entering D3.

Tested by:	Cyrus Rahman <crahman <> gmail DOT com>
2008-12-11 02:24:11 +00:00
Pyun YongHyeon
0596d7e65d Don't access undocumented register 0x82 on controllers that
have no such register. While here clear undocumented PHY
register 0x0B for RTL8110S.

Obtained from:	RealTek FreeBSD driver
2008-12-11 01:41:38 +00:00
Pyun YongHyeon
ead8fc669e Newer RealTek controllers requires setting stop request bit to
terminate active Tx/Rx operation.
2008-12-11 01:26:18 +00:00
Pyun YongHyeon
b659f1f0fe Always put controller into known state before device intialization.
While here remove re_reset calls invoked in system error case as
controller reset is always done in device initialization.
2008-12-11 00:46:07 +00:00
Pyun YongHyeon
f68bc089f9 Partly revert r185756. RTL8169SC doesn't like reduced delays in
GMII access while Tx/Rx is in progress.

Reported by:	Jaakko Heinonen <jh <> saunalahti DOT fi>,
		Anton Yuzhaninov <citrin <> citrin DOT ru>
Tested by:	Jaakko Heinonen <jh <> saunalahti DOT fi>
2008-12-11 00:30:26 +00:00
Marius Strobl
90447aad0a - Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which
causes data corruption in combination with certain bridges.
  Information about this problem was kindly provided by davidch. [1]
- As BGE_FLAG_PCIX is meant to indicate that the controller is in
  PCI-X mode, revert to the pre __FreeBSD_version 602101 method of
  reading the bus mode register rather than checking the mere
  existence of a PCI-X capability, which is also there when the
  NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X
  mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC
  to be tuned incorrectly.

PR:		128833 [1]
Reviewed by:	jhb
MFC after:	3 days
2008-12-09 21:34:22 +00:00
Pyun YongHyeon
92483efaab Fix a long standing VLAN tagged frame handling bug.
When VLAN tagged frame is received the hardware sets 'LONG' bit of
Rx status word. It is always set when the size of received frame
exceeded 1518 bytes, including CRC. This VLAN tagged frame clears
'OK' bit of Rx status word such that driver should not rely on 'OK'
bit of Rx status word to pass the VLAN tagged frame to upper stack.

To fix the bug, don't use SIS_CMDSTS_PKT_OK for Rx error check and
introduce SIS_RXSTAT_ERROR macro that checks Rx errors. If we are
configured to accept VLAN tagged frames and the received frame size
is less than or equal to maximum allowed length of VLAN tagged
frame, clear 'LONG' bit of Rx status word before checking Rx
errors.

Reported by:	Vladimir Ermako	< samflanker <> gmail DOT com >
Tested by:	Vladimir Ermako	< samflanker <> gmail DOT com >
2008-12-09 04:30:47 +00:00
Pyun YongHyeon
6d7e1582a3 mutex.h is needed here. It got it by namespace pollution.
Pointed out by:	bde
2008-12-08 03:48:03 +00:00
Pyun YongHyeon
b45fb24843 Reduce spin wait time consumed in GMII register access routines.
Waiting for 1ms for each GMII register access looks overkill and it
may also decrease overall performance of driver because re(4)
invokes mii_tick for every hz.

Tested by:	rpaulo
2008-12-08 02:48:41 +00:00
Pyun YongHyeon
130b6dfb35 o Implemented miibus_statchg handler. It detects whether re(4)
established a valid link or not. In miibus_statchg handler add a
  check for established link is valid one for the controller(e.g.
  1000baseT is not a valid link for fastethernet controllers.)
o Added a flag RE_FLAG_FASTETHER to mark fastethernet controllers.
o Added additional check to know whether we've really encountered
  watchdog timeouts or missed Tx completion interrupts. This change
  may help to track down the cause of watchdog timeouts.
o In interrupt handler, removed a check for link state change
  interrupt. Not all controllers have the bit and re(4) did not
  rely on the event for a long time. In addition, re(4) didn't
  request the interrupt in RL_IMR register.

Tested by:	rpaulo
2008-12-08 02:34:13 +00:00
Pyun YongHyeon
6f0f9b12fa Make sure to return the result of meida change request.
Previously it used to return success regardless of the result.
2008-12-08 01:44:18 +00:00
Marius Strobl
155781198a - According to the corresponding Linux, NetBSD and OpenSolaris
drivers, there should be a 1us delay after every write when
  bit-banging the MII. Also insert barriers in order to ensure
  the intended ordering. These changes hopefully will solve the
  bus wedging occasionally experienced with DM9102A since r182461.
- Deobfuscate dc_mii_readreg() a bit.
2008-12-07 23:02:37 +00:00
Warner Losh
f2323a477f Minor tweaks to some of the comments. Also, add a XXX wondering if we
need to frob the 16-bit EXCA registers during the new interrupt-driven
power-up sequence.
2008-12-07 22:49:47 +00:00
Andrew Thompson
c84f4dc85b Restore opt_inet.h include which was lost in the last commit. 2008-12-07 21:32:56 +00:00
Sam Leffler
9d6b29a668 honor IEEE80211_BPF_CRYPTO for raw xmit; fixes shared key auth in sta mode
PR:		kern/129022
2008-12-07 19:29:11 +00:00
Sam Leffler
2dc7fcc48f New periodic calibration scheme needed for 11n parts that have
multiple algorithms and potentially collect multiple samples.
Instead of a single calibration interval we now have short and long
intervals; the long interval roughly corresponds to the previous
single interval.  The short interval is used to speedup collection
of samples and happens much quicker.  We make calls using the short
interval until we're told the calibration work is complete at which
point we fallback to the long interval.  In addition there is a
much longer reset interval used to flush all calibration state and
cause everthing to start anew.

With these changes you can also disable calibration entirely by
setting the long interval to zero.
2008-12-07 19:26:34 +00:00
Warner Losh
a5d1eba6cf Use '0' rather than PZERO to not change the priority that I'm waiting
at.  I don't think this will make a huge difference, but I have
received a report of a interrupt storm on one 16-bit card that this
might fix (chances are it won't, since I think that we may need to
check both the CBB registers for the 16-bit card as well as the PCIC
registers for power state change).

Submitted by:	jhb@
2008-12-07 18:34:27 +00:00
Warner Losh
3e7d0bebac Use atomic_add_int rather than a simple ++ to ensure no cache races if
the power interrupt and init code waiting for the interrupt are
running on different CPUs.  I haven't seen this make any real
difference, but I've also had some reports of odd behavior I can't
otherwise explain.  It is an infrequent operation, and certainly
wouldn't hurt.
2008-12-07 18:32:09 +00:00
Nathan Whitehorn
582434bd08 Fix some nasty race conditions in the VIA-CUDA driver that ended up preventing
my right mouse button and keyboard LEDs from working due to mangled
configuration packets. Fixed several other races and associated problems in the
main ADB stack that were exposed while fixing this.
2008-12-06 23:26:02 +00:00
Alexander Motin
d493985afd Cleanup msleep() arguments.
Move wakeup() out of the lock.
2008-12-06 21:52:32 +00:00
Alexander Motin
eb67f31a1b Implement suspend/resume for mmc and mmcsd drivers.
Now it is possible to suspend/resume with inserted and active card.

To reinitialize card on resume and to detect card change while suspended,
implement bus rescan routines. It can also be used by controllers without
card presence detection signals or with multiple cards per slot support.

While there, cleanup msleep() usage. We have no any rights to exit without
"request done" signal from driver as it could lead to modify after free.
2008-12-06 21:41:27 +00:00
Andrew Thompson
5622c31582 The startall variable should default to zero, otherwise the vap is restarted
everytime an ioctl happens.

While I am here, limit the locking scope to SIOCSIFFLAGS.
2008-12-06 21:19:26 +00:00
Stanislav Sedov
e4ec1e683e - Eliminate unused variable. [1]
- Check for runt frames entering the stack. [2]

Suggested by:	ganbold[1], yongari[2]
Approved by:	kib (mentor)
MFC after:	2 weeks
2008-12-06 14:23:45 +00:00
George V. Neville-Neil
7f15419bb7 Bug fix to support N310 version of Chelsio cards (board ID 1088).
Obtained from:	Chelsio Inc.
MFC after:	3 days
2008-12-06 02:10:53 +00:00
Alexander Motin
d8208d9eb1 Forget current bus power settings on full reset. Chip must be reconfigured.
Do not issue command if there is no card, clock or power.
Controller will not detect command timeout without clock active.
2008-12-06 01:31:07 +00:00
George V. Neville-Neil
5197f3abd7 Re submit code to print the part and serial number for Chelsio cards.
The original code was accidentally removed in another commit.

MFC after: 1 day
2008-12-05 21:40:11 +00:00
Warner Losh
5b9ee137aa Move to using filter for the change interrupts. Also rework the power
interrupt code to be more robust.  I've been running these changes for
over a year...  With these changes, I don't see the ath card going
into reset like the code in the tree.
2008-12-05 05:20:08 +00:00
Warner Losh
ca446278b1 Minor style nit. 2008-12-05 04:48:04 +00:00
Warner Losh
f40b0e2e97 Augment comments, and move things around a smidge. 2008-12-05 04:46:26 +00:00
Warner Losh
414f7ec8bd Implement a method described in NetBSD PR 36652 for coping with the
BAD VCC bit.
2008-12-05 04:43:25 +00:00
George V. Neville-Neil
9036240993 Fix a bug with the ael1006 PHY. The bug shows up as persistent but incomplete
packet loss, of between 10-30%. The fix is to put the PHY into
and take it out of local loopback mode when resetting the interface.

Obtained from:	Chelsio Inc.
MFC after:	3 days
2008-12-04 20:32:53 +00:00
Kip Macy
23dc562170 Integrate 185578 from dfr
Use newbus to managed devices
2008-12-04 07:59:05 +00:00
Pyun YongHyeon
450ab47230 Add HW MAC counter support for newer JMC250/JMC260 revisions. 2008-12-04 02:16:53 +00:00
Pyun YongHyeon
f37739d7ab Add support for newer JMC250/JMC260 revisions.
o Chip full mask revision 2 or later controllers have to
   set correct Tx MAC and Tx offload clock depending on negotiated
   link speed.
 o JMC260 chip full mask revision 2 has a silicon bug that can't
   handle 64bit DMA addressing. Add workaround to the bug by
   limiting DMA address space to be within 32bit.
 o Valid FIFO space of receive control and status register was
   changed on chip full mask revision 2 or later controllers. For
   these controllers, use default 16QW as it's supposed to be the
   safest value for maximum PCIe compatibility. JMicron confirmed
   performance will not be reduced even if the FIFO space is set
   to 16QW.
 o When interface is put into suspend/shutdown state, remove Tx MAC
   and Tx offload clock to save more power. We don't need Tx clock
   at all in this state.
 o Added new register definition for chip full mask revision 2 or
   later controllers.

Thanks to JMicron for their continuous support of FreeBSD.
2008-12-04 01:58:40 +00:00
Xin LI
2dd5c73163 Don't attempt to clear status updates if we did not do a link state
change.  As a side effect, this makes the excessive interrupts to
disappear which has been observed as a regression in recent stable/7.

Reported by:	many (on -stable@)
Reviewed by:	davidch
2008-12-03 23:00:00 +00:00
Joseph Koshy
b4d091f3a4 Fixes for Core2 Extreme support.
Submitted by:	 "Artem Belevich" <artemb at gmail dot com>
2008-12-03 17:30:36 +00:00
Doug Ambrisko
d205405c23 Change new card identification names.
Submitted by:	LSI
MFC after:	3 days
2008-12-03 16:29:12 +00:00
Joseph Koshy
a10c6ee6bd Add aliases that map architectural event names to fixed function counters. 2008-12-03 15:23:08 +00:00
Pyun YongHyeon
1ce1618851 AR8113 also need to set DMA read burst value. This should fix
occasional DMA read error seen on AR8113.

Submitted by:	Jie Yang < Jie.Yang <> Atheros com >
2008-12-03 09:01:12 +00:00
Pyun YongHyeon
19042fb8c7 Add some PHY magic to enable PHY hibernation and 1000baseT/10baseT
power adjustment. This change is required to guarantee correct
operation on certain switches.

Submitted by:	Jie Yang < Jie.Yang <> Atheros com >
2008-12-03 08:56:01 +00:00