Commit Graph

101 Commits

Author SHA1 Message Date
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
jdolecek 2a0d290c56 use VLAN_* macros for VLAN tag extraction/addition 2005-02-20 15:56:03 +00:00
cube d16fd94009 Initialize 'error' in all cases in ioctl handler, otherwise it doesn't
compile (and of course might return garbage).  [hi kim!]
2005-02-06 08:52:08 +00:00
kim f045f7096d If the interface is up and running, only modify the receive filter
when setting promiscuous or debug mode.  This avoids resetting the
chip unnecessarily.

Fixes PR kern/29126.
2005-02-06 03:15:14 +00:00
thorpej 0fa67488f7 - Fix some logic errors in multi-descriptor packet reception case for
DP83820.
- Eliminate use of M_HASFCS.
2005-01-30 18:56:34 +00:00
thorpej e9818f5b5e When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
2004-10-30 18:08:34 +00:00
thorpej d17a849385 Use ANSI function decls and make use of static. 2004-08-21 22:48:18 +00:00
thorpej f3eaee75cf Add PAUSE-related event counters for sip(4) and gsip(4), slightly modified
from a patch supplied by HITOSHI Osada.
2004-05-15 22:33:13 +00:00
thorpej ffa382bf7c Patch from HITOSHI Osada:
* On the DP83820, don't set PCR_PS_DA if the PAUSE packet address is
  not registered in the multicast filter.
2004-05-15 22:26:49 +00:00
thorpej 9ac446650a Patch from HITOSHI Osada:
* SiS900 chips require the address of the PAUSE packet to be registered
  in the multicast filter.
2004-05-15 22:24:51 +00:00
fair 4521e00533 Two changes:
1. ifdef out the restriction that the SiS 900 has only one PHY
This is demonstrably false; the SiS 960 super south bridge in
PR 18590 has a SiS 900 rev 1 core in it.

2. bitbang the MII for all versions of the SiS 900; this is the
only way that the PHYs on this system answer.

Also, I suspect that SIS900_REV_960 constant in if_sipreg.h is
incorrectly labelled - there were later revisions of the super
south bridge (e.g. the 961, 962, and 963), and I suspect the
SiS 900 revision code there refers to one of those.
2004-05-09 03:03:55 +00:00
enami 0041584094 If defined(DP83820), (always) drop IFF_OACTIVE if we got txintr.
Otherwise, the driver simply stuck once we face tx resource shortage.
2004-04-22 06:11:38 +00:00
thorpej 466915b256 Flow control support for DP83820 and SiS900. From HITOSHI Osada. 2004-04-11 21:16:00 +00:00
thorpej 21cfdb75e2 Improvements to DP83820 support, from HITOSHI Osada:
- Fix jumbo frame support.
- Disable interrupts at the chip in sip_intr().
- Disable checksum offloading if MTU > 8109 - the hardware is broken
  in this case.
- Use the interrupt hold-off timer.
- Correct the Tx FIFO size.
- Add Pause Control/Status register definitions.
2004-04-11 16:57:44 +00:00
cube 03549a0cc1 The limitation for TX/RX DMA of rev. 900B and 635 os the SiS chips also
applies to rev. 0x91 for 96x chipsets.  Needed to fix PR 24043, but more
stressing testing has to be performed before closing it.
2004-01-11 09:07:56 +00:00
cube d8aa4bc899 Remove bitbang code that was taken from FreeBSD to support recent SiS
chipsets and use mii_bitbang interface instead.  Reflect sip dependency in
the config file.

Support for SiS96x needs broader testing.
2003-12-05 22:34:44 +00:00
keihan b8702f530b netbsd.org -> NetBSD.org
This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean".  Thanks for the patiance, and sorry for all the commits.
2003-12-04 13:57:30 +00:00
cube a00292cf94 o Add support for accessing the PHY through MDIO for recent SiS chips
o Add support for the recent SiS96x chipsets that have a new revision.
  That includes a new bit of code to access the EEPROM, since it is
  shared with the ieee1394 controller on those chipsets.

Mostly taken from FreeBSD (rev. 1.62 and 1.64 of sys/pci/if_sip.c).  I
tried to make the code look less ugly, but couldn't invent documentation.

Fix PR #23481.  Thanks to Stephane ENGEL <sengel AT melshake DOT com> for
the report and the cheerful testing.
2003-12-03 21:58:49 +00:00
mycroft 5ef2e1b264 Fix the real cause of the uninitialized warning -- we were looking for the VLAN
tag in the wrong place!
2003-10-29 03:31:22 +00:00
christos 125ccd91b1 Fix uninitialized variable warnings 2003-10-25 18:29:12 +00:00
martin 1483742f8a Fix typo (DP83020 -> DP83820) from HITOSHI Osada in PR kern/23023. 2003-09-30 21:21:34 +00:00
itojun 6d223cc3a4 KNF 2003-08-25 20:36:47 +00:00
itojun f80fd2c5ea accept 1518-byte frames (needed for vlan). Valtteri Vuorikoski 2003-08-15 07:29:34 +00:00
thorpej 8f70c6754b Add a work-around for the "short cable problem" that some DP83815
revisions have, as discussed on the soekris-tech mailing list a
while ago, whereby one can experience excessive recieve erros when
using < 30m cables.  The patch detects overflow in a DSP filter
parameter, and corrects it by writing a known good value.
2003-03-23 00:56:15 +00:00
briggs 85d93f8d10 Detect SMC EZ Card as 64-bit. Patch from Pavel Cahyna in kern/20680. 2003-03-13 13:57:01 +00:00
itojun 40606ab8f2 switch from kame-based m_aux mbuf auxiliary data, to openbsd m_tag
implementation.  it will simplify porting across *bsd (such as kame/altq),
and make us more synchronized.  from Joel Wilsson
2003-01-17 08:11:49 +00:00
tsutsui 238efe4697 Replace magic numbers for power management control with PCI_PMCSR* macros.
XXX Should we use pci_get_powerstate() and pci_set_powerstate() in pci.c?
2002-12-23 02:58:36 +00:00
scw 5b10944d66 Fix uninitialised variable warnings. 2002-11-24 12:06:12 +00:00
fair 8459c79958 Change the "dontcare" bits argument of ifmedia_init() to IFM_IMASK,
so that PHY instance is not siginificant in ifmedia_match(). This
is done to support multiple PHYs on the MII. Without this change,
ifmedia_set() would panic the system when no PHYs were matched.

I ran into this on an AMD EasyNow PC, which is built around SiS
system chips with an embedded SiS 900 core, and an external AMD
Am79c901 PHY, which presents two PHYs on the MII: one for HomePNA,
and one for standard 10base-T. The 10base-T PHY ends up with instance
number 1...
2002-10-17 01:17:30 +00:00
thorpej b75a007d9f Add trailing ; to CFATTACH_DECL. 2002-10-02 16:51:16 +00:00
thorpej 387fc6dc87 Use CFATTACH_DECL(). 2002-09-30 20:37:04 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
thorpej d8e650d53a * The Netgear GA-621 is a 64-bit card, so add it to the 64-bit
quirk table.
* We want to hardwire BMSR_EXTSTAT, not BMSR_EXTCAP, when reading
  the TBI BMSR.
* Fetch the GPIO bits from the GPIOR register after an auto-load,
  rather than reading from the EEPROM directly.
2002-08-26 22:52:02 +00:00
itojun 9287c3fbb9 need to set wantinit variable 2002-08-26 07:38:34 +00:00
itojun 3931bcf3a3 suppress some of debugging output (IFF_DEBUG will re-enable it). PR 18069 2002-08-26 07:37:26 +00:00
itojun 7b0ecaee62 use RND_ENABLED() to avoid unneeded function call. should help if_gsip case. 2002-08-21 03:59:31 +00:00
itojun 76f65d83e3 attach random number source. 2002-08-20 00:35:46 +00:00
thorpej b9d86783bf * Hard-code EXTSR_1000XFDX|EXTSR_1000XHDX for reads of the MII_EXTSR
in the TBI case.
* Force BMSR_ANEG | BMSR_EXTCAP to be returned for reads of the MII_BMSR
  in the TBI case.
2002-08-16 07:10:56 +00:00
thorpej 1fa46f89f9 Preliminary support for the ten-bit interface on the DP83820. This
code needs more testing, and more bug fixing.
2002-08-10 22:57:15 +00:00
thorpej 5689818798 Don't treat the "reset complete" interrupts as errors. Doing so
causes us to go into a reset/interrupt/reset/... loop.
2002-08-10 22:54:54 +00:00
thorpej 37422dde7e Add 64-bit quirk for the Accton EN1407-T/Planex GN-1000TE. IDs provided
by SAITOH Masanobu <msaitoh@netbsd.org>.
2002-07-11 18:07:56 +00:00
thorpej 8eb0145183 Add a table of known-64-bit DP83820-based cards. Use this table
to enable 64-bit data transfers on 64-bit cards when plugged into
a 64-bit slot.  Right know the Asante GigaNIX is listed in that
table.

Sigh, there is an EEPROM bit that can be used to detect 64-bit vs
32-bit cards.  Unfortunately, at least 2 vendors of 32-bit cards
fail to clear the "DATA64_EN" bit in the EEPROM, which causes the
card to lose badly, because it still manages to detect that it's
plugged into a 64-bit PCI slot.  Yay, stupid hardware vendors.
2002-06-30 20:36:06 +00:00
thorpej 145fa4de8a Load configuration data from the EEPROM on the DP83820 differently: rather
than grovel the EEPROM directly, initiate an "EEPROM load" in the PCI
test register, and fetch the values from the CFG register.
2002-06-30 20:04:43 +00:00
thorpej b77065a9a2 Update the TODO list: We have some Tx interrupt mitigation now, so
we need to do Rx interrupt mitigation next.
2002-06-30 19:13:46 +00:00
thorpej c9983ba67f Be more aggressive in giving descriptors to the chip in the transmit
path: Instead of waiting for the if_snd queue to be drained before
giving ownership of the frist descriptor to the chip, do it after
sync'ing all the descriptors for a single packet.
2002-06-30 19:11:40 +00:00
thorpej 6caa2f6db1 Implement a sliding interrupt delay window for Tx interrupts. 2002-06-30 18:52:21 +00:00
thorpej 0f2cbd0361 * Give symbolic names to the CFG bits in the EEPROM.
* Get CFG_M64ADDR, CFG_T64ADDR, and CFG_DATA64_EN from the EEPROM.
  Note, we still disable CFG_M64ADDR and CFG_T64ADDR later (XXX need
  PCI bus capability flags for these).
* Print a message if we're in a 64-bit slot and 64-bit data is
  disabled in the EEPROM.  Make sure CFG_DATA64_EN is disabled if
  we're not in a 64-bit slot.
2002-06-30 18:04:12 +00:00
lukem 06de426449 SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
2002-06-01 23:50:52 +00:00
tron e10511905f Set initial transmit drain threshold to 1504 to avoid the problem
described in PR kern/16070. Change approved by Jason Thorpe.

XXX We'll should try to find a better adaptive scheme for the next
    NetBSD release.
2002-05-28 20:20:49 +00:00
thorpej a487a4b57a Bump the number of Tx DMA segments from 8 to 16 (the zero-copy socket
code sometimes sees more than 8).
2002-05-03 00:18:31 +00:00