summaryrefslogtreecommitdiffstats
path: root/sys/dev/nge
Commit message (Collapse)AuthorAgeFilesLines
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* When reading PHY regs over the i2c bus, the turnaround ACK bitmbr2003-01-101-1/+1
| | | | | | | | | | is read one clock edge too late. This bit is driven low by slave (as any other input data bits from slave) when the clock is LOW. The current code did read the bit after the clock was driven high again. Reviewed by: luoqi MFC after: 2 weeks
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* network interface driver changes:sam2002-11-142-28/+13
| | | | | | | | | | | | | | o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls Reviewed by: many Approved by: re
* Fix instances of macros with improperly parenthasized arguments.alfred2002-11-091-2/+2
| | | | Verified by: md5
* Add support for DEVICE_POLLING.simokawa2002-11-062-0/+79
| | | | | | PR: kern/44772 Submitted by: Takashi Oono <takashi@yha.att.ne.jp> MFC after: 1 week
* Add support for SX cards using TBI such as Netgear GA621.ambrisko2002-08-082-63/+249
| | | | | Sponsored by: Vernier Networks. MFC after: 1 week
* Cleanup after my de-__P (remove leading whitespace before prototype args).alfred2002-07-061-84/+120
| | | | | | Add newlines after function return types in function declarations. Approved by: wpaul (a long time ago)
* catch up with ext_free prototype change.alfred2002-06-291-2/+2
|
* Do not call nge_tick() if we get an PHY interrupt, nge_tick() callsphk2002-05-041-3/+11
| | | | | | | | | mii_tick() which should only be called once per second. Our current MII/PHY state-engine is not able to deal with PHY interrupts as far as I can tell, and most net drivers don't seem to use the link/status change call-back mechanism. It seems that MII/PHY was orphaned before it grew up.
* Make one generic mii_phy_detach() to replace 19 slightly different ones.phk2002-04-291-17/+1
| | | | | | | Rename mii_phy_auto_stop() mii_phy_down(). Introduce mii_down(), use it from nge. Do not indirect it to 19 identical case's in 19 switchstatements like NetBSD did.
* Move a lot closer to NetBSDs MII support for GigE.phk2002-04-291-1/+3
| | | | Move fxp and nge drivers over to use the new stuff.
* Follow NetBSD and s/IFM_1000_TX/IFM_1000_T/phk2002-04-281-2/+2
|
* If the receiver runs out of space for an received frame in the internalphk2002-04-132-22/+8
| | | | | | | | | | | | | | | | | | | FIFO or the in-RAM descriptors it will switch to RX_IDLE from where it is not restarted. We used to deal with RX_IDLE by doing a total reinit but this lost our link and caused a potential 30sec autonegotiation against switches. This was changed to a less heavyhanded approach, but this failed to restart the receiver it it were in the RX_IDLE state. This change adds the RX_IDLE and the RX_FIFO_OFLOW conditions as triggers for interrupts and receive side processing, and restarts the receiver when it is RX_IDLE. Remove the #ifdef notyet'ed nge_rxeoc() function. Sponsored by: Cybercity Internet, Denmark. MFC after: 7 days
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+2
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Remove __P.alfred2002-03-201-51/+47
|
* Remove errors in LINT (now that they are fatal)julian2002-02-271-0/+4
|
* Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from thebrooks2001-12-031-1/+1
| | | | | | mbuf instead. Suggested by: fenner
* Do not call mii_polltick() immediately after mii_tick().jlemon2001-09-291-1/+0
| | | | Poiinted out by: wpaul
* Handle the RX FIFO overflow condition with the rxeof handler insteadwpaul2001-09-192-3/+4
| | | | | | | | of the rxeoc handler for now. The rxeoc handler will reset the link, and the NatSemi chip's RX FIFO will overflow on a 32-bit bus once you start hitting it with 500Mbps or more of traffic. Also increase the size of the RX ring to 128 descriptors (was 64).
* Have the driver to announce what capabilitis it supports.jlemon2001-09-181-0/+2
|
* Make vlan(4) loadable, unloadable, and clonable. As a side effect,brooks2001-09-051-22/+6
| | | | | | | interfaces must now always enable VLAN support. Reviewed by: jlemon MFC after: 3 weeks
* IFT_8021_VLAN -> IFT_L2VLAN per if_vlan_var.h rev 1.9. With this changebrooks2001-07-251-1/+1
| | | | LINT compiles, but doesn't link.
* Change the interrupt handler a bit so that we call the nge_rxeof() handlerwpaul2001-07-161-3/+2
| | | | | | when we get an RX_ERR interrupt rather than the nge_rxeoc() handler. The rxeoc (end of channel) handler attempts to reinitialize the whole NIC, which we don't want to do if we only received a bad packet.
* Two optimizations:wpaul2001-07-101-10/+35
| | | | | | | | | | | | | 1) Bite the bullet, and allow unaligned accesses without buffer copies on the i386 platform. According to some tests run by Andrew Gallatin, the buffer copy performance hit is greater than the unaligned access performance hit (especially with jumbo frames). We still need to copy everywhere else. 2) Enable interrupt moderation with a 100us timeout. Submitted by: Andrew Gallatin <no longer at duke.edu> MFC after: 1 week
* Apply patch supplied by Jonathan Chen: use the correct arguments towpaul2001-07-091-2/+2
| | | | | pci_enable_io(). We need to use SYS_RES_IOPORT/SYS_RES_MEMORY instead of PCIM_CMD_PORTEN/PCIM_CMD_MEMEN.
* Do not set the MODE_1000 bit unless we actually have a gigabit link.wpaul2001-07-081-1/+9
| | | | | | | | | | Previously, I had the MODE_1000 bit in the global config register set unconditionally, which was wrong: we have to turn it off if we have a 10/100 link. This is now handled in the nge_miibus_statchg() routine. Discovered by: Nathan Binkert <binkertn@eecs.umich.edu> (Note: this commit is being done from JFK airport. :P )
* Change m_devget()'s outdated and unused `offset' argument to actually meanbmilekic2001-06-201-3/+2
| | | | | | | | | | | | | | | | | | | | something: offset into the first mbuf of the target chain before copying the source data over. Make drivers using m_devget() with a first argument "data - ETHER_ALIGN" to use the offset argument to pass ETHER_ALIGN in. The way it was previously done is potentially dangerous if the source data was at the top of a page and the offset caused the previous page to be copied (if the previous page has not yet been appropriately mapped). The old `offset' argument in m_devget() is not used anywhere (it's always 0) and dates back to ~1995 (and earlier?) when support for ethernet trailers existed. With that support gone, it was merely collecting dust. Tested on alpha by: jlemon Partially submitted by: jlemon Reviewed by: jlemon MFC after: 3 weeks
* Fix some memory bugs with regard to jumbo buffers. I made a mistake whenwpaul2001-06-182-8/+5
| | | | | | | | | | converting from the old external mbuf buffer code to the new (with the MEXTADD() macro). Also free free list memory correctly in foo_free_jumbo_mem() routines: grab the head of the list, then remove it, _then_ free() it. This fixes the memory corruption problem I've been chasing in the level 1 driver.
* Mind-o in last commit: s/==/>=/ when checking MTU size. *blush*wpaul2001-06-161-1/+1
|
* Fix the last serious bug I've been chasing:wpaul2001-06-161-23/+41
| | | | | | | | | | | | | | The DP83820/83821 has an undocumented limitation concerning jumbo frames and TX checksum offload. In order for TX checksum offload to work, the outgoing frame must fit entirely within the TX FIFO, which is 8192 bytes in size. This isn't a problem, until you try to send a 9000-byte frame, at which point the TX DMA engine goes to sleep. It turns out that if you want to send a jumbo frame larger than 8170 bytes (8192 - 64), you have to turn off the TX checksum support. As a workaround, I changed nge_ioctl() so that if the user selects an MTU larger than 8152 bytes, we clear the if_hwassist flags. The flags will be set again once the MTU is reduced to a smaller value.
* Turn TCP and UDP hardware RX checksumming back on. jlemon pointed out wherewpaul2001-06-151-3/+1
| | | | I'd gone wrong before: we have to set csum_data to 0xffff, not 0.
* Fix TX bug: when using TCP/IP checksum offload on TX, we tell the chipwpaul2001-06-151-4/+4
| | | | | | | we want the checksums calculated on a per-packet basis using control bits in the extsts field of the DMA descriptor structure. For TX, the chip seems to want these bits set in the field of the first descriptor in a fragment chain, not the last.
* - Remember to set the 'extsts enable' bit in the CFG register to enable thewpaul2001-06-062-16/+16
| | | | | | | | use of the extsts field in DMA descriptors. We need this to tell the chip to calculate TCP/IP checksums in hardware on a per-packet basis. - Fix the unions in DMA descriptor structures. Breakage on alpha led me to realize I'd done it wrong the first time.
* Disable extra TCP/UCP checksum checking in nge_rxeof() for now.wpaul2001-06-061-0/+2
|
* Per jlemon: add code to nge_rxeof() to allow verification of TCP andwpaul2001-05-291-0/+8
| | | | | | | UDP checksums too, not just IP. The chip only tells us if the checksum is ok, it does not give us a copy of the partial checksum for later processing. We have to deal with this the right way, but we can deal with it.
* Fix mind-o in nge_rxeof(): I used CSUM_IP_CHECKED twice instead ofwpaul2001-05-291-1/+1
| | | | CSUM_IP_CHECKED|CSUM_IP_VALID.
* Fix instance of (struct ti_softc *) that should have beenwpaul2001-05-151-1/+1
| | | | | | (struct nge_softc *), which the compiler never complained about. I guess it doesn't matter, a pointer is a pointer, but looked weird to me.
* Adjust the descriptor structures a little by making the software partswpaul2001-05-151-4/+12
| | | | | | | | | | be unions with enough padding to make sure they always end up being a multiple of 8 bytes in size, since the 83820/83821 chips require descriptors to be aligned on 64-bit boundaries. I happened to get it right for the 32-bit descriptor/x86 case, but botched everything else. Things should work properle on 32-bit/64-bit platforms now. Note that the 64-bit descriptor format isn't being used currently.
* Unbreak release. *sigh*wpaul2001-05-121-1/+1
|
* It's vlan.h, not opt_vlan.h.wpaul2001-05-111-1/+1
|
* Add support for gigabit ethernet cards based on the NatSemi DP83820wpaul2001-05-112-0/+2712
and DP83821 gigabit ethernet MAC chips and the NatSemi DP83861 10/100/1000 copper PHY. There are a whole bunch of very low cost cards available with this chipset selling for $150USD or less. This includes the SMC9462TX, D-Link DGE-500T, Asante GigaNIX 1000TA and 1000TPC, and a couple cards from Addtron. This chip supports TCP/IP checksum offload, VLAN tagging/insertion. 2048-bit multicast filter, jumbograms and has 8K TX and 32K RX FIFOs. I have not done serious performance testing with this driver. I know it works, and I want it under CVS control so I can keep tabs on it. Note that there's no serious mutex stuff in here yet either: I need to talk more with jhb to figure out the right way to do this. That said, I don't think there will be any problems. This driver should also work on the alpha. It's not turned on in GENERIC.
OpenPOWER on IntegriCloud