modern dual-core systems as well.
- Parse the _CST packages for each cpu and track all the states individually,
on a per-cpu basis.
- Revert to generic FADT/P_BLK based Cx control if the _CST package
is not present on all cpus. In that case, the new driver will
still support per-cpu Cx state handling. The driver will determine the
highest Cx level that can be supported by all the cpus and configure the
available Cx state based on that.
- Fixed the case where multiple cpus in the system share the same
registers for Cx state handling. To do that, added a new flag
parameter to the acpi_PkgGas and acpi_bus_alloc_gas functions that
enable the caller to add the RF_SHAREABLE flag. This flag could also be
useful to other callers (acpi_throttle?) in the tree but this change is
not yet made.
- For Core Duo cpus, both cores seems to be taken out of C3 state when
any one of the cores need to transition out. This broke the short sleep
detection logic. It is disabled now if there is more than one cpu in
the system for now as it fixed it in my case. This quirk may need to
be re-enabled later differently.
- Added support to control cx_lowest on a per-cpu basis. There is still
a generic cx_lowest to enable changing cx_lowest for all cpus with a single
sysctl and for ease of use. Sample output for the new sysctl:
dev.cpu.0.cx_supported: C1/1 C2/1 C3/57
dev.cpu.0.cx_lowest: C3
dev.cpu.0.cx_usage: 0.00% 43.16% 56.83%
dev.cpu.1.cx_supported: C1/1 C2/1 C3/57
dev.cpu.1.cx_lowest: C3
dev.cpu.1.cx_usage: 0.00% 45.65% 54.34%
hw.acpi.cpu.cx_lowest: C3
This work was done by Stephane E. Potvin with some simple reworking by
myself. Thank you.
Submitted by: Stephane E. Potvin <sepotvin / videotron.ca>
MFC after: 2 weeks
revision 1.98 is NOT merged, because FreeBSD does not support this
syntax.
revision 1.99 is NOT merged, "const poisoning" part is not applicable
to FreeBSD. There is no variable shadowing, GCC can't find
this one (but there are others)
revision 1.100 is NOT merged, because it was null patch (no changes)
revision 1.101 is NOT merged, there is no BIT() macro in FreeBSD
revision 1.102 is merged
revision 1.103 is partially merged. There is no ai.ifaceh in FreeBSD
revision 1.104 is NOT merged
revision 1.105 is merged
revision 1.106 is not merged, because of rev. 1.107
revision 1.107 is a backuout of 1.106
Submitted by: Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
---snip---
New features:
1. Optional multichannel recording (32 channels on Live!, 64 channels
on Audigy).
All channels are 16bit/48000Hz/mono, format is fixed.
Half of them are copied from sound output, another half can be
used to record any data from DSP. What should be recorded is
hardcoded in DSP code. In this version it records dummy data, but
can be used to record all DSP inputs, for example..
Because there are no support of more-than-stereo sound streams
multichannell stream is presented as one 32(64)*48000 Hz 16bit mono
stream.
Channel map:
SB Live! (4.0/5.1)
offset (words) substream
0x00 Front L
0x01 Front R
0x02 Digital Front L
0x03 Digital Front R
0x04 Digital Center
0x05 Digital Sub
0x06 Headphones L
0x07 Headphones R
0x08 Rear L
0x09 Rear R
0x0A ADC (multi-rate recording) L
0x0B ADC (multi-rate recording) R
0x0C unused
0x0D unused
0x0E unused
0x0F unused
0x10 Analog Center (Live! 5.1) / dummy (Live! 4.0)
0x11 Analog Sub (Live! 5.1) / dummy (Live! 4.0)
0x12..-0x1F dummy
Audigy / Audigy 2 / Audigy 2 Value / Audigy 4
offset (words) substream
0x00 Digital Front L
0x01 Digital Front R
0x02 Digital Center
0x03 Digital Sub
0x04 Digital Side L (7.1 cards) / Headphones L (5.1 cards)
0x05 Digital Side R (7.1 cards) / Headphones R (5.1 cards)
0x06 Digital Rear L
0x07 Digital Rear R
0x08 Front L
0x09 Front R
0x0A Center
0x0B Sub
0x0C Side L
0x0D Side R
0x0E Rear L
0x0F Rear R
0x10 output to AC97 input L (muted)
0x11 output to AC97 input R (muted)
0x12 unused
0x13 unused
0x14 unused
0x15 unused
0x16 ADC (multi-rate recording) L
0x17 ADC (multi-rate recording) R
0x18 unused
0x19 unused
0x1A unused
0x1B unused
0x1C unused
0x1D unused
0x1E unused
0x1F unused
0x20..0x3F dummy
Fixes:
1. Do not assign negative values to variables used to index emu_cards
array. This array was never accessed when index is negative, but
Alexander (netchild@) told me that Coverity does not like it.
After this change emu_cards[0] should never be used to identify
valid sound card.
2. Fix off-by-one errors in interrupt manager. Add more checks there.
3. Fixes to sound buffering code now allows driver to use large playback
buffers.
4. Fix memory allocation bug when multichannel recording is not
enabled.
5. Fix interrupt timeout when recording with low bitrate (8kHz).
Hardware:
1. Add one more known Audigy ZS card to list. Add two cards with
PCI IDs betwen old known cards and new one.
Other changes:
1. Do not use ALL CAPS in messages.
Incomplete code:
1. Automute S/PDIF when S/PDIF signal is lost.
Tested on i386 only, gcc 3.4.6 & gcc41/gcc42 (syntax only).
---snip---
This commits enables a little bit of debugging output when the driver is
loaded as a module. I did a cross-build test for amd64.
The code has some style issues, this will be addressed later.
The multichannel recording part is some work in progress to allow playing
around with it until the generic sound code is better able to handle
multichannel streams.
This is supposed to fix
CID: 171187
Found by: Coverity Prevent
Submitted by: Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
server.
Don't complain about a hard loop id of 0xffff- we get this in
point-to-point topologies with the 2300 and 2K Login firmware.
Up the timeout on register FC4 types commands.
- Rename confusing AGP_INTEL_I845_MCHCFG to AGP_INTEL_I845_AGPM.
- Move E7205 and E7505 from i8x5 to i8x0 family. It probably worked
because the actual offset is the same.
In fact, all three families have the bit at the exact same place. Only
differences are name and width of the registers, i.e., NBXCFG (0x50, dword),
RDCR (0x51, byte), AGPM (0x51, byte), MCHCFG (0x50, word) depending on
the family of the chipsets.
a spin mutex since it doesn't have an INTR_FAST interrupt handler.
Beyond that the driver is still under Giant anyway.
- Remove unneeded locking during attach across operations that can't be
called with locks held (such as bus_dma_tag_create()).
MFC after: 1 week
Not objected to by: scottl
start working with third party usb modules, where sometimes it
is not easy to set the inclusion order so that there are no multiple
inclusions, yet you want to compile with high WARNS levels).
I am not sure if there is a standard for having a leading and/or trailing _
in the macro name, the usb code seems to use both.
There are still several unprotected headers here so it might be useful
to do the same thing on other files as well as the need arises.
MFC After: 3 days
semantics.
- Stop testing bpf pointers for NULL. In some cases use
bpf_peers_present() and then call the function directly inside the
conditional block instead of the macro.
- For places where the entire conditional block is the macro, remove the
test and make the macro unconditional.
- Use BPF_MTAP() in if_pfsync on FreeBSD instead of an expanded version of
the old semantics.
Reviewed by: csjp (older version)
o change handling of regdomain-related mib knobs so they can be set
post-attach: regdomain, countrycode, outdoor, and xchanmode; the
hal will not permit changing the regdomain but we expose it for now
o on regdomain/countrycode change recalculate the channel list and
push it to the net80211 layer (NB: looks to need more tweaking)
o setup rate tables for half/quarter rate channels
o honor half/quarter rate channel configs when changing channels
o honor half/quarter rate channel configs when setting the slot time
o use hack/nonstandard channel numbering scheme for the public safety
band to avoid overlapping 2.4G channels on dual-band cards
o remove setup of ic_sup_rates; the net80211 layer can do this for us
and it simplifies handling of half/quarter rate channels
Tested only in Public Safety Band with cards that have RF5112.
bge_intr(). Some of them are used in bge_poll(). Simplify by only
initializing these for polling mode and not toggling them when switching
modes. This also fixes missing synchronization with the coalescing
engine in the toggling.
The problem was that I was acquiring the driver sx lock and then waiting
for a taskqueue to drain, however the taskqueue itself would try to
acquire the lock as well leading to a deadlock.
To fix the problem roll my own exclusive lock that allows for lock
cancellation. This is a normal exclusive lock, however if someone
marks it as "dead" then all waiters who request an error return will
get back an error instead of continuing to wait for the lock.
In this particular case, the shutdown and detach functions kill the
lock while the async task thread tries to acquire the lock but will
abort if the lock returns an error.
The other option was to drop the driver lock mid-detach and mid-shutdown,
mid-detach was a ok, however mid-shutdown was not.
While I'm here, fix a bug in what appears to be the mii link status
word in the softc going out to lunch. Explicitly set the status
word to 1 after initializing the mii. This would result in an interface
that would never respond to "if_start" requests as the mii interface
would always look down.
return an error since it returns a count of battery devices in the system.
Set it to 0 explicitly, since it is the only switch branch that doesn't set
it.
# I guess no one uses it.
would be able to work with aac(4).
This approach is used by some other drivers as well. However, we
need a more generic way to do this in order to avoid having to
special case headers in individual drivers for each platform.
Obtained from: Adaptec (version b11518)
Approved by: scottl
been handled instead of when at least one descriptor was just handled.
For bge, it is normal to get a txeof when only a small fraction of the
queued tx descriptors have been handled, so the bug broke the watchdog
in a usual case.
- moved the synchronizing bus read to after the bus write for the first
interrupt ack so that it actually synchronizes everything necessary.
We were acking not only the status update that triggered the interrupt
together with any status updates that occurred before we got around
to the bus write for the ack, but also any status updates that occur
after we do the bus write but before the write reaches the device.
The corresponding race for the second interrupt ack resulted in
sometimes returning from the interrupt handler with acked but
unserviced interrupt events. Such events then remain unserviced
until further events cause another interrupt or the watchdog times
out.
The race was often lost on my 5705, apparently since my 5705 has broken
event coalescing which causes a status update for almost every packet,
so another status update is quite likely to occur while the interrupt
handler is running. Watchdog timeouts weren't very noticeable,
apparently because bge_txeof() has one of the usual bugs resetting the
watchdog.
- don't disable device interrupts while bge_intr() is running. Doing this
just had the side effects of:
- entering a device mode in which different coalescing parameters apply.
Different coalescing parameters can be used to either inhibit or
enhance the chance of getting another status update while in the
interrupt handler. This feature is useless with the current
organization of the interrupt handler but might be useful with a
taskqueue handler.
- giving a race for ack+reenable/return. This cannot be handled
by simply rearranging the order of bus accesses like the race for
ack+keepenable/entry. It is necessary to sync the ack and then
check for new events.
- taking longer, especially with the extra code to avoid the race on
ack+reenable/return.
Reviewed by: ru, gleb, scottl
re_watchdog() in order to avoid races accessing if_timer.
- Use bus_get_dma_tag() so re(4) works on platforms requiring it.
- Remove invalid BUS_DMA_ALLOCNOW when creating the parent DMA tag
and the tags that are used for static memory allocations.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
- Remove an unused variable in re_intr().
watchdog timer in dc_txeof() in case there are still unhandled
descriptors as dc_poll() invokes dc_poll() unconditionally.
Otherwise this would result in the watchdog timer constantly being
being reloaded and thus circumvent that the watchdog ever fires in
the DEVICE_POLLING case.
Pointed out by: bde
- Do not repeatedly read vendor/device IDs while probing.
- Remove redundant bzero(3) for softc. device_get_softc(9) does it for free[1].
Reviewed by: glebius
Suggested by: glebius[1]
- If we want mii_phy_add_media() to add 1000baseT media, we need to
supply sc->mii_extcapabilities.
- Fix formatting when announcing autonegotiation support.
behave as expected.
Also:
- Return an error if WD_PASSIVE is passed in to the ioctl as only
WD_ACTIVE is implemented at the moment. See sys/watchdog.h for an
explanation of the difference between WD_ACTIVE and WD_PASSIVE.
- Remove the I_HAVE_TOTALLY_LOST_MY_SENSE_OF_HUMOR define. If you've
lost your sense of humor, than don't add a define.
Specific changes:
i80321_wdog.c
Don't roll your own passive watchdog tickle as this would defeat the
purpose of an active (userland) watchdog tickle.
ichwd.c / ipmi.c:
WD_ACTIVE means active patting of the watchdog by a userland process,
not whether the watchdog is active. See sys/watchdog.h.
kern_clock.c:
(software watchdog) Remove a check for WD_ACTIVE as this does not make
sense here. This reverts r1.181.
work:
- A new PCI quirk (PCI_QUIRK_DISABLE_MSI) is added to the quirk table.
- A new pci_msi_device_blacklisted() determines if a passed in device
matches an MSI quirk in the quirk table. This can be overridden (all
quirks ignored) by setting the hw.pci.honor_msi_blacklist to 0.
- A global blacklist check is performed in the MI PCI bus code by checking
to see if the device at 0:0:0 is blacklisted.
Tested by: jdp
1) s/mi/mfi/ in FreeBSD ioctl path
2) add in "\n" on various failure messages
3) cap the length of time to abort an AEN command
4) fix passing sense data back to user to make Dell's Linux firmware
upgrade tool happy.
5) bump the MFI_POLL_TIMEOUT_SECS from 10s to 50s since the
firmware flash command can take ~40s to return.
This is some clean-up and enables RAID firmware to updated via Dell's
tool. Note Dell's tool requires the updates to the Linux emulator
that has been done in -current with TLS etc.
I need to discuss with scottl how to better submit mfi commands to
the firmware via the ioctl path so we don't do it in polled mode.
by vnode. Allow for md thread and the thread that owns lock on vnode
backing the md device to do the write even when runningbufspace is
exhausted.
Tested by: Peter Holm
Reviewed by: tegge
MFC after: 2 weeks
have been added erroneously, and it causes problems on some chips. A larger
change is needed to do this write at a more appropriate place, but that
change requires reworking the ASF logic. That will be worked on in the
future.
Submitted by: Bruce Evans
o no more ds_vdata in tx/rx descriptors
o split h/w tx/rx descriptor from s/w status
o as part of the descriptor split change the rate control module api
so the ath_buf is passed in to the module so it can fetch both
descriptor and status information as needed
o add some const poisoning
Also for sample rate control algorithm:
o split debug msgs (node, rate, any)
o uniformly bounds check rate indices (and in some cases correct checks)
o move array index ops to after bounds checking
o use final tsi from the status block instead of the h/w descriptor
o replace h/w descriptor struct's with proper mask+shift defs (this
doesn't belong here; everything is known by the driver and should
just be sent down so there's no h/w-specific knowledge)
MFC after: 1 month
controller. Due to lack of documentation, this driver is based on the
code from sk(4) and Marvell's myk(4) driver for FreeBSD. I've also
adopted the OpenBSD interface name, msk(4) in order to reduce naming
differences between BSDs.
The msk(4) driver supports the following Gigabit Ethernet adapters.
o SysKonnect SK-9Sxx Gigabit Ethernet
o SysKonnect SK-9Exx Gigabit Ethernet
o Marvell Yukon 88E8021CU Gigabit Ethernet
o Marvell Yukon 88E8021 SX/LX Gigabit Ethernet
o Marvell Yukon 88E8022CU Gigabit Ethernet
o Marvell Yukon 88E8022 SX/LX Gigabit Ethernet
o Marvell Yukon 88E8061CU Gigabit Ethernet
o Marvell Yukon 88E8061 SX/LX Gigabit Ethernet
o Marvell Yukon 88E8062CU Gigabit Ethernet
o Marvell Yukon 88E8062 SX/LX Gigabit Ethernet
o Marvell Yukon 88E8035 Gigabit Ethernet
o Marvell Yukon 88E8036 Gigabit Ethernet
o Marvell Yukon 88E8038 Gigabit Ethernet
o Marvell Yukon 88E8050 Gigabit Ethernet
o Marvell Yukon 88E8052 Gigabit Ethernet
o Marvell Yukon 88E8053 Gigabit Ethernet
o Marvell Yukon 88E8055 Gigabit Ethernet
o Marvell Yukon 88E8056 Gigabit Ethernet
o D-Link 550SX Gigabit Ethernet
o D-Link 560T Gigabit Ethernet
Unlike OpenBSD/NetBSD msk(4), the msk(4) driver supports all hardware
features including TCP/UDP checksum offload for transmit, MSI, TCP
segmentation offload(TSO), hardware VLAN tag stripping/insertion,
and jumbo frames(up to 9022 bytes). The only unsupported hardware
feature except RLMT is Rx checksum offload which I don't know how to
make it work reliably.
Known Issues:
It seems msk(4) does not work on the second port of dual port NIC.
(The first port works without problems.)
Thanks to Marvell for releasing the BSD licensed myk(4) driver and
thanks to all users helped fixing bugs.
Tested by: bz, philip, bms,
YAMAMOTO Shigeru < shigeru AT iij DOT ad DOT jp >,
Dmitry Pryanishnikov < dmitry AT atlantis DOT dp DOT ua >,
Jia-Shiun Li < jiashiun AT gmail DOT com >,
David Duchscher < daved AT tamu DOT edu >,
Arno J. Klaassen < arno AT heho DOT snv DOT jussieu DOT fr>,
Nicolae Namolovan < adrenalinup AT gmail DOT com>,
Andre Guibert de Bruet < andy AT siliconlandmark DOT com >
current ML
Tested on: i386, amd64
subtypes of HT capabilities.
- Add constants for the MSI mapping window HT PCI capability.
- On i386 and amd64, enable the MSI mapping window on any HT bridges we
encounter and report any non-standard mapping window addresses.
pcib_alloc_msix() methods instead of using the method from the generic
PCI-PCI bridge driver as the PCI-PCI methods will be gaining some PCI-PCI
specific logic soon.
- Use the appropriate register writing method when reseting the chip
- Program the descriptor DMA engine correctly.
- More reliably detect certain chips and their features.
Also add some low-level debugging tools to help future work on this driver.
Submitted by: David Christenson (proof of concept changes)
Sponsored by: www.UIA.net
- Correct RX packet drop counter for BCM5705+. This register is read/clear
and it wraps very quickly under heavy packet drops because only the lower
ten bits are valid according to the documentation. However, it seems few
more bits are actually valid and the rest bits are always zeros[1].
Therefore, we don't mask them off here. To get accurate packet drop count,
we need to check the register from bge_rxeof(). It is commented out for now,
not to penalize normal operation. Actual performance impact should be
measured later.
- Correct integer casting from u_long to uint32_t. Casting is not really
needed for all supported platforms but we better do this correctly[2].
Tested by: bde[1]
Suggested by: bde[2]
o Remove unused static global variable e1000phy_debug.
o Take advantage of mii_phy_dev_probe().
o Use MII_ANEGTICKS/MII_ANEGTICKS_GIGE instead of magic number 5.
o Add IFM_NONE as e1000phy(4) supports it without issues.
o Nuke magic PHY programming sequence in PHY reset and follow correct
reset sequence. [1]
o Make manual media selection work for all supported media types.
o Don't set MIIF_NOISOLATE so e1000phy(4) can be used in
configurations with multiple PHYs.
o In 1000baseT, when setting the link manually, one side must be the
master and the other the slave. If LINK0 is set, program the PHY
to be a master, otherwise it's a slave.
o When we lost a link, reset mii_ticks immediately so it correctly
check number of seconds elapsed in autonegotiation phase.
o Announce link loss right after it happens.
o After kicking autonegotiation, report PHY status instead of
returning immediatly.
o When link state check is in progress, check auto negotiation
completion bit only when auto negotiation is enbaled.
o When PHY is resolved to a master, show it with IFM_FLAG2.
Special thanks to marius who fixed several nits in original patch.
In half-duplex mode, nfe(4) fails to send packets. I think it's a bug
in nfe(4) as the same PHY works without problems on msk(4).
Obtained from: em(4) [1]
Reviewed by: marius
Tested by: bz
Either they're there early and the ispfw sets have
registered themselves, or they're not.
The module dependency stuff isn't quite what we want
anyway. If the user doesn't want the load placed on
system memory by loading the firmware, they don't
specify it to be loaded (either by being linked in
or via being a module to be loaded and then hooked
in with firmware(9)). It doesn't then make sense to
then override what they want by pulling it in anyway.
This might be able to work if we were able to pull in
just exactly what we needed for the card we have- but
that's an optimization left for the future.
hme_watchdog() in order to avoid races accessing if_timer.
- Use bus_get_dma_tag() so hme(4) works on platforms requiring it.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
gem_watchdog() in order to avoid races accessing if_timer.
While at it relax the watchdog a bit by reloading it in gem_tint()
if there are still packets enqueued.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
- Fix inconsistencies in prototypes.
depending on the NIC and isn't used at all with HomePNA links)
instead of if_slowtimo() for driving dc_watchdog() in order to
avoid races accessing if_timer.
- Use bus_get_dma_tag() so dc(4) works on platforms requiring it.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
- Remove an alpha remnant in dc_softc.
of the nvenet lib upgrade (the constant went from 63 (2^n - 1) to
32 (2^n)). For reasons that are not obvious to me this fixes the driver
on at least some NICs.
MFC after: 3 days
with- not hope for the best. Change some things which were gated
off of 24XX to be gated off of 2K login support. Convert some
isp_prt calls to xpt_print calls.
Add a note that suggests a cleanup.
Note: This patch was derived based on looking at the pvrxxx/pvr250
ports' Makefiles only, and may be incomplete. It is not derived from
anything I saw from Hauppage.
- In hme_eint() print MIF register contents on MIF interrupts.
- In hme_mifinit() don't bother to preserve the previous MIF config.
This was mainly done in order to preserve the PHY select bit (external
or internal PHY) but which only needs to be set as appropriate when
reading from or writing to the desired PHY in hme_mii_{read,write}reg().
Similarly don't bother to set the PHY select bit in hme_mii_statchg().
- In hme_mii_{read,write}reg() ignore requests to PHYs other than the
external and internal PHY one.
- Move enabling/disabling the MII drivers of the external transceiver
from hme_init_locked() and based on the sheer presence of an external
to hme_mifinit() and based on the currently selected media, defaulting
to the internal transceiver when the media hasn't been set, yet.
Invoke hme_mifinit() from the newly added hme_mediachange_locked() so
the setting of the MII drivers is updated when changing media.
These changes keep the MII bus from wedging (which manifests in the HME
and the PHYs no longer being able to communicate with each other) when
the PHY device drivers isolate the unused PHY in two-PHY configurations
as present in f.e. Netra t1 100 while changing media, either from
hme_init_locked() (see also below) or via ifconfig(8). They also allow
for using both transceivers/PHYs.
- In the newly added hme_mediachange_locked() also reset the PHYs in two-
PHY configurations before invoking mii_mediachg(). This is required
for successfully unisolating the previously unused PHY when switching
between PHYs.
- Now that changing media should no longer cause problems back out rev.
1.27 and re-enable setting the current media in hme_init_locked() (see
the commit message of rev. 1.23 for more info).
These changes are roughly a merge of NetBSD gem.c rev. 1.32 - 1.35 (1.30
was already fixed differently in our 1.36; 1.31 and 1.32 were wrong) with
some parts reworked and things that don't make sense like setting the MII
drivers and restoring the previous MIF and XIF settings in hme_mii_{read,
write}reg() omitted.
MFC after: 2 weeks
read wasn't flagging the SYNC mode was enabled. The temp
values for offset and sync period were uint8_t, but were
being assigned and shifted from a uint32_t value.
This didn't show up in testing because a random number
of 1030 cards set a bit that says "honor BIOS negotiation",
which means this whole code path was skipped.
This should clear up at least some of the negotation
issues that have been seen.
Fix things to use the LSI-Logic Fusion Library mask and shift names for
offset and sync, no matter how awkward they are, in preference to just
plain numbers.
- Don't set MIIF_NOISOLATE so amphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
AM79c873 and workalikes per se nor in combination with the NICs they're
used with and amphy(4) was already adding IFM_NONE anyway.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix a whitespace nit.
Obtained from: NetBSD dmphy(4) (except for the last item)
MFC after: 2 weeks
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- Fix a whitespace nit.
- Probe another Altima PHY, which is a AC101 workalike and integrated
in at least ADMtek ADM8511 but apparently is not mentioned in any
publically available data sheet so the actual identifier is unknown.
- Don't set MIIF_NOISOLATE so acphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
AC101 and workalikes per se nor in combination with the NICs they're
used with.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
Obtained from: NetBSD (except for the first and second item)
MFC after: 2 weeks
in at least ADMtek ADM8511 but apparently is not mentioned in any
publically available data sheet so the actual identifier is unknown.
- Add Davicom DM9102 PHY.
- Add DM9101 to the description of AMD 79C873 as at least some Davicom
DM9101F identify identical to AMD 79C873.
Obtained from: NetBSD
MFC after: 2 weeks
with multiple PHYs. There doesn't seem to be a problem with isolating
78Q2120 per se nor in combination with the NICs they're used with and
tdkphy(4) was already adding IFM_NONE anyway.
- Set MIIF_NOLOOP as loopback doesn't work with this PHY. The MIIF_NOLOOP
flag currently triggers nothing but hopefully will be respected by
mii_phy_setmedia() later on.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
Thanks to Hans-Joerg Sirtl for lending me test hardware.
Obtained from: NetBSD tqphy(4)
MFC after: 2 weeks
with multiple PHYs and un-comment case IFM_NONE in case MII_MEDIACHG
rgephy_service(). There doesn't seem to be a problem with isolating
RTL8169S and their internal PHY.
- Take advantage of mii_phy_add_media(). [1]
Obtained from: NetBSD [1]
Tested by: yongari
MFC after: 2 weeks
- Fix some whitespace nits.
- Fix some spelling in comments.
- Use MII_ANEGTICKS instead of 5.
- Don't define variables in nested scope.
- Remove superfluous returns at the end of void functions.
- Remove unused static global rgephy_mii_model.
- Remove dupe $Id$ in tdkphy(4).
- Sort brgphys table.
MFC after: 2 weeks
- Playback and headphone/speaker automute works.
- Recording untested due to me being deaf doing back-and-forth
remote debugging.
Free Macbook donation is highly appreciated :)
Tested by: Dennis Pielken <mips128@gmx.net>
mii_phy_match() API and takes care of the PHY device probe based on
the struct mii_phydesc array and the match return value provided.
Convert PHY drivers to take advantage of mii_phy_dev_probe(),
converting drivers to provide a mii_phydesc table in the first
place where necessary.
Reviewed by: yongari
MFC after: 2 weeks
discarded RX packets to input error for BCM5705 or newer chipset as the others.
Unfortunately we cannot do the same for output errors because ifOutDiscards
equivalent register does not exist. While I am here, replace misleading and
wrong BGE_RX_STATS/BGE_TX_STATS with BGE_MAC_STATS. They were reversed but
worked accidently.
machines and both TX and RX were broken on big-endian machines.
The chip design is crazy -- on RX, it puts the 16-bit VLAN tag
in network byte order (big-endian) in the 32-bit little-endian
register!
Thanks to John Baldwin for helping me document this change! ;-)
Tested by: sat (amd64), test program (sparc64)
PR: kern/105054
MFC after: 3 days
aue_tick calls several synchronous usb functions from a timeout(9),
this is very broken since a timeout(9) is run as an interrupt
and the usb functions tsleep.
A stopgap fix is to schedule a taskqueue task from the timeout
and defer work to that taskqueue task.
Preliminary support for Atmel AT45D series of DataFlash on the
SPI bus (ok, not really a hardware bus, but a logical
connection). This works only for the 8MB version of the part
due to hard coding. Both read and write are supported.
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- In rlphy_status() just use if_dname instead of determining the name
of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits and remove commented out code that just can't
be used with RealTek PHYs.
MFC after: 2 weeks
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- Don't set MIIF_NOISOLATE so qsphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
QS6612 per se nor in combination with the NICs they're used with.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
Obtained from: NetBSD (except for the first item)
MFC after: 2 weeks
loopback to work PCnet chips additionally need to be placed into
external loopback mode which pcn(4) doesn't do so far.
- In nsphy_service() just use if_dname instead of determining the name
of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Don't set MIIF_NOISOLATE, except for when used in combination with a
NIC that wedges when isolating the PHYs, so nsphy(4) can be used in
configurations with multiple PHYs.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia() (requires the MIIF_FORCEANEG
added in sys/dev/mii/mii_physubr.c 1.26, sys/dev/mii/miivar.h 1.19).
- Implement a separate nsphy_reset(). There are two reasons for this:
1) This PHY can take an inordinate amount of time to reset if media
is attached; under fairly normal circumstances up to nearly one
second. This is because it appears to go through an implicit auto-
negotiation cycle as part of the reset.
2) During reset and auto-negotiation, the BMCR will clear the reset
bit before the process is complete. It will return 0 until the
process is complete and it's safe to access the PHY again.
This is the first of two changes required to make the combination of
Am79c971 and DP83840A found on certain HP cards and on-board in IBM
machines work.
- Fix some whitespace nits.
Based on: NetBSD (except for the first and second item)
MFC after: 2 weeks
with multiple PHYs. There doesn't seem to be a problem with isolating
LXT970 per se nor in combination with the NICs they're used with and
lxtphy(4) was already adding IFM_NONE anyway.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits.
Obtained from: NetBSD
MFC after: 2 weeks
the BMSR contains any media at all to mii_phy_add_media(). The majority
of the drivers currently using mii_phy_add_media() were missing such a
check anyway though.
MFC after: 2 weeks
take place if IFM_AUTO is selected. This allows drivers like nsphy(4),
which need to force writing the ANAR according to the BMSR, to take
advantage of mii_phy_setmedia(). [1]
- In mii_phy_reset() once the current media is set don't isolate the PHY
corresponding to the instance of the currently selected media rather
than unconditionally not isolating the PHY corresponding to instance 0.
This saves a isolation-unisolation-cycle of the PHY corresponding to
the currently selected media for the case were it isn't instance 0.
- Fix some whitespace nits. [1]
Obtained from: NetBSD [1]
MFC after: 2 weeks
an URQ_REQUEST when DMA segments are passed to usbd_start_transfer();
when the request doesn't include the optional data buffer the size of
the transfer (xfer->length) is 0, in which case usbd_transfer() won't
create a DMA map but call usbd_start_transfer() with no DMA segments.
With the previous change this could result in the bus_dmamap_sync()
implementation dereferencing the NULL-pointer passed as the DMA map
argument.
While at it fix what appears to be a typo in usbd_start_transfer();
in order to determine wheter usbd_start_transfer() was called with
DMA segments check whether the number of segments is > 0 rather than
the pointer to them being > 0.
OK'ed by: imp
in every sense.
General
-------
- Multichannel safe, endian safe, format safe
* Large part of critical pcm filters such as vchan.c, feeder_rate.c,
feeder_volume.c, feeder_fmt.c and feeder.c has been rewritten so that
using them does not cause the pcm data to be converted to 16bit little
endian.
* Macrosses for accessing pcm data safely are defined within sound.h in
the form of PCM_READ_* / PCM_WRITE_*
* Currently, most of them are probably limited for mono/stereo handling,
but the future addition of true multichannel will be much easier.
- Low latency operation
* Well, this require lot more works to do not just within sound driver,
but we're heading towards right direction. Buffer/block sizing within
channel.c is rewritten to calculate precise allocation for various
combination of sample/data/rate size. As a result, applying correct
SNDCTL_DSP_POLICY value will achive expected latency behaviour simmilar
to what commercial 4front driver do.
* Signal handling fix. ctrl+c of "cat /dev/zero > /dev/dsp" does not
result long delay.
* Eliminate sound truncation if the sound data is too small.
DIY:
1) Download / extract
http://people.freebsd.org/~ariff/lowlatency/shortfiles.tar.gz
2) Do a comparison between "cat state*.au > /dev/dsp" and
"for x in state*.au ; do cat $x > /dev/dsp ; done"
- there should be no "perceivable" differences.
Double close for PR kern/31445.
CAVEAT: Low latency come with (unbearable) price especially for poorly
written applications. Applications that trying to act smarter
by requesting (wrong) blocksize/blockcount will suffer the most.
Fixup samples/patches can be found at:
http://people.freebsd.org/~ariff/ports/
- Switch minimum/maximum sampling rate limit to "1" and "2016000" (48k * 42)
due to closer compatibility with 4front driver.
Discussed with: marcus@ (long time ago?)
- All driver specific sysctls in the form of "hw.snd.pcm%d.*" have been
moved to their own dev sysctl nodes, notably:
hw.snd.pcm%d.vchans -> dev.pcm.%d.vchans
Bump __FreeBSD_version.
Driver specific
---------------
- Ditto for sysctls.
- snd_atiixp, snd_es137x, snd_via8233, snd_hda
* Numerous cleanups and fixes.
* _EXPERIMENTAL_ polling mode support using simple callout_* mechanisme.
This was intended for pure debugging and latency measurement, but proven
good enough in few unexpected and rare cases (such as problematic shared
IRQ with GIANT devices - USB). Polling can be enabled/disabled through
dev.pcm.0.polling. Disabled by default.
- snd_ich
* Fix possible overflow during speed calibration. Delay final
initialization (pcm_setstatus) after calibration finished.
PR: kern/100169
Tested by: Kevin Overman <oberman@es.net>
* Inverted EAPD for few Nec VersaPro.
PR: kern/104715
Submitted by: KAWATA Masahiko <kawata@mta.biglobe.ne.jp>
Thanks to various people, notably Joel Dahl, Yuriy Tsibizov, Kevin Oberman,
those at #freebsd-azalia @ freenode and others for testing.
Joel Dahl will do the manpage update.
- incorporate csjp's fix for a mishandled endian conversion
- convert PAGE_SIZE to 4096 for PCIe adapter workaround (my page size is not 4k)
- implement em_read_pcie_cap_reg where we set the max read size on pcie to 4k (taken from mxge)
Reviewed by: scottl and jfvogel
I have been debugging the usb problems some more. Your were
right in your assumption (thanks for the pointer) about lack
of calls to bus_dmamap_sync(). In usbdi.c bus_dmamap_sync()
does get used for transfers that move data from PC to USB and
it is used for transfers that move data from USB to PC. But
someone forgot that control transfers consist of possibly two
data chunks : the request itself and optionally a buffer of
data that should be transfered to or from the USB device. On
requests to the control endpoint without additional data
bus_dmamap_sync() didn't get called. For some reason my first
tests with umass worked (due to enough cache poisening I
guess). The attached patch adds a call to bus_dmamap_sync()
to usbdi.c and now all devices I have tried work out of the
box. I have successfully transfered large files using the
if_axe driver and I have mounted several different umass
devices.
submitted by: Daan Vreeken
sponsored by: Vitsch Electronics
reviewed by: cognet@
- Fix bug preventing adoption of running firmware
- Set PCIe max read request size to 4KB
- Read PCIe link width from config space
- Assume aligned completions from the southbridge ports
of intel E5000 chips
- Use aligned firmware when link width is x4 or less
- Add hw.mxge.force_firmware tunable to allow user to force
selection of aligned (or unaligned) firmware