summaryrefslogtreecommitdiffstats
path: root/sys/dev/cardbus
Commit message (Collapse)AuthorAgeFilesLines
* Move the resource handling down into the pci bus as well.imp2003-02-182-410/+49
| | | | | | | | | | | 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.
* Move the pnp and location info into the common pci bus. Make all knownimp2003-02-171-46/+4
| | | | | | | | | pci busses implement this. Also minor comment smithing in cardbus. Fix copyright to this year with my name on it since I've been doing a lot to this file. Reviewed by: jhb
* Kill a now-bogus commentimp2003-02-171-4/+0
|
* Move call to pci_print_verbose until after all the variables that itimp2003-02-171-1/+1
| | | | | | depends on. Pointy hat to: imp (anybody know if these things are accepted at Eco-Cycle?)
* Checkpoint a work in progress:imp2003-02-161-532/+23
| | | | | | | | | | | | | | | | | | o Use the common pci_* routines in preference to the copied and hacked routines from an ancient pci.c. This saves 509 lines in cardbus.c. More savings to follow when I convert the resource code over. In the past when I've done this the resource code conversion breaks cardbus in subtle ways so I'm doing a 1/2 way checkpoint this time. cardbus still works for me the same as it did before. It also looks like cardbus devices now show up as pci bus devices to pciconf -l, but maybe that was happening before. Inspired by a patch from Justin Gibbs many moons ago. When he finishes his kobj multiple inheritance work, we can transition the finished version of this work to that fairly easily.
* 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
* MFp4:imp2003-02-121-0/+11
| | | | | | | | | | | Second part of the kldload patches for cardbus. This makes kldload of a driver for a device that's inserted now appears to work. To make it work, we only do a power cycle of the card if there's no children drivers attached. This likely is papering over bogosities in the power system. The power sequence needs to be re-written, so I'll not worry about the papering over until the re-write.
* MFp4:imp2003-02-121-7/+5
| | | | Don't reach inside of rman to r_dev. Use rman_get_device instead.
* Whitespace nits.imp2003-02-121-2/+2
|
* Don't turn off the power of cards when new drivers are addedimp2003-02-111-19/+13
| | | | | | | | unconditionally. kldloading a cardbus driver was shooting down other attached devices because most drivers assume that one cannot power-cycle cards w/o the driver knowning about it. Submitted by: simokawa-san
* MFp4:imp2003-01-274-63/+63
| | | | u_int*_t -> uint*_t to conform more closely with C99.
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-212-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Need more parens here.imp2002-11-271-1/+1
| | | | Approved by: re (blanket)
* Implement PCI_IVAR_ETHADDR. Cardbus has the MAC addr in the CIS,imp2002-11-274-3/+97
| | | | | | | | 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)
* MFp4:imp2002-11-141-10/+7
| | | | | o Add a diagnostic for an 'impossible' condition. o Collapse common code.
* 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
|
* Step one of cleaning and fixing cardbus:scottl2002-11-121-65/+92
| | | | | | | | | | | | | - Fix some especially bad style in the CIS BAR tuple parsing code. - activate Option ROMS correctly. - de-obfuscate the Option ROM image selection code. - Fix mis-interpretation of the PCI spec that prevented Option ROMs whose CIS section wasn't in the first image from working. - Fix mis-interpretation of the PCI spec that prevented CIS's mapped into MEMIO space from working at all. - Reject invalid CIS pointers. Reviewed by: imp
* Use the explicit value 0xffffffff instead of assuming that is what ~0ULjhb2002-11-061-1/+1
| | | | | | equals. Approved by: imp
* MFp4:imp2002-11-021-36/+25
| | | | | | | | | | | | | | | o Always release the resources on device detach. o Attach resources the same with driver added as we do we do in the insert case (maybe this should be a routine). o signal the wakeup of the thread on resume instead of trying to force an interrupt. o Minor debug hacks. o use 0xffffffff instead of -1 for uint32_t items. o Don't complain when we're asked to detach no cards. This is normal. o Eliminate the now worthless second parameter to card_detach_card. o minor style(9)isms Some of these patches may be from: iwasaki-san, jhb, iadowse
* o Add routines to return the location and pnpinfo for this card.imp2002-10-071-46/+83
| | | | | | | | | | | | Note, we return the PCI pnp info, but in fact that's wrong to do since that data is not defined for CardBus cards. CardBus says that these registers are undefined and one should use the CIS to do device matching. To date, all CardBus cards have had these registered defined, no doubt because they are using common silicon to produce both the PCI cards and the CardBus cards. However, it isn't any worse than the rest of the system, so just note it in passing and move on. o Also sort prototypes while I'm here.
* Don't abuse the fact that -a == ~a + 1. Signed vs unsigned checkersimp2002-10-071-1/+1
| | | | | | | complain when a is a unsigned type. So instead use the latter here and be on our way. Spotted by: flexlint by way of phk
* Add extra set of parens around the barbit macro to make it clear whatimp2002-10-071-1/+1
| | | | | | we're intending to shift. Spotted by: flexlint by way of phk (should fix about 40 messages)
* Don't leak the bar list for each thing we allocate.imp2002-09-291-1/+3
| | | | | | # This code really needs a rewrite Spotted by the eagle eyes of: phk
* - Forgot to remove `cardattached` declaration in revision 1.22.arr2002-09-101-1/+1
|
* Remove more bogus reprobe code. I don't think it is needed here either.imp2002-09-101-14/+1
|
* pccbb -> cbbimp2002-08-151-1/+1
|
* Silence warning.alfred2002-06-011-2/+2
| | | | | When casting a "const void *" to a "struct foo **" you want to actually cast it to "struct foo * const *" not simply "const struct foo **".
* Make oldcard and newcard kernel module work.takawata2002-05-302-2/+4
|
* Revert most of the recent PCI merge. This has proven to be tooimp2002-03-152-126/+971
| | | | | unstable for the coming DP1 release. Instead, I'll develop that on the IMP_CB_MERGE branch until it is more stable.
* Cleanup the recent cardbus cleanups. This fixes some of the panicsimp2002-03-132-50/+31
| | | | | that I introduced with -v. However, other problems still remain (including the loss of interrupts).
* Don't use __FBSDID yet. Looks like most (all?) of the rest of the kernelimp2002-03-072-4/+0
| | | | doesn't do that.
* Implement hw.cardbus.debug and hw.cardbus.cis_debug to help debug someimp2002-03-072-24/+25
| | | | of the cardbus problems that people may start seeing.
* Two style(9) fixes:imp2002-03-071-53/+50
| | | | | - return(foo); (note parens) - use __FBSDID()
* Check for NULL on resource allocation. For the moment, punt, but we shouldimp2002-03-071-0/+18
| | | | be smarter about a) cleanup and b) fallback.
* Use the pci.c code wherever possible, rather than copying all the pciimp2002-02-273-986/+104
| | | | | | | | | | | | | | code into cardbus and s/pci/cardbus. This exposes a few pci_* functions that are now static. This work is similar to work Justin posted to the mobile list about a year or two ago, which I have neglected since then. This is a subset of his current work with the multiple inheritance newbus architecutre. When completed, that will eliminate the need for pci/pci_private.h. Similar work is needed for the cardbus_cis and pccard_cis code as well.
* Get rid of the bogus DETACH_NOWARN and don't warn when asked to detachimp2002-02-071-4/+3
| | | | | a card that isn't there unless we're booting verbose. It serves no purpose.
* Add support for suspending/resuming CardBus bridges.imp2001-12-151-3/+16
| | | | | | | We really should have and use power state information, but none exists today. Submitted by: YAMAMOTO Shigeru-san <shigeru@iij.ad.jp>
* Part two of this NEWCARD update:jon2001-08-274-367/+1037
| | | | | | | | | | | | | | | | Briefly, the significant changes include: * Way better resource management in pccbb, pccard and cardbus. * pccard hot-removal now appears to work. * support pre-fetchable memory in cardbus. * update cardbus to support new pci bus interface functions. * Fix CIS reading to no longer use rman_get_virtual(). What's not there, but in the works: * pccard needs to do interrupt properly and not read the ISR on single function cards. * real resource management for pccard * a complete implementation of CIS parsing * need to look into how to correctly use mutex in pccbb
* Non-functional changes to NEWCARD stuff.jon2001-08-265-414/+429
| | | | | | | | | | | | This is the first part of a two-part update to NEWCARD. Changes in this commit are non-functional, and includes the following: * indentation and other changes to meet style(9). * other minor style consistancy changes * addition of comments * renaming of device_t variables to be consistant across all of NEWCARD. (note that not all style violations are fixed in this commit -- those that aren't will be clobbered by the next commit.)
* Use bus_space when reading CIS. This allows us to access it in 8 bitimp2001-06-051-7/+11
| | | | | | | mode, which is what the standard mandates. Submitted by: Takanori Watanabe-san Reviewed by: jhb
* Fix memory leaks with dev_get_children().imp2001-02-081-0/+3
| | | | Submitted by: Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
* Fix typo: wierd -> weird.asmodai2001-02-061-1/+1
| | | | There is no such thing as wierd in the english language.
* This cannot possibly be right:peter2001-01-071-2/+2
| | | | | | | | foo(int *nret) { for (i = 0; i < nret; i++) { free(array[i], .... Fix to do the logically correct thing.. (s/nret/*nret/)
* * Better kld support in pccbb/cardbusjon2001-01-063-89/+245
| | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Don't try to free the now-nonexistent hdrspec field. This one snuck bymsmith2000-12-131-2/+0
| | | | me in the previous round of patches. Oops.
* Updates to match changes elsewhere in the PCI subsystem:msmith2000-12-131-97/+1
| | | | | | | | | - 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.
OpenPOWER on IntegriCloud