summaryrefslogtreecommitdiff
path: root/drivers/pcmcia/cistpl.c
AgeCommit message (Collapse)Author
2010-09-29pcmcia: convert pcmcia_request_configuration to pcmcia_enable_deviceDominik Brodowski
pcmcia_enable_device() now replaces pcmcia_request_configuration(). Instead of config_req_t, all necessary flags are either passed as a parameter to pcmcia_enable_device(), or (in rare circumstances) set in struct pcmcia_device -> flags. With the last remaining user of include/pcmcia/cs.h gone, remove all references. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-ide@vger.kernel.org CC: linux-usb@vger.kernel.org CC: laforge@gnumonks.org CC: linux-mtd@lists.infradead.org CC: alsa-devel@alsa-project.org CC: linux-serial@vger.kernel.org CC: Jiri Kosina <jkosina@suse.cz> CC: linux-scsi@vger.kernel.org Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> (for drivers/bluetooth) Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-08-03pcmcia: move local definitions out of include/pcmcia/cs.hDominik Brodowski
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-08-03pcmcia: use pcmica_{read,write}_config_byteDominik Brodowski
Use pcmcia_read_config_byte and pcmcia_write_config_byte instead of pcmcia_access_configuration_register. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-serial@vger.kernel.org CC: Michael Buesch <mb@bu3sch.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-07-30pcmcia: remove cs_types.hDominik Brodowski
Remove cs_types.h which is no longer needed: Most definitions aren't used at all, a few can be made away with, and two remaining definitions (typedefs, unfortunatley) may be moved to more specific places. CC: linux-ide@vger.kernel.org CC: linux-usb@vger.kernel.org CC: laforge@gnumonks.org CC: linux-mtd@lists.infradead.org CC: alsa-devel@alsa-project.org CC: linux-serial@vger.kernel.org Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/) Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-05-21sysfs: add struct file* to bin_attr callbacksChris Wright
This allows bin_attr->read,write,mmap callbacks to check file specific data (such as inode owner) as part of any privilege validation. Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-10pcmcia: call pcmcia_{read,write}_cis_mem with ops_mutex heldDominik Brodowski
This avoids multiple lock takings in several codepaths. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-05-10pcmcia: move high level CIS access code to separate fileDominik Brodowski
No code changes. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-04-17pcmcia: avoid late calls to pccard_validate_cisDominik Brodowski
pccard_validate_cis() nowadays destroys the CIS cache. Therefore, calling it after card setup should be avoided. We can't control the deprecated PCMCIA ioctl (which is only used on ARM nowadays), but we can avoid -- and report -- any other calls. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-03-03pcmcia: CodingStyle fixesDominik Brodowski
Fix most of the remaining CodingStyle issues in drivers/pcmcia , which related to wrong indent -- PCMCIA historically used 4 spaces. Also, remove a custom min() implementation with the generic one. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: use read_cis_mem return valueDominik Brodowski
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: add locking to pcmcia_{read,write}_cis_memDominik Brodowski
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: delay re-scanning and re-querying of PCMCIA busDominik Brodowski
After a CIS update -- or the finalization of the resource database --, proceed with the re-scanning or re-querying of PCMCIA cards only in a separate thread to avoid deadlocks. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: also lock fake and cache CIS by ops_mutexDominik Brodowski
Specifically, struct list_head cis_cache; size_t fake_cis_len; u8 *fake_cis; are protected. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: add locking to set_mem_map()Dominik Brodowski
Protect the pccard_operations callback "set_mem_map" by a new mutex ops_mutex. This mutex also protects the following values in struct pcmcia_socket: pccard_mem_map win[] pccard_mem_map cis_mem void __iomem *cis_virt Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: move cistpl.c into pcmcia moduleDominik Brodowski
As PCMCIA is the only real user of CIS access functions, include cistpl.c in the PCMCIA module, not in the PCMCIA & CardBus core module. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: CardBus doesn't need CIS accessDominik Brodowski
At least no in-kernel CardBus-capable PCI driver makes use of the CIS access functions. Therefore, it seems sensible to remove this unused code, and cleanup cardbus.c a lot. CC: Jesse Barnes <jbarnes@virtuousgeek.org> CC: Linus Torvalds <torvalds@linux-foundation.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: improve check for same card in slot after resumeDominik Brodowski
During a suspend/resume cycle, an user may change the card in the PCMCIA/CardBus slot. The pcmcia_core can at least look at the socket state to check whether it is the same. For PCMCIA devices, move the detection and handling of such a change to ds.c. For CardBus devices, the PCI hotplug interface doesn't offer a "rescan" facility which also _removes_ devices no longer to be found behind a bridge. Therefore, remove and re-add all devices unconditionally. CC: Jesse Barnes <jbarnes@virtuousgeek.org> CC: Linus Torvalds <torvalds@linux-foundation.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: cleanup pccard_validate_cis()Dominik Brodowski
Cleanup pccard_validate_cis() and make it return an error code on all failures, not merely on some failures. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: validate CIS, not CIS cache.Dominik Brodowski
In pccard_validate_cis(), validate the card CIS, not the CIS cache. Also, destroy the CIS cache if pccard_validate_cis fails. Furthermore, do not remove the fake CIS in destroy_cis_cache() but do so explicitely in the code paths where it makes sense. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2009-12-07pcmcia: CodingStyle fixesDominik Brodowski
Fix several CodingStyle issues in drivers/pcmcia/ . checkpatch.pl no longer reports errors in the PCMCIA core. The remaining warnings mostly relate to wrong indent -- PCMCIA historically used 4 spaces --, to lines over 80 characters and to hundreds of typedefs. The cleanup of those will follow in the future. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2009-11-08pcmcia: use dynamic debug instead of custom infrastructureDominik Brodowski
Use the generic "dynamic debug" infrastructure instead of CONIG_PCMCIA_DEBUG in the PCMCIA core (pcmcia.ko and pcmcia_core.ko). To enable debugging, enable CONFIG_DYNAMIC_DEBUG, mount debugfs and $ echo -n 'module pcmcia_core +p' > /sys/kernel/debug/dynamic_debug/control for the complete module "pcmcia_core", for example. For more detailled instructions, please see Documentation/dynamic-debug-howto.txt Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2009-11-08pcmcia: add new CIS access helpersDominik Brodowski
As a replacement to pcmcia_get_{first,next}_tuple() and pcmcia_get_tuple_data(), three new -- and easier to use -- functions are added: - pcmcia_get_tuple() to get the very first CIS entry of one type. - pcmcia_loop_tuple() to loop over all CIS entries of one type. - pcmcia_get_mac_from_cis() to read out the hardware MAC address from CISTPL_FUNCE. Only a handful of drivers need these functions anyway, as most CIS access is already handled by pcmcia_loop_config(), which now shares the same backed (pccard_loop_tuple()) with pcmcia_loop_tuple(). A pcmcia_get_mac_from_cis() bug noted by Komuro <komurojun-mbn@nifty.com> has been fixed in this revision. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2009-10-19pcmcia: pccard_read_tuple and TUPLE_RETURN_COMMON cleanupDominik Brodowski
pccard_read_tuple(), which is only used by the PCMCIA core, should handle TUPLE_RETURN_COMMON more sensibly: If a specific function (which may be 0) is requested, set tuple.Attributes = 0 as was done in all PCMCIA drivers. If, however, BIND_FN_ALL is requested, return the "common" tuple. As to the callers of pccard_read_tuple(): - All calls to pcmcia_validate_cis() had set the "function" parameter to BIND_FN_ALL. Therefore, remove the "function" parameter and make the parameter to pccard_read_tuple explicit. - Calls to CISTPL_VERS_1 and CISTPL_MANFID now set BIND_FN_ALL. This was already the case for calls to CISTPL_LONGLINK_MFC. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-11-02pcmcia: add braces in error pathDominik Brodowski
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-31pcmcia: remove unused argument to pcmcia_parse_tuple()Dominik Brodowski
Since we're just parsing the tuple being passed to this function, we don't need any device-specific information. Also, remove the call to pcmcia_validate_cis() from pcmciamtd.c, since it is already called by the PCMCIA core. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23pcmcia: deprecate CS_BAD_TUPLEDominik Brodowski
CS_BAD_TUPLE was used to denote a bad tuple being passed to the parse function. Therefore, replace it with -EINVAL and a verbose message. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23pcmcia: deprecate CS_NO_MORE_ITEMSDominik Brodowski
CS_NO_MORE_ITEMS is returned by the CIS tuple reading and parsing code if the end of a tuple chain is reached. As at least one PCMCIA driver relies on matching this return value, replace it with -ENOSPC which is now uniquely used for this purpose within the in-kernel pcmcia subsystem. CC: Russell King <rmk+kernel@arm.linux.org.uk> CC: linux-serial@vger.kernel.org CC: Michael Buesch <mb@bu3sch.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23pcmcia: deprecate CS_BAD_HANDLEDominik Brodowski
CS_BAD_HANDLE means that something went badly wrong: no parameter was passed, or the paramater passed wasn't the correct one. Therefore, replace it with -EINVAL. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23pcmcia: deprecate CS_NO_CARDDominik Brodowski
It means that no card can be detected in the socket, so return -ENODEV Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23pcmcia: deprecate CS_UNSUPPORTED_*Dominik Brodowski
CS_UNSUPPORTED_MODE and CS_UNSUPPORTED_FUNCTION were mostly used to denote trying to use PCMCIA functions on CardBus cards. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23pcmcia: deprecate CS_OUT_OF_RESOURCEDominik Brodowski
CS_OUT_OF_RESOURCE was almost only used to note -ENOMEM situations. Therefore, use -ENOMEM explicitely, and also print out warnings. CC: netdev@vger.kernel.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23pcmcia: deprecate CS_SUCCESSDominik Brodowski
Instead of using own error or success codes, the PCMCIA code should rely on the generic return values. Therefore, replace all occurrences of CS_SUCCESS with 0. CC: netdev@vger.kernel.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23Merge branches 'pcmcia-config-loop' and 'pcmcia-printk' into pcmciaDominik Brodowski
* pcmcia-config-loop: pcmcia: pcmcia_config_loop() improvement by passing vcc pcmcia: pcmcia_config_loop() default CIS entry handling pcmcia: pcmcia_config_loop() ConfigIndex unification pcmcia: use pcmcia_loop_config in misc pcmcia drivers pcmcia: use pcmcia_loop_config in net pcmcia drivers pcmcia: use pcmcia_loop_config in ISDN pcmcia drivers pcmcia: use pcmcia_loop_config in scsi pcmcia drivers pcmcia: use pcmcia_loop_config in bluetooth drivers pcmcia: use pcmcia_loop_config in pata and ide drivers pcmcia: add pcmcia_loop_config() helper * pcmcia-printk: pcmcia: don't add extra DEBUG cflag pcmcia: remove unused cs_socket_name() definition pcmcia: use dev_printk in module rsrc_nonstatic pcmcia: use dev_printk in module pcmcia pcmcia: use dev_printk in module pcmcia_core pcmcia: use dev_printk and dev_dbg in yenta_socket
2008-08-23pcmcia: use dev_printk in module pcmcia_coreDominik Brodowski
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-02pcmcia: only copy CIS override data onceDominik Brodowski
Instead of copying CIS override data in socket_sysfs.c or ds.c, and then again in cistpl.c, only do so once. Also, cisdump_t is now only used by the deprecated ioctl. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-07-15pcmcia: fix cisinfo_t removalMarc Zyngier
The cisinfo_t removal patch (c5081d5f4775b2a3f858f91151bbf9163e473075 pcmcia: simplify pccard_validate_cis ) introduced a bug that prevented card detection, for the (info->Chains == MAX_TUPLES) check was replaced by (count), which is always true. Restoring the comparison to MAX_TUPLES makes everybody happy... [linux@dominikbrodowski.net: update changelog comment] Signed-off-by: Marc Zyngier <marc.zyngier@altran.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-06-24pcmcia: remove unused bulkmem.hMagnus Damm
The code in include/pcmcia/bulkmem.h was only kept for compatibility reasons. Therefore, move the remaining region_info_t definition to ds.h [linux@dominikbrodowski.net: do not modify the IOCTL, move definition to ds.h, and update changelog] Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-06-24pcmcia: simplify pccard_validate_cisDominik Brodowski
As cisinfo_t only contains one unsigned_int, pccard_validate_cis can be simplified by passing that around directly. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-04-29pcmcia: use get/put_unaligned_* helpersHarvey Harrison
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Daniel Ritz <daniel.ritz@gmx.ch> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16pcmcia: cistpl: use get_unaligned() in CIS parsingDaniel Ritz
Based on a patch by Haavard Skinnemoen posted to linux-pcmcia, but using static inlines for readability reasons. this should fix PCMCIA an AVR32 Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-14[PATCH] remove many unneeded #includes of sched.hTim Schmielau
After Al Viro (finally) succeeded in removing the sched.h #include in module.h recently, it makes sense again to remove other superfluous sched.h includes. There are quite a lot of files which include it but don't actually need anything defined in there. Presumably these includes were once needed for macros that used to live in sched.h, but moved to other header files in the course of cleaning it up. To ease the pain, this time I did not fiddle with any header files and only removed #includes from .c-files, which tend to cause less trouble. Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha, arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig, allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all configs in arch/arm/configs on arm. I also checked that no new warnings were introduced by the patch (actually, some warnings are removed that were emitted by unnecessarily included header files). Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2006-03-31[PATCH] pcmcia: remove include of config.hDominik Brodowski
Remove the inclusion of include/config.h as it isn't needed any longer. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06[PATCH] drivers/pcmcia/cistpl.c: fix endian warningsAlexey Dobriyan
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-05[PATCH] pcmcia: avoid macro usage in cistplPavel Machek
Fix macro abuse in pcmcia. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2005-11-07[PATCH] kfree cleanup: misc remaining driversJesper Juhl
This is the remaining misc drivers/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in misc files in drivers/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> Acked-by: Roland Dreier <rolandd@cisco.com> Acked-by: Pierre Ossman <drzeus@drzeus.cx> Acked-by: Jean Delvare <khali@linux-fr.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Len Brown <len.brown@intel.com> Acked-by: "Antonino A. Daplas" <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-28[PATCH] pcmcia: avoid duble iounmap of one addressDominik Brodowski
Avoid double iounmap of one address, and disable cis_virt if set_mem_map failed. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-27[PATCH] pcmcia: resource handling fixesDominik Brodowski
- properly bail out in set_cis_map if call to socket driver's set_mem_map failed - don't abort do_mem_probe cycle if one entry failed (!CONFIG_PCMCIA_PROBE) - don't do iomem probing in chunks larger than 0x800000 (1 << 23) as yenta_socket and vrc4173_cardu.c fail to set_mem_map for windows equal to or larger than (1 << 24). Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-27[PATCH] pcmcia: cs.c cleanupDominik Brodowski
Clean up cs.c Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-27[PATCH] pcmcia: move pcmcia resource handling out of cs.cDominik Brodowski
Move the 16-bit PCMICA resource handling from pcmcia_core.o to pcmcia.o. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-27[PATCH] pcmcia: rename some functionsDominik Brodowski
Rename some functions in drivers/pcmcia/ to show they belong to the PCMCIA subsystem. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>