Commit Graph

68 Commits

Author SHA1 Message Date
thorpej 749715f6ee Use aprint_*(). 2003-01-31 00:26:25 +00:00
enami 545f475e0e Fix multicast handling on 3C905B or later card;
- Handle IFF_ALLMULTI case correctly.  This is necessary to mrouted working.
  Tested by taca@netbsd.org.
- Clear unnecessary multicast hash bit.  Otherwise, unnecessary multicast
  packet is received.  Tested by me with the 3C905C bought at akihabara.
  It was 2980yen.

The code is written by fvdl@netbsd.org and me.
2002-11-09 11:45:18 +00:00
fair 96b8b890ed Change the "dontcare bits" argument to ifmedia_init() to IFM_IMASK
so that it is possible select PHY instances other than the first
one (instance zero), if there is more than one PHY attached.
2002-10-22 00:01:55 +00:00
thorpej f3ae1a786e In ex_shutdown(), call ex_enable() to make sure the interface is
powered up and the PCI configuration registers restored.  If we
don't do this, the firmware on some machines gets REALLY confused.
2002-07-01 16:16:37 +00:00
itojun 92cb1aaac7 more proper fix to ex_disable. 2002-06-20 23:47:25 +00:00
wiz d30d25dc1a Spelling fixes, from Sergey Svishchev in kern/16650. 2002-05-12 15:48:36 +00:00
mhitch d410426604 Interface byte counts are counted in ether_input() and ether_output(). Don't
count them when reading the NIC counters - it doubles the count.  Read the
NIC counters to prevent counter overflow interrupts, but don't add them to
the interface counters.  Don't bother reading the upper counts because they
are just latched when reading the totals.

Fixes final part of PR#11549.
2002-04-06 19:28:01 +00:00
christos 49b8e36112 Clean up the C_ and S_ constants. We don't really need two sets of them.
Also make the interrupt handler for older 3com cards look like the xl one.
I.e. don't ack the interrupt latch bit before checking if it is set.
At the same time, introduce constants for the watched interrupts, so that
we don't copy them all over the place.
2001-12-28 20:35:46 +00:00
lukem a4bae8b066 add/cleanup RCSID 2001-11-13 13:14:31 +00:00
perry 7a702dcf66 trivially rename some macro parameters to avoid lint warnings. 2001-11-10 22:48:09 +00:00
yamt 9946aef1da ack intr only when intr is for us. 2001-10-03 06:58:47 +00:00
yamt 0e8ee83d8f avoid losing a desc on error. 2001-10-01 09:26:29 +00:00
wiz 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
thorpej 623f83a793 Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places. 2001-07-19 16:25:23 +00:00
thorpej 0884f20bf7 bzero -> memset 2001-07-07 16:13:44 +00:00
thorpej 06ff822b44 bcopy -> strcpy 2001-07-07 15:57:50 +00:00
thorpej c2c26e1362 bcmp -> memcmp 2001-07-07 05:35:39 +00:00
thorpej 9988acd41e Don't need INET or NS includes here. 2001-06-12 22:28:15 +00:00
thorpej ca4d373730 Implement support for IP/TCP/UDP checksum offloading provided by
network interfaces.  This works by pre-computing the pseudo-header
checksum and caching it, delaying the actual checksum to ip_output()
if the hardware cannot perform the sum for us.  In-bound checksums
can either be fully-checked by hardware, or summed up for final
verification by software.  This method was modeled after how this
is done in FreeBSD, although the code is significantly different in
most places.

We don't delay checksums for IPv6/TCP, but we do take advantage of the
cached pseudo-header checksum.

Note: hardware-assisted checksumming defaults to "off".  It is
enabled with ifconfig(8).  See the manual page for details.

Implement hardware-assisted checksumming on the DP83820 Gigabit Ethernet,
3c90xB/3c90xC 10/100 Ethernet, and Alteon Tigon/Tigon2 Gigabit Ethernet.
2001-06-02 16:17:06 +00:00
fvdl ba2882488a Despite what the hardware docs say, the global reset command is not
done when the command-in-progress bit has been cleared. The 1ms
time that is mentioned also seems wrong; 20,000us is not enough
on at least one machine. So, do a delay(100000) in ex_reset.
Fortunately, this function is only called when the card is
attached or when hardware failure is suspected.

While here, only mask one 1 bit in the 'reset hack' case.
2001-05-10 22:57:44 +00:00
kanaoka 0d6646292e - Fix typo in comment.
- Add (missed)powerhook_disestablish() in ex_detach().
 - Sync with below.     Original commit log message:
 Add new powerhook argument values, PWR_SOFTSUSPEND, PWR_SOFTSTANDBY and
 PWR_SOFTRESUME. Apm calls powerhook with the values in normal interrupt
 priority level while others are protected with splhigh().
2001-04-26 08:21:51 +00:00
thorpej 9710d432c2 Power management support for the CardBus Etherlink XL cards.
From Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>.
2001-01-30 19:27:39 +00:00
thorpej 6b16911a43 ALTQ'ify. 2000-12-14 06:27:23 +00:00
thorpej b84f740be0 Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach(). 2000-11-15 01:02:11 +00:00
thorpej 275539f03c NBPG -> PAGE_SIZE 2000-11-14 18:21:00 +00:00
bouyer f87b1573c3 Support ETHERCAP_VLAN_MTU by ignoring the EX_UPD_ERROR and EX_UPD_OVERSIZED
status bits. Tested with a 3c905-TX.
2000-10-17 16:16:52 +00:00
thorpej 2198741306 Use ether_ioctl(). 2000-10-11 16:57:45 +00:00
thorpej 7ca3fb9ef0 Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
2000-10-01 23:32:39 +00:00
fvdl c5d8401866 Add support for the 3c555, 556 and 556B MiniPCI cards. Based on the
cardbus code and the FreeBSD xl driver.
2000-09-19 01:15:06 +00:00
haya ea9ef4ff69 Correct LED polarity bit. This bit and PHY power bit should be
defined in elinkxlreg.h.
2000-08-31 08:42:29 +00:00
haya 25147761ff Add support 3C[CX]FE575CT. 2000-08-29 08:54:50 +00:00
haya 0e2c6c0cc1 Access on ELINK_W3_INTERNAL_CONFIG register with 32-bit mode. Remove
16-bit access code.  This register is 32-bit.  16-bit access with the
register causes data inconsistency (especially for CardBus cards).
2000-08-25 09:01:59 +00:00
mrg 314f1e97c5 remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-28 17:12:48 +00:00
mrg e185413725 remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h> 2000-06-27 04:18:48 +00:00
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
thorpej 692e54c43d Use ether_crc32_be(). 2000-05-12 16:44:19 +00:00
tsutsui 0ee6a24aa7 Read upd_pktstatus from DMA buffer after bus_dmamap_sync() called. 2000-05-12 15:22:33 +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
enami a5921b902e Check if device is active in the interrupt handler and the one second
tick handler.
2000-03-02 01:21:56 +00:00
thorpej ac1b683642 Amend previous; pay attention to EX_CONF_MII on deactivate, too. 2000-03-01 20:53:11 +00:00
thorpej 448dfa4249 Only detach PHYs if we have MII in the first place, and remove a bunch
of #if 0'd code which was copied from the Tulip driver.
2000-03-01 20:51:50 +00:00
augustss 494c9affea Support detach. 2000-02-05 18:11:55 +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
thorpej 84dc99fdea Bring some order to the chaos which was the MII code function naming
"conventions".
2000-02-02 08:05:26 +00:00
mycroft 9efabde18b Rearrange ex_intr() to use C_INTR_LATCH the same way the ep driver does,
to prevent race conditions.
2000-01-18 03:35:40 +00:00
thorpej afbb07a0e5 Use htole32() and le32toh(). 1999-12-12 02:53:56 +00:00
bouyer 3a220103e8 Adapt printf format for 64bit stats counters. 1999-11-19 10:42:48 +00:00
thorpej 916d6aaa36 Use the common MII bit-bang module. 1999-11-17 17:56:52 +00:00