Commit Graph

81 Commits

Author SHA1 Message Date
jhawk 1e59d99d28 For all network drivers that call ether_ifattach(), and also
have _detach() functions:
  Ensure that softc keeps state about whether the attach succeeded,
  and make the detach function return immediately if the attach did
  not complete.
2000-05-29 17:37:12 +00:00
martin 41dc1a6839 Avoid stomping on the W0_CONFIG_CTRL register which seems not to be
implemented on EISA cards. This makes a 3Com 3C597 Fast Etherlink TX
work for me at last, fixing PR kern/7067.
2000-05-07 14:03:25 +00:00
augustss 169ac5b3c1 Remove register declarations. 2000-03-30 12:41:09 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
thorpej a6f861574a No longer necessary to futz with ifp->if_baudrate here. 2000-03-06 21:02:00 +00:00
itojun 1ccb9e8170 when change mbuf type, clear m_pkthdr so that we do not get panic with
old data in pointer fields.  NOTE: we'll extend m_pkthdr field soon.

Wondering: do mbuf pre-allocation code in elink3.c really buy us much
performance?  it comes with code duplicate/synchronization problem with
sys/mbuf.h...
2000-02-25 03:39:13 +00:00
enami c7573d517e - Bail out from attach stage if failed to enable card, number of iospace
or memspace is unexpected, failed to map iospace or failed to configure
the controller properly.
- Disestablish an interrupt handler if failed to enable card.
2000-02-08 12:49:12 +00:00
enami 20522c36ed Detach MII if there is. 2000-02-03 06:03:39 +00:00
thorpej eed75dbc26 Don't dry to diving MIIF_NOISOLATE in the PHY drivers. Instead, pass
flags down from the parent to child vi mii_attach().
2000-02-02 17:09:38 +00:00
augustss a5f7a2c791 Detach rnd source in ep_detach(). Check for DVF_ACTIVE in epintr(); 2000-02-02 11:00:48 +00:00
augustss e4c766e299 Make sure to untimeout() things on detach. 2000-02-02 08:57:51 +00:00
augustss 82559ba682 Move detach operations around a little to simplify (and perhaps get it
right?).  Prompted by Jason, itojun and myself.
2000-02-02 08:41:00 +00:00
thorpej 84dc99fdea Bring some order to the chaos which was the MII code function naming
"conventions".
2000-02-02 08:05:26 +00:00
augustss ea45df4d30 Make sure to get rid of shutdown hook and ttach media on detach. 2000-02-02 08:00:21 +00:00
thorpej dc5a586c1c Use the common MII bit-bang module. 1999-11-19 18:17:14 +00:00
thorpej 4bdf6bd731 Call mii_down() as appropriate. 1999-11-12 18:14:17 +00:00
thorpej 0ad32f07d2 Revert this part of rev 1.59:
- Be more conservative when resetting the interface after a transmit error.

It caused the interface to totally wedge on the (somewhat common) transmit
FIFO underrun condition.
1999-11-04 20:27:11 +00:00
thorpej ca9b9a3b2e Adapt to mii_phy_probe() change. 1999-11-04 00:24:00 +00:00
enami b9451ead47 remmove unncecessary empty line. 1999-10-30 12:07:08 +00:00
enami fc21ddd943 Call epstop at the beginning of epinit, especially to make sure that
ep_tick is untimeouted before new one is scheduled.  This makes 3C574-TX
works at least in 10Mb/s mode.
1999-10-30 01:35:47 +00:00
enami 4c4a056bc5 fix typo in previous commit. 1999-10-20 16:39:11 +00:00
enami 8a5c548579 cosmetic changes before i do some functional changes. 1999-10-20 16:34:22 +00:00
thorpej 5082673b91 - Encapsulate the EEPROM reading code into ep_read_eeprom(), and use
the correct "read eeprom" opcode on the RoadRunner (which has a larger
  EEPROM, and thus needs a different opcode to make room for the larger
  offsets).
- Reset and enable the MII before probing for PHYs, and reset and enable
  the MII in epinit().
- Be more conservative when resetting the interface after a transmit error.

Based on PR #8331, from Ryoji KATO.

Closer on 3c574, probably will work fine with the 3CCFEM556BI (which
won't have an older rev TDK Semi PHY, and which was tested by the author
of the PR).
1999-10-11 17:48:20 +00:00
thorpej f98d358a1f Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m).  The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary.  Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
1999-05-18 23:52:51 +00:00
jonathan 055b827e11 Calling DELAY() during polling for command completion of the normal
per-packet discard of every received packet increases latency and
decrease throughput.  INstead, Spin on S_COMMAND_IN_PROGESS for enough
iterations as the expected time to completion.  Only do DELAY()/poll
loops (as suggested by Jason Thorpe) if spinning fails.
Take PCI as fastest case and compute worst-case estimate.

Shorten DELAY() in S_COMMAND_COMPLETE polling-loop up 10, loop-count
down.  to speed up epreset() completion (m/c filter change, ifup/ipdown, etc).
1999-04-20 04:40:24 +00:00
jonathan 07c7535688 * Make doubly sure that the ep shutdownhooks are run at splnet() or above.
* Clear the `enabled' bit in the softc so late hardware interrupts
  (e.g., just after the full reset) done as part of shutdown) are dropped.
* Eliminate loops that  poll forever on S_COMMAND_IN_PROGRESS to complete.
  Add inline function with bounded loopcount plus small delay, to avoid
  bugs in EISA hardware which never sets S_COMMAND_IN_PROGRESS.
  Use for both TX_RESET/RX_RESET/GLOBAL_RESET cmds, and polling for
  discard-Rx completion
1999-04-19 23:26:48 +00:00
jonathan 2bf9a70e67 Endian-ness bugfix for elink3 on big-endian hosts.
Big-endian CPUs should use bus_space_{read,write}_multi_stream methods
  to PIO packet data to NIC in 16-bit or 32-bit chunks.
  Make it so.
  Since we don't have stream methods on all ports yet (esp. i386), use
  the bus_space_{read,write}_multi methods if the compile-time
  stream-method feature-test   macro is not set.
Originally from tsubai@netbsd.org, via HAYAKAWA koichi's cardbus patches.
1999-04-13 20:23:52 +00:00
thorpej ad22c1dd58 Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
1999-03-25 23:16:37 +00:00
explorer 3ebb419571 Update to slightly altered rnd_attach_source() api 1999-02-28 17:08:05 +00:00
thorpej 69a4436f8b Avoid initializing the interface in the SIOCSIFFLAGS if ! UP and ! RUNNING. 1999-02-17 03:40:59 +00:00
mycroft 90b7cbc727 Simplify argument to MGET(), to generate better code. 1998-12-12 16:36:24 +00:00
thorpej 1d0f24882d Now that the *_activate() functions don't do things which are attachment
specific, move them into the chipset drivers.
1998-11-18 18:34:52 +00:00
thorpej dd6750820c Expose the "enable" and "disable" functions so that the front-ends can
access them.
1998-11-17 20:25:00 +00:00
thorpej d2afdb5b59 Fix some whitespace lossage, canonicalize some media names. 1998-11-16 19:13:31 +00:00
fvdl 7b10c3e7e4 Add the 'ex' driver, a DMA driver for 3Com 90x and 90xB cards. Rename
constants from EP_ to ELINK_ since they're now used in the ex driver as well.
1998-11-04 00:29:28 +00:00
thorpej f3bfb08d45 When determining the default media on the Vortex/Boomerang, don't pick
the full-duplex variant.  XXX We should check the EEPROM for "default to
full-duplex".
1998-08-28 18:16:02 +00:00
thorpej bc21c243cd For non-MII Vortex/Boomerang, set full-duplex in the MAC CONTROL register
in epsetmedia() if full-duplex is selected (new feature on these cards!)

On MII Boomerangs, set the full-duplex bit in MAC CONTROL in the statchg
callback from the MII layer.  Should fix full-duplex on these cards.
1998-08-26 01:32:41 +00:00
thorpej 6bfd748b46 First-crack at RoadRunner (3c574-TX 10/100Mbps PCMCIA). Doens't yet use
any of the RoadRunner speed hacks.
1998-08-17 23:20:39 +00:00
thorpej cbcc3cfa46 Oops, back out something that I didn't intend to commit. 1998-08-16 01:16:57 +00:00
thorpej 479d8b25bf The 3c515 (Corkscrew) and 3c574 (RoadRunner) have their Window 1 registers
offset!  Define an inline function to compute the Window 1 register offset
and use it.
1998-08-15 16:20:51 +00:00
thorpej b170caf730 Completely rewrite media selection. Add support for the MII/PHY on
the 3Com 3c905-TX and 3c905-T4.  Fix handling of the MII on the
3c595-MII and 3c597-MII (can't talk to the PHYs on these cards; just
use "manual" for the external MII port).

Fixes kern/4782 (Chris Demetriou).
1998-08-12 18:51:52 +00:00
jonathan 011f2bda08 defopt NS, NSIP. 1998-07-05 06:49:00 +00:00
jonathan 3751946b97 defopt INET, NETATALK. 1998-07-05 00:51:04 +00:00
augustss 713692a2b5 For the Rx:Tx split message change "(undefined)" to "3:5". 1998-03-04 18:10:03 +00:00
thorpej 095c4c092d Adjust for config changes. 1998-01-12 09:23:08 +00:00
jonathan 8bb9a1ccb2 Protect #ifdef DEBUG printfs with a run-time teson a patchable variable
(epdebug), as per Jason Thorpe's comments.
1997-10-18 00:15:02 +00:00
explorer f9370ddc7a Add and/or update rnd_*() hooks 1997-10-15 05:55:13 +00:00
thorpej 10708da893 Pull down from marc-pcmcia branch:
Minor tweaks to deal with PCMCIA differences, and support for power
management.
1997-10-14 21:28:37 +00:00
jonathan 2f459bf1d8 Initialize local variable 'j' in eeprombusy() to pacify gcc -O (not -O2)
on i386.
1997-07-30 18:26:23 +00:00
thorpej 151926da32 Make sure we're in register window 0 before attempting EEPROM access,
pointed out by Matthias Drochner.
1997-05-14 00:22:00 +00:00