summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pccard.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Remove debug printfs and Debugger() calls.imp1999-10-251-65/+18
| | | | | | | Add support for memory mapping This should allow pccard that need memory mapping to work, but I don't have one to test against.
* Massive rewrite of pccard to convert it to newbus.imp1999-10-251-391/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Gut the compatibility interface, you now must attach with newbus. o Unit numbers from pccardd are now ignored. This may change the units assigned to a card. It now uses the first available unit. o kill old skeleton code that is now obsolete. o Use newbus attachment code. o cleanup interfile dependencies some. o kill list of devices per slot. we use the device tree for what we need. o Remove now obsolete code. o The ep driver (and maybe ed) may need some config file tweaks to allow it to attach. See config files that were committed for examples on how to do this. Drivers to be commited shortly. This is an interrum fix until the new pccard. ed, ep and sio will be supported by me with this release, although others are welcome to try to support other devices before new pccard is working. I plan on doing minimal further work on this code base. Be careful when upgrading, since this code is known to work on my laptop and those of a couple others as well, but your milage may vary. BUGS TO BE FIXED: o system memory isn't allocated yet, it will be soon. o No devices actually have a pccard newbus attach in the tree. BUGS THAT MIGHT BE FIXED: o card removal, including suspend, usually hangs the system. Many thanks to Peter Wemm and Doug Rabson for helping me to fill in the missing bits of New Bus understanding at FreeBSD Con '99.
* Remove name field from controller information. Fix name setting inimp1999-10-161-2/+2
| | | | | | | | pc98 case that I missed before. Attempt to get the irq for the PCIC first from the loader env var and second from the config system. I've been able to boot my laptop with a kernel that hardwired the irq to 10. This should allow boot -c to finally start working for pcic irq, but I've not tested that. Add $FreeBSD$ to slot.h.
* Reorganize the attachement point for pcic (it was unattached andimp1999-10-151-3/+1
| | | | | | | | | | | | | | | | | | | | | | floating before). Attach pccard devices to pcic, one per slot (although this may change to one per pcic). pcic is now attached to isa (to act as a bridge) and pccard is attached to pcic, cbb and pc98ic (the last two are card bus bridge and the pc98ic version of pcic, neither of which are in the tree yet). Move pccard compat code into pccard/pccard_compat.c. THIS REQUIRES A CONFIG FILE CHANGE. You must change your pcic/card entries to be: # PCCARD (PCMCIA) support controller pcic0 at isa? controller pcic1 at isa? controller card0 The old system was upside down and this corrects that problem. It will make it easier to add support for YENTA pccard/card bus bridges. Much more cleanup needs to happen before newbus devices can have pccard attachments. My previous commit's comments were premature.
* Make it easier to have completely new bus attachment points for pccardimp1999-10-151-28/+7
| | | | | | | | | | devices. There may still be problems with said drivers, if so please let me know. o Move attach-like functionality to the nbk attach compatibility code. o Smarter probe code: for the compatibility code probe succeeds if strcmp succeeds, for noncompatibility you can do anything you like. o Get rid of some compiler warnings introduced in last commit.
* *** empty log message ***imp1999-09-261-3/+3
|
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* Kludge together support for the old pccard system with newbus. Thisimp1999-09-061-15/+57
| | | | | | | | will allow newbus based drivers to have pccard attachments. Also start printing out probe messages for pccards stating the resources used and regularize many of the pccard printfs. Reviewed by: Peter Wemm.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-9/+2
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* o Add additional printfs for error cases when we can't attach the device.imp1999-08-011-8/+26
| | | | | | | | o Add field to dev_desc for the size of the io port range. This isn't used yet in the committed sources, but will make the transition easier in the future. If you build this into your kernel, you will need to rebuild pccardd.
* Simplify cdevsw registration.phk1999-05-311-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-5/+22
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* Unbreak slot_irq_handler(). The problem here is that slot_irq_handler()wpaul1999-05-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | abuses its argument, which is supposed to be an integer unit number, as a pointer to the head of the 'struct slot' list. When this code was hacked^Wupdated for newbus, a new mechanism for registering slot_irq_handler() was put in place and the significance of the unit number was overlooked. When registering an interrupt, we have both device_id and unit. The unit number is passed as 'unit' but /sys/i386/usa/intr_machdep.c:register_intr() drops unit on the floor and uses device_id instead. Since pccard_alloc_intr() always sets device_id to 0, this means the unit number is always zero, and slot_irq_handler() is always called with 0, which becomes a NULL pointer which slot_irq_handler() tries to dereference and the kernel explodes. Result: if you assign a PCMCIA driver in the kernel config file like this: device wi0 at isa? port? irq? Then the system will panic the moment a PCMCIA device is attached and an interrupt is triggered. The quick fix: make pccard_alloc_intr() pass the unit number as both the device_id and unit arguments to register_pcic_intr(). The correct fix would be to rewrite /sys/pccard to be less disgusting.
* - When the card is inserted, call pccard_insert_beep instead ofnate1999-05-021-2/+2
| | | | | | pccard_remove_beep. Submitted by: PAO
* Eliminate compiler warning about missing type in declaration.jdp1999-04-271-3/+2
| | | | | | | Remove useless initialization of static variable to 0. Move static variable declaration into the only function that uses it.
* Fix the code that prints the "Initializing PC-card drivers" messagejdp1999-04-271-4/+3
| | | | | | | | so that the list of drivers is correct. This is a slightly simplified version of the patch from the PR. PR: misc/10544 Submitted by: Christophe Colle <colle@krtkg1.rug.ac.be>
* Suser() simplification:phk1999-04-271-5/+5
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Updated to use new APIC (SMP) safe interrupt register/unregisterroger1999-03-101-3/+4
| | | | | | | functions. Posted for review to -smp and -mobile and -hackers with no objections. Reviewed by: Nate
* On second thought: do previous fux in pcic.c better.guido1999-02-141-1/+2
| | | | Now we just untimeout the call to inserted() if it exists.
* Add "beep" ioctl. (#10 is reserved for PIOCSVIR)kuriyama1999-02-131-1/+6
| | | | | Obtained from: PAO3 Reviewed by: -current list
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-4/+4
| | | | | | | kernel compile. This commit includes significant work to proper handle const arguments for the DDB symbol routines.
OpenPOWER on IntegriCloud