summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pccard.c
Commit message (Collapse)AuthorAgeFilesLines
* Garbage collect options AVM_A1_PCI, AVM_A1_PCMCIA, DEBUG_LINUX, DEV_APM,bde2002-02-151-2/+0
| | | | | GUS_DMA, GUS_DMA2, GUS_IRQ, OLTR_NO_BULLSEYE_MAC, OLTR_NO_HAWKEYE_MAC, OLTR_NO_TMS_MAC and PCIC_RESUME_RESET.
* Avoid doubly defining machdep.pccardmsmith2002-01-081-2/+0
|
* Use d_thread_t (the new ugly compatibility hack) rather than the oldimp2001-11-121-6/+4
| | | | uglier compatibility hack (#define thread proc).
* Introduce the concept of "default" voltage. Have pccard layer use thisimp2001-11-111-1/+1
| | | | | | | | | value (-1) in lue of 50 (which assumes a 5.0V card). The rest of the pccard system doesn't detect the proper voltage for the card, so we have to do it on powerup. Many (all?) 3.3V cards can tolerate 5.0V for reading the CIS, but may fail to operate properly when so powered. Idea from: Chiharu Shibata-san <chi@bd.mbn.or.jp> in bsd-nomads:15867
* Better error messages for the cases where device_add_child fails. Weimp2001-11-021-2/+8
| | | | | | | | should also whine if the old pccardd is used, but that's a little harder than it sounds. This also has the effect of fixing a typo that was in the last version I committed.
* Remove an extra " that crept into a string.silby2001-11-021-1/+1
|
* Print a warning when device_add_child returns NULL. This used to beimp2001-11-021-0/+5
| | | | | | impossible at this point, but now it apparently is. Grump. Submitted by: OGAWA Takaya <t-ogawa@triaez.kaisei.org>
* <jkh> "Hey Rocky, watch me eject this pccard outta my laptop!" "What,imp2001-09-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | again? That NEVER works!" "This time for sure!" Minor overhaul of how we do interrupts for the pci interrupt routing case to cope with card ejection better (read: make it not hand on so many cards): o Reintroduce func_intr and func_arg and use the to store the interrupt handler to call. o Create a pcic_pci_func_intr to call the real interrupt handler iff the card hasn't been ejected. o Remove some checks in pcic_setup_intr now that it is used exclusively for isa routed interrupts. o Defer the eject event until later too, but make sure we can't do any client driver ISR calling in the interrum. o Add some simple code to make sure that we don't attach more than one child. This should fix pccardd starting twice problem (ala single user -> multi-user when you started pccardd by hand in SU). MFC: after jkh thinks I've put the crack pipe away.
* Even better compatibility with 4.x. #define thread proc, since forimp2001-09-131-16/+2
| | | | | this file, that's a reasonable workaround. Also, include sys/proc.h for 4.x.
* Better way to do compatibility between the two versions.imp2001-09-131-20/+8
|
* Fix KSE breakage to this file:imp2001-09-131-0/+32
| | | | Make it compile again on 4.x.
* KSE Milestone 2julian2001-09-121-9/+9
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* A bunch of interrupt related cleanup.imp2001-07-311-33/+0
| | | | | | | | | | | | | o Move PIOCSRESOURCE from pccard to pcic so the kernel can give pccardd better hints as to what resources to use. o Implement an undocumented hw.pcic.interrupt_route to allow people that need to do so to route their interrupts in a non-standard way. o Only preallocate a resource in probe if we're routing via pci. o If we aren't routing via pci, then set the irq to use explicitly to defeat the automatic IRQ routing of the pci layer. This, with the pccardd code should be close to what can be committed to -stable.
* When booted -v (eg bootverbose is non-zero), have pccard report whatimp2001-07-301-0/+7
| | | | | | | | | resources it is attempting to assign to a child object. This should help people track down mysterious resource allocation problems more easily. # Unfortunately, it is harder to do the conflict check and report which # resource failed if the driver itself doesn't.
* Minor nits merged from my stable tree:imp2001-07-271-2/+1
| | | | | | | | | | | | o kill blank line that I introduced in cardinfo.h o Delete unused variable wasinactive. o return 0 from pccard_resume. o Set the state and lastsate initially to be empty. o move comment above code for interrupt dispatching. o Powerstate interface is now available as of 430002, not 500000 (note that this change will be not 100% correct since the power state stuff didn't enter current until well after 500000, but it is good enough for the two branche we have going now).
* Attempt to fix and document interactions between suspend/resume and pccardcimp2001-07-271-24/+17
| | | | | | | | | | | | | | | | | | | | power x 0. pccardc power x 0 used to disable the slot. But a suspend/resume would reactivate the pccard. It no longer does that. Now the disabling of the slot is sticy until it is reset with power x 1 or the card is ejected. This seems closer to correct behavior to me. o Process all card state changes the same using pccard_do_stat_change(). o Cleanup disabling the card so that we can preserve the state after the change. Basically, don't set it to empty as often as we do. o On suspend, the new state is "empty" and the laststate is "suspend" o Document state machine with a diagram of states and edges. The edges are labeld to tell the reader what event causes the external state changes. o "machdep.pccard.pcic_resume_reset" may be obsolete now. We always call the bridge driver's resume method on resume now. Otherwise cards won't automatically show up. If it needs to stay, I'll add it back.
* Note that spls are noopsimp2001-07-091-0/+2
|
* Cleanup some obsolete commentsimp2001-07-061-2/+3
|
* Minor whitespace nit.imp2001-07-011-1/+1
|
* Save the IRQ that we get in pci attachment.imp2001-06-161-13/+7
| | | | | | | | | | | Print type of pci bridge we find. Force the IRQ of pci bridges upon all its children. Allocate the resources on behalf of the bridge when we're testing to see if they exist. This should help people who don't read updating instructions very well. This patch started out with an idea from Shigeru Yamamoto-san in -current.
* Minor style(9) nit. a|b -> a | b.imp2001-06-041-1/+1
|
* Update copyright infoimp2001-05-251-0/+1
|
* Minor style(9) changes:imp2001-05-141-35/+35
| | | | return (VALUE);
* Take a stab at making this less dependent on having pcic as a parent.imp2001-05-141-24/+17
| | | | | | | For memory for the pccard attribute/common memory mapping allocate on the pccard. For other allocations, use whatever is the parent of this device. There's no doubt other issues lurking, but this should make things closer to being independent.
* o Get rid of static array of slots in pccard layer. Move this to theimp2001-05-131-39/+23
| | | | | | | | | softc. o Store pointers to softc in dev_t in si_drv1. o Change 'kludge version' to 'classic version' since things are getting less kludgy. o Minor code shuffling so that we probe and attach the pccard slots. o Minor style(9) changes.
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* First step towards plugging the "pccard is trying to map into a BIOSimp2001-03-261-75/+63
| | | | | | | | | | | region for CIS reading" problem: Use bus_alloc_resource to get the memory that we'll be using. Also has the benefit of doing usage checking as well. This gets rid of the ugly kludge that we had before for mapping pmem to vmem. Second, move PIOCSRESOURCE to its own routine and make it conform more to style(9) in the process.
* Place the call to pccard_insert_beep() in the inserted() timeoutiedowse2001-03-201-1/+1
| | | | | | | | | | | | routine instead of pccard_event(). This avoids spurious extra calls to pccard_insert_beep() at insert or remove time which could occur due to noise on the card-present lines. Clean up some code in pccard_beep.c; we were depending on the order of evaluation of function arguments, which is undefined in C. Also, use `0' rather than `NULL' for integer values. Reviewed by: sanpei, imp
* select() DKI is now in <sys/selinfo.h>.wollman2001-01-091-1/+0
|
* Make a few more mallocs use M_ZERO.dwmalone2000-10-291-4/+3
| | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Approved by: imp
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-291-1/+0
| | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>.
* Change snprintf to strncpy.imp2000-10-261-2/+9
| | | | | Also add a comment about a bogus assumption in the current code found at bsdcon by jhb.
* fix some minor problem in PIOCSRESOURCE ioctl.sanpei2000-10-011-14/+5
| | | | | | | | | | | | | | - If resource which was allocated for pcic was requested via this ioctl, bus_alloc_resource would be succeeded and that resource was returned as free resource. So check whether requested resource was used for pcic or not before bus_alloc_resource test. - merge SYS_RES_IRQ routine into other SYS_RES_* routine and clean up. problem reported by: Yohei Terada <terada@jiro.c.u-tokyo.ac.jp>
* o Remove 9 unnecessary includes.imp2000-09-201-6/+1
| | | | | | | | o Add Vpp power at 5.0V rather than 0. Setting it to zero violates the pccard spec. Most pcic devices in use today don't let us violate the spec, but some older ones do. Bill Paul sent this to me a long time ago and I thought I'd commit it before now. o Add some debug stuff hidden behind bootverbose.
* add PIOCSRESOURCE(IOC_GET_RESOURCE_RANGE)sanpei2000-09-171-0/+45
| | | | | | | Now /usr/sbin/pccardd read free resource(io,irq) range with this ioctl. Original Idea from: PAO3
* Add UNIX domain socket feature to pccardd. This makes pccardume2000-08-201-3/+5
| | | | | | | related PAO3/ports such as gxcardmon work. Reviewed by: imp Obtained from: PAO3
* There is no atdevbase on the alpha. Hide this case statement on alpha untilmjacob2000-06-231-0/+3
| | | | the design/implementation is complete.
* Checkin my first batch of New Mexico changes:imp2000-04-251-7/+7
| | | | | o minor whitespace things (bad because this is also a functional commit) o Backport reading in of CIS entries from the driver level.
* /tmp/msgimp2000-02-211-24/+5
|
* This fixes a bug that /etc/pccard_ether did not work without DHCP.hosokawa2000-01-161-0/+2
| | | | | | | | | | | | | | | | | | For example, when /etc/pccard.conf had ed0 in config line, but kernel refused this name and said devclass_alloc_unit: ed0 already exists, using next availale unit number Kernel used ed1 as device name and it did not match with config and insert/remove lines. Fortunately, dhclient was called without args, and it works, but if we wanted to use static IP address for PC-card, it did not work. This modification makes pccardd to execute insert/remove lines with the true device name that returns from kernel. (Last change to etc/pccard.conf.sample eliminated all hardwired device name from insert/remove lines in /etc/pccard.conf)
* Stop the recurring feeling of deja vuimp2000-01-131-1/+2
| | | | | | | | | | Stop the recurring feeling of deja vu Stop the recurring feeling of deja vu Stop the recurring feeling of deja vu and debounce the eject messages. We now mark the socket empty in the interrupt handler, rather than after we've disabled the socket which happens "much later".
* Switch to using suspend/resume methods rather than the APM hooks.imp1999-12-081-101/+53
| | | | | | | | | | | | | Should have no effect, but does make things a little cleaner. I thought this was the race that was causing problems, but it turned out to be in pccardd waking up after the empty/insert events had happened and being confused. Minor cleanup: o Remove isahd from pccard_devinfo o remove extra from controller o formatting nits o use PCCARD_DEVINFO(d) rather than a bare device_get_ivars(d)
* Fix alloc_driver() so that calls devclass_get_device() with slt->slotnumwpaul1999-12-081-1/+1
| | | | | | | | | | | | | | | as the unit argument instead of 0. disable_slot() calls devclass_get_device() correctly, however because alloc_driver() does it wrong, disable_slot() is unable to locate the child devices attached to the pccard bus and thus fails to call device_delete_child() on them. The end result is that when a card is removed, its detach routine is never called, and re-insertion always fails. With this fix (and the previous one to if_wi.c), I can now insert, remove and re-insert my WaveLAN/IEEE card and things behave correctly. kldunloading the if_wi.ko module also seems to work properly now. Ok'ed by: imp
* Remove unused junk: next fields and list head. Likely not completelyimp1999-12-061-6/+0
| | | | | needed on software reaching EOL, but I'd have caught the hang bug sooner had I done this earlier.
* Remove the 'ivars' arguement to device_add_child() andmdodd1999-12-031-1/+2
| | | | | | | | | | | | | | | | device_add_child_ordered(). 'ivars' may now be set using the device_set_ivars() function. This makes it easier for us to change how arbitrary data structures are associated with a device_t. Eventually we won't be modifying device_t to add additional pointers for ivars, softc data etc. Despite my best efforts I've probably forgotten something so let me know if this breaks anything. I've been running with this change for months and its been quite involved actually isolating all the changes from the rest of the local changes in my tree. Reviewed by: peter, dfr
* Print device names for children that fail to detach.imp1999-12-021-1/+3
| | | | | | | Free child array when we're done with it. Forgotten by: imp Submitted by: Nick Hibma <hibma@skylink.it>
* Make pccardc beep actually work. The kernel was doing the wrong thingimp1999-12-021-3/+0
| | | | | | | | with the beep information it had (like ignoring it). Submitted by: sanpei@sanpei.org (MIHIRA-san Yoshiro) Add $FreeBSD$ to pccard_beep.c while I'm here.
* /tmp/msgimp1999-12-021-1/+16
|
* Fix the hang on card eject problem and maybe the hang on suspendimp1999-12-011-21/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | problem. o Create new timeout routine so we don't detach the card inside a ISR but instead drop back to spl0 via a timeout of 0. o Actually delete the child of the pccard device rather than just faking it badly. o Fix sio, ed and ep to have pccard detach routines that are int rather than void. o Fix ep and ed pccard detach routines to use if_detach rather than just if_down. if_detach destroys the device, while if_down just marks it down. In this incarnation of the pccard things, we map the disable the slot action to detach the driver, which removes the driver from the device tree. When that is done, a panic would soon follow as the ifconfig tried to down the device. Didn't fix: o Should cache the pccard dev child's pointer in struct slot o remove now unused parts of struct slot o Any driver using softc after detach has been called. sio's softc used to be statically allocated, so you could check sc->gone, but that is now gone. o Didn't remove gone from softc of drivers that use the old pccard method. Didn't test: o ed driver changes o sio driver changes on pccards o suspend (no laptop or apm support on my desktop)
* Kill unneeded includesimp1999-11-201-3/+0
| | | | Found by phk's script a while ago.
OpenPOWER on IntegriCloud