aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fxp
Commit message (Collapse)AuthorAgeFilesLines
...
* Export hardware MAC statistics through sysctl node. PreviouslyPyun YongHyeon2010-05-093-78/+242
| | | | | | | | | | | | | | | | | | | | | | | | | fxp(4) already used to extract most hardware MAC statistics but it didn't show them. With this change, all MAC statistics counters are exported. Because there are a couple of new counters for 82558 and 82559, enable extended MAC statistics functionality to get these counters. Accoring to public data sheet, 82559 MAC statistics return 24 DWORD counters(3 counters are unknown at this moment) so increase MAC counter structure to meet the MAC statistics block size. The completion of MAC counter dump is now checked against FXP_STATS_DR_COMPLETE status code which is appended at the end of status block. Previously fxp(4) ignored the status of the FXP_SCB_COMMAND_CU_DUMPRESET command. fxp(4) does not wait for the completion of pending command before issuing FXP_SCB_COMMAND_CU_DUMPRESET. Instead it skips the command and try it next time. This scheme may show better performance but there is chance to loose updated counters after stopping controller. So make sure to update MAC statistics in fxp_stop(). While I'm here move sysctl node creation to fxp_sysctl_node(). Tested by: Larry Baird < lab <> gta dot com > Notes: svn path=/head/; revision=207832
* 8255x configure command requires number of bytes of configurationPyun YongHyeon2010-05-071-4/+13
| | | | | | | | | | | | | | | | | | | table. The default size of the configuration table was 22 bytes. To use extended feature of 82550/82551 the configuration table size was expanded to 32 bytes. The added configuration for 82550/82551 specifies VLAN hardware tagging and IPSec configuration as well as TCO. To make configuration easier fxp(4) used a configuration template and the template was copied to configuration table. After that, some parameters of the configuration table was changed depending on controller type and operation mode. However the size of template was 22 bytes so some configuration parameters were not properly initialized on 82550/82551. Fix this by increasing the template size. For 82557, 82558 and 82559 the size of the configuration is still 22 bytes. Notes: svn path=/head/; revision=207750
* It seems controller has two types of promiscuous control, one forPyun YongHyeon2010-05-071-1/+1
| | | | | | | | | | | | | | unicast and the other for multicast. To receive multicast frames that host didn't join in promiscuous mode, driver have to set promiscuous mode for multicast frames as well. The Open Source Software Developer Manual for i8255x was not clear how to handle promiscuous mode. PR: kern/145905 MFC after: 5 days Notes: svn path=/head/; revision=207748
* With r206844, CSUM_TCP is also set for CSUM_TSO case. ModifyPyun YongHyeon2010-04-191-54/+52
| | | | | | | | drivers to take into account for the change. Basically CSUM_TSO should be checked before checking CSUM_TCP. Notes: svn path=/head/; revision=206876
* It seems some 82559ER controllers do not support Rx checksumPyun YongHyeon2009-09-281-2/+5
| | | | | | | | | | | | offloading. Datasheet said nothing about the limitation of 82559ER except WOL. Explicitly disable Rx checksum offloading for controllers that is known to lack the capability. PR: kern/138135 Tested by: Gooderum, Mark < mgooderum <> websense dot com > Notes: svn path=/head/; revision=197586
* Revert previous commit and add myself to the list of people who shouldPoul-Henning Kamp2009-09-081-1/+0
| | | | | | | 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-0/+1
| | | | 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
* For ICH based fxp(4) controllers treat them as 82559 compatibles.Pyun YongHyeon2009-06-212-69/+93
| | | | | | | | | | | | | | | | | To detect which controller is ICH based one, add a new member variable ich to struct fxp_ident and move the struct to if_fxpvar.h. Since I've faked controller revision, don't allow microcode loading for ICH based controllers. With this change all ICH based controllers will have WOL and Rx checksum offload capability. PR: kern/135451 Tested by: Alexey Shuvaev ( shuvaev <> physik dot uni-wuerzburg dot de ), pluknet ( pluknet <> gmail dot com ), Gary Jennejohn ( gary.jennejohn <> freenet dot de ) Notes: svn path=/head/; revision=194574
* Overhaul fxp(4) multicast filter programming. fxp(4) hardwares doPyun YongHyeon2009-06-212-134/+38
| | | | | | | | | | | | | | | | | | | | | | not allow multicast filter programming when controller is busy to send/receive frames. So it used to mark need_mcsetup bit and defer multicast filter programming until controller becomes idle state. To detect when the controller is idle fxp(4) relied on Tx completion interrupt with NOP command and fxp_start_body and fxp_intr_body had to see whether pending multicast filter programming was requested. This resulted in very complex logic and sometimes it did not work as expected. Since the controller should be in idle state before any multicast filter modifications I changed it to reinitialize the controller whenever multicast filter programming is required. This is the same way what OpenBSD and NetBSD does. Also I added IFF_DRV_RUNNING check in ioctl handler so controller would be reinitialized only if it is absolutely needed. With this change I guess we can remove fxp(4) DELAY hack in ifioctl for IPv6 case. Notes: svn path=/head/; revision=194573
* Always check fxp(4) is running, see if it can accept frames fromPyun YongHyeon2009-06-211-3/+10
| | | | | | | | | | | upper stack in fxp_start_body(). fxp(4) drops driver lock in Rx path so check the fxp(4) is still running after reacquiring driver lock in Rx path. Also don't invoke fxp_intr_body if fxp(4) is not running. With this change there is no need to set suspend bit in device attach phase. Notes: svn path=/head/; revision=194572
* Don't blindly enable Rx lock-up workaround. Newer chips do not needPyun YongHyeon2009-06-212-1/+9
| | | | | | | | | the Rx lock-up workaround. Obtained from: NetBSD Notes: svn path=/head/; revision=194571
* Due to possible PCI bus lock-up issues fxp(4) didn't perform fullPyun YongHyeon2009-06-211-1/+5
| | | | | | | | | | | | hardware reset in attach phase. Selective reset does not clear configured parameters so I think full hardware reset is required. To prevent PCI bus lock-up, do selective reset first which will get off the controller from PCI bus and request software reset after selective reset. Software reset will unmask interrupts so disable it after the reset. Notes: svn path=/head/; revision=194570
* Introduce Rx mbuf dma tag and use it in Rx path. Previously it usedPyun YongHyeon2009-06-212-44/+73
| | | | | | | | | | | | | | | | | common mbuf dma tag for both Tx and Rx path but Rx buffer should have single DMA segment and maximum buffer size of the segment should be less than MCLBYTES. fxp(4) also have to check Tx completion status which was updated by DMA so we need BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTWRITE synchronization in Tx path. Fix all misuse of bus_dmamap_sync(9) in fxp(4). I guess this change shall fix occasional driver breakage in PAE environments. While I'm here add error messages of dma tag/buffer creation and correct messages. Notes: svn path=/head/; revision=194569
* Controller will dma SCB command status for a given command andPyun YongHyeon2009-06-101-13/+14
| | | | | | | | | | | | driver should read updated status back after issuing a SCB command. To send a command to controller and read updated status back, driver should synchronize both memory read and write operations with device. Fix bus_dmamap_sync operation specifier used in fxp_dma_wait() by adding both memory read and memory write operations. Notes: svn path=/head/; revision=193875
* When user_frac in the polling subsystem is low it is going to busy theAttilio Rao2009-05-301-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | CPU for too long period than necessary. Additively, interfaces are kept polled (in the tick) even if no more packets are available. In order to avoid such situations a new generic mechanism can be implemented in proactive way, keeping track of the time spent on any packet and fragmenting the time for any tick, stopping the processing as soon as possible. In order to implement such mechanism, the polling handler needs to change, returning the number of packets processed. While the intended logic is not part of this patch, the polling KPI is broken by this commit, adding an int return value and the new flag IFCAP_POLLING_NOCOUNT (which will signal that the return value is meaningless for the installed handler and checking should be skipped). Bump __FreeBSD_version in order to signal such situation. Reviewed by: emaste Sponsored by: Sandvine Incorporated Notes: svn path=/head/; revision=193096
* Don't blindly set IP packet length from interface MTU in TSO case.Pyun YongHyeon2009-04-131-1/+2
| | | | | | | | | | | | | Remote host can advertise smaller MSS than that of sender so upper stack might have adjusted the MSS which in turn generates IP packets that are less size than that of interface MTU. Reported by: Bjoern Koenig ( bkoenig <> alpha-tierchen dot de ) Tested by: Bjoern Koenig ( bkoenig <> alpha-tierchen dot de ) MFC after: 3 days Notes: svn path=/head/; revision=190982
* remove now-redunant cardbus attachment.Warner Losh2009-03-091-1/+0
| | | | Notes: svn path=/head/; revision=189575
* writereg returns an int.Warner Losh2009-02-051-2/+3
| | | | Notes: svn path=/head/; revision=188176
* Always check whether dma map is valid before unloading the map.Pyun YongHyeon2009-01-081-1/+2
| | | | | | | | When fxp(4) intializes Rx buffers for the first time, there is no loaded dma map so attempting to unload it is an invalid operation. Notes: svn path=/head/; revision=186884
* It seems that we don't need to reserve a TBD to set total TCPPyun YongHyeon2008-12-181-4/+4
| | | | | | | | | payload length in TSO case. Leaving unused TBD also seem to cause SCB timeouts under certain conditions when TSO/non-TSO traffics are active at the same time. Notes: svn path=/head/; revision=186262
* mutex.h is needed here. It got it by namespace pollution.Pyun YongHyeon2008-12-081-0/+2
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=185758
* Add VLAN hardware tag insertion/stripping support. Tx/Rx checksumPyun YongHyeon2008-12-022-2/+29
| | | | | | | | | | | | | | offload for VLAN frames are also supported. The VLAN hardware assistance is available only on 82550/82551 based controllers. While I'm here change the confusing name of bit1 in byte 22 of configuration block to vlan_drop_en. The bit controls whether hardware strips VLAN tagged frame or not. Special thanks to wpaul who sent valuable VLAN related information to me. Tested on: i386, sparc64 Notes: svn path=/head/; revision=185540
* Make sure to clear PMDR register by writing back power managementPyun YongHyeon2008-12-021-5/+4
| | | | | | | | | | events. Just reading PMDR register was not enough to have fxp(4) immuninize against received magic packets during system boot. Tested by: Alexey Shuvaev < shuvaev <> physik DOT uni-wuerzburg DOT de > Notes: svn path=/head/; revision=185538
* Add basic WOL support for 82550/82551/82558 and 82559 basedPyun YongHyeon2008-11-273-11/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | controllers. ICH based controllers are treated as 82559. 82557, earlier revision of 82558 and 82559ER have no WOL capability. o WOL support requires help of a firmware so add check whether hardware is capable of handling magic frames by reading EEPROM. o Enable accepting WOL frames only when hardware is about to suspend or shutdown. Previously fxp(4) used to allow receipt of magic frame under normal operation mode which could cause hardware hang if magic frame is received by hardware. Datasheet clearly states driver should not allow WOL frames under normal operation mode. o Disable WOL frame reception in device attach so have fxp(4) immunize against system hang which can be triggered by magic packets when the hardware is not in fully initialized state. o Don't reset all hardware configuration data in fxp_stop() otherwise important configuration data is lost and this would reset WOL configuration to default state which in turn cause hardware hang on receipt of magic frames. To fix the issue, preserve hardware configuration data by issuing a selective reset. o Explicitly disable interrupts after issuing selective reset as reset may unmask interrupts. Tested by: Alexey Shuvaev < shuvaev <> physik DOT uni-wuerzburg DOT de > Notes: svn path=/head/; revision=185354
* Implement TSO for 82550/82551 controllers.Pyun YongHyeon2008-11-263-14/+118
| | | | | | | | | | | | | | | | | | | | | | | | | o Configure controller to use dynamic TBD as TSO requires that operation mode. o Add a dummy TBD to tx_cb_u as TSO can access one more TBD in TSO operation. o Increase a DMA segment size to 4096 to hold a full IP segment with link layer header. o Unlike other TSO capable controllers, 82550/82551 does not modify the first IP packet in TSO operation so driver should create an IP packet with proper header. Subsequent IP packets are generated from the header information in the first IP packet header. Likewise pseudo checksum also should be computed by driver for the first packet. o TSO requires one more TBD to hold total TCP payload. To make code simple for TSO/non-TSO case, increase the index of the first available TBD array. o Remove KASSERT that checks the size of a DMA segment should be less than or equal to MCLBYTES as it's no longer valid in TSO. o Tx threshold and number of TBDs field is used to store MSS in TSO. So don't set the Tx threshold in TSO case. Notes: svn path=/head/; revision=185330
* Implement Rx checksum offload for 82559 or later controllers.Pyun YongHyeon2008-11-262-28/+110
| | | | | | | | | | | | | | | | 82559 or later controllers added simple checksum calculation logic in RU. For backward compatibility the computed checksum is appended at the end of the data posted to Rx buffer. This type of simple checksum calculation support had been used on several vendors such as Sun HME/GEM, SysKonnect GENESIS and Marvell Yukon controllers. Because this type of checksum offload support requires parsing of received frame and pseudo checksum calculation with software routine it still consumes more CPU cycles than that of full-fledged checksum offload controller. But it's still better than software checksum calculation. Notes: svn path=/head/; revision=185329
* o Introduce a new function, fxp_new_rfabuf which allocates a newPyun YongHyeon2008-11-261-27/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rx buffer and loads DMA map. Also add a function fxp_discard_rfabuf that handles reusing Rx buffer/DMA map. With this change fxp_add_rfabuf just handles appending a new RFA to existing chain. o Initialize mbuf length in fxp_new_rfabuf. o Don't reset rnr and have fxp(4) handle received frames even if it couldn't allocate new Rx buffer. This will make fxp(4) reload updated RFA under rnr case. The rnr would still be reset to 0 if polling is active and fxp(4) processed number of allowed Rx events. o Update if_iqdrops if fxp(4) couldn't allocate Rx buffer. Previously fxp(4) used to try to reuse Rx buffer when new buffer allocation is failed. But fxp(4) didn't take into account loaded DMA map such that the same DMA map was loaded again without unloading the map. There is no reason to unload the loaded map and reload the same map again, just reusing the map is enough. I believe the spare DMA map in softc was introduced to implement this behaviour. Also fxp(4) used to stop Rx processing if once Rx buffer allocation or DMA map load fails which in turn resulted in losing incoming frames under heavy network load. With this change fxp(4) should survive from resource shortage condition. Notes: svn path=/head/; revision=185328
* Simplify Tx checksum offload configuration. Also clear CSUM_IP ifPyun YongHyeon2008-11-251-8/+5
| | | | | | | we've computed IP checksum with software method. Notes: svn path=/head/; revision=185286
* - Allow fxp_encap() enqueue failed transmissions and setPyun YongHyeon2008-11-252-70/+71
| | | | | | | | | | | | | | | | | | | | | | | | IFF_DRV_OACTIVE to note resource shortage to upper stack. - Don't count number of mbuf chains. Default 32 DMA segments for a frame is enough for most cases. If bus_dmamap_mbuf_sg fails use m_collapse(9) to collapse the mbuf chain instead of relying on expensive m_defrag(9). - Move bpf handling to fxp_start_body() which is supposed to be more appropriate place. - Always arm watchdog timer whenever a new Tx request is made. Previously fxp(4) used to arm watchdog timer only when FXP_CXINT_THRESH-th Tx request is made. Because fxp(4) does not rely on Tx interrupt to reclaim transmitted mbufs it's better to arm watchdog timer to detect potential lockups. - Add more aggresive Tx buffer reclaiming in fxp_start_body to make room for new Tx requests. Since fxp(4) does not request Tx completion interrupt for every frames it's necessary to clean TXCBs in advance to saturate link. - Make fxp(4) try to start more packets transmitting regardless of interrupt type in fxp_intr_body. Notes: svn path=/head/; revision=185285
* Move unarming watchdog timer and pending multicast configurationPyun YongHyeon2008-11-251-5/+5
| | | | | | | | | | | check to fxp_txeof(). While I'm here unarm watchdog timer only if there are no pending queued Tx requests. Previously the watchdog timer was unarmed whenever Tx interrupt is raised. This could be resulted in hiding root cause of watchdog timeouts. Notes: svn path=/head/; revision=185276
* Fix Tx/Rx checksum offload ioctl handling and make Rx handler honorPyun YongHyeon2008-11-251-9/+26
| | | | | | | | | | checksum offload configuration. Now checksum offload can be controlled by ifconfig(8). While I'm here add an additional check for interface capabilities before applying user's request. Notes: svn path=/head/; revision=185273
* Make fxp(4) build with FXP_IP_CSUM_WAR.Pyun YongHyeon2008-11-251-2/+2
| | | | Notes: svn path=/head/; revision=185272
* Sort head files and removed ununsed header file.Pyun YongHyeon2008-11-251-13/+9
| | | | Notes: svn path=/head/; revision=185271
* Whitespace fix.Pyun YongHyeon2008-11-253-25/+25
| | | | Notes: svn path=/head/; revision=185269
* Reuse the mbuf that was just retrieved from the receive ring if mbufQing Li2008-03-221-8/+17
| | | | | | | | | | | exhaustion is encountered. There was a fix made previously for this problem but the solution (breaking out of the receive loop) does not seem to work. mbuf reuse strategy is already adopted by other drivers such as if_bge. The problem was recreated and the patch is also verified in the same test environment. Notes: svn path=/head/; revision=177507
* Remove the volatile qualifier to apply to fxp_miibus_readreg().Kevin Lo2007-05-301-2/+2
| | | | Notes: svn path=/head/; revision=170125
* Add support for the 82562GX chip within if_fxp.Remko Lodder2007-03-281-0/+1
| | | | | | | | | | PR: 110251 Submitted by: Vyacheslav Vovk Approved by: imp (mentor) MFC After: 3 days Notes: svn path=/head/; revision=167998
* 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
* Change the remainder of the drivers for DMA'ing devices enabled in theMarius Strobl2007-01-211-15/+16
| | | | | | | | | | | sparc64 GENERIC and the sound device drivers known working on sparc64 to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4), stge(4) and ti(4) these changes are runtime tested (unless I booted up the wrong kernels again...). Notes: svn path=/head/; revision=166165
* Grammar nit.Ruslan Ermilov2006-12-011-1/+1
| | | | Notes: svn path=/head/; revision=164792
* - Instead of if_watchdog/if_timer interface use our own timerGleb Smirnoff2006-11-302-13/+19
| | | | | | | that piggybacks on fxp_tick() callout. Notes: svn path=/head/; revision=164771
* Added yet another extra fxp(4) PCI ID.Rink Springer2006-11-141-0/+1
| | | | | | | | | | | PR: kern/104896 Submitted by: Yoshihiko Sarumaru <mistral@imasy.or.jp> Reviewed by: imp (mentor), jfv Approved by: imp (mentor) MFC after: 3 days Notes: svn path=/head/; revision=164283
* Added PCI ID's for:Rink Springer2006-11-061-0/+2
| | | | | | | | | | | | | | | | - 0x1065: Intel 82562ET/EZ/GT/GZ PRO/100 VE Ethernet [1], as found on Tyan GS14 barebones. - 0x1094: Intel Pro/100 946GZ (ICH7) Network Connection [2], as found on Intel 946GZis motherboards. [1] Submitted by: myself [2] Submitted by: Mike Tancsa <mike@sentex.net> Reviewed by: imp (mentor), jfv Approved by: imp (mentor) MFC after: 3 days Notes: svn path=/head/; revision=164031
* fix fxp so that it will reset the link when you change the speed... ThisJohn-Mark Gurney2006-10-061-0/+5
| | | | | | | | | | | | | | will fix a problem where you boot w/ the default of autoselect, but then set the speed to 100/full, the switch will keep the autoselect/100/full negotiation... This will continue to work till someone resets the switch or unplugs the cable resulting in the switch failing to autoneg and falling back to 100/half, causing a hard to track down duplex mismatch.. Submitted by: nCircle Network Security, Inc. MFC after: 1 week Notes: svn path=/head/; revision=163061
* Since DELAY() was moved, most <machine/clock.h> #includes have beenPoul-Henning Kamp2006-05-161-1/+0
| | | | | | | unnecessary. Notes: svn path=/head/; revision=158651
* Whitespace fixMatteo Riondato2006-04-141-1/+1
| | | | | | | Pointed out by: Nate Lawson Notes: svn path=/head/; revision=157757
* Add device ID for Intel Pro/100 VE Network Connection cardMatteo Riondato2006-04-141-0/+1
| | | | | | | | | PR: kern/95729 Submitted by: Nicky Bulthuis MFC after: 1 day Notes: svn path=/head/; revision=157747
* Do not touch ifp->if_baudrate in miibus aware drivers.Gleb Smirnoff2006-02-141-1/+0
| | | | Notes: svn path=/head/; revision=155671
* Check for 10BaseT media correctly. Before we were confusingWarner Losh2006-01-041-1/+2
| | | | | | | | | | | ifm_status and ifm_active. IFM_10_T gets set in the ifm_active field, not in the ifm_status field, as far as I can tell. Note: this was to enable a workaround that's rarely enabled. I don't know how to corrupt my eeprom to test it, and would rather not know... Notes: svn path=/head/; revision=154042