summaryrefslogtreecommitdiff
path: root/sys/dev/bce
Commit message (Collapse)AuthorAgeFilesLines
* MFC r265703David C Somayajulu2014-05-123-23/+11
| | | | | | | | | | | Modify Copyright information and other strings to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business. Added clean option to Makefile Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation Notes: svn path=/stable/9/; revision=265918
* MFC r263957:Pyun YongHyeon2014-04-141-2/+2
| | | | | | | | | | | Increase the number of TX DMA segments from 32 to 35. It turned out 32 is not enough to support a full sized TSO packet. While I'm here fix a long standing bug introduced in r169632 in bce(4) where it didn't include L2 header length of TSO packet in the maximum DMA segment size calculation. Notes: svn path=/stable/9/; revision=264443
* MFC r257307:Pyun YongHyeon2013-11-041-3/+5
| | | | | | | | | | | | | Fix regression introduced in r235816. r235816 triggered kernel panic or hang after warm boot. Don't blindly restore BCE_EMAC_MODE media configuration in bce_reset(). If driver is about to shutdown it will invoke bce_reset() which in turn results in restoring BCE_EMAC_MODE media configuration. This operation seems to confuse controller firmware. Notes: svn path=/stable/9/; revision=257624
* MFC r252402:Pyun YongHyeon2013-07-102-3/+31
| | | | | | | | | Fix triggering false watchdog timeout when controller is in PAUSE state. Previously it used to check if controller has sent a PAUSE frame to the remote peer. Notes: svn path=/stable/9/; revision=253128
* MFC r243624:Andre Oppermann2013-07-051-1/+1
| | | | | | | | | | | | | | Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability. Checksumming the IP header of fragments is no different from doing normal IP headers. Discussed with: yongari Note that the definition of CSUM_IP_FRAGS is left in mbuf.h to allow for stable branch source compatibility. Notes: svn path=/stable/9/; revision=252828
* Now that r251221 has been MFC'ed to stable/9 in r251939, merge the remainderMarius Strobl2013-06-181-8/+11
| | | | | | | | | of r251146 previously partially MFC'ed in r251573: In bce_get_pg_buf(), take advantage of bus_dmamap_load_mbuf_sg(9). Notes: svn path=/stable/9/; revision=251971
* MFC: r251159Marius Strobl2013-06-091-11/+17
| | | | | | | | | | | | - Checking for spurious interrupts is only necessary when using INTx. Actually, this may be further optimized for controller variants supporting one-shot MSIs but I'm lacking the necessary hardware for testing. - Add some missing synchronization of the statistics and status DMA maps. Notes: svn path=/stable/9/; revision=251574
* MFC: r251146 (partial)Marius Strobl2013-06-091-110/+79
| | | | | | | | | | | | | | | | | | | - Do not supply arguments as pointers to bce_get_{pg,rx}_buf() that are not altered or actually needed there any longer. - Honor errors passed to the DMA mapping callbacks. - In bce_get_rx_buf(), do not reserve stack space for more DMA segments than actually necessary. - In bce_rx_intr(), remove a pointless check for an empty mbuf pointer which can only happen in case of a severe programming error. Moreover, recovering from that situation would require way more actions with header splitting enabled (which it is by default). - Fix VLAN tagging in the RX path; do not attach the VLAN tag twice if the firmware has been told to keep it. [1] Obtained from: OpenBSD [1] Notes: svn path=/stable/9/; revision=251573
* MFC: r251142Marius Strobl2013-06-093-157/+101
| | | | | | | | | | | | | | - As a follow-up to r247565 (MFC'ed to stable/9 in r248036), make firmware images that do not require patching at runtime actually const. - Remove pointless softc members by employing the corresponding constants directly. - Remove pointless returns. - Remove unnecessary inclusion of opt_device_polling.h. - Replace an outdated and now bogus comment in bce_tick() with the appropriate one. Notes: svn path=/stable/9/; revision=251570
* MFC: r227309 (partial)Marius Strobl2013-03-091-1/+1
| | | | | | | | | | | Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/stable/9/; revision=248085
* MFC: r243857 (partial)Marius Strobl2013-03-091-5/+5
| | | | | | | | Mechanically substitute flags from historic mbuf allocator with malloc(9) flags in sys/dev. Notes: svn path=/stable/9/; revision=248078
* MFC: r247565, r247590Marius Strobl2013-03-082-59/+35
| | | | | | | | | | | | | | - Make tables, device ID strings etc const. - Use NULL instead of 0 for pointers. - Remove redundant bzero(9)'ing of the softc. - Remove redundant/unused softc members. - Don't allocate MSI/MSI-X as RF_SHAREABLE. - Re-use bus accessor macros instead of duplicating them. - In bce_miibus_{read,write}_reg(), remove superfluous limiting of the PHY address (missed in r213893). Notes: svn path=/stable/9/; revision=248036
* MFC r239110:Davide Italiano2012-10-271-1/+1
| | | | | | | | Remove a spurious brace which causes build fail in case BCE_DEBUG option is turned on. Notes: svn path=/stable/9/; revision=242196
* MFC r235816:Pyun YongHyeon2012-05-291-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make IPMI work in the bce driver even when the interface is configured down. Formerly, IPMI communication was lost whenever the interface was not up. The reason was that the BCE_EMAC_MODE register was not configured with the correct media settings. There are two parts to the fix. First, resetting the chip in bce_reset() causes the BCE_EMAC_MODE register to be initialized to a default value that does not necessarily correspond to the actual media settings. The fix implemented here is a bit of a hack. Ideally, at the end of bce_reset() we would poll the PHY to determine the negotiated media, and then we would set the BCE_EMAC_MODE register accordingly. That is difficult, since the PHY is abstracted behind the MII layer and is not supposed to be queried directly from the MAC driver. Instead, we read the BCE_EMAC_MODE register at the beginning of bce_reset() and then restore its media bits to their original values before returning. If IPMI is up and running, then the link is already established and the BCE_EMAC_MODE register is already set appropriately when bce_reset() is called. If IPMI is not running, no harm is done by preserving the BCE_EMAC_MODE settings. The driver will set the register properly once the interface is configured up and link is established. Second, bce_miibus_statchg() is sometimes called when the link is down. In that case, the reported media settings are invalid. Formerly, the driver used them anyway to setup the BCE_EMAC_MODE register. We now avoid changing any MAC registers unless link is active and the reported media settings are valid. Submitted by: jdp Tested by: jdp Notes: svn path=/stable/9/; revision=236216
* MFC r235151:Pyun YongHyeon2012-05-232-52/+444
| | | | | | | | | | | | | | | | | | | | | | Implement basic remote PHY support. Remote PHY allows the controller to perform MDIO type accesses to a remote transceiver using message pages defined through MRBE(multirate backplane ethernet). It's used in blade systems(e.g Dell Blade m610) which are connected to pass-through blades rather than traditional switches. This change directly manipulates firmware's mailboxes to control remote PHY such that it does not use mii(4). Alternatively, as David said, it could be implemented in brgphy(4) by creating a fake PHY and let brgphy(4) do necessary mii accesses and bce(4) can implement mailbox accesses based on the type of brgphy(4)'s mii accesses. Personally, I think it would make brgphy(4) hard to maintain since it would have to access many bce(4) registers in brgphy(4). Given that there are users who are suffering from lack of remote PHY support, it would be better to get working system rather than waiting for complete/perfect implementation. Notes: svn path=/stable/9/; revision=235818
* MFC r235119:Pyun YongHyeon2012-05-141-14/+4
| | | | | | | | | | Restore jumbo frame configuration which was broken in r218423. Submitted by: Andrey Zonov <andrey <> zonov dot org > (initial version) Tested by: Andrey Zonov <andrey <> zonov dot org > Notes: svn path=/stable/9/; revision=235423
* MFC r234121:Pyun YongHyeon2012-04-232-55/+53
| | | | | | | | | | | | Back out r228476. r228476 fixed superfluous link UP/DOWN messages but broke IPMI access during boot. It's not clear why r228476 breaks IPMI and should be revisited. Reported by: Paul Guyot <paulguyot <> ieee dot org > Notes: svn path=/stable/9/; revision=234593
* MFC r228476:Pyun YongHyeon2012-01-092-53/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | Rework link state tracking and remove superfluous link UP/DOWN messages. o Add check for actually resolved speed in miibus_statchg callback instead of blindly reprogramming BCE_EMAC_MODE register. The callback may be called multiple times(e.g. link UP, link transition, auto-negotiate complete etc) while auto-negotiation is in progress. All unresolved link state changes are ignored now and setting BCE_EMAC_MODE after link establishment is done once. o bce(4) is careful enough not to drive MII_TICK if driver got a valid link. To detect lost link, bce(4) relied on link state change interrupt and if driver see the interrupt, it forced to drive MII_TICK by calling bce_tick() in interrupt handler. Because bce(4) generates multiple link state change interrupts while auto-negotiation is in progress, bce_tick() would be called multiple times and this resulted in generating multiple link UP/DOWN messages. With this change, bce_tick() is not called in interrupt handler anymore such that miibus_statchg callback handles link state changes with consistent manner. Notes: svn path=/stable/9/; revision=229864
* MFC r226173, r227843, r227848 and r227908:Hans Petter Selasky2011-12-311-5/+1
| | | | | | | | | Use DEVMETHOD_END to mark end of device methods. Remove superfluous device methods. Add some missing __FBSBID() macros. Notes: svn path=/stable/9/; revision=229093
* MFC r226123:Pyun YongHyeon2011-12-312-52/+25
| | | | | | | | | | | | | | BCE_MISC_ID register of BCM5716 returns the same id of BCM5709 so remove explicit checks for BCM5716. The BCM5709 and BCM5716 chips are virtually indistinguishable by software except for the PCI device ID. The two chips differ in that BCM5709 supports TCP/IP and iSCSI offload in Windows while the BCM5716 doesn't. While I'm here remove now unused definition of BCE_CHIP_NUM_5716 and BCE_CHIP_ID_5716_C0. Notes: svn path=/stable/9/; revision=229052
* - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOPMarius Strobl2011-05-031-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (reporting IFM_LOOP based on BMCR_LOOP is left in place though as it might provide useful for debugging). For most mii(4) drivers it was unclear whether the PHYs driven by them actually support loopback or not. Moreover, typically loopback mode also needs to be activated on the MAC, which none of the Ethernet drivers using mii(4) implements. Given that loopback media has no real use (and obviously hardly had a chance to actually work) besides for driver development (which just loopback mode should be sufficient for though, i.e one doesn't necessary need support for loopback media) support for it is just dropped as both NetBSD and OpenBSD already did quite some time ago. - Let mii_phy_add_media() also announce the support of IFM_NONE. - Restructure the PHY entry points to use a structure of entry points instead of discrete function pointers, and extend this to include a "reset" entry point. Make sure any PHY-specific reset routine is always used, and provide one for lxtphy(4) which disables MII interrupts (as is done for a few other PHYs we have drivers for). This includes changing NIC drivers which previously just called the generic mii_phy_reset() to now actually call the PHY-specific reset routine, which might be crucial in some cases. While at it, the redundant checks in these NIC drivers for mii->mii_instance not being zero before calling the reset routines were removed because as soon as one PHY driver attaches mii->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. Consequently, NIC drivers now no longer should call mii_phy_reset() directly, so it was removed from EXPORT_SYMS. - Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe(). The purpose of that function is to perform the common steps to attach a PHY driver instance and to hook it up to the miibus(4) instance and to optionally also handle the probing, addition and initialization of the supported media. So all a PHY driver without any special requirements has to do in its bus attach method is to call mii_phy_dev_attach() along with PHY-specific MIIF_* flags, a pointer to its PHY functions and the add_media set to one. All PHY drivers were updated to take advantage of mii_phy_dev_attach() as appropriate. Along with these changes the capability mask was added to the mii_softc structure so PHY drivers taking advantage of mii_phy_dev_attach() but still handling media on their own do not need to fiddle with the MII attach arguments anyway. - Keep track of the PHY offset in the mii_softc structure. This is done for compatibility with NetBSD/OpenBSD. - Keep track of the PHY's OUI, model and revision in the mii_softc structure. Several PHY drivers require this information also after attaching and previously had to wrap their own softc around mii_softc. NetBSD/OpenBSD also keep track of the model and revision on their mii_softc structure. All PHY drivers were updated to take advantage as appropriate. - Convert the mebers of the MII data structure to unsigned where appropriate. This is partly inspired by NetBSD/OpenBSD. - According to IEEE 802.3-2002 the bits actually have to be reversed when mapping an OUI to the MII ID registers. All PHY drivers and miidevs where changed as necessary. Actually this now again allows to largely share miidevs with NetBSD, which fixed this problem already 9 years ago. Consequently miidevs was synced as far as possible. - 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) Reviewed by: yongari (earlier version), silence on arch@ and net@ Notes: svn path=/head/; revision=221407
* Do a sweep of the tree replacing calls to pci_find_extcap() with calls toJohn Baldwin2011-03-231-4/+4
| | | | | | | pci_find_cap() instead. Notes: svn path=/head/; revision=219902
* - Updated firmware which improves small packet performance.David Christensen2011-02-111-10834/+11094
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=218529
* - Added error checking to nvram read functions.David Christensen2011-02-102-43/+49
| | | | | | | | | | - Minor style updates. Submitted by: gcooper@freebsd.org MFC after: 2 weeks Notes: svn path=/head/; revision=218527
* - Added systcls for header splitting, RX/TX buffer count, interruptDavid Christensen2011-02-072-696/+1105
| | | | | | | | | | | | | | | | coalescing, strict RX MTU, verbose output, and shared memory debug. - Added additional debug counters (VLAN tags and split header frames). - Updated debug counters to 64 bit definitions. - Updated l2fhdr bit definitions. - Combined RX buffer sizing into a single function. - Added buffer size and interrupt coalescing settings to adapter info printout. Submitted by: davidch MFC after: 2 weeks Notes: svn path=/head/; revision=218423
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.Matthew D Fleming2011-01-121-11/+11
| | | | | | | Commit the rest of the devices. Notes: svn path=/head/; revision=217323
* o Flesh out the generic IEEE 802.3 annex 31B full duplex flow controlMarius Strobl2010-11-141-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support in mii(4): - Merge generic flow control advertisement (which can be enabled by passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD, IFM_FLOW isn't implemented as a global option via the "don't care mask" but instead as a media specific option this. This has the following advantages: o allows flow control advertisement with autonegotiation to be turned on and off via ifconfig(8) with the default typically being off (though MIIF_FORCEPAUSE has been added causing flow control to be always advertised, allowing to easily MFC this changes for drivers that previously used home-grown support for flow control that behaved that way without breaking POLA) o allows to deal with PHY drivers where flow control advertisement with manual selection doesn't work or at least isn't implemented, like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4), by setting MIIF_NOMANPAUSE o the available combinations of media options are readily available from the `ifconfig -m` output - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so these are understood by ifconfig(8). o Make the master/slave support in mii(4) actually usable: - Change IFM_ETH_MASTER from being implemented as a global option via the "don't care mask" to a media specific one as it actually is only applicable to IFM_1000_T to date. - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to actually configure manually selected slave mode (like we also do in the PHY specific implementations). - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it is understood by ifconfig(8). o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4), e1000phy(4) and ip1000phy(4) to use the generic flow control support instead of home-grown solutions via IFM_FLAGs. This includes changing these PHY drivers and smcphy(4) to no longer unconditionally advertise support for flow control but only if the selected media has IFM_FLOW set (or MIIF_FORCEPAUSE is set) and implemented for these media variants, i.e. typically only for copper. o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0 and some IFM_FLAGn. o Switch brgphy(4) to add at least the the supported copper media based on the contents of the BMSR via mii_phy_add_media() instead of hardcoding them. The latter approach seems to have developed historically, besides causing unnecessary code duplication it was also undesirable because brgphy_mii_phy_auto() already based the capability advertisement on the contents of the BMSR though. o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not just BCM5701. Apparently this was a misinterpretation of a workaround in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but this doesn't mean we can't set these as well on other PHYs for manual media selection. o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so IFM_1000_T master mode support now is generally available with all PHY drivers. o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's not applicable there. Reviewed by: yongari (plus additional testing) Obtained from: NetBSD (partially), OpenBSD (partially) MFC after: 2 weeks Notes: svn path=/head/; revision=215297
* Converted the remainder of the NIC drivers to use the mii_attach()Marius Strobl2010-10-151-6/+7
| | | | | | | | | | introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these are only straight forward conversions though. Reviewed by: yongari Notes: svn path=/head/; revision=213894
* Make sure to not use stale ip/tcp header pointers. The ip/tcpPyun YongHyeon2010-10-141-0/+2
| | | | | | | | | | | | | | header parser uses m_pullup(9) to get access to mbuf chain. m_pullup(9) can allocate new mbuf chain and free old one if the space left in the mbuf chain is not enough to hold requested contiguous bytes. Previously drivers can use stale ip/tcp header pointer if m_pullup(9) returned new mbuf chain. Reported by: Andrew Boyer (aboyer <> averesystems dot com) MFC after: 10 days Notes: svn path=/head/; revision=213844
* Add the capability to read the complete contents of the NVRAM via sysctlDoug Ambrisko2010-10-062-0/+68
| | | | | | | | | | | | | | | | | | dev.bce.<unit>.nvram_dump Add the capability to write the complete contents of the NVRAM via sysctl dev.bce.<unit>.nvram_write These are only available if the kernel option BCE_DEBUG is enabled. The nvram_write sysctl also requires the kernel option BCE_NVRAM_WRITE_SUPPORT to be enabled. These are to be used at your own caution. Since the MAC addresses are stored in the NVRAM, if you dump one NIC and restore it on another NIC the destination NIC's MAC addresses will not be preserved. A tool can be made using these sysctl's to manage the on-chip firmware. Reviewed by: davidch, yongari Notes: svn path=/head/; revision=213489
* Fix an apparent typo.Jung-uk Kim2010-07-261-1/+1
| | | | | | | | Found by: clang Reviewed by: davidch, yongari Notes: svn path=/head/; revision=210522
* Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4)Pyun YongHyeon2010-07-192-1/+2
| | | | | | | | | controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes. Reviewed by: davidch Notes: svn path=/head/; revision=210271
* Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero()Pyun YongHyeon2010-07-191-19/+14
| | | | | | | | | | | calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to take advantage of efficient synchronization for architectures that support that feature. Reviewed by: davidch Notes: svn path=/head/; revision=210270
* Use bus_get_dma_tag() to get parent tag. Also usePyun YongHyeon2010-07-191-3/+3
| | | | | | | | | | BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths. Previously it used MAXBSIZE which was wrong. Reviewed by: davidch Notes: svn path=/head/; revision=210269
* Add KASSERT to check number of returned DMA segments.Pyun YongHyeon2010-07-191-0/+2
| | | | | | | Reviewed by: davidch Notes: svn path=/head/; revision=210267
* Do not report current link state if interface is not UP.Pyun YongHyeon2010-07-191-0/+4
| | | | | | | Reviewed by: davidch Notes: svn path=/head/; revision=210263
* Correctly check the result of media selection. Previously it alwaysPyun YongHyeon2010-07-191-5/+9
| | | | | | | | | returned success. Reviewed by: davidch Notes: svn path=/head/; revision=210261
* Don't change current media in bce_stop(). There is no need to doPyun YongHyeon2010-07-191-24/+0
| | | | | | | | | this here. Reviewed by: davidch Notes: svn path=/head/; revision=210260
* Have bce_init_ctx() return error code and make caller check thePyun YongHyeon2010-07-191-18/+22
| | | | | | | | | | | return code. If context was not setup correctly give up initialization. While I'm here move variable declarations to the beginning of the function. Reviewed by: davidch Notes: svn path=/head/; revision=210259
* When we didn't find a matching flash device, do not touch flashPyun YongHyeon2010-07-191-4/+3
| | | | | | | | | | config data. While I'm here, use return code of bce_init_nvram() to set error instead of directly setting ENODEV. Reviewed by: davidch Notes: svn path=/head/; revision=210257
* Add a fastpath to allocate from packet zone when using m_getjcl.Fabien Thomas2010-05-071-5/+2
| | | | | | | | | | This will add support for packet zone for at least igb and ixgbe and will avoid to check for that in bce and mxge. MFC after: 1 week Notes: svn path=/head/; revision=207761
* - Enable flow control.David Christensen2010-04-302-784/+955
| | | | | | | | | | | | | | | | | | - Print device details only when verbose boot is enabled. - Add debug output for shared memory access. - Add debug statistics (checksum offload & VLAN frame counters). - Modify TX path to update consumer index for each frame completed rather than updating the consumer index only once for a group of frames to improve small packet performance. - Print driver/firmware pulse messages only when verbose boot is enabled. - Add debug sysctl to clear statistics. - Fix more style(9) violations. MFC after: 2 weeks Notes: svn path=/head/; revision=207411
* - Fixed 5708S 2.5G support broken in last commit.David Christensen2010-04-062-2839/+3118
| | | | | | | | | | | - Added some new debug helper routines to systcl. - Fixed many of the style(9) violations that have crept into the code due to my use of a "smart" editor. MFC after: 2 weeks Notes: svn path=/head/; revision=206268
* - Added support for 5709S/5716S PHYs.David Christensen2010-03-183-386/+285
| | | | | | | | | | | - Update copyright to 2010. - Add new debug code for RV2P block. - Improve output formatting for various debug functions. MFC after: 2 weeks Notes: svn path=/head/; revision=205300
* Add TSO support on VLANs. bce(4) controllers require VLAN hardwarePyun YongHyeon2010-02-261-2/+10
| | | | | | | | | | tagging to make TSO work on VLANs so explicitly disable TSO on VLAN if VLAN hardware tagging is disabled. Reviewed by: davidch Notes: svn path=/head/; revision=204374
* Move TSO setup to new function bce_tso_setup(). Also remove VLANPyun YongHyeon2010-02-261-69/+114
| | | | | | | | | | | | | | | parsing code in TSO path as the controller requires VLAN hardware tagging to make TSO work over VLANs. While parsing the mbuf in TSO patch, always perform check for writable mbuf as bce(4) have to reset IP length and IP checksum field of IP header and make sure to ensure contiguous buffer before accessing IP/TCP headers. While I'm here replace magic number 40 to more readable sizeof(struct ip) + sizeof(struct tcphdr). Reviewed by: davidch Notes: svn path=/head/; revision=204373
* Prefer m_collapse(9) over m_defrag(9).Pyun YongHyeon2010-02-261-1/+1
| | | | | | | Reviewed by: davidch Notes: svn path=/head/; revision=204372
* Make toggling TSO, VLAN hardware checksum offloading work. Also fixPyun YongHyeon2010-02-261-14/+16
| | | | | | | | | | | | TX/RX checksum handler to set/clear relavant assist bits which was used to cause unexpected results. With this change, bce(4) can be bridged with other interfaces that lack TSO, VLAN checksum offloading. Reviewed by: davidch Notes: svn path=/head/; revision=204371
* Make sure to stop controller first before changing MTU. And ifPyun YongHyeon2010-02-261-7/+14
| | | | | | | | | | interface is not running don't initialize controller. While here remove unnecessary update of error variable. Reviewed by: davidch Notes: svn path=/head/; revision=204370
* Allow disabling VLAN hardware tag stripping with software workPyun YongHyeon2010-02-261-20/+40
| | | | | | | | | | | | | around. Management firmware(ASF/IPMI/UMP) requires the VLAN hardware tag stripping so don't actually disable VLAN hardware tag stripping. If VLAN hardware tag stripping was disabled, bce(4) manually reconstruct VLAN frame by appending stripped VLAN tag. Also remove unnecessary IFCAP_VLAN_MTU message. Reviewed by: davidch Notes: svn path=/head/; revision=204368