<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/sys/dev/nge, branch stable/7</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=stable%2F7</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=stable%2F7'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2011-12-31T01:10:29Z</updated>
<entry>
<title>MFC r226478:</title>
<updated>2011-12-31T01:10:29Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2011-12-31T01:10:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=b1edb1d47a06cc90022e55051658ccde362a10d8'/>
<id>urn:sha1:b1edb1d47a06cc90022e55051658ccde362a10d8</id>
<content type='text'>
  Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
  Because driver is accessing a common MII structure in
  mii_pollstat(), updating user supplied structure should be done
  before dropping a driver lock.

  Reported by:	Karim (fodillemlinkarimi &lt;&gt; gmail dot com)
</content>
</entry>
<entry>
<title>MFC: r226995 (partially), r227042</title>
<updated>2011-11-06T21:11:22Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2011-11-06T21:11:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=d3ecab167c2ba356e77f21a0c18b9d11572b789e'/>
<id>urn:sha1:d3ecab167c2ba356e77f21a0c18b9d11572b789e</id>
<content type='text'>
- Import the common MII bitbang'ing code from NetBSD and convert drivers to
  take advantage of it instead of duplicating it. This reduces the size of
  the i386 GENERIC kernel by about 8k. The only potential in-tree users left
  unconverted are ed(4) and xe(4). Xe(4) generally should be changed to use
  miibus(4) instead of implementing PHY handling on its own, as otherwise it
  makes not much sense to add a dependency on miibus(4)/mii_bitbang(4) to it
  just for the MII bitbang'ing code. Ed(4) has some chip specific things
  interwinded with the MII bitbang'ing code and it's unclear whether it can
  be converted to common code, at least not without thorough testing of all
  the various chips supported by ed(4).
  The common MII bitbang'ing code also is useful in the embedded space for
  using GPIO pins to implement MII access.
- Based on lessons learnt with dc(4) (see r185750), add bus barriers to the
  MII bitbang read and write functions of the other drivers converted in
  order to ensure the intended ordering. Given that register access via an
  index register as well as register bank/window switching is subject to the
  same problem, also add bus barriers to the respective functions of smc(4),
  tl(4) and xl(4).
- Sprinkle some const.

Thanks to the following testers:
Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4))
Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4).

Reviewed by:	yongari (subset of drivers)
Obtained from:	NetBSD (partially)
</content>
</entry>
<entry>
<title>MFC: r221407 (partial)</title>
<updated>2011-09-11T20:25:57Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2011-09-11T20:25:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=99e4ce3e7b07bcdeca71fdffa04401cb54e795aa'/>
<id>urn:sha1:99e4ce3e7b07bcdeca71fdffa04401cb54e795aa</id>
<content type='text'>
- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Add a PHY-specific reset routine is for lxtphy(4) which disables MII
  interrupts.
- Remove redundant checks in NIC drivers for mii-&gt;mii_instance not being
  zero before calling the reset routines because as soon as one PHY driver
  attaches mii-&gt;mii_instance is incremented and we hardly can end up in
  their media change callbacks etc if no PHY driver has attached as
  mii_attach() would have failed in that case and not attach a miibus(4)
  instance.
- Convert the mebers of the MII data structure to unsigned where
  appropriate. This is partly inspired by NetBSD/OpenBSD.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
  weren't explicitly converted to support flow control before. It's
  unclear whether flow control actually works with these but typically
  it should and their net behavior should be more correct with these
  changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from:	NetBSD (partially)
</content>
</entry>
<entry>
<title>MFC: r213894, r213896, r214913</title>
<updated>2010-11-07T17:38:54Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2010-11-07T17:38:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=5ef253ad3271b78ee1e9eb8cad20afaf6e613671'/>
<id>urn:sha1:5ef253ad3271b78ee1e9eb8cad20afaf6e613671</id>
<content type='text'>
Converted the remainder of the NIC drivers to use the mii_attach()
introduced in r213878 (MFC'ed to stable/7 in r214685) instead of
mii_phy_probe(). Unlike r213893 (MFC'ed to stable/7 in r214910)
these are mostly straight forward conversions though.
</content>
</entry>
<entry>
<title>MFC r192506:</title>
<updated>2009-06-07T05:46:12Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2009-06-07T05:46:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=7574501460815308f19ecfb5e73d6b19201f8138'/>
<id>urn:sha1:7574501460815308f19ecfb5e73d6b19201f8138</id>
<content type='text'>
  bus_dma(9) conversion and make nge(4) work on all architectures.
  o Header file cleanup.
  o bus_dma(9) conversion.
    - Removed all consumers of vtophys(9) and converted to use
      bus_dma(9).
    - 64bit DMA support was disabled because DP83821 is not capable
      of handling the DMA request. 64bit DMA request on DP83820
      requires different descriptor structures and it's hard to
      dynamically change descriptor format at run time so I disabled
      it. Note, this is the same behavior as previous one but
      previously nge(4) didn't explicitly disable 64bit mode on
      DP83820.
    - Added Tx/Rx descriptor ring alignment requirements(8 bytes
      alignment).
    - Limit maximum number of Tx DMA segments to 16. In fact,
      controller does not seem to have limitations on number of Tx
      DMA segments but 16 should be enough for most cases and
      m_collapse(9) will handle highly fragmented frames without
      consuming a lot of CPU cycles.
    - Added Rx buffer alignment requirements(8 bytes alignment). This
      means driver should fixup received frames to align on 16bits
      boundary on strict-alignment architectures.
    - Nuked driver private data structure in descriptor ring.
    - Added endianness support code in Tx/Rx descriptor access.
  o Prefer faster memory mapped register access to I/O mapped access.
     Added fall-back mechanism to use alternative register access.
     The hardware supports both memory and I/O mapped access.
  o Added suspend/resume methods but it wasn't tested as controller I
    have does not support PCI PME.
  o Removed swap argument in nge_read_eeprom() since endianness
    should be handled after reading EEPROM.
  o Implemented experimental 802.3x full-duplex flow-control. ATM
    it was commented out but will be activated after we have generic
    flow-control framework in mii(4) layer.
  o Rearranged promiscuous mode settings and simplified logic.
  o Always disable Rx filter prior to changing Rx filter functions as
    indicated in DP83820/DP83821 datasheet.
  o Added an explicit DELAY in timeout loop of nge_reset().
  o Added a sysctl variable dev.nge.%d.int_holdoff to control
    interrupt moderation. Valid ranges are 1 to 255(default 1) in
    units of 100us. The actual delivery of interrupt would be delayed
    based on the sysctl value. The interface has to be brought down
    and up again before a change takes effect. With proper tuning
    value, users do not need to resort to polling(4) anymore.
  o Added ALTQ(4) support.
  o Added missing IFCAP_VLAN_HWCSUM as nge(4) can offload Tx/Rx
    checksum calculation on VLAN tagged frames as well as VLAN tag
    insertion/stripping. Also add IFCAP_VLAN_MTU capability as nge(4)
    can handle VLAN tagged oversized frames.
  o Fixed media header length for VLAN.
  o Rearranged nge_detach routine such that it's now used for general
    clean-up routine.
  o Enabled MWI.
  o Accessing EEPROM takes very long time so read 6 bytes ethernet
    address with one call instead of 3 separate accesses.
  o Don't set if_mtu in device attach, it's already set in
    ether_ifattach().
  o Don't do any special things for TBI interface. Remove TBI
    specific media handling in the driver and have gentbi(4) handle
    it. Add glue code to read/write TBI PHY registers in miibus
    method. This change removes a lot of PHY handling code in driver
    and now its functionality is handled by mii(4).
  o Alignment fixup code is now applied only for strict-alignment
    architectures. Previously the code was applied for all
    architectures except i386. With this change amd64 will get
    instant Rx performance boost.
  o When driver fails to allocate a new mbuf, update if_qdrops so
    users can see what was wrong in Rx path.
  o Added a workaround for a hardware bug which resulted in short
    VLAN tagged frames(e.g. ARP) was rejected as if runt frame was
    received. With this workaround nge(4) now accepts the short VLAN
    tagged frame and nge(4) can take full advantage of hardware VLAN
    tag stripping. I have no idea how this bug wasn't known so far,
    without the workaround nge(4) may never work on VLAN
    environments.
  o Fixed Rx checksum offload logic such that it now honors active
    interface capability configured with ifconfig(8).
  o In nge_start()/nge_txencap(), always leave at least one free
    descriptor as indicated in datasheet. Without this the hardware
    would be confused with ring descriptor structure(e.g. no clue
    for the end of descriptor ring).
  o Removed dead-code that checks interrupts on PHY hardware. The
    code was designed to detect link state changes but it was
    disabled as driving nge_tick clock would break auto-negotiation
    timer. This code is no longer needed as nge(4) now uses mii(4)
    and link state change handling is done with mii callback.
  o Rearranged ethernet address programming logic such that it works
     on strict-alignment architectures.
  o Added IFCAP_VLAN_HWTAGGING/IFCAP_VLAN_HWCSUM handler in
     nge_ioctl() such that the functionality is configurable with
     ifconfig(8). DP83820/DP83821 can do checksum offload for VLAN
     tagged frames so enable Tx/Rx checksum offload for VLAN
     interfaces.
  o Simplified IFCAP_POLLING selection logic in nge_ioctl().
  o Fixed module unload panic when bpf listeners are active.
  o Tx/Rx descriptor ring address uses 64bit DMA address for
     readability. High address part of DMA would be 0 as nge(4)
     disabled 64bit DMA transfers so it's ok for DP83821.
  o Removed volatile keyword in softc as bus_dmamap_sync(9) should
     take care of this.
  o Removed extra driver private structures in descriptor ring. These
     extra elements are not part of descriptor structure. Embedding
     private driver structure into descriptor ring is not good idea
     as its size may be different on 32bit/64bit architectures.
  o Added miibus_linkchg method handler to catch link state changes.
  o Removed unneeded nge_ifmedia in softc. All TBI access is handled
    in gentbi(4). There is no difference between TBI and non-TBI case
    now.
  o Removed "gigabit link up" message handling in nge_tick. Link
    state change notification is already performed by mii(4) and
    checking link state by accessing PHY registers in periodic timer
    handler of driver is wrong. All link state and speed/duplex
    monitoring should be handled in PHY driver.
  o Use our own timer for watchdog instead of if_watchdog/if_timer
    interface.
  o Added hardware MAC statistics counter, users canget current MAC
    statistics from dev.nge.%d.stats sysctl node(%d is unit number of
    a device).
  o Removed unused macros, NGE_LASTDESC, NGE_MODE, NGE_OWNDESC,
    NGE_RXBYTES.
  o Increased number of Tx/Rx descriptors from 128 to 256. From my
    experience on gigabit ethernet controllers, number of descriptors
    should be 256 or higher to get an optimal performance on gigabit
    link.
  o Increased jumbo frame length to 9022 bytes to cope with other
    gigabit ethernet drivers. Experimentation shows no problems with
    9022 bytes.
  o Removed unused member variables in softc.
  o Switched from bus_space_{read|write}_4 to bus_{read|write}_4.
  o Added support for WOL.
</content>
</entry>
<entry>
<title>MFC r192288-192292,192294,192297-192299:</title>
<updated>2009-06-07T05:41:13Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2009-06-07T05:41:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=1541b8318c50dffaefe595d183a7f8755ab344cf'/>
<id>urn:sha1:1541b8318c50dffaefe595d183a7f8755ab344cf</id>
<content type='text'>
r192288:
  Use ANSI C declarations for all functions.

r192289:
  Remove register keyword.

r192290:
  Remove trailling whitespaces.

r192291:
  Remove return statement at the end of functions that return void.

r192292:
  style(9) - space after keyword.

r192294:
  s/u_int8_t/uint8_t/g
  s/u_int16_t/uint16_t/g
  s/u_int32_t/uint32_t/g

r192297:
  style(9)

r192298:
  Consistently use tab characters instead of spaces.

r192299:
  Remove extra parenthesis used in macros. These macros are not used
  in driver, though.
</content>
</entry>
<entry>
<title>MFC: Fix function prototype for device_shutdown method.</title>
<updated>2008-03-13T07:50:48Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2008-03-13T07:50:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=b9251501098ece76306aa0fd7417efc01883a316'/>
<id>urn:sha1:b9251501098ece76306aa0fd7417efc01883a316</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Catch up the rest of the drivers with the ether_vlan_mtap modifications.</title>
<updated>2007-03-04T03:38:08Z</updated>
<author>
<name>Christian S.J. Peron</name>
<email>csjp@FreeBSD.org</email>
</author>
<published>2007-03-04T03:38:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=59a0d28bacbcc668a45c393f836f97cd8b536f8a'/>
<id>urn:sha1:59a0d28bacbcc668a45c393f836f97cd8b536f8a</id>
<content type='text'>
If these drivers are setting M_VLANTAG because they are stripping the
layer 2 802.1Q headers, then they need to be re-inserting them so any
bpf(4) peers can properly decode them.

It should be noted that this is compiled tested only.

MFC after:	3 weeks
</content>
</entry>
<entry>
<title>o break newbus api: add a new argument of type driver_filter_t to</title>
<updated>2007-02-23T12:19:07Z</updated>
<author>
<name>Paolo Pisati</name>
<email>piso@FreeBSD.org</email>
</author>
<published>2007-02-23T12:19:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=ef544f631226436ef590825881e7a28369df82f6'/>
<id>urn:sha1:ef544f631226436ef590825881e7a28369df82f6</id>
<content type='text'>
  bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@
</content>
</entry>
<entry>
<title>Move ethernet VLAN tags from mtags to its own mbuf packet header field</title>
<updated>2006-09-17T13:33:30Z</updated>
<author>
<name>Andre Oppermann</name>
<email>andre@FreeBSD.org</email>
</author>
<published>2006-09-17T13:33:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=78ba57b9e1fd08812b6f5a1b48a20d624a23b31d'/>
<id>urn:sha1:78ba57b9e1fd08812b6f5a1b48a20d624a23b31d</id>
<content type='text'>
m_pkthdr.ether_vlan.  The presence of the M_VLANTAG flag on the mbuf
signifies the presence and validity of its content.

Drivers that support hardware VLAN tag stripping fill in the received
VLAN tag (containing both vlan and priority information) into the
ether_vtag mbuf packet header field:

	m-&gt;m_pkthdr.ether_vtag = vlan_id;	/* ntohs()? */
	m-&gt;m_flags |= M_VLANTAG;

to mark the packet m with the specified VLAN tag.

On output the driver should check the mbuf for the M_VLANTAG flag to
see if a VLAN tag is present and valid:

	if (m-&gt;m_flags &amp; M_VLANTAG) {
		... = m-&gt;m_pkthdr.ether_vtag;	/* htons()? */
		... pass tag to hardware ...
	}

VLAN tags are stored in host byte order.  Byte swapping may be necessary.

(Note: This driver conversion was mechanic and did not add or remove any
byte swapping in the drivers.)

Remove zone_mtag_vlan UMA zone and MTAG_VLAN definition.  No more tag
memory allocation have to be done.

Reviewed by:	thompsa, yar
Sponsored by:	TCP/IP Optimization Fundraise 2005
</content>
</entry>
</feed>
