summaryrefslogtreecommitdiff
path: root/sys/dev/ic
AgeCommit message (Collapse)Author
2021-07-14fix "logically dead code" flagged by coverityDaniel Dickman
It looks like twe was refactored in 2011 and one error check was missed. While the device may no longer be widely used, this helps reduce the coverity alert count. CID 1453371 ok krw@
2021-07-13Ensure that we don't overrun the TX FIFO for longer transfers. CheckPatrick Wildt
the limit after every character, and wait for the FIFO to empty before sending out more bytes. With this I can now use ipmitool(1) to change IPMI passwords on the Ampere eMAG. ok kettenis@
2021-07-08fix the hibernate io path.David Gwynne
a botched merge meant i was posting the previously used slot to the chip to process before posting the current slot. ok deraadt@
2021-07-07update drm to linux 5.10.47Jonathan Gray
hardware support changes include inteldrm: better support for tiger lake amdgpu: support for navi12, navi21 "sienna_cichlid", arcturus amdgpu: support for cezanne "green sardine" ryzen 5000 apu Thanks to the OpenBSD Foundation for sponsoring this work, patrick@ for helping adapt rockchip drm, kettenis@ and mpi@ for uvm discussions and various testers.
2021-07-01Prevent athn(4) from calling ieee80211_find_rxnode() on bad frames.Stefan Sperling
This fixes an issue introduced with our workaround for bogus michael mic failures seen when hardware receives control frames. We do need to ignore the michael mic failure in this case but we should not call ieee80211_find_rxnode() on such frames unconditionally. Do this only if the transmitter's address has already been cached. When ieee80211_find_rxnode() is called with an unknown source MAC address it will create a new entry in the node cache. Frames flagged as incorrectly received by hardware should not be passed to ieee80211_find_rxnode() without further verification to avoid creating bogus cache entries based on corrupt frame headers. Prompted by an issue seen by kettenis@ on arm64 where the node cache contains bogus entries. This change doesn't fix the issue but it is a step in the right direction regardless since it fixes one possible cause for the issue. ok kettenis@ tested by myself and Mikolaj Kucharski
2021-06-02Correctly calculate number of PRPL entries we have to sync by addingPatrick Wildt
brackets to manage operator precedence. Otherwise we'd attempt to sync more than needed, which doesn't cause issues, but it's still wrong. ok dlg@ jmatthew@
2021-05-31make nvme_read8 and write8 less clever.David Gwynne
hopefully big endian still works.
2021-05-31try to get rid of a weird comma on the alpns attach line.David Gwynne
"makes sense" jmatthew@
2021-05-30Include <sys/mutex.h> to avoid a hidden header dependency.Visa Hankala
OK jsg@ deraadt@
2021-05-29Only allocate the "hibernate" queue when HIBERNATE support is being built.Mark Kettenis
This makes the NVMe storage on the Apple M1 machines actually work! ok patrick@, dlg@
2021-05-28aplns needs some dmamem per queue for it's iommu.David Gwynne
2021-05-28provide nvme_ops for vanilla pci nvme, and use them in the right places.David Gwynne
this paves the way for supporting the apple nvme storage controllers. hopefully most of the remaining work on that is in the bus glue for those controllers and this code won't need more tweaks. hibernate still works, but it's relying on luck at the moment. hibernate on arm64 and the apple controllers in particular will almost certainly require more work here. ok jmatthew@
2021-05-28provide an nvme_ops struct to start trying to support apple m1 nvme.David Gwynne
the Apple NVME Storage (ans) controller is almost but not quite a vanilla nvme controller. one difference is that it doesnt attach to a pci bus, so it will need custom bus glue to attach on those machines. the other differences are around command submission. vanilla nvme command submission is done via rings where the host fills in one or more entries on the ring and then posts where the ring is up to in a doorbell. ans nvme command submission is done via an array of command slots where the host picks a slot and then posts every slot number it fills in to a doorbell instead. this is kind of clever because once a command slot is allocated, you don't need any coordination between multiple cpus using that array of slots to fill in and post the entry they were allocated. on the other hand, it's different, so the code needs to be specialised. ans also seems to have some weird iommu thing that needs to be maintained as commands are posted and completed. the nvme_ops struct will allow vanilla and ans controllers to provide their own backens for these different semantics. ok jmatthew@
2021-05-28move the nvme_dmamem prototypes so bus glue can use them.David Gwynne
ok jmatthew@
2021-05-28shuffle the deck chairs. no functional changeDavid Gwynne
2021-05-28move nvme_barrier to nvmevar.h, just to keep it with the other reg ops.David Gwynne
2021-05-28let nvme_read8 and nvme_write8 get used by bus glue too.David Gwynne
ok jmatthew@
2021-05-28move the nvme_read4 and nvme_write4 macros to the header.David Gwynne
this allows nvme bus glue to use the macros too. ok jmatthew@
2021-05-27vga(4): fix vga_doswitch() prototypecheloha
Timeout callback functions need to be void (*)(void *). No need to cast the function pointer if fixing the type is trivial. ok kettenis@
2021-05-17Fix mbuf leaks after reception error in re_rxeof().Visa Hankala
Also, increment the error counter when an unexpected fragment is seen. OK claudio@
2021-05-16panic does not require a \n at the end. When one is provided, it looks wrong.Theo de Raadt
2021-05-07RealTek -> RealtekJonathan Gray
ok jmc@ kevlo@
2021-05-07add support for RTL8168FP/RTL8111FP/RTL8117 to re(4)Jonathan Gray
from Stephen Taylor who tested on a ThinkCenter M75n Nano IoT with RTL8111FP-CG
2021-05-06Fix bogus return statement.Mark Kettenis
From miod@
2021-05-03work around an athn(4) device problem with bogus Michael MIC failuresStefan Sperling
Clients using Tx aggregation against an athn(4) hostap will send block ack request control frames whenever they need to sync their Tx block ack window. athn(4) dropped such frames due to bogus Michael MIC failures reported by the hardware decryption engine. Ignore such failures for control frames in order to fix athn(4) hostap mode against clients which use Tx aggregation. Additionally, only report Michael MIC failures to the net80211 stack if the offending client is actually using TKIP, which would also have prevented the problem since we require CCMP as group cipher in our default configuration. Problem reported and fix tested by kettenis@
2021-05-01Actually, that variable needs to be a u_int8_t pointer.Mark Kettenis
This is what was tested, but I forgot to commit a file.
2021-05-01Retire OpenBSD/sgi.Visa Hankala
OK deraadt@
2021-05-01variable has to be a pointer after last changeTheo de Raadt
2021-04-29Replace uvm_km_alloc(9) calls with km_alloc(9) calls. Make the copied ROMMark Kettenis
contents executable using pmap_kenter_pa(9) since uvm stops us from doing so using higher-level interfaces (for good reasons). Maintaining W^X of course! ok mpi@
2021-04-24Remove unused function pointers from `todr_handle'.Martin Pieuchot
from miod@
2021-04-22Use the long version of the bwfm(4) firmware path, which includes thePatrick Wildt
board's compatible string, when printing an error about not being able to load the firmware. Since most NVRAM files are board- or package- specific, having the compatible makes it easier for us to find the correct files, so that we can add them to the bwfm-firmware port. ok kurt@
2021-04-15Switch athn(4) 802.11n Tx rate adaptation from MiRA to RA.Stefan Sperling
Tests: AR5418: Uwe Werler AR9280: kn, jmatthew, Lauri Tirkkonen, Scott Bennett, Mikolaj Kucharski AR9285: kevlo, trondd, myself ok deraadt@
2021-04-15Make athn(4) set the channel when hostap or monitor modes enter RUN state.Stefan Sperling
Fixes a problem where the hardware would end up using a different channel than the one selected by net80211. Found while investigating issues reported by trondd testing my athn RA patch. ok deraadt@
2021-03-07ansiJonathan Gray
2021-03-03off by oneJonathan Gray
ok claudio@ deraadt@
2021-02-26Read and parse OTP on the BCM4378. There are quite a few firmware andPatrick Wildt
nvram files used for the different Apple devices. The device tree and the OTP hold the information which of those we will have to use. For now this information will simply be printed, but depending on how we choose to do the firmare distribution we could use it for loadfirmware().
2021-02-26Refactor bwfm(4) firmware loading. The PCIe backend will need to be ablePatrick Wildt
to load the CLM blob like the SDIO backend already does. Additionally it is also helpful for the PCIe backend to try a file named after the device tree compatible. Thus refactor the SDIO code and make it available for both SDIO and PCIe.
2021-02-25Some newer chips have two D11/802.11 cores, and we need to reset both atPatrick Wildt
the same time.
2021-02-25Prevent zero size devices from attachingjan
This also fixes two NULL ptr derefs in later code path. OK patick@, krw@
2021-02-25we don't have to cast to caddr_t when calling m_copydata anymore.David Gwynne
the first cut of this diff was made with coccinelle using this spatch: @rule@ type caddr_t; expression m, off, len, cp; @@ -m_copydata(m, off, len, (caddr_t)cp) +m_copydata(m, off, len, cp) i had fix it's opinionated idea of formatting by hand though, so i'm not sure it was worth it. ok deraadt@ bluhm@
2021-02-24Enumerate GCI core, which seems to contain the OTP on the Apple M1.Patrick Wildt
2021-02-23remove some unused includesJonathan Gray
2021-02-09Add a barrier between reading the cqe flags and the command ID, whichJonathan Matthew
should ensure that we don't read a stale command ID and complete the wrong scsi io. powerpc64 base builds were crashing like this fairly regularly. ok deraadt@ dlg@
2021-01-31Add basic support for BCM4378 as found on the Apple M1 SoCs. There's aPatrick Wildt
little bit more to do though before it can be enabled.
2020-12-17bwfm: add a delay in bwfm_set_key_cb before talking to hardwareJoshua Stein
This works around an issue on the BCM43602 where ieee80211 calls this too quickly during authentication and triggers "unexpected pairwise key update" errors. ok patrick
2020-12-12Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp.jan
OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
2020-12-08an(4): tsleep(9) -> tsleep_nsec(9)cheloha
In an_wait() we spin for up to (3 * hz) iterations awaiting AN_EV_CMD. If we don't see it in a given iteration we block for up to 1 tick and spin again. jsg@ suggests instead blocking for 100ms at a time for up to 30 iterations. Discussed with mpi@. Idea from jsg@. Murmurs of agreement from claudio@ and kettenis@. probably ok jsg@
2020-12-02Extract another couple of chunks from main() into helper functions,Kenneth R Westerback
get_routefd() and set_user().
2020-11-17Split imxiic(4) into the FDT-attachment code and the i.MX I2C codePatrick Wildt
in preparation for upcoming ACPI-attachment. ok kettenis@
2020-11-16Fix compile error on big-endian machines caused by recent multicast commit.Patrick Wildt