Commit Graph

54 Commits

Author SHA1 Message Date
Dominik Brodowski 2f3061eb10 pcmcia: remove unused argument to pcmcia_parse_tuple()
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-31 15:50:33 +02:00
Dominik Brodowski 635d19bea0 pcmcia: deprecate CS_NO_MORE_ITEMS
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-23 02:29:54 +02:00
Dominik Brodowski 4c89e88bfd pcmcia: deprecate CS_SUCCESS
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-23 02:29:26 +02:00
Dominik Brodowski ef313e36d8 pcmcia: remove remaining in-kernel pcmcia_get_configuration_info() users
Remove the three remaining pcmcia_get_configuration_info() users:
- pcmciamtd is marked broken anyway.
- serial_cs.c can access the relevant structs directly
- ipwireless didn't use the output

CC: linux-serial@vger.kernel.org
CC: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23 02:02:05 +02:00
Dominik Brodowski ad913c1192 pcmcia: pcmcia_config_loop() improvement by passing vcc
By passing the current Vcc setting to the pcmcia_config_loop callback
function, we can remove pcmcia_get_configuration_info() calls from many
drivers.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23 01:22:52 +02:00
Dominik Brodowski 8e2fc39dde pcmcia: pcmcia_config_loop() default CIS entry handling
Many drivers use the default CIS entry within their pcmcia_config_loop()
callback function. Therefore, factor the default CIS entry handling out.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23 01:22:00 +02:00
Dominik Brodowski 498ac1899b pcmcia: pcmcia_config_loop() ConfigIndex unification
Almost all drivers set p_dev->conf.ConfigIndex to cfg->index in
the pcmcia_config_loop() callback function. Therefore, factor it out.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23 01:21:29 +02:00
Dominik Brodowski 84e2d34004 pcmcia: use pcmcia_loop_config in misc pcmcia drivers
Use the config loop helper in misc pcmcia drivers.

CC: Harald Welte <laforge@gnumonks.org>
CC: <linux-parport@lists.infradead.org>
CC: Russell King <rmk+kernel@arm.linux.org.uk>
CC: Ed Okerson <eokerson@quicknet.net>
CC: linux-serial@vger.kernel.org
CC: boti@rocketmail.com
CC: linux-usb@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2008-08-23 01:21:29 +02:00
Olof Johansson 906da809c5 pcmcia: replace kio_addr_t with unsigned int everywhere
Remove kio_addr_t, and replace it with unsigned int.  No known architecture
needs more than 32 bits for IO addresses and ports and having a separate type
for it is just messy.

Signed-off-by: Olof Johansson <olof@lixom.net>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-05 09:44:08 -08:00
Komuro 5e7bf8cc60 netdrvr/pcmcia: use IRQ_TYPE_DYNAMIC_SHARING flag for irq.Attributes.
The drivers below support IRQ-sharing.

3c574_cs, 3c589_cs, pcnet_cs,
axnet_cs, smc91c92_cs, fmvj18x_cs.
xirc2ps_cs, serial_cs.

Signed-off-by: Komuro <komurojun-mbn@nifty.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29 06:07:05 -04:00
Eric Leblond 64da82efae Add support for PCMCIA card Sierra WIreless AC850
Add support for Sierra Wireless AC850 which has the same Ids as the
AC710/750 but has a different firmware.

Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 09:42:50 -07:00
Attila Kinali 9d9b7ad717 Add manufacturer and card id of teltonica pcmcia modems
Add the manufacturer and card id of teltonica pcmcia modems to serial_cs.c

Signed-off-by: Attila Kinali <attila@kinali.ch>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-07 16:28:43 -07:00
Komuro 40738f3fcd PCMCIA-NETDEV : add new ID of lan&modem multifunction card
fmvj18x_cs:
      NEC PK-UG-J001
      Panasonic CF-VML201
      Panasonic TO-PDL9610

pcnet_cs:
       MICRO-RESEARCH  MC336LAN

Signed-off-by: Komuro <komurojun-mbn@nifty.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-08 22:16:39 -04:00
Sergei Organov bb289bc46f serial: Add PCMCIA IDs for Quatech DSP-100 dual RS232 adapter.
Add PCMCIA IDs for Quatech DSP-100 dual RS232 adapter.

Signed-off-by: Sergei Organov <osv@javad.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-02-16 15:19:16 -08:00
Tim Schmielau cd354f1ae7 [PATCH] remove many unneeded #includes of sched.h
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>
2007-02-14 08:09:54 -08:00
Burman Yan 8f31bb39ec [PATCH] serial: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-14 08:09:52 -08:00
Dominik Brodowski af2b3b503a [PATCH] pcmcia: conf.ConfigBase and conf.Present consolidation
struct pcmcia_device *p_dev->conf.ConfigBase and .Present are set in almost
all PCMICA driver right at the beginning, using the same calls but slightly
different implementations. Unfiy this in the PCMCIA core.

Includes a small bugfix ("drivers/net/pcmcia/xirc2ps_cs.c: remove unused
label") from and Signed-off-by Adrian Bunk <bunk@stusta.de>

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-12-04 20:12:02 -05:00
Dominik Brodowski efd50585e2 [PATCH] pcmcia: remove manf_id and card_id indirection
As we read out the manufactor and card_id from the PCMCIA device in the
PCMCIA core, and device drivers can access those reliably in struct
pcmcia_device's fields manf_id and card_id, remove additional (and partly
broken) manf_id and card_id detection logic from PCMCIA device drivers.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-12-04 20:09:20 -05:00
Tony Olech 44e5e33e99 [PATCH] pcmcia: IDs for Elan serial PCMCIA devcies
Add IDs for Elan serial PCMCIA devices. In addition, move the
pdaudio_cf driver from matching based on manf_id and card_id to
the more specific prod_id1 and prod_id2 to avoid false
positives.

Signed-off-by: Tony Olech <tony.olech@elandigitalsystems.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-12-04 20:09:19 -05:00
Russell King fe59d5372a [SERIAL] Fix resume handling bug
Unfortunately, pcmcia_dev_present() returns false when a device is
suspended, so checking this on resume does not work too well.  Omit
this test.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-10-01 17:14:07 +01:00
Russell King f3d106881b [SERIAL] serial_cs: Add quirk for brainboxes 2-port RS232 card
Mauro Ziliani reports that this card has a higher clock rate.
Rather than tweak the 8250 driver to handle this, add a quirk to
pass the correct clock rate to the driver.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-10-01 17:06:45 +01:00
Russell King 20f130495c [SERIAL] serial_cs: handle Nokia multi->single port bodge via config quirk
According to the existing code, Nokia only make single-port cards,
but are detected as multi-port cards.  Handle this in roughly the
same way via the config quirk - forcing it to be a real single port
card (info->multi=0) changes the way we allocate the IO memory,
which might stop the card working.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-10-01 17:06:41 +01:00
Russell King efd92dfaad [SERIAL] serial_cs: add configuration quirk
Add a quirk primerily to handle tweaks to the link->conf structure,
eg as required for Socket cards.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-10-01 17:06:37 +01:00
Russell King 7ef057fa70 [SERIAL] serial_cs: Convert Oxford 950 / Possio GCC wakeup quirk
Move the Oxford Semi OX950 / Possio GCC wakeup handling to a quirk
wakeup handler.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-10-01 17:06:34 +01:00
Russell King eee3a883ce [SERIAL] serial_cs: convert IBM post-init handling to a quirk
Move IBM quirk handling into its own quirk entry.  Note that doing
quirk handling after we've registered the ports is racy, but since
I don't know if moving this will have an undesired effect, it's
probably better to leave where it is.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-10-01 17:06:30 +01:00
Russell King a8244b564c [SERIAL] serial_cs: allow wildcarded quirks
Some quirks we will introduce next apply to (eg) all cards of one
manufacturer.  Therefore, we need a way to list these in the quirk
table - use ~0 - this is not a possible device ID value.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-10-01 17:06:27 +01:00
Russell King 1fbbac4bcb [SERIAL] serial_cs: convert multi-port table to quirk table
- rename multi_id table to serial_quirk / quirks[]
- use named initialisers
- store a pointer to the quirk table in the serial_info structure
  so we can use the quirk table entry later.
- apply multi-port quirk after the multi-port guessing code,
  but only if it's != -1.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-10-01 17:06:23 +01:00
Russell King 43549ad7a7 [SERIAL] serial_cs: Use clean up multiport card detection
- Use ARRAY_SIZE() instead of home grown based version.
- use parse->manfid.card rather than le16_to_cpu(buf[1]) -
  manfid.card is already converted to this format.
- use info->prodid in subsequent tests rather than
  parse->manfid.card.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-10-01 17:06:20 +01:00
Dominik Brodowski fec21889cd [PATCH] pcmcia: another ID for serial_cs.c
Add an ID for "GlobeTrotter" cards which need a CIS override

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-06-30 22:09:10 +02:00
Petr Vandrovec 30bac7aa0e [PATCH] pcmcia: Add support for Possio GCC AKA PCMCIA Siemens MC45
This ugly hack add support for Siemens MC45 PCMCIA GPRS card (which is
identical to Possio GCC, and which is offered by one of our local GPRS
providers).  Card has unfortunate feature that after poweron oxcf950 chip
is fully powered and works, but attached MC45 modem is powered down :-(
There is a special sequence (which takes 1 sec :-( ) to poweron MC45 (and
after MC45 powers on, it takes more than 2 secs until firmware fully
boots...) which needs to be executed after all powerons.

I'm really not familiar with PCMCIA subsystem, so I have no idea whether I
should issue request_region() on rest of oxcf950 address range (0-7 is
UART, 8-F are special configuration registers), or how this should be
better integrated with PM system and so on - I just put it in same place
where another hack already lived...

Card uses 18.432MHz XTAL, so to get it to work you must add lines below to
the /etc/pcmcia/serial.opts.

case "$MANFID-$FUNCID-$PRODID_1-$PRODID_2-$PRODID_3-$PRODID_4" in
'030c,0003-2-GPRS-CARD--')
    SERIAL_OPTS="baud_base 1152000"
    ;;
esac

Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:27:07 +02:00
Dominik Brodowski 9940ec3617 [PATCH] pcmcia: convert DEV_OK to pcmcia_dev_present
Instead of the DEV_OK macro, drivers should use pcmcia_dev_present().

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:26:57 +02:00
Dominik Brodowski e2d4096365 [PATCH] pcmcia: use bitfield instead of p_state and state
Instead of the two status values struct pcmcia_device->p_state and state,
use descriptive bitfields. Most value-checking in drivers was invalid, as
the core now only calls the ->remove() (a.k.a. detach) function in case the
attachement _and_ configuration was successful.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:26:33 +02:00
Dominik Brodowski 15b99ac172 [PATCH] pcmcia: add return value to _config() functions
Most of the driver initialization isn't done in the .probe function, but in
the internal _config() functions. Make them return a value, so that .probe
can properly report whether the probing of the device succeeded or not.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:26:06 +02:00
Dominik Brodowski fba395eee7 [PATCH] pcmcia: remove dev_link_t and client_handle_t indirection
dev_link_t * and client_handle_t both mean struct pcmcai_device * by now.
Therefore, remove all such indirections.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:21:06 +02:00
Dominik Brodowski fd238232cd [PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the
same entity. The actual contents of dev_link_t will be cleaned up step by step.
This patch includes a bugfix from and signed-off-by Andrew Morton.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:15:57 +02:00
Dominik Brodowski 70294b4683 [PATCH] pcmcia: remove unneeded Vcc pseudo setting
As we do not allow setting Vcc in the pcmcia core, and Vpp1 and
Vpp2 can only be set to the same value, a lot of code can be
streamlined.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:15:55 +02:00
Dominik Brodowski 8661bb5b4a [PATCH] pcmcia: default suspend and resume handling
In all but one case, the suspend and resume functions of PCMCIA drivers
contain mostly of calls to pcmcia_release_configuration() and
pcmcia_request_configuration(). Therefore, move this code out of the
drivers and into the core.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:15:52 +02:00
Dominik Brodowski 5f2a71fcb7 [PATCH] pcmcia: add pcmcia_disable_device
pcmcia_disable_device(struct pcmcia_device *p_dev) performs the necessary
cleanups upon device or driver removal: it calls the appropriate
pcmcia_release_* functions, and can replace (most) of the current drivers'
_release() functions.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:15:50 +02:00
Domen Puncer 1de9cedfbd [PATCH] serial_cs: add Merlin U630 IDs
Add Merlin U630 IDs.

Signed-off-by: Domen Puncer <domen.puncer@ultra.si>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:13:15 +02:00
Dominik Brodowski f542ff6dd1 [PATCH] pcmcia: add new IDs for serial_cs.c
Add IDs for Sierra Aircard 55 CDMA 1xrtt Modem -- a CIS update is required
for this card.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-12 18:48:15 +01:00
Dominik Brodowski f8cfa618dc [PATCH] pcmcia: unify attach, EVENT_CARD_INSERTION handlers into one probe callback
Unify the EVENT_CARD_INSERTION and "attach" callbacks to one unified
probe() callback. As all in-kernel drivers are changed to this new
callback, there will be no temporary backwards-compatibility. Inside a
probe() function, each driver _must_ set struct pcmcia_device
*p_dev->instance and instance->handle correctly.

With these patches, the basic driver interface for 16-bit PCMCIA drivers
now has the classic four callbacks known also from other buses:

        int (*probe)            (struct pcmcia_device *dev);
        void (*remove)          (struct pcmcia_device *dev);

        int (*suspend)          (struct pcmcia_device *dev);
        int (*resume)           (struct pcmcia_device *dev);

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06 00:03:24 +01:00
Dominik Brodowski b463581154 [PATCH] pcmcia: remove dev_list from drivers
The linked list of devices managed by each PCMCIA driver is, in very most
cases, unused. Therefore, remove it from many drivers.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06 00:03:20 +01:00
Dominik Brodowski cc3b4866be [PATCH] pcmcia: unify detach, REMOVAL_EVENT handlers into one remove callback
Unify the "detach" and REMOVAL_EVENT handlers to one "remove" function.
Old functionality is preserved, for the moment.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06 00:03:10 +01:00
Dominik Brodowski 98e4c28b7e [PATCH] pcmcia: new suspend core
Move the suspend and resume methods out of the event handler, and into
special functions. Also use these functions for pre- and post-reset, as
almost all drivers already do, and the remaining ones can easily be
converted.

Bugfix to include/pcmcia/ds.c
Signed-off-by: Andrew Morton <akpm@osdl.org>

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-05 23:59:02 +01:00
Arjan van de Ven cb3592be27 [SERIAL] mark several serial tables const
This patch marks a few serial data structures const, moving them to
.rodata where they won't false-share cachelines with things that get
written to.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-11-28 21:04:11 +00:00
Dominik Brodowski a42f0dc437 [PATCH] pcmcia: new IDs for serial_cs
Add new ID to serial_cs.c; the CIS fimware override is available by the
manufacturer at http://www.sierrawireless.com .  Remember to name the CIS
binary SW_7xx_SER.cis and to put it into /lib/firmware/

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2005-09-26 13:11:28 +02:00
Komuro d277ad0eaa [PATCH] pcmcia: fix many device IDs
If the product-id-string contains the '+' , '&' ,'_', it was not converted
properly from the /etc/pcmcia/config(pcmcia-cs config file).

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-07-28 08:39:00 -07:00
Dominik Brodowski 44670d2b50 [PATCH] pcmcia: remove references to pcmcia/version.h
As a follow-up, remove the inclusion of pcmcia/version.h in many files.

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-07-07 18:24:07 -07:00
Dominik Brodowski 1e212f3645 [PATCH] pcmcia: move event handler
Move the "event handler" to struct pcmcia_driver -- the unified event handler
will disappear really soon, but switching it to struct pcmcia_driver in the
meantime allows for better "step-by-step" patches.

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-07-07 18:24:05 -07:00
Jun Komuro f4d7510d3d [PATCH] pcmcia: more IDs for TDK multifunction cards
Add new pcmcia id_table for fmvj18x_cs and serial_cs.
(TDK multi-function card (NetPartner9610 and MobileNetworker3200))

Signed-off-by: Jun Komuro <komurojun-mbn@nifty.com>
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 18:03:17 -07:00