summaryrefslogtreecommitdiffstats
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* Correct some bInterval USB template descriptor values.hselasky2011-12-064-10/+10
| | | | MFC after: 3 days
* Fix compile warning when using clang to compile the code.hselasky2011-12-061-1/+1
| | | | | Submitted by: arundel @ MFC after: 3 days
* Catch up with Bryan Venteicher's virtio Hg repo:grehan2011-12-0610-79/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c162516 Remove vtblk_sector_size c162515 Wrap long license lines c162514 Remove vtblk_unit c162513 Wrap long lines in the license. c162512 Remove verbose messages when link goes up/down. A similar message is printed elsewhere as a result of if_link_state_change(). c162511 Explicity compare pointer to NULL c162510 Allocate the mac filter table at attach time. c162509 Add real BSD licenses to the header files copied from Linux. The chases upstream changes made in Linux awhile ago. c162508 Only notify if we actually dequeued something. c162507 Change a couple of if () { KASSERT(...) } to just KASSERTs. In non-debug kernels, the if() { } probably get optomized away, but I guess this is clearer. c162506 Remove VIRTIO_BLK_F_TOPOLOGY fields in the config. TOPOLOGY has since been removed from the spec, and the FreeBSD didn't really do anything with the fields anyways. c162505 Move vtblk_enqueue_request() outside the locks when getting the ident. c162504 Remove soon to be uneeded trylock during dump [1]. http://lists.freebsd.org/pipermail/freebsd-current/2011-November/029226.html c162503 Remove emtpy line c162502 Drop frame if cannot allocate a vtnet_tx_header. If we don't, we set OACTIVE, but if there are no other frames in flight, vtnet_txeof() will never be called to unset OACTIVE. The interface would have to be down/up'ed in order to become usable. We could be cuter here and only do this if the virtqueue is emtpy, but its probably not worth the complication. c162501 Start mbuf replacement loop at 1 for clarity Obtained from: Bryan Venteicher bryanv at daemoninthecloset dot org
* Make et_probe() return BUS_PROBE_DEFAULT such that allow otheryongari2011-12-061-15/+11
| | | | | | | | driver that has high precedence for the controller override et(4). Add missing callout_drain(9) in device detach and rework detach routine. While I'm here use rman_get_rid(9) instead of using cached resource id because bus methods are free to change the id.
* et(4) supports VLAN oversized frame so correctly set header length.yongari2011-12-061-2/+4
| | | | | | While I'm here remove initializing if_mtu, it is set by ether_ifattach(9). Also move callout_init_mtx(9) to the right below driver lock initialization.
* Fix alt(4) support. Also add check for number of available TXyongari2011-12-051-18/+22
| | | | | | | | | | | descriptors before trying to send frames. If we're not able to send a frame, make sure to prepend it to if_snd queue such that alt(4) should work. While I'm here prefer ETHER_BPF_MTAP to BPF_MTAP. ETHER_BPF_MTAP should be used for controllers that support VLAN hardware tag insertion. The controller supports VLAN tag insertion but lacks VLAN tag stripping in RX path though.
* Implement suspend/resume methods. Driver has no issue withyongari2011-12-051-0/+30
| | | | suspend/resume.
* Remove NetBSD license. r199548 removed all bit macros that wereyongari2011-12-051-35/+0
| | | | derived from NetBSD.
* - In mii_attach(9) just set the driver for a newly added miibus(4) instancemarius2011-12-051-3/+3
| | | | | | | | | | | | | before calling bus_enumerate_hinted_children(9) (which is the minimum for this to work) instead of fully probing it so later on we can just call bus_generic_attach(9) on the parent of the miibus(4) instance. The latter is necessary in order to work around what seems to be a bzzarre race in newbus affecting a few machines since r227687, causing no driver being probed for the newly added miibus(4) instance. Presumably this is the same race that was the motivation for the work around done in r215348. Reported and tested by: yongari - Revert the removal of a static in r221913 in order to help compilers to produce more optimal code.
* Fix off by one error in mbuf access. Previously it caused panic.yongari2011-12-051-6/+13
| | | | | | | While I'm here use NULL to compare mbuf pointer and add additional check for zero length mbuf before accessing the mbuf. PR: kern/162932
* add netmap support for "em", "lem", "igb" and "re".luigi2011-12-054-0/+347
| | | | | | | | | | | | | | On my hardware, "em" in netmap mode does about 1.388 Mpps on one card (on an Asus motherboard), and 1.1 Mpps on another card (PCIe bus). Both seem to be NIC-limited, because i have the same rate even with the CPU running at 150 MHz. On the "re" driver the tx throughput is around 420-450 Kpps on various (8111C and the like) chipsets. On the Rx side performance seems much better, and i can receive the full load generated by the "em" cards. "igb" is untested as i don't have the hardware.
* revise the implementation of the rings connected to the host stackluigi2011-12-051-27/+46
|
* 1. Fix the handling of link reset while in netmap more.luigi2011-12-058-582/+827
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A link reset now is completely transparent for the netmap client: even if the NIC resets its own ring (e.g. restarting from 0), the client will not see any change in the current rx/tx positions, because the driver will keep track of the offset between the two. 2. make the device-specific code more uniform across different drivers There were some inconsistencies in the implementation of the netmap support routines, now drivers have been aligned to a common code structure. 3. import netmap support for ixgbe . This is implemented as a very small patch for ixgbe.c (233 lines, 11 chunks, mostly comments: in total the patch has only 54 lines of new code) , as most of the code is in an external file sys/dev/netmap/ixgbe_netmap.h , following some initial comments from Jack Vogel about making changes less intrusive. (Note, i have emailed Jack multiple times asking if he had comments on this structure of the code; i got no reply so i assume he is fine with it). Support for other drivers (em, lem, re, igb) will come later. "ixgbe" is now the reference driver for netmap support. Both the external file (sys/dev/netmap/ixgbe_netmap.h) and the device-specific patches (in sys/dev/ixgbe/ixgbe.c) are heavily commented and should serve as a reference for other device drivers. Tested on i386 and amd64 with the pkt-gen program in tools/tools/netmap, the sender does 14.88 Mpps at 1050 Mhz and 14.2 Mpps at 900 MHz on an i7-860 with 4 cores and 82599 card. Haven't tried yet more aggressive optimizations such as adding 'prefetch' instructions in the time-critical parts of the code.
* Modify the GPIO i2c bus code to allow for arbitrary data/clockadrian2011-12-041-14/+22
| | | | | | | | | pins, rather than defaulting to 0 and 1. This way the pin order can be reversed. It is reversed with the TP-Link TL-WR1043nd. Submitted by: Stefan Bethke <stb@lassitu.de>
* Allow the i2c node requirements to be slightly relaxed.adrian2011-12-043-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | These realtek switch PHYs speak a variant of i2c with some slightly modified handling. From the submitter, slightly modified now that some further digging has been done: The I2C framework makes a assumption that the read/not-write bit of the first byte (the address) indicates whether reads or writes are to follow. The RTL8366 family uses the bus: after sending the address+read/not-write byte, two register address bytes are sent, then the 16-bit register value is sent or received. While the register write access can be performed as a 4-byte write, the read access requires the read bit to be set, but the first two bytes for the register address then need to be transmitted. This patch maintains the i2c protocol behaviour but allows it to be relaxed (for these kinds of switch PHYs, and whatever else Realtek may do with this almost-but-not-quite i2c bus) - by setting the "strict" hint to 0. The "strict" hint defaults to 1. Submitted by: Stefan Bethke <stb@lassitu.de>
* Add quirk for Micron RealSSD eUSB failing on unsupported SCSI commandemaste2011-12-032-0/+5
| | | | | | | | | | It appears this device fails if sent a SYNCHRONIZE_CACHE command, so add quirk to avoid sending it. I will follow up with Micron on this issue, and will adjust the quirk if necessary based on their feedback. Reviewed by: hselasky@
* Fix a compile warning with clang.hselasky2011-12-031-1/+1
| | | | | Reported by: arundel @ MFC after: 3 days
* Fix OF_finddevice error return value in case of FDT.jchandra2011-12-026-9/+11
| | | | | | | | | | | | | | | | | | | According to the open firmware standard, finddevice call has to return a phandle with value of -1 in case of error. This commit is to: - Fix the FDT implementation of this interface (ofw_fdt_finddevice) to return (phandle_t)-1 in case of error, instead of 0 as it does now. - Fix up the callers of OF_finddevice() to compare the return value with -1 instead of 0 to check for errors. - Since phandle_t is unsigned, the return value of OF_finddevice should be checked with '== -1' rather than '<= 0' or '> 0', fix up these cases as well. Reported by: nwhitehorn Reviewed by: raj Approved by: raj, nwhitehorn
* Add hw.ahci.force tunable to control whether AHCI drivers should attachmav2011-12-023-3/+31
| | | | | | | | | | to known AHCI-capable chips (AMD/NVIDIA), configured for legacy emulation. Enabled by default to get additional performance and functionality of AHCI when it can't be enabled by BIOS. Can be disabled to honor BIOS settings if needed for some reason. MFC after: 1 month
* Update Westmere uncore event exception list.fabient2011-12-021-0/+8
| | | | | Submitted by: Davide Italiano <davide italiano at gmail com> MFC after: 1 week
* Fix checks for error return from urtw_alloc_rx_data_list() andkevlo2011-12-021-2/+2
| | | | urtw_alloc_tx_data_list().
* Add a constant for the Advisory Non-Fatal Error bit in AER corrected errorjhb2011-11-301-0/+1
| | | | status and mask.
* Announce flow control capability to PHY drivers and enable flowyongari2011-11-282-11/+43
| | | | | | | | | | control for all vr(4) controllers that support it. It's known that old vr(4) controllers(Rhine II) does not support TX pause but Rhine III supports both TX and RX pause. Make TX pause really work on Rhine III by letting controller know available RX buffers. While here, adjust XON/XOFF parameters to get better performance with flow control.
* Reuse flag variable to represent driver internal states rather thanyongari2011-11-282-19/+19
| | | | | | | using member variables in softc. While I'm here change media after setting IFF_DRV_RUNNING. This will remove unnecessary link state handling in vr_tick() if controller established a link immediately.
* sfxge: Add $FreeBSD$ tags to common code files.philip2011-11-2834-7/+96
| | | | Requested by: bz
* This commit marks the beginning of a new internal USBhselasky2011-11-281-0/+114
| | | | | | | | | | transfer statemachine. This work is about using a single state variable instead of multiple state bits as input for the USB statemachine to determine what to do in the various parts of the code. No APIs towards USB device drivers or USB host controller drivers will be changed. MFC after: 1 month
* Prevent a division by zero with some broken batteriesdumbbell2011-11-261-0/+8
| | | | This problem was seen on a laptop with a dead battery.
* Deorbit the broken amd(4) (see PR 124667), which was superseded by esp(4)marius2011-11-252-3124/+0
| | | | as of r227006.
* To save more power, switch to 10/100Mbps link when controller isyongari2011-11-231-4/+76
| | | | | | | | put into suspend/shutdown. Old PCI controllers performed that operation in firmware but for RTL8111C or newer controllers, it's responsibility of driver. It's not clear whether the firmware of RTL8111B still downgrades its speed to 10/100Mbps so leave it as it was.
* Make sure to stop TX MAC before freeing queued TX frames.yongari2011-11-231-5/+37
| | | | | | For RTL8111DP, check if the TX MAC is active by reading RL_GTXSTART register. For RTL8402/8168E-VL/8168F/8411, wait until TX queue is empty.
* Wrap BCM5785 in #ifdef notyet for now. According to yongari@ there aremarius2011-11-231-0/+2
| | | | | | issues probably needing workarounds in bge(4) when brgphy(4) handles this PHY. Letting ukphy(4) handle it instead results in a working configuration, although likely with performance penalties.
* - Just use cam_calc_geometry(9) on newer version of FreeBSD rather thanmarius2011-11-234-14/+34
| | | | | duplicating it. - In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END.
* Use DEVMETHOD_END.marius2011-11-2332-36/+33
|
* Probe the BCM5785.marius2011-11-231-0/+1
| | | | Obtained from: NetBSD
* Sync with NetBSD rev. 1.104marius2011-11-231-1/+14
| | | | Obtained from: NetBSD
* fix formatting warning using casts. The numbers involvedluigi2011-11-231-4/+4
| | | | | are small and these are debug statements, so there is no reason to obfuscate the format string with PRIsomeKINDofINTEGER
* Re-lock the ath lock after ath_reset() has been called.adrian2011-11-231-0/+1
| | | | | | | | | | The calibrate callout is done with the sc lock held. This only showed up when using an older NIC (AR5212) whose radio/phy requires the rfgain adjustment. Pointy-hat-to: adrian Sponsored by: Hobnob, Inc.
* Remove unused variable mii.kevlo2011-11-231-2/+0
| | | | | | This variable is initialized but not used. Reviewed by: yongari
* Flesh out the TX aggregation completion statistics.adrian2011-11-233-5/+16
| | | | | | | | | * Failall is now named just that. * Add TX ok and TX fail, for aggregate frame sub-frames. This will break athstats; a followup commit wil resolve this. Sponsored by: Hobnob, Inc.
* Disable accepting frames in re_stop() to put RX MAC into idle state.yongari2011-11-231-3/+15
| | | | | | | | | | | | | | | | | | Because there is no reliable way to know whether RX MAC is in stopped state, rejecting all frames would be the only way to minimize possible races. Otherwise it's possible to receive frames while stop command execution is in progress and controller can DMA the frame to freed RX buffer during that period. This was observed on recent PCIe controllers(i.e. RTL8111F). While this change may not be required on old controllers it wouldn't make negative effects on old controllers. One side effect of this change is disabling receive so driver reprograms RL_RXCFG to receive WOL frames when it is put into suspend or shutdown. This should address occasional 'memory modified free' errors seen on recent RealTek controllers.
* Perform media change after setting IFF_DRV_RUNNING flag. Without it,yongari2011-11-221-2/+2
| | | | | | driver would ignore the first link state update if controller already established a link such that it would have to take additional link state handling in re_tick().
* Writing access to RL_CFG5 register also requires EEPROM writeyongari2011-11-221-5/+6
| | | | | | | | | | | | | access. While I'm here, enable WOL through magic packet but disable waking up system via unicast, multicast and broadcast frames. Otherwise, multicast or unicast frame(e.g. ICMP echo request) can wake up system which is not probably wanted behavior on most environments. This was not known as problem because RL_CFG5 register access had not effect until this change. The capability to wake up system with unicast/multicast frames are still set in driver, default off, so users who need that feature can still activate it with ifconfig(8).
* Rename device_delete_all_children() into device_delete_children().hselasky2011-11-2222-22/+22
| | | | | Suggested by: jhb @ and marius @ MFC after: 1 week
* s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mentionmarius2011-11-2210-11/+11
| | | | of kobj(9) from device drivers.
* - There's no need to overwrite the default device method with the defaultmarius2011-11-22103-410/+157
| | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID.
* For IP1001 PHY, do not set multi-port device(MASTER). Ideally thisyongari2011-11-221-1/+2
| | | | | | | | | | bit should not affect link establishment process of auto-negotiation if manual configuration is not used, which is true in auto-negotiation. However it seems setting this bit interfere with IP1001 PHY's down-shifting feature such that establishing a 10/100Mbps link failed when 1000baseT link is not available during auto-negotiation process. Tested by: Andrey Smagin <samspeed <> mail dot ru >
* Announce flow control capability to underlying PHY driver.yongari2011-11-221-4/+11
| | | | | | Pause timer value is initialized to 0xFFFF. Controller allows just 4 different TX pause thresholds. The lowest possible threshold value looks too aggressive so use next available threshold value.
* Rework link establishment and link state detection logic.yongari2011-11-221-18/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove MIIBUS statchg callback and program VGE_DIAGCTL before initiating link establishment. Previously driver used to program VGE_DIAGCTL after getting a link in statchg callback. It seems the VGE_DIAGCTL register works like a kind of MII register such that it requires setting a 'to be' mode in advance rather than relying on resolved speed/duplex of established link. This means the statchg callback is not needed in driver. In addition, if there was no link at the time of media change, this was not called at all. - Introduce vge_ifmedia_upd_locked() to change current media to configured one. Actual media change is performed only after PHY reset and VGE_DIAGCTL setup. - In WOL configuration, make sure to clear forced mode such that controller can rely on auto-negotiation. - Unlike most other drivers that use miibus(4), vge(4) used controller's auto-polling feature for link state tracking via interrupt. This came from controller's inefficient mechanism to access MII registers. On link state change interrupt, vge(4) used to get current link state with series of MII register accesses. Because vge(4) already enabled auto polling, read PHY status register to resolved speed/duplex/flow control parameters. vge(4) still does not drive MII_TICK to reduce number of MII register accesses which in turn means the driver does not know the status of auto-negotiation. This was a one of long standing issue of vge(4). Probably driver may be able to implement a timer that keeps track of auto-negotiation state and restart auto-negotiation when driver couldn't establish a link within a specified period. However the controller does not provide a reliable way to detect auto-negotiation failure so I'm not sure whether it's worth to implement it in driver. Alternatively driver can completely disable MII auto-polling and let miibus(4) poll link state by driving MII_TICK. This may reduce unnecessary overhead of stopping/restarting MII auto-polling of controller. Unfortunately it was known that some variants of controller does not work correctly if MII auto-polling is disabled.
* Always start MII auto polling before accessing any MII registers.yongari2011-11-221-0/+2
|
* Append unit number to the WMI status device name to allow attachingjh2011-11-221-1/+1
| | | | | | | multiple acpi_wmi(4) instances. PR: kern/162491 Reviewed by: avg
OpenPOWER on IntegriCloud