aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bce
Commit message (Collapse)AuthorAgeFilesLines
* 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-791/+962
| | | | | | | | | | | | | | | | | | - 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-2893/+3172
| | | | | | | | | | | - 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-389/+288
| | | | | | | | | | | - 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
* - Added a workaround for NC-SI management firmware that would allowDavid Christensen2010-01-202-29/+137
| | | | | | | | | | | frames to be accepted while the driver is resetting the hardware. This failure is generally observed when broadcast frames are received during driver load and will generate "Unable to write CTX memory" errors. - Small changes to driver flags display. Notes: svn path=/head/; revision=202717
* - Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable headerStanislav Sedov2009-10-212-47/+47
| | | | | | | | | | | splitting in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not propagated into if_bce.c anyway. It is disabled by default. Approved by: davidch MFC after: 3 days Notes: svn path=/head/; revision=198320
* Revert previous commit and add myself to the list of people who shouldPoul-Henning Kamp2009-09-081-4/+4
| | | | | | | know better than to commit with a cat in the area. Notes: svn path=/head/; revision=196970
* Add necessary include.Poul-Henning Kamp2009-09-081-4/+4
| | | | Notes: svn path=/head/; revision=196969
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/Robert Watson2009-06-261-2/+2
| | | | | | | | | | | | | | | | IF_ADDR_UNLOCK() across network device drivers when accessing the per-interface multicast address list, if_multiaddrs. This will allow us to change the locking strategy without affecting our driver programming interface or binary interface. For two wireless drivers, remove unnecessary locking, since they don't actually access the multicast address list. Approved by: re (kib) MFC after: 6 weeks Notes: svn path=/head/; revision=195049
* - Added code to read bootcode firwmare version.David Christensen2009-06-232-43/+131
| | | | | | | | | - Created dedicated shared memory access routines. MFC after: One week Notes: svn path=/head/; revision=194781
* DMA synchronization fixes:Xin LI2009-05-181-16/+13
| | | | | | | | | | | | | | | | | | - In bce_rx_intr(), use BUS_DMASYNC_POSTREAD instead of BUS_DMASYNC_POSTWRITE, as we want to "read" from the rx page chain pages. - Document why we need to do PREWRITE after we have updated the rx page chain pages. - In bce_intr(), use BUS_DMASYNC_POSTREAD and BUS_DMASYNC_PREREAD when before and after CPU "reading" the status block. - Adjust some nearby style mismatches/etc. Pointed out by: yongari Approved by: davidch (no objection) but bugs are mine :) Notes: svn path=/head/; revision=192281
* - Fixed incorrect packet length problem caused be earlier change toDavid Christensen2009-05-082-2/+6
| | | | | | | | | | support ZERO_COPY_SOCKETS. - Created #define for context initialization retry count. MFC after: 1 week Notes: svn path=/head/; revision=191923
* - Updated firmware to latest 4.6.X release.David Christensen2009-03-043-13581/+13987
| | | | | | | | | | | - Added missing firmware for 5709 A1 controllers. - Changed some debug statistic variable names to be more consistent. Submitted by: davidch MFC after: Two weeks Notes: svn path=/head/; revision=189325
* - Update copyright to 2009.David Christensen2009-02-273-42/+65
| | | | | | | | | | | - Only enable split header operation when ZERO_COPY_SOCKETS is enabled in the kernel. Submitted by: davidch MFC after: 1 week Notes: svn path=/head/; revision=189117
* Changes to match "Marketing Description" from Broadcom for HP servers.Xin LI2009-01-151-12/+14
| | | | | | | | Submitted by: davidch MFC after: 2 months Notes: svn path=/head/; revision=187317
* Remove intermediate variable busaddr and have bus_* operate directly onXin LI2009-01-131-13/+6
| | | | | | | | | | softc members upon initialization. Reviewed by: davidch MFC after: 1 month Notes: svn path=/head/; revision=187204
* Add several HP OEM parts' PCI IDs.Xin LI2009-01-131-0/+22
| | | | | | | MFC after: 2 months Notes: svn path=/head/; revision=187133
* Don't count InFramesL2FilterDiscards into Ierr. This value does not representXin LI2008-12-161-1/+0
| | | | | | | | | | | | a real packet error but simply indicate that an unexpected unicast or multicast error was received by the NIC, which was not counted in the past as well. Reported by: many (on -stable@) Reviewed by: davidch MFC after: 3 days Notes: svn path=/head/; revision=186169
* Test whether sc->tx_mbuf_map[i], not whether sc->tx_mbuf_map is NULL beforeXin LI2008-12-161-1/+1
| | | | | | | | | doing bus_dmamap_sync() since it operates on the former, not the latter. Reviewed by: davidch Notes: svn path=/head/; revision=186168
* Don't attempt to clear status updates if we did not do a link stateXin LI2008-12-031-5/+6
| | | | | | | | | | | change. As a side effect, this makes the excessive interrupts to disappear which has been observed as a regression in recent stable/7. Reported by: many (on -stable@) Reviewed by: davidch Notes: svn path=/head/; revision=185593
* - bump __FreeBSD version to reflect added buf_ring, memory barriers,Kip Macy2008-11-221-0/+3
| | | | | | | | | | | | | | | | | | | | and ifnet functions - add memory barriers to <machine/atomic.h> - update drivers to only conditionally define their own - add lockless producer / consumer ring buffer - remove ring buffer implementation from cxgb and update its callers - add if_transmit(struct ifnet *ifp, struct mbuf *m) to ifnet to allow drivers to efficiently manage multiple hardware queues (i.e. not serialize all packets through one ifq) - expose if_qflush to allow drivers to flush any driver managed queues This work was supported by Bitgravity Inc. and Chelsio Inc. Notes: svn path=/head/; revision=185162
* Correct a logic error when testing BCE_PHY_SERDES_FLAG.Xin LI2008-11-191-1/+1
| | | | | | | | | | PR: kern/128801 Pointed out by: Adam Morrison Ok'ed by: davidch MFC after: 3 days Notes: svn path=/head/; revision=185082
* - Updated support for 5716.David Christensen2008-08-272-297/+545
| | | | | | | | | | | | | | - Added some additional code for debug builds. - Fixed a problem printing physical memory on 64bit system during debugging. - Modified some of the context memory and mailbox register names to more clearly distinguish their use. - Added memory barriers for Intel CPUs when accessing host memory data structures which are written by hardware. MFC after: Two weeks. Notes: svn path=/head/; revision=182293
* - Added support for BCM5709 and BCM5716 controllers.David Christensen2008-06-133-6019/+16022
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=179771
* - Fixed kern/123696 by increasing firmware timeout value from 100 to 1000.David Christensen2008-06-102-54/+193
| | | | | | | | | | | | | - Fixed a problem on i386 architecture when using split header/jumbo frame firmware caused by hardware alignment requirements. - Added #define BCE_USE_SPLIT_HEADER to allow the feature to be enabled/ disabled. Enabled by default. PR: kern/123696 MFC after: 2 weeks Notes: svn path=/head/; revision=179695
* Trim an extra semi-colon.John Baldwin2008-05-301-1/+1
| | | | Notes: svn path=/head/; revision=179436
* The BCE chips appear to have an undocumented requirement that RX frames beScott Long2008-05-081-0/+8
| | | | | | | | | | | | | | | aligned on an 8 byte boundary. Prior to rev 1.36 this wasn't a problem because mbuf clusters tend be naturally aligned. The switch to using split buffers with the first buffer being the embedded data area of the mbuf has broken this assumption, at least on i386, causing a complete failure of RX functionality. Fix this for now by using a full cluster for the first RX buffer. A more sophisticated approach could be done with the old buffer scheme to realign the m_data pointer with m_adj(), but I'm also not clear on performance benefits of this old scheme or the performance implications of adding an m_adj() call to every allocation. Notes: svn path=/head/; revision=178853
* Remove some remnant alpha hacks.Marius Strobl2008-04-261-1/+1
| | | | | | | Approved by: PCI-maintainers (imp, jhb) Notes: svn path=/head/; revision=178588
* - Fixed a problem with the send chain consumer index which would causeDavid Christensen2008-04-113-1658/+1613
| | | | | | | | | | | | | | TX traffic to sit in the send chain until a received packet kick started the interrupt handler. This would cause extremely slow performance when used with NFS over UDP. - Removed untested polling code. - Updated copyright year in the file header. - Removed inadvertent ^M's created by DOS text editor. MFC after: 2 weeks Notes: svn path=/head/; revision=178132
* MFC after: 4 weeksDavid Christensen2008-02-223-5555/+7977
| | | | | | | | | | | | - Added loose RX MTU functionality to allow frames larger than 1500 bytes to be accepted even though the interface MTU is set to 1500. - Implemented new TCP header splitting/jumbo frame support which uses two chains for receive traffic rather than the original single recevie chain. - Added additional debug support code. Notes: svn path=/head/; revision=176448
* Fix function prototype for device_shutdown method.Pyun YongHyeon2007-11-221-3/+5
| | | | Notes: svn path=/head/; revision=173839