summaryrefslogtreecommitdiffstats
path: root/sys/dev/fxp
Commit message (Collapse)AuthorAgeFilesLines
* writereg returns an int.imp2009-02-051-2/+3
|
* Always check whether dma map is valid before unloading the map.yongari2009-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.
* It seems that we don't need to reserve a TBD to set total TCPyongari2008-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.
* mutex.h is needed here. It got it by namespace pollution.yongari2008-12-081-0/+2
| | | | Pointed out by: bde
* Add VLAN hardware tag insertion/stripping support. Tx/Rx checksumyongari2008-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
* Make sure to clear PMDR register by writing back power managementyongari2008-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 >
* Add basic WOL support for 82550/82551/82558 and 82559 basedyongari2008-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 >
* Implement TSO for 82550/82551 controllers.yongari2008-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.
* Implement Rx checksum offload for 82559 or later controllers.yongari2008-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.
* o Introduce a new function, fxp_new_rfabuf which allocates a newyongari2008-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.
* Simplify Tx checksum offload configuration. Also clear CSUM_IP ifyongari2008-11-251-8/+5
| | | | we've computed IP checksum with software method.
* - Allow fxp_encap() enqueue failed transmissions and setyongari2008-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.
* Move unarming watchdog timer and pending multicast configurationyongari2008-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.
* Fix Tx/Rx checksum offload ioctl handling and make Rx handler honoryongari2008-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.
* Make fxp(4) build with FXP_IP_CSUM_WAR.yongari2008-11-251-2/+2
|
* Sort head files and removed ununsed header file.yongari2008-11-251-13/+9
|
* Whitespace fix.yongari2008-11-253-25/+25
|
* Reuse the mbuf that was just retrieved from the receive ring if mbufqingli2008-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.
* Remove the volatile qualifier to apply to fxp_miibus_readreg().kevlo2007-05-301-2/+2
|
* Add support for the 82562GX chip within if_fxp.remko2007-03-281-0/+1
| | | | | | | PR: 110251 Submitted by: Vyacheslav Vovk Approved by: imp (mentor) MFC After: 3 days
* o break newbus api: add a new argument of type driver_filter_t topiso2007-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@
* Change the remainder of the drivers for DMA'ing devices enabled in themarius2007-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...).
* Grammar nit.ru2006-12-011-1/+1
|
* - Instead of if_watchdog/if_timer interface use our own timerglebius2006-11-302-13/+19
| | | | that piggybacks on fxp_tick() callout.
* Added yet another extra fxp(4) PCI ID.rink2006-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
* Added PCI ID's for:rink2006-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
* fix fxp so that it will reset the link when you change the speed... Thisjmg2006-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
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-161-1/+0
| | | | unnecessary.
* Whitespace fixmatteo2006-04-141-1/+1
| | | | Pointed out by: Nate Lawson
* Add device ID for Intel Pro/100 VE Network Connection cardmatteo2006-04-141-0/+1
| | | | | | PR: kern/95729 Submitted by: Nicky Bulthuis MFC after: 1 day
* Do not touch ifp->if_baudrate in miibus aware drivers.glebius2006-02-141-1/+0
|
* Check for 10BaseT media correctly. Before we were confusingimp2006-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...
* Add the device ID of fxp(4) NICs found in Sony Vaio VGN-TX1XP laptops.mux2005-12-121-0/+1
| | | | | | PR: kern/90024 Submitted by: Thomas Hurst <tom@hur.st> MFC after: 3 days
* - Store pointer to the link-level address right in "struct ifnet"ru2005-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.
* Catch up with IFP2ENADDR() type change (array -> pointer).ru2005-11-111-2/+1
|
* - Don't pollute opt_global.h with DEVICE_POLLING and introduceglebius2005-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
* Big polling(4) cleanup.glebius2005-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
* Convert fxp(4) to use the new bus_alloc_resources() API, it simplifiesmux2005-09-272-60/+42
| | | | the resource allocation code significantly.
* Fix an unaligned I/O memory access in the event that a SCB times out.marcel2005-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
* Add callout_drain()'s to foo_detach() after calling foo_stop() to make surejhb2005-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
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-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
* - Use callout_init_mtx() to close a small race between callout_stop() andjhb2005-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
* Modify device drivers supporting multicast addresses to lock if_addr_mtxrwatson2005-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
* Add a new PCI id for fxp(4) cards found on ICH7-based systems.mux2005-07-291-0/+1
| | | | | | This commit is a RELENG_6 candidate. Submitted by: Martin Nilsson <martin@gneto.com>
* Move if_alloc() up in fxp_attach() so there's an ifp beforebrooks2005-06-111-6/+7
| | | | | | mii_phy_probe() is called. Committed via: fxp0
* Avoid deadlock in fxp driver when system runs out of mbufs.wes2005-06-101-1/+6
| | | | | MFC after: 1 week Provided by: Ernie Smallis <esmallis@stbernard.com>
* Revert the unnecessicary addition of some braces in fxp_attach(). Don'tbrooks2005-06-101-3/+1
| | | | | explicitly free the ifp in fxp_detach(), the call to fxp_release() takes care of it.
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-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
* Correct commentimp2005-06-061-2/+1
|
* Remove some variables the last commit stopped using so the code compiles.brooks2005-06-061-2/+2
|
OpenPOWER on IntegriCloud