summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccbb
Commit message (Collapse)AuthorAgeFilesLines
* Change and clean the mutex lock interface.bmilekic2001-02-091-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Fix memory leaks with dev_get_children().imp2001-02-081-0/+6
| | | | Submitted by: Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
* o Now that I've had time to test the new interface, reintegrate it back in.imp2001-01-071-12/+11
| | | | | | | | | | | | | | | o Fix OLDCARD to use the new interface. o Rename the offsetp argument to deltap to more closely reflect what it is returning (it returns the delta from the requested value to the actual value). o Remove duplicate $FreeBSD$ in pccbb.c o Allow deltap to be NULL. o Convert new isa pcic driver and add XXX comments that this function isn't actually implemented there (which means that NEWCARD pccard stuff won't work there until it is). o Revert attempts to make old inferface work in NEWCARD. Subitted by: peter (Parts of the new version code)
* Undo the interface change to CARD_GET_MEMORY_OFFSET. It wasn't testedimp2001-01-071-7/+7
| | | | | | | | | | | by even a compile of the OLDCARD code, was unapproved by me the keeper of OLDCARD and broke OLDCARD and the ray driver. Adjust new code to cope with the older interface. If the interface changes in the future, it ***MUST*** be cleared by me so that the OLDCARD impacts taken into account. It code in card_if.m is used jointly by both OLDCARD and NEWCARD.
* * Better kld support in pccbb/cardbusjon2001-01-062-55/+94
| | | | | | | | | | | | | | | | | | | | | | | | | - pccbb no longer needs to remember whether a card is inserted. - pccbb reissues insertion on load of cardbus/pccard modules. - got rid of unnecessary delays in power functions. - Cardbus children are no longer deleted if probe/attach fails. - non-attached child devices are reprobed at driver_added. * CARD interface to read CIS - added card_cis_read/card_cis_free interface to read arbitrary CIS data. This currently is only implemented in cardbus. * pccard begins to work - pccard can now use higher memory space (and uses it by default). - set_memory_offset interface changed. - fixed ccr access, which was broken at multiple locations. - implement an interrupt handler - pccard can now share interrupts. - resource alloc/release/activate/deactivate functions gutted: some resources are allocated by the bridge before the child device is probed or attached. Thus the resource "belongs" to the bridge, and the pccard_*_resource functions need to fudge the owner/rid. - changed some error conditions to panics to speed debugging. * Mutex fix - Giant is entered at the beginning of thread
* Updates to match changes elsewhere in the PCI subsystem:msmith2000-12-132-1/+33
| | | | | | | | | - Remove redundant header-type-specific support in the cardbus pcibus clone. The bridges don't need this anymore. - Use pcib_get_bus instead of the deprecated pci_get_secondarybus. - Implement read/write ivar support for the pccbb, and teach it how to report its secondary bus number. Save the subsidiary bus number as well, although we don't use it yet.
* A bunch of newcard/cardbus changes that's been sitting in my tree for a while:jon2000-11-283-241/+333
| | | | | | - Make pccbb/cardbus kld loadable and unloadable. - Make pccbb/cardbus use the power interface from pccard instead of inventing its own. - some other minor fixes
* Cleanup allocation of resources for 16-bits. We now do the rightimp2000-10-221-12/+20
| | | | | thing in pccbb bridge (the pcic bridge will be updated as I merge the two copies of the code that were in the original cardbus commit).
* Allow interrupts to be sharable.imp2000-10-201-9/+6
| | | | This allows us to probe, but not attach.
* Go ahead and disable the legacy mapping of the pcic registers on theimp2000-10-181-1/+1
| | | | | | RF5C47x. Before the code would only do this on the RF5C46x bridges. Submitted by: Jonathan Chen
* Initial commit of NEWCARD cardbus side (that actually compiles and works)jon2000-10-184-0/+2075
Files: dev/cardbus/cardbus.c dev/cardbus/cardbusreg.h dev/cardbus/cardbusvar.h dev/cardbus/cardbus_cis.c dev/cardbus/cardbus_cis.h dev/pccbb/pccbb.c dev/pccbb/pccbbreg.h dev/pccbb/pccbbvar.h dev/pccbb/pccbb_if.m This should support: - cardbus controllers: * TI 113X * TI 12XX * TI 14XX * Ricoh 47X * Ricoh 46X * ToPIC 95 * ToPIC 97 * ToPIC 100 * Cirrus Logic CLPD683x - cardbus cards * 3c575BT * 3c575CT * Xircom X3201 (includes IBM, Xircom and, Intel cards) [ 3com support already in kernel, Xircom will be committed real soon now] This doesn't work with 16bit pccards under NEWCARD. Enable in your config by having "device pccbb" and "device cardbus". (A "device pccard" will attach a pccard bus, but it means you system have a high chance of panicing when a 16bit card is inserted) It should be fairly simple to make a driver attach to cardbus under NEWCARD -- simply add an entry for attaching to cardbus on a new DRIVER_MODULE and add new device IDs as necessary. You should also make sure the card can be detached nicely without the interrupt routine doing something weird, like going into an infinite loop. Usually that should entail adding an additional check when a pci register or the bus space is read to check if it equals 0xffffffff. Any problems, please let me know. Reviewed by: imp
OpenPOWER on IntegriCloud