summaryrefslogtreecommitdiff
path: root/sys/dev/cardbus
AgeCommit message (Collapse)Author
2023-05-06few more typos in the word "register", mainly s/resister/register/.andvar
In one comment I assume that it was meant to be pull-up resistor.
2022-09-25Remove unnecessary include of <sys/malloc.h>.thorpej
2022-08-24pmf(9): *_child_register never fails. Make it return void.riastradh
No kernel bump because this isn't documented or used in any modules, only in dev/pci/pci.c and dev/cardbus/cardbus.c which are as far as I know always statically linked into the kernel. The next change, however, will require a revbump -- to make pmf_device_register return void so we can prune vast swaths of dead error branches.
2022-03-26When reading CIS tuples from a BAR, do not blindly copy 2k of data (ormartin
to the end of the BAR space), but instead follow the tuples and stop reading once we reach the end of the list. I have a card bwi0 at cardbus0 function 0: Broadcom Wireless bwi0: BBP id 0x4306, BBP rev 0x2, BBP pkg 0 where the BAR claims 8k space but seems to only implement 6k (but that is impossible to report as the spec only allows 2^n sizes) and the CIS starts at a bit over 4k (so the old code tried reading beyound the 6k limit and caused pci bus errors). An alternative would be to avoid reporting bus errors during this access, but since we are only interested in the CIS chain anyway (and that ends way earlier) this is a simpler solution.
2021-11-01fix typos, mainly in words minimum and maximum, but also few others.andvar
2021-08-07Merge thorpej-cfargs2.thorpej
2021-07-24Fix all remaining typos, mainly in comments but also in few definitions and ↵andvar
log messages, reported by me in PR kern/54889. Also fixed some additional typos in comments, found on review of same files or typos.
2021-04-24Merge thorpej-cfargs branch:thorpej
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
2021-04-17convert cardslot event thread from wakeup/tsleep to mutex/condvar.mrg
this avoids a strange hang at reboot i am seeing on an old pentium4-m laptop, that was introduced with kern_mutex.c 1.91/92, though i can not really explain why that matters (in the waiting thread, a pointer that should be NULL remains non NULL.) thanks to jmcneill@ for some helpful review commentary here. don't panic() if either "cardbus" or "pcmcia" didn't attach and a card is inserted. this can happen for various reasons, including some regression in netbsd (-current, and -9, at least) that suggests using PCI_BUS_FIXUP (though it still fails to attach the card i have.) both found with GCC 10 testing, though both also occur with GCC 7 in the netbsd-9 tree as well.
2020-10-04Ensure event_thread stays in event loop upon creation.nat
2020-06-12pmf-powerdown == false --> pmf-no-powerdown == truethorpej
2019-11-10in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAITchs
and remove code to handle failures that can no longer happen.
2019-03-05 Catch up with MI pci changes to fix compile error.msaitoh
2019-03-01- Almost all ppbreg.h's definitions are also in pcireg.h. Remove duplicatedmsaitoh
definitions from ppbreg.h and move some definitions from ppbreg.h to pcireg.h. - Change fast back-to-back "capable" to "enable" in pci_subr.c. - Print Primary Discard Timer, Secondary Discard Timer, Discard Timer Status and Discard Timer SERR# Enable bit in pci_subr.c. - PCI_BRIDGE_PREFETCHBASE32_REG and PCI_BRIDGE_PREFETCHLIMIT32_REG are "upper" 32bit registers, rename to *UP32_REG to avoid confusion. - Use macro.
2018-12-14add cardbus attachment for malo(4), from OpenBSDjakllsch
2018-12-14fix whitespacejakllsch
2018-12-08Clean up initialization of com_regs structure, in preparation forthorpej
some additional changers.
2018-09-03Rename min/max -> uimin/uimax for better honesty.riastradh
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended. HOWEVER! Some subsystems have #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation. To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it. I have left a handful of bootloaders that are too annoying to compile-test, and some dead code: cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4)) It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them. Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
2018-04-09Stop potential misuse of vendor names and USB vendor IDs in root hubjakllsch
device and string descriptors. Firstly: Few vendors have identical PCI-SIG vendor IDs and USB-IF vendor IDs. As such, using the PCI vendor ID as a USB vendor ID may trample on whomever is allocated that USB vendor ID. Secondly: The vendor of the host controller hardware implementation has little to nothing to do with our usbroothub implementation. Thus we should not potentially associate any problems therewith to such third party. This change will result in root hubs being identified by USB Vendor ID 0x0000. Root hub vendor string will now be "NetBSD" (or, specifically: ostype). Product ID (0x0000) and product strings remain unchanged.
2018-04-02Remove extra printf duplicate with MI codes.rin
2017-06-01remove checks for failure after memory allocation calls that cannot fail:chs
kmem_alloc() with KM_SLEEP kmem_zalloc() with KM_SLEEP percpu_alloc() pserialize_create() psref_class_create() all of these paths include an assertion that the allocation has not failed, so callers should not assert that again.
2016-09-24weak alias some pcmcia functions (to an returns error function) so thismrg
links when pcmcia isn't in the kernel. PR#7253.
2016-07-14- Use aprint*() more in xxx_attach().msaitoh
- Add missing aprint_naive("\n"). - Remove extra spaces and tabs. - KNF.
2016-07-14KNF. No functional change.msaitoh
2016-07-14- Use aprint*() instead of printf() in xxx_attach().msaitoh
- Add missing aprint_naive("\n"); - KNF
2016-07-11KNF. No functional change.msaitoh
2016-07-07KNF. Remove extra spaces. No functional change.msaitoh
2016-04-23Merge nick-nhusbskrll
- API / infrastructure changes to support memory management changes. - Memory management improvements and bug fixes. - HCDs should now be MP safe - conversion to KERNHIST based debug - FS/LS isoc support on ehci(4). - conversion to kmem(9) - Some USB 3 support - mostly from Takahiro HAYASHI (t-hash). - interrupt transfers now get proper DMA operations - general bug fixes - kern/48308 - uhub status notification improvements - umass(4) probe fix (applied to HEAD already) - ohci(4) short transfer fix
2015-04-13Convert sys/dev to use <sys/rndsource.h>.riastradh
2014-10-17Fix i386 CARDBUS build.uebayasi
2014-09-21remove more old pci_findvendor codechristos
2013-11-21Expand "#ifdef notyet" section to encompass the use of the variableriz
declared within.
2013-10-17move notyet variable into notyet sectionchristos
2013-10-12Pass the device name in, so we can debug what deferred drivers did not work.christos
2013-04-03instead of ifnet use ethercom.christos
2013-03-30This is the initial port of OpenBSD's athn(4) driver. It supportschristos
quite a few Atheros 802.11n devices. See the athn(4) manpage for a list. This port has only been tested with a TP-LINK TL-WN722N USB adapter which has an AR9271 chipset (VENDOR: 0x0cf3, PRODUCT: 0x9271). The BSS, Monitor, and HostAP modes all seem to work on that adapter, though the later has not been tested much. The driver also supports PCI and CardBUS devices, but those interfaces are completely untested and probably won't work at this point. If someone can provide me with other adapters that should be supported, particularly PCI or CardBUS adapters, or tell me where I can get one cheaply, I would be happy to try to get the driver working on those devices as well.
2013-03-30patches for new wifi devices.christos
2012-12-20Change sdhc_detach so that it detaches all host controllers at once.jakllsch
This should make multiple slot controllers, for example those with a controller on more than one PCI/CardBus BAR, detach with fewer bugs. Tested with as-of-yet-uncommited sdhc_pci changes on a single-host ExpressCard JMicron JMB38[89].
2012-10-27split device_t/softc for all remaining drivers.chs
replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
2012-08-04Fix error branches and config pending races in firewire init.riastradh
This way, if anything fails, it just fails; you don't panic. This can happen if suspending and resuming of firewire is broken (e.g., as I encountered in PR kern/44581).
2012-04-12- Add pmf(9) suspend, resume to bwi(4) cardbus front end.nakayama
- Apply cardbus code cleanups.
2012-04-08PR/46310: Ryo ONODERA: Add support for cardbus bwi(4)christos
2012-02-18split device_t/softcdrochner
2012-02-18Remove uneeded and unused structure.matt
2012-02-02Use "opt_sdmmc.h" for SDHC_DEBUG.nonaka
2012-02-02Entropy-pool implementation move and cleanup.tls
1) Move core entropy-pool code and source/sink/sample management code to sys/kern from sys/dev. 2) Remove use of NRND as test for presence of entropy-pool code throughout source tree. 3) Remove use of RND_ENABLED in device drivers as microoptimization to avoid expensive operations on disabled entropy sources; make the rnd_add calls do this directly so all callers benefit. 4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might have lead to slight entropy overestimation for some sources. 5) Add new source types for environmental sensors, power sensors, VM system events, and skew between clocks, with a sample implementation for each. ok releng to go in before the branch due to the difficulty of later pullup (widespread #ifdef removal and moved files). Tested with release builds on amd64 and evbarm and live testing on amd64.
2012-01-27converting extent(9) from malloc(9) to kmem(9)para
preceding kmem-vmem-pool-uvm patch releng@ acknowledged
2011-10-07Stop calling ATH_LOCK_{INIT,DESTROY}(), they don't exist any more.dyoung
2011-09-05Change 0x1229's product name from 82557 to 8255x.msaitoh
82550, 82551, 82558 and 82559 share the same product id. This change makes "pcictl dump" happy.
2011-08-01remove some bloat:drochner
-cardbus doesn't use multiple interrupt lines like PCI, and it doesn't use machanisms like interrupt line register and swizzling -- no need to carry around dummy information, this is all dealt with by the bridge (I'm asking myself how "rbus_ppb" can work -- a bridge attached to cardbus just can't work like a normal PCI bridge as far as interrupts are concerned. I thing that should be a hardware specific driver because behavior is not covered by a standard.) -cardbus always uses 3.3V -- no need for a variable to keep track of the voltage