Commit Graph

11 Commits

Author SHA1 Message Date
Pyun YongHyeon
5d384a0de9 Announce flow control ability to PHY driver and enable RX flow
control.  Controller does not automatically generate pause frames
based on number of available RX buffers so it's very hard to
know when driver should generate XON frame in time.  The only
mechanism driver can detect low number of RX buffer condition is
ET_INTR_RXRING0_LOW or ET_INTR_RXRING1_LOW interrupt.  This
interrupt is generated whenever controller notices the number of
available RX buffers are lower than pre-programmed value(
ET_RX_RING0_MINCNT and ET_RX_RING1_MINCNT register).  This scheme
does not provide a way to detect when controller sees enough number
of RX buffers again such that efficient generation of XON/XOFF
frame is not easy.

While here, add more flow control related register definition.
2011-12-09 19:10:38 +00:00
Pyun YongHyeon
39bea5ddf3 Remove unnecessary definition of ET_PCIR_BAR. Controller support
I/O memory only.
While here, use pci_set_max_read_req(9) rather than directly
manipulating PCIe device control register.
2011-12-09 18:34:45 +00:00
Pyun YongHyeon
fa1483dd2f Do not disable interrupt without knowing whether the raised
interrupt is ours.  Note, interrupts are automatically ACKed when
the status register is read.
Add RX/TX DMA error to interrupt handler and do full controller
reset if driver happen to encounter these errors.  There is no way
to recover from these DMA errors without controller reset.
Rename local variable name intrs with status to enhance
readability.

While I'm here, rename ET_INTR_TXEOF and ET_INTR_RXEOF to
ET_INTR_TXDMA and ET_INTR_RXDMA respectively.  These interrupts
indicate that a frame is successfully DMAed to controller's
internal FIFO and they have nothing to do with EOF(end of frame).
Driver does not need to wait actual end of TX/RX of a frame(e.g.
no need to wait the end signal of TX which is generated when a
frame in TX FIFO is emptied by MAC).  Previous names were somewhat
confusing.
2011-12-09 18:17:02 +00:00
Pyun YongHyeon
38953bb0a5 Disable all clocks and put PHY into COMA before entering into
suspend state.  This will save more power.
On resume, make sure to enable all clocks.  While I'm here, if
controller is not fast ethernet, enable gigabit PHY.
2011-12-07 23:20:14 +00:00
Pyun YongHyeon
6f61c82844 Consistently use a tab character instead of using either a space or
tab after #define.
While I'm here consistently use capital letters when it uses
hexadecimal notation.

No functional changes.
2011-12-07 22:04:57 +00:00
Pyun YongHyeon
e0b5ac0220 Implement hardware MAC statistics counter. Counters could be
queried with dev.et.%d.stats sysctl node where %d is an instance of
device.
2011-12-07 21:46:09 +00:00
Pyun YongHyeon
7ac1823956 Remove NetBSD license. r199548 removed all bit macros that were
derived from NetBSD.
2011-12-05 22:09:07 +00:00
Xin LI
e5fdd9de2c Change copyright holder to author. We prefer using a real legal
entity for copyright holders.

Approved by:	sephe
MFC after:	3 days
2010-07-30 17:51:22 +00:00
Pyun YongHyeon
73e338b028 Remove extra spce at the EOL. 2009-11-19 21:46:58 +00:00
Pyun YongHyeon
23263665d5 Remove complex macros that were used to compute bits values.
Although these macros may have its own strength, its complex
definition make hard to read the code.

Approved by:	delphij
2009-11-19 20:57:35 +00:00
Xin LI
4d52a57549 Add et(4), a port of DragonFly's Agere ET1310 10/100/Gigabit
Ethernet device driver, written by sephe@

Obtained from:	DragonFly
Sponsored by:	iXsystems
MFC after:	2 weeks
2008-06-20 19:28:33 +00:00