aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fxp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Add the device ID of fxp(4) NICs found in Sony Vaio VGN-TX1XP laptops.Maxime Henrion2005-12-121-0/+1
| | | | | | | | | PR: kern/90024 Submitted by: Thomas Hurst <tom@hur.st> MFC after: 3 days Notes: svn path=/head/; revision=153339
* - Store pointer to the link-level address right in "struct ifnet"Ruslan Ermilov2005-11-111-1/+1
| | | | | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead. Notes: svn path=/head/; revision=152315
* Catch up with IFP2ENADDR() type change (array -> pointer).Ruslan Ermilov2005-11-111-2/+1
| | | | Notes: svn path=/head/; revision=152311
* - Don't pollute opt_global.h with DEVICE_POLLING and introduceGleb Smirnoff2005-10-051-0/+4
| | | | | | | | | | | | opt_device_polling.h - Include opt_device_polling.h into appropriate files. - Embrace with HAVE_KERNEL_OPTION_HEADERS the include in the files that can be compiled as loadable modules. Reviewed by: bde Notes: svn path=/head/; revision=150968
* Big polling(4) cleanup.Gleb Smirnoff2005-10-011-24/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Axe poll in trap. o Axe IFF_POLLING flag from if_flags. o Rework revision 1.21 (Giant removal), in such a way that poll_mtx is not dropped during call to polling handler. This fixes problem with idle polling. o Make registration and deregistration from polling in a functional way, insted of next tick/interrupt. o Obsolete kern.polling.enable. Polling is turned on/off with ifconfig. Detailed kern_poll.c changes: - Remove polling handler flags, introduced in 1.21. The are not needed now. - Forget and do not check if_flags, if_capenable and if_drv_flags. - Call all registered polling handlers unconditionally. - Do not drop poll_mtx, when entering polling handlers. - In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx. - In netisr_poll() axe the block, where polling code asks drivers to unregister. - In netisr_poll() and ether_poll() do polling always, if any handlers are present. - In ether_poll_[de]register() remove a lot of error hiding code. Assert that arguments are correct, instead. - In ether_poll_[de]register() use standard return values in case of error or success. - Introduce poll_switch() that is a sysctl handler for kern.polling.enable. poll_switch() goes through interface list and enabled/disables polling. A message that kern.polling.enable is deprecated is printed. Detailed driver changes: - On attach driver announces IFCAP_POLLING in if_capabilities, but not in if_capenable. - On detach driver calls ether_poll_deregister() if polling is enabled. - In polling handler driver obtains its lock and checks IFF_DRV_RUNNING flag. If there is no, then unlocks and returns. - In ioctl handler driver checks for IFCAP_POLLING flag requested to be set or cleared. Driver first calls ether_poll_[de]register(), then obtains driver lock and [dis/en]ables interrupts. - In interrupt handler driver checks IFCAP_POLLING flag in if_capenable. If present, then returns.This is important to protect from spurious interrupts. Reviewed by: ru, sam, jhb Notes: svn path=/head/; revision=150789
* Convert fxp(4) to use the new bus_alloc_resources() API, it simplifiesMaxime Henrion2005-09-272-60/+42
| | | | | | | the resource allocation code significantly. Notes: svn path=/head/; revision=150610
* Fix an unaligned I/O memory access in the event that a SCB times out.Marcel Moolenaar2005-09-211-3/+9
| | | | | | | | | | | The FXP_SCR_FLOWCONTROL registers is at offset 0x19, but 2 bytes wide. It cannot be read as a word without causing a panic on architectures that enforce strict alignment. MFC after: 3 days Notes: svn path=/head/; revision=150408
* Add callout_drain()'s to foo_detach() after calling foo_stop() to make sureJohn Baldwin2005-08-171-0/+1
| | | | | | | | | | | | that if softclock is running on another CPU and is blocked on our driver lock, we will wait until it has acquired the lock, seen that it was cancelled, dropped the lock, and awakened us so that we can safely destroy the mutex. MFC after: 3 days Notes: svn path=/head/; revision=149203
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson2005-08-091-4/+4
| | | | | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days Notes: svn path=/head/; revision=148887
* - Use callout_init_mtx() to close a small race between callout_stop() andJohn Baldwin2005-08-082-71/+25
| | | | | | | | | | | | | | | | the timeout routine. - Fix locking in detach. - Add locking in shutdown. - Don't mess with the PCI command register in resume, the PCI bus driver already does this for us. - Add locking to the non-serial ifmedia routines. - Fix locking in ioctl. - Remove spls and support for 4.x. MFC after: 1 week Notes: svn path=/head/; revision=148872
* Modify device drivers supporting multicast addresses to lock if_addr_mtxRobert Watson2005-08-031-0/+2
| | | | | | | | | | | over iteration of their multicast address lists when synchronizing the hardware address filter with the network stack-maintained list. Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca> MFC after: 1 week Notes: svn path=/head/; revision=148654
* Add a new PCI id for fxp(4) cards found on ICH7-based systems.Maxime Henrion2005-07-291-0/+1
| | | | | | | | | This commit is a RELENG_6 candidate. Submitted by: Martin Nilsson <martin@gneto.com> Notes: svn path=/head/; revision=148546
* Move if_alloc() up in fxp_attach() so there's an ifp beforeBrooks Davis2005-06-111-6/+7
| | | | | | | | | mii_phy_probe() is called. Committed via: fxp0 Notes: svn path=/head/; revision=147289
* Avoid deadlock in fxp driver when system runs out of mbufs.Wes Peters2005-06-101-1/+6
| | | | | | | | MFC after: 1 week Provided by: Ernie Smallis <esmallis@stbernard.com> Notes: svn path=/head/; revision=147282
* Revert the unnecessicary addition of some braces in fxp_attach(). Don'tBrooks Davis2005-06-101-3/+1
| | | | | | | | explicitly free the ifp in fxp_detach(), the call to fxp_release() takes care of it. Notes: svn path=/head/; revision=147269
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-06-102-24/+32
| | | | | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam Notes: svn path=/head/; revision=147256
* Correct commentWarner Losh2005-06-061-2/+1
| | | | Notes: svn path=/head/; revision=147042
* Remove some variables the last commit stopped using so the code compiles.Brooks Davis2005-06-061-2/+2
| | | | Notes: svn path=/head/; revision=147038
* The PCI bus code saves/restores these config registers now.Warner Losh2005-06-052-20/+0
| | | | Notes: svn path=/head/; revision=147029
* Be more conservative when enabling extended features. There are fxp(4)Maxime Henrion2005-04-222-3/+7
| | | | | | | | | NICs out there that have an utterly bogus revision ID. Reported by: Denis Shaposhnikov <dsh@vlink.ru> Notes: svn path=/head/; revision=145401
* Add a microcode to implement receive bundling for 82551 chipsets withMaxime Henrion2005-04-213-20/+152
| | | | | | | | | | a revision ID of 0x0f (D102 E-step). MFC after: 2 weeks Tested by: pav Notes: svn path=/head/; revision=145368
* Enable extended RFDs and TCBs, and thus checksum offloading, forMaxime Henrion2005-04-211-2/+1
| | | | | | | | | | | | | | latest 82550 and 82551 chipsets (revision IDs 0x0e, 0x0f and 0x10). We were only enabling it for revisions 0x0c and 0x0d, now it's enabled for any 8255x NIC with a revision ID bigger than 0x0c. It should be safe, and this is what Intel does in their open source driver. MFC after: 2 weeks Tested by: Pavel Lobach lobach_pavel at mail dot ru Notes: svn path=/head/; revision=145359
* Unload and destroy the TX DMA maps before destroying the DMA tagMaxime Henrion2005-03-161-4/+3
| | | | | | | | | they're attached to, not after. Spotted by: Coverity via sam Notes: svn path=/head/; revision=143705
* - Encapsulate the code responsible for initializing a new TX descriptorMaxime Henrion2005-03-072-190/+189
| | | | | | | | | | from an mbuf into the fxp_encap() function, as done in other drivers. - Don't waste time calling bus_dmamap_load_mbuf() if we know the mbuf chain is too long to fit in a TX descriptor, call m_defrag() first. - Convert fxp(4) to use bus_dmamap_load_mbuf_sg(). Notes: svn path=/head/; revision=143243