summaryrefslogtreecommitdiffstats
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* Flesh out some inline documentation which hopefully reflect the intendedadrian2009-05-271-0/+23
| | | | reality of these functions.
* Add in some INVARIANT checks in the TX mbuf descriptor "freelist" management ↵adrian2009-05-271-0/+2
| | | | | | | | code. Slot 0 must always remain "free" and be a pointer to the first free entry in the mbuf descriptor list. It is thus an error to have code allocate or push slot 0 back into the list.
* Add the ksyms(4) pseudo driver. The ksyms driver allows a process tosson2009-05-261-0/+678
| | | | | | | | | | | | | | get a quick snapshot of the kernel's symbol table including the symbols from any loaded modules (the symbols are all merged into one symbol table). Unlike like other implementations, this ksyms driver maps memory in the process memory space to store the snapshot at the time /dev/ksyms is opened. It also checks to see if the process has already a snapshot open and won't allow it to open /dev/ksyms it again until it closes first. This prevents kernel and process memory from being exhausted. Note that /dev/ksyms is used by the lockstat(1) command. Reviewed by: gallatin kib (freebsd-arch) Approved by: gnn (mentor)
* Unifdef __NetBSD__ here, the usb stack as a whole doesnt support NetBSD and itthompsa2009-05-262-418/+2
| | | | obsfucates the code.
* Do not forcefully close the write transfer when closing the tty, it needs tothompsa2009-05-262-21/+7
| | | | run to completion and drain the tty queue.
* Unbreak bktr(4).ed2009-05-261-1/+1
|
* Free the memory correctly in the error casebenjsc2009-05-261-1/+1
| | | | | | Submitted by: frtzkatz at yahoo.com Approved by: sam MFC after: 1 month
* There is rubbish heremarkm2009-05-252-11/+8
| | | | | It is time to take it out Now it is cleaner
* Correct controller description for 88E8035, 88E8036, 88E8038 andyongari2009-05-251-4/+4
| | | | 88E8039. These are fast ethernet controllers.
* Simplify SIOCSIFFLAGS handler.yongari2009-05-251-12/+8
|
* Be consistent with other capability checking.yongari2009-05-251-7/+8
|
* Don't reinitialize controller when interface is already running.yongari2009-05-251-1/+9
|
* If interface is not UP, don't return media status.yongari2009-05-251-0/+4
|
* Add device ids for Yukon FE+(88E8040, 88E8040T, 88E8048 and 88E8070).yongari2009-05-252-1/+13
|
* Add workaround for Yukon FE+ A0. This controller is known to haveyongari2009-05-252-11/+52
| | | | | | | | | | | | | | | | | severe silicon bugs that can't handle VLAN hardware tagging as well as status LE writeback bug. The status LE writeback bug is so critical we can't trust status word of received frame. To accept frames on Yukon FE+ A0 msk(4) just do minimal check for received frames and pass them to upper stack. This means msk(4) can pass corrupted frames to upper layer. You have been warned! Also I supposed RX_GMF_FL_THR to be 32bits register but Linux driver treated it as 16bit register so follow their leads. At least this does not seem to break msk(4) on Yukon FE+. Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com ) Bruce Cran ( bruce <> cran dot org dot uk ) Michael Reifenberger ( mike <> reifenberger dot com ) Stephen Montgomery-Smith ( stephen <> missouri dot edu )
* Add preliminary Yukon FE+ support and register definitions.yongari2009-05-252-4/+20
| | | | | | | | | | | | | | Yukon FE+ is fast ethernet controller and uses new descriptor format. Since I don't have this controller, the support code was written from guess and various feedback from enthusiastic users. Thanks to all users who patiently tested my initial patches. Special thanks to Tanguy Bouzeloc who fixed critical bug of initial patch. Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com ) Bruce Cran ( bruce <> cran dot org dot uk ) Michael Reifenberger ( mike <> reifenberger dot com ) Stephen Montgomery-Smith ( stephen <> missouri dot edu )
* Explicitly reset GMAC Controls and initialize GM_GP_CTRL register.yongari2009-05-251-10/+8
| | | | | | | The GM_GP_CTRL register may have stale content from previous link information so clearing it will make hardware update the register correctly when it established a valid link. While I'm here remove stale comment.
* Disable HW WOL for Yukon EC Ultra. While I'm here use switchyongari2009-05-251-11/+15
| | | | | statement over if-else statement. This change will make it easy to add newer Yukon controllers.
* Explicitly check resolved speed/duplex. Just checking IFM_ACTIVEyongari2009-05-251-8/+24
| | | | | | | | does not guarantee established link. Also 1000baseT link report for fast ethernet controller is not valid one so make sure gigabit link is allowed for this controller. Whenever we lost link, check whether Rx/Tx MACs were enabled. If both MAC are not active, do not try to disable it again.
* Add support for newer descriptor format. This format is used onyongari2009-05-252-12/+29
| | | | Yukon FE+, Yukon Extreme and Yukon Supreme.
* Oops, add missing ~ operator.yongari2009-05-251-1/+1
|
* Caller already hold a driver lock in mii callback, assert it.yongari2009-05-251-1/+1
|
* Rather than checking every chip revision, introduce more flags toyongari2009-05-252-29/+33
| | | | | | | | | | | | mark controller's capability. Controllers that have jumbo frame support sets MSK_FLAG_JUMBO, and controllers that does not support checksum offloading for jumbo frames will set MSK_FLAG_JUMBO_NOCSUM. For Fast Ethernet controllers it will set MSK_FLAG_FASTETHER and it would be used in link state handling. While here, disable Tx checksum offloading if jumbo frame is used on controllers that does not have Tx checksum offloading capability for jumbo frame(e.g. Yukon EC Ultra).
* Correctly return the result of mii_mediachg(). Previously it alwaysyongari2009-05-251-2/+3
| | | | used to return success.
* Use bit definition to represent MSI and detach state instead ofyongari2009-05-252-6/+6
| | | | using separate variables in softc.
* Use bit definition to represent link state, device suspend insteadyongari2009-05-252-13/+15
| | | | of using separate variables in softc.
* Remove link handling taskqueue and use mii callback directly. Whileyongari2009-05-252-19/+3
| | | | I'm here also checks driver running state.
* Add driver support for 88E3016 PHY which is found on Marvell Yukonyongari2009-05-253-4/+34
| | | | | | | | | | | | | | | FE+ controller. Due to the severe silicon bugs for Yukon FE+, 88E3016 seems to require more workarounds. However I'm not sure whether the workaround is PHY specific or only applicable to Yukon FE+. The datasheet for the PHY is publicly available but it lacks several details for the workaround used in this change. The workaround information was obtained from Linux. Many thanks to Yukon FE+ users who helped me add 88E3016 support. Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com ) Bruce Cran ( bruce <> cran dot org dot uk ) Michael Reifenberger ( mike <> reifenberger dot com ) Stephen Montgomery-Smith ( stephen <> missouri dot edu )
* Do not ignore NEXT Page capability of auto-negotiationyongari2009-05-251-4/+7
| | | | | | advertisement register. Some PHYs such as 88E3016 requires NEXT Page capability to establish valid link. Also set protocol selector field which is read only but it makes the intention clearer.
* Don't read unnecessary PHY registers. Speed/duplex resolution bityongari2009-05-251-12/+16
| | | | | | | is valid only for auto-negotiation case so check the bit if we know auto-negotiation is active. While I'm here explicitly checks current speed with speed mask and set IFM_NONE if resolved speed is unknown.
* Report current link state while auto-negotiation is in progress.yongari2009-05-251-1/+1
|
* Use mii_phy_add_media() and remove usage of local macro ADD. Alsoyongari2009-05-251-50/+12
| | | | | | | | | checks extended status register to see whether the PHY is fast ethernet or not. This removes a lot of checks for specific PHY models and it makes easy to add more PHYs to e1000phy(4). While I'm here remove setting mii_anegticks as it is set with mii_phy_add_media().
* NVIDIA MCP controllers have no Rx buffer alignment restrictions.yongari2009-05-251-1/+1
| | | | | | | | | | Remove PAGE_SIZE alignment used in Rx buffer DMA tag creation. The alignment restriction was used in old local jumbo allocator and nfe(4) switched to UMA backed page allocator for jumbo frame. This change should fix jumbo buffer allocation failure. Reported by: Pascal Braun ( pascal.braun <> continum dot net )
* Partial reversion of previous commit. The CXGB_SHUTDOWN flag does NOTgnn2009-05-221-4/+0
| | | | | | | need to be inverted when doing an ifconfig down of an interface. Pointed out by: Navdeep Parhar MFC after: 1 week
* Fix a possible panic cxgb_controller_attach() routine that would occurgnn2009-05-221-6/+12
| | | | | | | | | | | | only if prepping the adapter failed. Slight adjustment to comments. Fix a bug whereby downing the interface didn't preven it from processing packets. Submitted by: Navdeep Parhar MFC after: 1 week
* Don't clear last usage when a new HID item is found, it improves parsing ofthompsa2009-05-211-3/+0
| | | | | | Apple keyboard HID descriptors. Submitted by: Hans Petter Selasky
* Remove README.TXT as the info is in usb(4).thompsa2009-05-211-411/+0
|
* Add Sharp WILLCOM03 ipaq and Option GTHSDPA 3g device ids.thompsa2009-05-213-1/+6
| | | | Submitted by: Hans Petter Selasky
* Use the correct usb config number on attach.thompsa2009-05-211-1/+1
| | | | | Reported by: Greg Rivers Submitted by: Hans Petter Selasky
* Fix a failure to report failure on stalled status stage for controlthompsa2009-05-211-7/+0
| | | | | | transactions. Submitted by: Hans Petter Selasky
* Add a driver for the AVR32 series USB Device Controller. Not hooked up asthompsa2009-05-212-0/+2319
| | | | | | | FreeBSD does not yet support this platform but it makes it easier to stay in sync. Submitted by: Hans Petter Selasky
* Improve device mode (gadget) stall handling.thompsa2009-05-2110-10/+25
| | | | | | | | | Some hardware easily comes out of sync with regard to whether the current or the next control transfer should be stalled, if a stall command is always issued before receiving the SETUP packet. After this patch the stall command will only be issued when a transfer should actually be stalled. Submitted by: Hans Petter Selasky
* rssi/nf data are now dbm, tag them accordinglysam2009-05-211-2/+2
|
* o remove bpf tap call missed in r192468sam2009-05-211-3/+1
| | | | o correct rssi taken from rx descriptor; need dbm
* Integrate three changes from Chelsio.gnn2009-05-216-178/+172
| | | | | | | | | | 1) Add a sysctl that will say what type of PHYs exist on the card. 2) Fix a bug that occurs when an AEL 2005 PHY resets without a transciever in the card. 3) Unify the PHY link detection code. Obtained from: Navdeep Parhar MFC after: 10 days
* Modified the attach and detach routines to handle bringing ports upgnn2009-05-211-85/+146
| | | | | | | | and down more cleanly. This addresses a problem where if we have the link flap during boot the driver would lock up the system. Reviewed by: jhb MFC after: 1 week
* Largely revert the earlier change to use a single CCB for the RAID recoveryjhb2009-05-211-3/+8
| | | | | | | | | | thread. Multiple RAID events in quick succession can cause an additional bus rescan to be scheduled before an earlier scan has completed. In this case the driver was attempting to use the same CCB storage for two requests. PR: kern/130330 Reviewed by: Riccardo Torrini riccardo.torrini | esaote com MFC after: 1 week
* force type matchsam2009-05-211-1/+1
|
* Print out device attachment.thompsa2009-05-212-0/+2
|
* bus_dma(9) conversion and make nge(4) work on all architectures.yongari2009-05-212-835/+1654
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Header file cleanup. o bus_dma(9) conversion. - Removed all consumers of vtophys(9) and converted to use bus_dma(9). - 64bit DMA support was disabled because DP83821 is not capable of handling the DMA request. 64bit DMA request on DP83820 requires different descriptor structures and it's hard to dynamically change descriptor format at run time so I disabled it. Note, this is the same behavior as previous one but previously nge(4) didn't explicitly disable 64bit mode on DP83820. - Added Tx/Rx descriptor ring alignment requirements(8 bytes alignment). - Limit maximum number of Tx DMA segments to 16. In fact, controller does not seem to have limitations on number of Tx DMA segments but 16 should be enough for most cases and m_collapse(9) will handle highly fragmented frames without consuming a lot of CPU cycles. - Added Rx buffer alignment requirements(8 bytes alignment). This means driver should fixup received frames to align on 16bits boundary on strict-alignment architectures. - Nuked driver private data structure in descriptor ring. - Added endianness support code in Tx/Rx descriptor access. o Prefer faster memory mapped register access to I/O mapped access. Added fall-back mechanism to use alternative register access. The hardware supports both memory and I/O mapped access. o Added suspend/resume methods but it wasn't tested as controller I have does not support PCI PME. o Removed swap argument in nge_read_eeprom() since endianness should be handled after reading EEPROM. o Implemented experimental 802.3x full-duplex flow-control. ATM it was commented out but will be activated after we have generic flow-control framework in mii(4) layer. o Rearranged promiscuous mode settings and simplified logic. o Always disable Rx filter prior to changing Rx filter functions as indicated in DP83820/DP83821 datasheet. o Added an explicit DELAY in timeout loop of nge_reset(). o Added a sysctl variable dev.nge.%d.int_holdoff to control interrupt moderation. Valid ranges are 1 to 255(default 1) in units of 100us. The actual delivery of interrupt would be delayed based on the sysctl value. The interface has to be brought down and up again before a change takes effect. With proper tuning value, users do not need to resort to polling(4) anymore. o Added ALTQ(4) support. o Added missing IFCAP_VLAN_HWCSUM as nge(4) can offload Tx/Rx checksum calculation on VLAN tagged frames as well as VLAN tag insertion/stripping. Also add IFCAP_VLAN_MTU capability as nge(4) can handle VLAN tagged oversized frames. o Fixed media header length for VLAN. o Rearranged nge_detach routine such that it's now used for general clean-up routine. o Enabled MWI. o Accessing EEPROM takes very long time so read 6 bytes ethernet address with one call instead of 3 separate accesses. o Don't set if_mtu in device attach, it's already set in ether_ifattach(). o Don't do any special things for TBI interface. Remove TBI specific media handling in the driver and have gentbi(4) handle it. Add glue code to read/write TBI PHY registers in miibus method. This change removes a lot of PHY handling code in driver and now its functionality is handled by mii(4). o Alignment fixup code is now applied only for strict-alignment architectures. Previously the code was applied for all architectures except i386. With this change amd64 will get instant Rx performance boost. o When driver fails to allocate a new mbuf, update if_qdrops so users can see what was wrong in Rx path. o Added a workaround for a hardware bug which resulted in short VLAN tagged frames(e.g. ARP) was rejected as if runt frame was received. With this workaround nge(4) now accepts the short VLAN tagged frame and nge(4) can take full advantage of hardware VLAN tag stripping. I have no idea how this bug wasn't known so far, without the workaround nge(4) may never work on VLAN environments. o Fixed Rx checksum offload logic such that it now honors active interface capability configured with ifconfig(8). o In nge_start()/nge_txencap(), always leave at least one free descriptor as indicated in datasheet. Without this the hardware would be confused with ring descriptor structure(e.g. no clue for the end of descriptor ring). o Removed dead-code that checks interrupts on PHY hardware. The code was designed to detect link state changes but it was disabled as driving nge_tick clock would break auto-negotiation timer. This code is no longer needed as nge(4) now uses mii(4) and link state change handling is done with mii callback. o Rearranged ethernet address programming logic such that it works on strict-alignment architectures. o Added IFCAP_VLAN_HWTAGGING/IFCAP_VLAN_HWCSUM handler in nge_ioctl() such that the functionality is configurable with ifconfig(8). DP83820/DP83821 can do checksum offload for VLAN tagged frames so enable Tx/Rx checksum offload for VLAN interfaces. o Simplified IFCAP_POLLING selection logic in nge_ioctl(). o Fixed module unload panic when bpf listeners are active. o Tx/Rx descriptor ring address uses 64bit DMA address for readability. High address part of DMA would be 0 as nge(4) disabled 64bit DMA transfers so it's ok for DP83821. o Removed volatile keyword in softc as bus_dmamap_sync(9) should take care of this. o Removed extra driver private structures in descriptor ring. These extra elements are not part of descriptor structure. Embedding private driver structure into descriptor ring is not good idea as its size may be different on 32bit/64bit architectures. o Added miibus_linkchg method handler to catch link state changes. o Removed unneeded nge_ifmedia in softc. All TBI access is handled in gentbi(4). There is no difference between TBI and non-TBI case now. o Removed "gigabit link up" message handling in nge_tick. Link state change notification is already performed by mii(4) and checking link state by accessing PHY registers in periodic timer handler of driver is wrong. All link state and speed/duplex monitoring should be handled in PHY driver. o Use our own timer for watchdog instead of if_watchdog/if_timer interface. o Added hardware MAC statistics counter, users canget current MAC statistics from dev.nge.%d.stats sysctl node(%d is unit number of a device). o Removed unused macros, NGE_LASTDESC, NGE_MODE, NGE_OWNDESC, NGE_RXBYTES. o Increased number of Tx/Rx descriptors from 128 to 256. From my experience on gigabit ethernet controllers, number of descriptors should be 256 or higher to get an optimal performance on gigabit link. o Increased jumbo frame length to 9022 bytes to cope with other gigabit ethernet drivers. Experimentation shows no problems with 9022 bytes. o Removed unused member variables in softc. o Switched from bus_space_{read|write}_4 to bus_{read|write}_4. o Added support for WOL.
OpenPOWER on IntegriCloud