summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccard/pccard.c
Commit message (Collapse)AuthorAgeFilesLines
* Add in parsing of the disk FUNCE tuples.imp2009-03-031-0/+4
|
* Bring consistent debugging output for all values that are supposedwkoszek2009-02-051-10/+10
| | | | | | | to be printed in a hexadecimal format. Otherwise, '270' doesn't say much. Reviewed by: imp
* Fix parameter types for set_res_flags and read_ivarsimp2009-02-051-4/+4
|
* Fix a small problem in the comment about departure from NetBSD.imp2008-08-071-1/+1
| | | | | Also, r181392 fixed a small problem with multifunction cards that would cause the card not to power down when the last driver detached from it.
* Add NEC PC-9802N-J02 (confirmed) and NEC PC-9202N-J02R (speculative)imp2008-08-071-17/+3
| | | | to the list of devices.
* Unify the initial card probe/attach procedure with the kldloadimp2008-08-061-63/+111
| | | | | | | | | | | | | | | | | | | procedure. There were some subtle differences before that could lead to a variety of bugs, including resources being lost (in one case forever). pccard_probe_and_attach_card does this now, and includes comments about what's going on and why, since it isn't obvious from the code. Please let me know if I've missed anything... Provide a new function called pccard_select_cfe that allows drivers to select which configuration entry to use. This is needed for some older pre-MFC standard cards with many functions that want to activate all their functions by selecting alternative entries, or to work around broken ones. pccard_select_cfe will migrate into the pccard_if.m interface as its interface stabilizes to keep all the pccard drivers from referencing any symbols in the pccard.ko module directly. Fix a printf to refer to the right function name.
* only register a ithread handler if the card requests an ithreadimp2007-06-161-3/+2
| | | | handler.
* Make the interrupt handler wrapper capable of correctly support ↵piso2007-05-311-16/+19
| | | | | | filter+ithread handler. Discussed and reviewed with: bsdimp, simokawa
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-9/+22
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* We need to free the ivars for the child that we just deleted.imp2007-02-031-0/+3
|
* When pccard_safe_quote is passed NULL for src, it shouldn't panic.imp2006-04-271-1/+1
| | | | | Someone sent me this a while ago, but I can't find who to give them proper credit...
* Add some sanity checking to the pccard insertion case. Whine if theimp2005-12-281-4/+6
| | | | | bridge tries to tell us about a new card when we have one already in the socket.
* Remove compat layer for OLDCARD compatibility. All instances of itimp2005-09-221-26/+0
| | | | are now gone from the tree.
* remove some dead codeimp2005-09-201-9/+1
|
* Implement /dev/pccardN.cis. This mirrors the CIS for the card to userland.imp2005-09-201-1/+6
| | | | | | pccardc dumpcis /dev/pccardN.cis will work now, but I may rewrite pccardc. Also, move more of the private data to a new file called pccardvarp.h.
* Add a few new functions interfaces to allow reading/writing attributeimp2005-09-131-1/+89
| | | | memory, the CCR and a tweak to cis_scan.
* Define and use PCCARD_MEM_PAGE_SIZE.imp2005-09-131-1/+1
|
* Insert missing int i;imp2005-07-151-0/+1
|
* Also provide the function type in the nomatch routine.imp2005-07-141-4/+7
|
* o Check to make sure the card has a function (panic if not) in read_ivar.imp2005-07-131-44/+64
| | | | | | | o Use pf more consistantly for pccard_function. o Make sure we quote the strings properly (maybe this function belongs in subr_bus.c) o Tweak a comment to be more accurate after code changed.
* Add a much-requested feature: The ability for pccard attachments toimp2005-07-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | scan the CIS for interesting tuples. 95% of what can be obtained from the CIS is harvested by the pccard layer and presented to the user in standard function calls. However, there are special needs at times where the standard stuff doesn't suffice. This is for those special cases. CARD_SCAN_CIS(device_get_parent(dev), function, argp) scans the CIS of the card, passing each tuple to function with the tuple and argp as its arguments. Returning 0 continues the scan, while returning 1 terminates the scan. The value of the last invocation of function is returned from this function. int (*pccard_scan_t)(struct pccard_tuple *tuple, void *argp) function called for each tuple. Elements of the CIS tuple can be read with pccard_tuple_read_{1,2,3,4,n}(). You are reading the actual tuple memory each time, in case your card has registers in the CIS. # I suppose these things should be documented in pccard(4) or something like # that. # I plan on unifying cardbus CIS support in a similar way. Approved by: re (scottl)
* Big cleanup of resource code for pccard. Once coventry noticedimp2005-04-121-101/+30
| | | | | | | | | | problems here, it became clear we were being too complex. o Don't keep track of resources in two places o Use resource_list_purge instead of rolling our own o Just reassign the ownership of the resource, rather than freeing it and reallocating it. o Fix compile problems when sizeof(u_long) != sizeof(int)
* Cleanup of resource allocation code after having my attention focused onimp2005-04-121-31/+61
| | | | | | | | this code: o rid is stored in the resource, so don't bother keeping track of it here. o Implement memory space o Don't try to activate 'memory card' CFEs. This is type memory, as opposed to the memory resource.
* Use return value of resource_list_add to avoid a secondimp2005-04-121-7/+11
| | | | | | | | | | | | resource_list_find. Check to make sure that rle is not NULL and panic if it is (but it appears that resource_list_add already panics, so I'm not entirely sure it is necessary now). Add a test to make sure we have a interrupt resource when we're disabling it. This is also a cannot happen, but the extra care shoudln't hurt. Found by: Coventry tool via sam@
* Need to initialize the resource list that we keep for our children.imp2005-03-181-0/+1
| | | | | | | STAILQ's require this, while it is optional for SLIST (well, as long as the memory is bzeroed). Noticed by: phk's crash
* Use STAILQ in preference to SLIST for the resources. Insert new resourcesimp2005-03-181-1/+1
| | | | | | | | | last in the list rather than first. This makes the resouces print in the 4.x order rather than the 5.x order (eg fdc0 at 0x3f0-0x3f5,0x3f7 is 4.x, but 0x3f7,0x3f0-0x3f5 is 5.x). This also means that the pci code will once again print the resources in BAR ascending order.
* Add an XXX comment about string quoting.imp2005-02-161-0/+1
|
* Ignore the expected function number.imp2005-01-241-5/+0
| | | | | | | | | | | NetBSD went this route a while ago. FreeBSD originally tried this to cope with multifunction cards. However, it turns out that we're better off not worrying about the function number, and instead worry about the function type for the function. This has worked well in NetBSD, and all FreeBSD's relevant drivers have been converted. # I'll rework the macros that specify them shortly, as soon as I can # come up with a good, compatible way to deal...
* u_intXX_t -> uintXX_timp2005-01-241-12/+12
|
* Fix spelling errorimp2005-01-191-1/+1
| | | | submitted by: Anders Hanssen
* Go ahead and match on CIS3 and CIS4 strings as well. These are NULLimp2005-01-171-1/+14
| | | | | | | | | for the vast majority of our cards. However, they are critically needed to distinguish different fe based PC Cards (the FMV-182 from the 182A) which need to be treated differently (the ethernet address is loaded not from the standard CIS-based ethernet tuples, but from differing locations in attribute space based on the version string in CIS3. This should have no impact for other users of this function.
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Some cards don't have the info entries in the CIS, so vendorstr and/orimp2004-08-161-7/+21
| | | | | | | | | prodstr may be NULL when fetched. For the default device description, guard against this and return the numeric IDs instead when this happens. For the matching routines, and consider NULL to not match those entries that aren't NULL w/o calling strcmp. Early patches by: Anders Hanssen
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-2/+2
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Use %#jx for both args.imp2003-11-041-2/+2
| | | | Non-use of %# mocked by: bde
* Fix two small style nits pointed out by bde: Remove spaces after cast andimp2003-11-031-1/+1
| | | | indent continued line 4 spaces instead of 2.
* o Use %j and uintmax_t rather than uint64_t for casting.imp2003-11-031-4/+3
| | | | | | o use more proper bus_size_t for iosize rather than bus_addr_t. Noticed by: bde
* ia64 tenderbox hates what I did wrt a printf, so cast the snot out ofimp2003-11-031-2/+2
| | | | it and hope for the best.
* MFp4:imp2003-11-021-45/+97
| | | | | | | | | | o Fix MFC cards. We were bogusly setting CCR_IOBASE[01] and CCR_IOLIMIT. now when we activate the resource, we adjust these for MFC cards, per the spec. o Change type of pf_mfc_* to be bus_addr_t, which is more correct than long. This makes my 3C362D/3C363D and 3CXEM556 cards work! Woo Hoo!
* Const poison string accessor functions.imp2003-10-261-3/+4
|
* o move the cis tuple definitions into a common file.imp2003-10-071-23/+0
| | | | | | o minor optimization of cardbus_cis processing. Remove a bunch of generic entries that are handled by generic. o no longer need the card_get_type stuff.
* Whacked out CIS configurations can cause us to not have any child. Whenimp2003-09-051-2/+4
| | | | | | | such a card is ejected, we'd panic. Instead, just ignore it. I should also add a sanity check in the FUNCID code as well, but this isn't wrong since the check is cheap and happens infrequently.
* Probe routines can return < 0 for speculative matches. In theimp2003-08-251-1/+1
| | | | | | | compatibility routine, go ahead and accept that as 'success'. A properly written compatible driver should return < 0 for both the compat match and compat probe routines, so this will wind up doing the right thing.
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* pc98pcic isn't the name of the media driver. tcic likely will neverimp2003-08-201-3/+0
| | | | | happen (unless someone sends one to me). Kill bogus module depend that I commented out over a year ago.
* Add a comment about the MPSAFEness of this pccard_intr handler. Givenimp2003-06-131-0/+4
| | | | | | | | how we registered pccard_intr, it is MPSAFE. However, since we register the pccard_intr handler with the flags of the ISR we call, that is the gating factor. We need do nothing specific here. Prompted by: seeing pccard_intr in a panic.
* In [bsd-nomads:16650] shibagaki-san presented an example product id ofimp2003-04-101-1/+1
| | | | | | | | | | | | | | | 0 in a problem that is being discussed. That means that the test for product != 0 may cause problems. Looking at pccarddevs (which i should have done earlier) we see: product BONDWELL B236 0x0000 Game Card Joystick product CONTEC CNETPC 0x0000 Contec C-NET(PC)C product IBM MICRODRIVE 0x0000 IBM Microdrive product RAYTHEON WLAN 0x0000 WLAN Adapter product SOCKET EA_ETHER 0x0000 Socket Communications EA product TDK LAK_CD011WL 0x0000 TDK LAK-CD011WL so use only the vendor field for the end sentinel.
* 1.77 was bogus: there is no logic bug. Back it out and compare theimp2003-04-091-1/+1
| | | | correct fields instead.
* Fix a logic bug in previous commit (use || rather than &&). In order tojhb2003-04-091-1/+1
| | | | | terminate the loop only when both the name and vendor are zero, we should keep looping so long as either one is not zero.
* Make sure that both pp_name and pp_vendor are zero to know we're at theimp2003-04-091-4/+5
| | | | | end of the list now that some valid entries don't have pp_name set. Also, don't print a warning if pp->name is NULL and it is a total wildcard.
OpenPOWER on IntegriCloud