aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bge
Commit message (Collapse)AuthorAgeFilesLines
* Do not report MAC, TX, and RX stats via sysctl(8) with BCM5705+.Jung-uk Kim2007-11-161-7/+6
| | | | | | | | | | | | The register layout is little different from memory-mapped stats in the previous generation chips. In fact, it is bad because registers in this range are cleared after reading them. Reviewed by: scottl MFC after: 3 days Notes: svn path=/head/; revision=173675
* Make the PCI code aware of PCI domains (aka PCI segments) so we canMarius Strobl2007-09-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | support machines having multiple independently numbered PCI domains and don't support reenumeration without ambiguity amongst the devices as seen by the OS and represented by PCI location strings. This includes introducing a function pci_find_dbsf(9) which works like pci_find_bsf(9) but additionally takes a domain number argument and limiting pci_find_bsf(9) to only search devices in domain 0 (the only domain in single-domain systems). Bge(4) and ofw_pcibus(4) are changed to use pci_find_dbsf(9) instead of pci_find_bsf(9) in order to no longer report false positives when searching for siblings and dupe devices in the same domain respectively. Along with this change the sole host-PCI bridge driver converted to actually make use of PCI domain support is uninorth(4), the others continue to use domain 0 only for now and need to be converted as appropriate later on. Note that this means that the format of the location strings as used by pciconf(8) has been changed and that consumers of <sys/pciio.h> potentially need to be recompiled. Suggested by: jhb Reviewed by: grehan, jhb, marcel Approved by: re (kensmith), jhb (PCI maintainer hat) Notes: svn path=/head/; revision=172394
* Despite several examples in the kernel, the third argument ofDavid Malone2007-06-041-1/+1
| | | | | | | | | | | | | | | | sysctl_handle_int is not sizeof the int type you want to export. The type must always be an int or an unsigned int. Remove the instances where a sizeof(variable) is passed to stop people accidently cut and pasting these examples. In a few places this was sysctl_handle_int was being used on 64 bit types, which would truncate the value to be exported. In these cases use sysctl_handle_quad to export them and change the format to Q so that sysctl(1) can still print them. Notes: svn path=/head/; revision=170289
* Add on/off controls for VLAN_MTU and VLAN_HWTAGGING to bge(4).Yaroslav Tykhiy2007-06-011-2/+41
| | | | Notes: svn path=/head/; revision=170176
* Remove an empty line.Jung-uk Kim2007-05-221-1/+0
| | | | Notes: svn path=/head/; revision=169882
* Remove BCM5704S specific tunable (hw.bge.fake_autoneg) andJung-uk Kim2007-05-221-15/+13
| | | | | | | auto-detect the condition. Notes: svn path=/head/; revision=169881
* Rearrange DMA read/write control register settings based on document snippetJung-uk Kim2007-05-222-46/+45
| | | | | | | | | provided by davidch via glebius. PR: kern/96806 Notes: svn path=/head/; revision=169880
* Remove stale alpha support code.Jung-uk Kim2007-05-221-11/+0
| | | | Notes: svn path=/head/; revision=169878
* Fix time out check in EEPROM read and move delays to give some settle time.Jung-uk Kim2007-05-221-11/+12
| | | | | | | Submitted by: mjacob Notes: svn path=/head/; revision=169876
* Add delays in MI communication register R/W loops.Jung-uk Kim2007-05-221-0/+2
| | | | Notes: svn path=/head/; revision=169875
* Reflect MFC of pci_find_extcap().Jung-uk Kim2007-05-011-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=169191
* - Add support/quirks for the on-board BGEs found in Sun Blade 1500Marius Strobl2007-04-302-34/+98
| | | | | | | | | | | | | | | | | | | | Blade 2500, Fire V210 and probably some other sparc64 machines. These chips are typically not fitted with an EEPROM which means that we have to obtain the MAC address via OFW and that some chip tests will just always fail. These changes are based on the respective code found in OpenBSD with some additional info obtained from OpenSolaris and some style suggestions by jkim@. They also have the desired side-effect of respecting the 'local-mac-address?' system configuration variable for the affected BGEs. - In bge_attach() factor out calling bge_release_resources() before going to the fail label into the fail label as well as replace a magic 6 with ETHER_ADDR_LEN. Reviewed by: yongari (before style changes), jkim Notes: svn path=/head/; revision=169152
* Enable MSI support on RELENG_6.Jung-uk Kim2007-04-021-3/+3
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=168277
* Fix some OID names and minor style as per feedback from various people.Scott Long2007-03-131-16/+11
| | | | | | | | | | Also, apparently quad support is broken in the sysctl infrastructure, so don't pretend that it works. Submitted by: ru, bde Notes: svn path=/head/; revision=167496
* Add MAC, RX, and TX stats reporting via sysctl.Scott Long2007-03-121-10/+147
| | | | Notes: svn path=/head/; revision=167480
* Add more chipset revision IDs.Jung-uk Kim2007-03-092-0/+5
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=167351
* Use correct bits to stop firmware when ASF mode is enabled.Jung-uk Kim2007-03-081-2/+2
| | | | Notes: svn path=/head/; revision=167312
* Fix more style(9) bugs.Jung-uk Kim2007-03-081-76/+62
| | | | | | | | | | | | - Remove some excessive parentheses around shift operators. - Use macro instead of magic number where it is applicable. - Change lower-case hexdecimals to upper cases to match wpaul's style. - Revert some unnecessary line wraps and changes from the previous commit. Pointed out by: bde Notes: svn path=/head/; revision=167311
* Fix style(9) and consistency.Jung-uk Kim2007-03-061-87/+105
| | | | Notes: svn path=/head/; revision=167280
* Pollute bge(4) with #if's and #ifdef's to make MFC easier.Jung-uk Kim2007-03-061-27/+77
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=167279
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | 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@ Notes: svn path=/head/; revision=166901
* Use bge_writereg_ind() to do global reset as we did before 1.159 for certainJung-uk Kim2007-02-141-1/+1
| | | | | | | | | | chipsets. It was causing 'firmware handshake timed out' errors for some chips. Discussed with: scottl Notes: svn path=/head/; revision=166718
* Fix two typos in comments.Jung-uk Kim2007-02-141-2/+2
| | | | Notes: svn path=/head/; revision=166717
* Add BCM5701 A0/B0 CRC bug workaround. Magic values taken from Linux driver.Jung-uk Kim2007-02-122-0/+4
| | | | Notes: svn path=/head/; revision=166677
* Fix style(9).Jung-uk Kim2007-02-122-1598/+1601
| | | | | | | Pointed out by: many Notes: svn path=/head/; revision=166676
* Add PHY DSP code for BCM5755M.Jung-uk Kim2007-02-122-1/+5
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=166673
* - Fix BCM5754 support found in Dell PowerEdge SC440.Jung-uk Kim2007-01-152-19/+36
| | | | | | | | | | | | | | - Move some PHY bug detections from brgphy.c to if_bge.c. - Do not penalize working PHYs. - Re-arrange bge_flags roughly by their categories. - Fix minor style(9) nits. PR: kern/107257 Obtained from: OpenBSD Tested by: Mike Hibler <mike at flux dot utah dot edu> Notes: svn path=/head/; revision=166031
* Correct the comment describing the BGE_PCISTATE_PCI_BUSSPEED bit.John Polstra2007-01-111-1/+1
| | | | | | | It had the sense of the bit reversed. Notes: svn path=/head/; revision=165932
* After rev.1.169, the "interrupt" coalescing parameters are not used inBruce Evans2006-12-261-8/+2
| | | | | | | | | | bge_intr(). Some of them are used in bge_poll(). Simplify by only initializing these for polling mode and not toggling them when switching modes. This also fixes missing synchronization with the coalescing engine in the toggling. Notes: svn path=/head/; revision=165557
* Re-enable MSI support for those chips on which it is believed to workJohn Polstra2006-12-222-34/+88
| | | | | | | properly. Notes: svn path=/head/; revision=165459
* Correct the BGE_CHIPID_BCM5750_B0 constant.John Polstra2006-12-221-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=165458
* In bge_txeof(), cancel the watchdog timeout if all descriptors haveBruce Evans2006-12-201-1/+2
| | | | | | | | | | been handled instead of when at least one descriptor was just handled. For bge, it is normal to get a txeof when only a small fraction of the queued tx descriptors have been handled, so the bug broke the watchdog in a usual case. Notes: svn path=/head/; revision=165383
* Avoid a race and a pessimization in bge_intr():Bruce Evans2006-12-201-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - moved the synchronizing bus read to after the bus write for the first interrupt ack so that it actually synchronizes everything necessary. We were acking not only the status update that triggered the interrupt together with any status updates that occurred before we got around to the bus write for the ack, but also any status updates that occur after we do the bus write but before the write reaches the device. The corresponding race for the second interrupt ack resulted in sometimes returning from the interrupt handler with acked but unserviced interrupt events. Such events then remain unserviced until further events cause another interrupt or the watchdog times out. The race was often lost on my 5705, apparently since my 5705 has broken event coalescing which causes a status update for almost every packet, so another status update is quite likely to occur while the interrupt handler is running. Watchdog timeouts weren't very noticeable, apparently because bge_txeof() has one of the usual bugs resetting the watchdog. - don't disable device interrupts while bge_intr() is running. Doing this just had the side effects of: - entering a device mode in which different coalescing parameters apply. Different coalescing parameters can be used to either inhibit or enhance the chance of getting another status update while in the interrupt handler. This feature is useless with the current organization of the interrupt handler but might be useful with a taskqueue handler. - giving a race for ack+reenable/return. This cannot be handled by simply rearranging the order of bus accesses like the race for ack+keepenable/entry. It is necessary to sync the ack and then check for new events. - taking longer, especially with the extra code to avoid the race on ack+reenable/return. Reviewed by: ru, gleb, scottl Notes: svn path=/head/; revision=165376
* Partially back out rev. 1.148 and use new ETHER_BPF_MTAP() macro for VLAN.Jung-uk Kim2006-12-201-11/+5
| | | | | | | Remaining changes are cosmetic. Notes: svn path=/head/; revision=165363
* - Add missing callout_drain() call.Oleg Bulyzhin2006-12-191-12/+10
| | | | | | | | | | - Synchronize bge_tick() with callout_reset/callout_stop() calls. - Avoid using bge_tick() inside bge_link_upd(), use mii_pollstat() instead. MFC after: 2 month Notes: svn path=/head/; revision=165344
* - Remove stale VPD support and its comment and get device name from VPD API.Jung-uk Kim2006-12-182-48/+19
| | | | | | | | | | | - Do not repeatedly read vendor/device IDs while probing. - Remove redundant bzero(3) for softc. device_get_softc(9) does it for free[1]. Reviewed by: glebius Suggested by: glebius[1] Notes: svn path=/head/; revision=165333
* Disable bge MSI support for now. A couple of people warned me that thereJohn Polstra2006-12-151-0/+9
| | | | | | | | | are problems with it on several revisions of this chip. I'll re-enable it after I've sorted out which chip revisions work and which don't. Notes: svn path=/head/; revision=165236
* Add MSI support to the bge driver. I tested this on a Dell SC1435John Polstra2006-12-142-4/+19
| | | | | | | running an i386 kernel, and it worked fine. Notes: svn path=/head/; revision=165233
* Fix recent style problems and expand a comment.Scott Long2006-12-131-12/+15
| | | | | | | Submitted by: Bruce Evans Notes: svn path=/head/; revision=165189
* Use the BGE_IS_* macros consistently. Also add a couple of missingScott Long2006-12-131-5/+9
| | | | | | | cases to the debug_info function. Notes: svn path=/head/; revision=165188
* Remove a redundant write of the firmware reset magic number. It looks toScott Long2006-12-131-6/+0
| | | | | | | | | | | | have been added erroneously, and it causes problems on some chips. A larger change is needed to do this write at a more appropriate place, but that change requires reworking the ASF logic. That will be worked on in the future. Submitted by: Bruce Evans Notes: svn path=/head/; revision=165187
* Use one counter instead of four to make up TX collision stats as BCM5705+.Jung-uk Kim2006-12-131-8/+1
| | | | | | | It reduces chance of errors from multiple counter wraps at the same time. Notes: svn path=/head/; revision=165181
* Fix support for certain 575x/578x chips. This consists of the following:Scott Long2006-12-122-35/+274
| | | | | | | | | | | | | | - Use the appropriate register writing method when reseting the chip - Program the descriptor DMA engine correctly. - More reliably detect certain chips and their features. Also add some low-level debugging tools to help future work on this driver. Submitted by: David Christenson (proof of concept changes) Sponsored by: www.UIA.net Notes: svn path=/head/; revision=165114
* - Correct collision counter for BCM5705+. This register is read/clear.Jung-uk Kim2006-12-111-10/+13
| | | | | | | | | | | | | | | | | | | - Correct RX packet drop counter for BCM5705+. This register is read/clear and it wraps very quickly under heavy packet drops because only the lower ten bits are valid according to the documentation. However, it seems few more bits are actually valid and the rest bits are always zeros[1]. Therefore, we don't mask them off here. To get accurate packet drop count, we need to check the register from bge_rxeof(). It is commented out for now, not to penalize normal operation. Actual performance impact should be measured later. - Correct integer casting from u_long to uint32_t. Casting is not really needed for all supported platforms but we better do this correctly[2]. Tested by: bde[1] Suggested by: bde[2] Notes: svn path=/head/; revision=165101
* - Add BGE_FLAG_JUMBO flag which idicates jumbo frame capability. Some day weJung-uk Kim2006-12-042-22/+24
| | | | | | | | may be able to support jumbo frames for BCM5714 and BCM5780. - Rename BGE_IS_5705_OR_BEYOND() to BGE_IS_5705_PLUS() for consistency. Notes: svn path=/head/; revision=164888
* Use bge_flags to save chipset family and remove dead code while I am here.Jung-uk Kim2006-12-042-53/+43
| | | | Notes: svn path=/head/; revision=164886
* Fix my error in rev. 1.152Gleb Smirnoff2006-12-041-1/+1
| | | | | | | Submitted by: oleg Notes: svn path=/head/; revision=164879
* Fix white spaces.Jung-uk Kim2006-12-011-1/+1
| | | | Notes: svn path=/head/; revision=164781
* Simplify statistics updates, remove redundant register reads, and addJung-uk Kim2006-12-012-28/+19
| | | | | | | | | | | discarded RX packets to input error for BCM5705 or newer chipset as the others. Unfortunately we cannot do the same for output errors because ifOutDiscards equivalent register does not exist. While I am here, replace misleading and wrong BGE_RX_STATS/BGE_TX_STATS with BGE_MAC_STATS. They were reversed but worked accidently. Notes: svn path=/head/; revision=164780
* - Instead of if_watchdog/if_timer interface use our own timerGleb Smirnoff2006-11-302-24/+18
| | | | | | | | that piggybacks on bge_tick() callout. - Lock bge_tick() using callout_init_mtx(). Notes: svn path=/head/; revision=164769