summaryrefslogtreecommitdiff
path: root/sys/dev/ic/gem.c
AgeCommit message (Collapse)Author
2009-10-15Add detach support to a few more drivers, and in others do the neccessaryTheo de Raadt
operations in the detach function in the right order. Also ensure that the interrupt handlers not trust registers that go away. read over very carefully by dms, tested by me
2009-08-10More cases of shutdown hooks not needed after card is already stopped. InTheo de Raadt
these cases the xxstop function is a bit more complicated and has a flag of some sort, but the use of that flag does not matter; DMA is already ceased ok dlg
2009-08-09MCLGETI() will now allocate a mbuf header if it is not provided, thusTheo de Raadt
reducing the amount of splnet/splx dancing required.. especially in the worst case (of m_cldrop) ok dlg kettenis damien
2009-08-03Comment fixes and code tidy-up (whitespace and more consistentStuart Henderson
numeric values) from Brad. No binary change.
2009-07-18Remove redundant code for setting the maximum frame receive sizeStuart Henderson
and fix the appropriate code in gem_init_regs(). From Brad, tested by Brad (sparc64), todd@ (macppc).
2009-07-18Simplify receive filter handling, from Brad.Stuart Henderson
Tested by Brad on sparc64, todd@ on macppc.
2009-03-29Remove unused prototype.Mark Kettenis
2009-03-22Add workaround for RX MAC/FIFO hangs on ERI. Tested by matthieu@ and naddy@.Mark Kettenis
ok dlg@
2009-03-20Unconditionally drain the RX ring when stpping the chip.Mark Kettenis
ok dlg@, jsg@
2009-01-27make drivers tell the mclgeti allocator what their maximum ring size isDavid Gwynne
to prevent the hwm growing beyond that. this allows the livelock mitigation to do something where the hwm used to grow beyond twice the rx rings size. ok kettenis@ claudio@
2008-12-14Switch gem(4) over to using MCLGETI when allocating mbufs for the rx ring.Mark Kettenis
help from dlg@, tested by a few, ok dlg@
2008-12-10Replace m_free() with m_freem() in foo_start() to ensure that upon errorBrad Smith
the full mbuf chain is freed. ok claudio@ kettenis@
2008-11-28Eliminate the redundant bits of code for MTU and multicast handlingBrad Smith
from the individual drivers now that ether_ioctl() handles this. Shrinks the i386 kernels by.. RAMDISK - 2176 bytes RAMDISKB - 1504 bytes RAMDISKC - 736 bytes Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users. Build tested on almost all archs by todd@/brad@ ok naddy@
2008-11-26Use m_defrag instead of collapsing mbufs ourselves.Mark Kettenis
ok dlg@
2008-11-07Simplify the interface flag handling in the ioctl handler.Brad Smith
2008-11-07Remove storing the Ethernet header in the receve interrupt handler, theBrad Smith
disabled code that used to use this was removed 7 years ago.
2008-11-07- According to the Apple GMAC driver, the GEM ASIC specification andBrad Smith
the OpenSolaris eri(7D) the TX FIFO threshold has to be set to 0x4ff for the Gigabit variants and 0x100 for the ERI in order to avoid TX underruns. - Turn on workarounds for silicon bugs in the Apple GMAC variants. This was based on information obtained from the Darwin GMAC and Linux GEM drivers. - Turn on "infinite" (i.e. maximum 31 * 64 bytes in length) DMA bursts. From FreeBSD Tested by a few users with Apple GMAC's and Sun ERI.
2008-10-02First step towards cleaning up the Ethernet driver ioctl handling.Brad Smith
Move calling ether_ioctl() from the top of the ioctl function, which at the moment does absolutely nothing, to the default switch case. Thus allowing drivers to define their own ioctl handlers and then falling back on ether_ioctl(). The only functional change this results in at the moment is having all Ethernet drivers returning the proper errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown ioctl's. Shrinks the i386 kernels by.. RAMDISK - 1024 bytes RAMDISKB - 1120 bytes RAMDISKC - 832 bytes Tested by martin@/jsing@/todd@/brad@ Build tested on almost all archs by todd@/brad@ ok jsing@
2008-09-10Convert timeout_add() calls using multiples of hz to timeout_add_sec()Bret Lambert
Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
2008-08-30Fix an issue initially reported by drahn@ with gem(4) where theseBrad Smith
drivers can report 2-3x times the number of actual packets being transmitted by only incrementing the counter for descriptors with buffers being freed. ok kettenis@
2008-08-26Fix a couple of problems that may make gem(4) get stuck:Mark Kettenis
1. If bus_dmamap_load_mbuf() fails because there are not enough segments in the map, defrag the mbuf. 2. If there are not enough free (hardware ring) descriptors, set IFF_OACTIVE and keep the packet on the queue. 3. If there is some other resource starvation that makes bus_dmamap_load_mbuf() or defragmentation fail, drop the packet. Don't set IFF_OACTIVE, since the Tx ring could be empty and we'd be stuck. 4. Only pass packets that are actually handed off to the hardware to BPF. Do so before handing them off to the hardware to make sure the packet isn't freed behind our back. ok dlg@
2008-05-31Properly set the IFF_OACTIVE flag if all the descriptrs are in use forBrad Smith
the TX ring and clear the flag when some have been freed. ok dlg@ kettenis@
2008-05-09- Count excess and late collisions as output errors.Brad Smith
- Count receive errors as input errors. Based on similar change to the gem(4) driver from NetBSD. ok kettenis@
2008-02-10Set reserved bits in the TX Configuration Register the value from the Sun docs.Mark Kettenis
Seems to fix watchdog timeout issues in Sun ERI variants. tested by a few
2008-02-08Return ENOTTY not EINVAL for unsupported ioctl's;Thordur I. Bjornsson
ok kettenis@
2008-01-11Fall back on using SERDES if MDI0/MDI1 bits aren't set too. Fix PCS handling.Mark Kettenis
Makes the onboard fiber gem(4) in the Sun Fire V880 work. tested by many; ok dlg@
2007-09-30s/NPBFILTER/NBPFILTER/ in #endif comment. No functional change.Mark Kettenis
2007-04-19Cleanup phy selection code, simplifying the code considerably. Attach onlyMark Kettenis
one phy on Sun ERI; gets rid of the duplicate phy on the blade1k. tested by many, ok drahn@
2006-12-21betetr yet, just nuke sc_enaddr all together, just fill in arpcom andJason Wright
everybody is happy
2006-11-25ANSIBrad Smith
2006-11-25fix use of gem_bitwait().Brad Smith
2006-11-25Split the GEM registers into two halfs and provide a bus_space_handle_tBrad Smith
for each. While there, fix a typo in gem_bitwait(). From martin@NetBSD
2006-11-25Fix a copy and pasto.Brad Smith
From martin@NetBSD
2006-11-11be silentTheo de Raadt
2006-11-10Fix typo.Mark Kettenis
2006-11-10Add support for Sun 1000baseSX cards.Mark Kettenis
ok deraadt@
2006-10-17replace hand rolled code with LIST_FOREACH in gem_mediachange().Brad Smith
ok kettenis@ "Looks correct to me" krw@
2006-07-11put CRC error message under GEM_DEBUG. this just spews out like crazyBrad Smith
on a heavily loaded hub.
2006-04-15check for IFF_RUNNING being set before calling gem_init().Brad Smith
2006-03-25allow bpf(4) to ignore packets based on their direction (inbound orDamien Miller
outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@
2006-02-21remove some commented out and NetBSD-specific code.Brad Smith
2006-02-21add missing MTU ioctl switch case.Brad Smith
Noticed by: Ben Lovett <ben at tilderoot dot com>
2006-02-08eliminate a reset when configuring the IP address.Brad Smith
tested by kettenis@
2006-02-05call gem_setladrf() if the NIC is already running and only theBrad Smith
PROMISC or ALLMULTI flags are being adjusted or if adjusting the multicast addresses instead of doing a full re-init of the chip. ok kettenis@
2005-11-15add IFQ_SET_MAXLEN().Brad Smith
2005-11-07splimp -> splnetBrad Smith
2005-11-02sync mbuf before unloading in gem_rxdrain().Brad Smith
From NetBSD
2005-11-02handle TX underrun and packet too long errors by resetting the chip.Brad Smith
From NetBSD ok krw@
2005-10-31- some DEBUG should be GEM_DEBUGBrad Smith
- introduce gem_bitwait() to factor out some of the register wait code From NetBSD - remove some statics - remove parameter names from prototypes ok kettenis@
2005-10-31typoBrad Smith