summaryrefslogtreecommitdiffstats
path: root/sys/dev/cardbus/cardbus_cis.c
Commit message (Collapse)AuthorAgeFilesLines
* Partially revert 222753: If a CardBus card stores its CIS in a BAR, deletejhb2011-09-121-0/+1
| | | | | | | | | the BAR after parsing the CIS. This forces the resource range to be reallocated if the BAR is reused by the device. Submitted by: deischen Reviewed by: imp Approved by: re (kib)
* Minor cleanup:imp2011-06-211-5/+16
| | | | | | | | o Consider No CIS a normal event and stop whining about it so much (too many cards are like this, espeically usb/firewire cards). o Add comments to the cis reading code. o Made the read from config space a smidge easier to read and eliminate a loop that can be done mathematically.
* More properly handle Cardbus cards that that store their CIS in a BAR afterjhb2011-06-061-3/+2
| | | | | | | | | the recent changes to track BAR state explicitly. The code would now attempt to add the same BAR twice in this case. Instead, change this so that it recognizes this case and only adds it once and do not delete the BAR outright after parsing the CIS. Tested by: bschmidt
* Fix an error case I missed in the previous change so that the CIS resourcejhb2009-12-301-2/+2
| | | | is fully cleaned up if we fail to find the CIS in the devices ROM.
* Delete the CIS resource after releasing it. This is needed when the CIS isjhb2009-12-301-2/+3
| | | | | | stored in a BAR since the CIS BAR is mapped before the PCI bus driver enumerates all the BARs. Without this change, the PCI bus driver would attempt to initialize a BAR that was already allocated resulting in a panic.
* Teach the PCI bus driver to handle PCIR_BIOS BARs properly and remove specialjhb2009-12-301-6/+0
| | | | | | | | | handling for the PCIR_BIOS decoding enable bit from the cardbus driver. The PCIR_BIOS BAR does include type bits like other BARs. Instead, it is always a 32-bit non-prefetchable memory BAR where the low bit is used as a flag to enable decoding. Reviewed by: imp
* Use bus_*() rather than bus_space_*().jhb2009-12-301-17/+7
|
* Minorly improved debugging. Use the DEVPRINTF macro and report theimp2009-03-131-13/+7
| | | | offset for memory when mapping in the CIS.
* Overhaul of CIS parsing, next step: keep a cached copy of the CIS,imp2008-11-171-0/+1
| | | | | | | | | read before we configure the card, so we can implement /dev/cardbus*.cis. Also, do this on a per-child basis, so we now have a different name than before. I think i'll have to fix that for some legacy tools to keep working. I can now do a dumpcis on my running atheros card and have it still work!
* First step in cleaning up CIS parsing and /dev/cardbus*.cis: removeimp2008-11-151-18/+16
| | | | | | redundant malloc/free. Add comments about how this should really be done. Fix an overly verbose comment about under 1MB mapping: go ahead and set the bits, but we ignore them.
* Use child (the card) in preference to cbdev (the bridge) whenimp2008-11-031-2/+4
| | | | | | | | | | | allocating resources to read the CIS. I'm not sure when this changed, but it is totally wrong. Also, add a minor improvement to the debugging. This should help everybody trying to run dumpcis on atheros wireless card as well. MFC after: 2 days
* gcc 4.2 thinks that tupleid is uninitialized. Or might be usedimp2007-06-081-1/+1
| | | | | | | uninitialized. It gets passed into other routines that initialize it... Cope by initializing. Submitted by: mjacob
* Change PCIM_CIS_ASI_TUPLE to _CONFIG.imp2007-05-161-1/+1
| | | | | | Add PCI_MAX_BAR_0 minor style nit. Add PCIM_CIS_CONFIG_MASK
* Minor cleanup of CIS parsing.imp2006-06-121-5/+1
|
* Better error message when the CIS is a non-standards conforming '0'.imp2006-06-121-1/+3
|
* Use the child to allocate the resource rather than bridge, since we'reimp2006-01-031-41/+6
| | | | | | | | | | allocating a resource that's in the card itself. Remove more now-redundant resource_list_add, and now-redunant code that lives in the pci layer. # This fixes the atheros card that I have which had its CIS in one of # the BARs. Don't know yet if this fixes the amd64 issues reported.
* Minor style(9) hacking, plus use a macro in place of (struct resource *)~0ULimp2006-01-031-6/+7
| | | | (what the heck does that mean?).
* Fixing build bustage.avatar2005-12-311-1/+1
|
* The RID2BAR macro returns a number, not a bitmask. Fix this.imp2005-12-301-4/+6
| | | | Spotted by: ru, jhb
* Retire BARBIT in favor of new PCI_RID2BAR.imp2005-12-291-4/+4
|
* Implement /dev/cardbus%d.cis, same thing as /dev/pccard%d.cis. Thereimp2005-12-291-71/+49
| | | | | are some rough edges with this still, but it seems to work well enough to commit.
* Eliminate even more duplication, and move some definitions into pcireg.himp2005-10-281-19/+19
|
* Simplify code a little, prefer PCI?_FOO registers where possible.imp2005-10-281-15/+9
|
* Be more verbose on errors with CIS reading. This should be a noop, butimp2005-02-201-4/+9
| | | | | appears to fix the ath problem that had been reported. I don't see how it can, so there's likely some other hidden bug.
* Move resource allocation routines from cardbus_cis.c to cardbus.c.imp2005-02-061-315/+3
| | | | | | | | | | | They have nothing at all to do with CIS parsing. Remove some unused funce parsing: nothing used the results. Use more of pccard_cis.h's deifnitions for the cardbus specific cis parsing we do. More work is needed in this area. This reduces the size of the cardbus module by 380 bytes or so...
* Use the standard FreeBSD licenseimp2005-01-131-8/+5
| | | | Approved by: imp, jon
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Add note about why we're ignoring the below 1MB bit.imp2004-04-111-0/+19
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-2/+1
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* remove obsolete quirks for cardbus cis. none have proven to be needed.imp2003-10-071-25/+3
|
* o move the cis tuple definitions into a common file.imp2003-10-071-35/+4
| | | | | | 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.
* Remove prototype for decode_tuple_copy() which was axed in the lastjhb2003-10-061-3/+0
| | | | revision to fix compile.
* remove the cardbus cis reading code. nobody ever used it and it hasimp2003-10-061-109/+0
| | | | locking issues down to the api level.
* Use PCIR_BAR(x) instead of PCIR_MAPS.jhb2003-09-021-1/+1
| | | | | Glanced over by: imp, gibbs Tested by: i386 LINT
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* Don't leak "barlist" allocation on failure.phk2003-06-011-0/+4
| | | | Found by: FlexeLint
* Ignore the 'must allocate below 1MB' flag for the TPL_BAR_REG. It isimp2003-05-241-0/+2
| | | | | | | | | | | | set on realtek cards, but they work without it (and don't work with it). The standard seems to imply that this is just a hint anyway, so this should be harmless. It doesn't appear to be set on any other cardbus cards that I have (or have seen). This should make the rl based CardBus cards work again. I've been running it for about a month now. Approved by: re@ (jhb)
* MFp4: when you can't allocate a resource, print a message, don't panic.imp2003-04-081-0/+19
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-3/+3
| | | | Approved by: trb
* Move the resource handling down into the pci bus as well.imp2003-02-181-90/+39
| | | | | | | | | | | Minor CIS resource allocation code cleanup Remove some fairly useless debug writes. This finishes the work to move as much cardbus code as possible into pci. We wind up removing 800-odd lines from cardbus.c: we go from 1285 to 400 lines. Reviewed by: mdodd
* Sanity check the BAR length reported by the CIS with the BAR length thatscottl2003-02-171-4/+22
| | | | | | | | is encoded in the PCI BAR. The latter is more reliable. This allows the sio/modem function of the Xircom RealPort ethernet+modem card to work. Note that there still seem to be issues with sio_pci not releasing resources on detach.
* Clean up the CIS BAR parsing code by removing several pointless checks.scottl2003-02-161-19/+19
| | | | Don't complain about the Option ROM BAR type since it's perfectly valid.
* MF-p4:imp2003-02-121-80/+154
| | | | | | | | | | | | | Kill the slightly bogus #define for DECODE_PROTOTYPE Be less verbose. Hide most (all I hope) of the CIS parsing behind cardbus_debug_cis (which is set with hw.cardbus.debug_cis=1). This doesn't fix problems with parsing, but should make cardbus less chatty. There appears to be some issues still with the parsing of the CIS, but this won't fix them. Prompted by: scottl
* Whitespace nits.imp2003-02-121-2/+2
|
* MFp4:imp2003-01-271-37/+37
| | | | u_int*_t -> uint*_t to conform more closely with C99.
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-3/+3
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Implement PCI_IVAR_ETHADDR. Cardbus has the MAC addr in the CIS,imp2002-11-271-2/+65
| | | | | | | | sometimes, so return it when requested and it does. Also a little more infrastructure for a few other things. Submitted by: sam Approved by: re (blanket for NEWCARD)
* minor correction to commentimp2002-11-141-1/+1
|
* When parsing the CIS, if a BAR tuple is encountered, enable the correspondingscottl2002-11-131-0/+5
| | | | | | | | | bit in the PCI command register for the device. Otherwise, device drivers that look at this register to see which types of BARs are usable will think that none of them are. This allows my Adaptec 1480A cardbus card to finally work. Reviewed by: imp
* Fix two typos from the previous commit. This code is definitely infectious.scottl2002-11-121-2/+2
|
OpenPOWER on IntegriCloud