Commit a2e28fc1 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: disable pcmcia ioctl for !ARM, prepare for removal
  pcmcia: CodingStyle fixes
  pcmcia: alchemy: fixup wrong comments
  pcmcia: remove irq_list parameter from pd6729
  yenta_socket: ENE CB712 CardBus bridge needs special treatment with Echo Audio Indigo soundcards
parents 03a2c4d7 a3f916f2
...@@ -117,19 +117,25 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org> ...@@ -117,19 +117,25 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org>
--------------------------- ---------------------------
What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
When: November 2005 When: 2.6.35/2.6.36
Files: drivers/pcmcia/: pcmcia_ioctl.c Files: drivers/pcmcia/: pcmcia_ioctl.c
Why: With the 16-bit PCMCIA subsystem now behaving (almost) like a Why: With the 16-bit PCMCIA subsystem now behaving (almost) like a
normal hotpluggable bus, and with it using the default kernel normal hotpluggable bus, and with it using the default kernel
infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA
control ioctl needed by cardmgr and cardctl from pcmcia-cs is control ioctl needed by cardmgr and cardctl from pcmcia-cs is
unnecessary, and makes further cleanups and integration of the unnecessary and potentially harmful (it does not provide for
proper locking), and makes further cleanups and integration of the
PCMCIA subsystem into the Linux kernel device driver model more PCMCIA subsystem into the Linux kernel device driver model more
difficult. The features provided by cardmgr and cardctl are either difficult. The features provided by cardmgr and cardctl are either
handled by the kernel itself now or are available in the new handled by the kernel itself now or are available in the new
pcmciautils package available at pcmciautils package available at
http://kernel.org/pub/linux/utils/kernel/pcmcia/ http://kernel.org/pub/linux/utils/kernel/pcmcia/
Who: Dominik Brodowski <linux@brodo.de>
For all architectures except ARM, the associated config symbol
has been removed from kernel 2.6.34; for ARM, it will be likely
be removed from kernel 2.6.35. The actual code will then likely
be removed from kernel 2.6.36.
Who: Dominik Brodowski <linux@dominikbrodowski.net>
--------------------------- ---------------------------
......
...@@ -51,17 +51,23 @@ config PCMCIA_LOAD_CIS ...@@ -51,17 +51,23 @@ config PCMCIA_LOAD_CIS
config PCMCIA_IOCTL config PCMCIA_IOCTL
bool "PCMCIA control ioctl (obsolete)" bool "PCMCIA control ioctl (obsolete)"
depends on PCMCIA depends on PCMCIA && ARM && !SMP && !PREEMPT
default y default y
help help
If you say Y here, the deprecated ioctl interface to the PCMCIA If you say Y here, the deprecated ioctl interface to the PCMCIA
subsystem will be built. It is needed by cardmgr and cardctl subsystem will be built. It is needed by the deprecated pcmcia-cs
(pcmcia-cs) to function properly. tools (cardmgr, cardctl) to function properly.
You should use the new pcmciautils package instead (see You should use the new pcmciautils package instead (see
<file:Documentation/Changes> for location and details). <file:Documentation/Changes> for location and details).
If unsure, say Y. This config option will most likely be removed from kernel 2.6.35,
the associated code from kernel 2.6.36.
As the PCMCIA ioctl is not locking safe, it depends on !SMP and
!PREEMPT.
If unsure, say N.
config CARDBUS config CARDBUS
bool "32-bit CardBus support" bool "32-bit CardBus support"
......
...@@ -54,10 +54,6 @@ static const u_int exponent[] = { ...@@ -54,10 +54,6 @@ static const u_int exponent[] = {
/* Upper limit on reasonable # of tuples */ /* Upper limit on reasonable # of tuples */
#define MAX_TUPLES 200 #define MAX_TUPLES 200
/*====================================================================*/
/* Parameters that can be set with 'insmod' */
/* 16-bit CIS? */ /* 16-bit CIS? */
static int cis_width; static int cis_width;
module_param(cis_width, int, 0444); module_param(cis_width, int, 0444);
...@@ -79,21 +75,23 @@ void release_cis_mem(struct pcmcia_socket *s) ...@@ -79,21 +75,23 @@ void release_cis_mem(struct pcmcia_socket *s)
mutex_unlock(&s->ops_mutex); mutex_unlock(&s->ops_mutex);
} }
/* /**
* Map the card memory at "card_offset" into virtual space. * set_cis_map() - map the card memory at "card_offset" into virtual space.
*
* If flags & MAP_ATTRIB, map the attribute space, otherwise * If flags & MAP_ATTRIB, map the attribute space, otherwise
* map the memory space. * map the memory space.
* *
* Must be called with ops_mutex held. * Must be called with ops_mutex held.
*/ */
static void __iomem * static void __iomem *set_cis_map(struct pcmcia_socket *s,
set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flags) unsigned int card_offset, unsigned int flags)
{ {
pccard_mem_map *mem = &s->cis_mem; pccard_mem_map *mem = &s->cis_mem;
int ret; int ret;
if (!(s->features & SS_CAP_STATIC_MAP) && (mem->res == NULL)) { if (!(s->features & SS_CAP_STATIC_MAP) && (mem->res == NULL)) {
mem->res = pcmcia_find_mem_region(0, s->map_size, s->map_size, 0, s); mem->res = pcmcia_find_mem_region(0, s->map_size,
s->map_size, 0, s);
if (mem->res == NULL) { if (mem->res == NULL) {
dev_printk(KERN_NOTICE, &s->dev, dev_printk(KERN_NOTICE, &s->dev,
"cs: unable to map card memory!\n"); "cs: unable to map card memory!\n");
...@@ -124,17 +122,14 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag ...@@ -124,17 +122,14 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
return s->cis_virt; return s->cis_virt;
} }
/*======================================================================
Low-level functions to read and write CIS memory. I think the
write routine is only useful for writing one-byte registers.
======================================================================*/
/* Bits in attr field */ /* Bits in attr field */
#define IS_ATTR 1 #define IS_ATTR 1
#define IS_INDIRECT 8 #define IS_INDIRECT 8
/**
* pcmcia_read_cis_mem() - low-level function to read CIS memory
*/
int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
u_int len, void *ptr) u_int len, void *ptr)
{ {
...@@ -153,7 +148,8 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, ...@@ -153,7 +148,8 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
flags = ICTRL0_AUTOINC; flags = ICTRL0_AUTOINC;
} }
sys = set_cis_map(s, 0, MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0)); sys = set_cis_map(s, 0, MAP_ACTIVE |
((cis_width) ? MAP_16BIT : 0));
if (!sys) { if (!sys) {
dev_dbg(&s->dev, "could not map memory\n"); dev_dbg(&s->dev, "could not map memory\n");
memset(ptr, 0xff, len); memset(ptr, 0xff, len);
...@@ -172,7 +168,8 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, ...@@ -172,7 +168,8 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
u_int inc = 1, card_offset, flags; u_int inc = 1, card_offset, flags;
if (addr > CISTPL_MAX_CIS_SIZE) if (addr > CISTPL_MAX_CIS_SIZE)
dev_dbg(&s->dev, "attempt to read CIS mem at addr %#x", addr); dev_dbg(&s->dev,
"attempt to read CIS mem at addr %#x", addr);
flags = MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0); flags = MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0);
if (attr) { if (attr) {
...@@ -209,13 +206,19 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, ...@@ -209,13 +206,19 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
} }
/**
* pcmcia_write_cis_mem() - low-level function to write CIS memory
*
* Probably only useful for writing one-byte registers.
*/
void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
u_int len, void *ptr) u_int len, void *ptr)
{ {
void __iomem *sys, *end; void __iomem *sys, *end;
unsigned char *buf = ptr; unsigned char *buf = ptr;
dev_dbg(&s->dev, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len); dev_dbg(&s->dev,
"pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
mutex_lock(&s->ops_mutex); mutex_lock(&s->ops_mutex);
if (attr & IS_INDIRECT) { if (attr & IS_INDIRECT) {
...@@ -227,7 +230,8 @@ void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, ...@@ -227,7 +230,8 @@ void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
flags = ICTRL0_AUTOINC; flags = ICTRL0_AUTOINC;
} }
sys = set_cis_map(s, 0, MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0)); sys = set_cis_map(s, 0, MAP_ACTIVE |
((cis_width) ? MAP_16BIT : 0));
if (!sys) { if (!sys) {
dev_dbg(&s->dev, "could not map memory\n"); dev_dbg(&s->dev, "could not map memory\n");
mutex_unlock(&s->ops_mutex); mutex_unlock(&s->ops_mutex);
...@@ -275,14 +279,13 @@ void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, ...@@ -275,14 +279,13 @@ void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
} }
/*====================================================================== /**
* read_cis_cache() - read CIS memory or its associated cache
This is a wrapper around read_cis_mem, with the same interface, *
but which caches information, for cards whose CIS may not be * This is a wrapper around read_cis_mem, with the same interface,
readable all the time. * but which caches information, for cards whose CIS may not be
* readable all the time.
======================================================================*/ */
static int read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, static int read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr,
size_t len, void *ptr) size_t len, void *ptr)
{ {
...@@ -353,7 +356,6 @@ remove_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, u_int len) ...@@ -353,7 +356,6 @@ remove_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, u_int len)
* This destroys the CIS cache but keeps any fake CIS alive. Must be * This destroys the CIS cache but keeps any fake CIS alive. Must be
* called with ops_mutex held. * called with ops_mutex held.
*/ */
void destroy_cis_cache(struct pcmcia_socket *s) void destroy_cis_cache(struct pcmcia_socket *s)
{ {
struct list_head *l, *n; struct list_head *l, *n;
...@@ -366,13 +368,9 @@ void destroy_cis_cache(struct pcmcia_socket *s) ...@@ -366,13 +368,9 @@ void destroy_cis_cache(struct pcmcia_socket *s)
} }
} }
/*====================================================================== /**
* verify_cis_cache() - does the CIS match what is in the CIS cache?
This verifies if the CIS of a card matches what is in the CIS */
cache.
======================================================================*/
int verify_cis_cache(struct pcmcia_socket *s) int verify_cis_cache(struct pcmcia_socket *s)
{ {
struct cis_cache_entry *cis; struct cis_cache_entry *cis;
...@@ -404,13 +402,12 @@ int verify_cis_cache(struct pcmcia_socket *s) ...@@ -404,13 +402,12 @@ int verify_cis_cache(struct pcmcia_socket *s)
return 0; return 0;
} }
/*====================================================================== /**
* pcmcia_replace_cis() - use a replacement CIS instead of the card's CIS
For really bad cards, we provide a facility for uploading a *
replacement CIS. * For really bad cards, we provide a facility for uploading a
* replacement CIS.
======================================================================*/ */
int pcmcia_replace_cis(struct pcmcia_socket *s, int pcmcia_replace_cis(struct pcmcia_socket *s,
const u8 *data, const size_t len) const u8 *data, const size_t len)
{ {
...@@ -433,11 +430,7 @@ int pcmcia_replace_cis(struct pcmcia_socket *s, ...@@ -433,11 +430,7 @@ int pcmcia_replace_cis(struct pcmcia_socket *s,
return 0; return 0;
} }
/*====================================================================== /* The high-level CIS tuple services */
The high-level CIS tuple services
======================================================================*/
typedef struct tuple_flags { typedef struct tuple_flags {
u_int link_space:4; u_int link_space:4;
...@@ -451,7 +444,8 @@ typedef struct tuple_flags { ...@@ -451,7 +444,8 @@ typedef struct tuple_flags {
#define MFC_FN(f) (((tuple_flags *)(&(f)))->mfc_fn) #define MFC_FN(f) (((tuple_flags *)(&(f)))->mfc_fn)
#define SPACE(f) (((tuple_flags *)(&(f)))->space) #define SPACE(f) (((tuple_flags *)(&(f)))->space)
int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple) int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function,
tuple_t *tuple)
{ {
if (!s) if (!s)
return -EINVAL; return -EINVAL;
...@@ -499,9 +493,9 @@ static int follow_link(struct pcmcia_socket *s, tuple_t *tuple) ...@@ -499,9 +493,9 @@ static int follow_link(struct pcmcia_socket *s, tuple_t *tuple)
ofs = tuple->LinkOffset; ofs = tuple->LinkOffset;
SPACE(tuple->Flags) = LINK_SPACE(tuple->Flags); SPACE(tuple->Flags) = LINK_SPACE(tuple->Flags);
HAS_LINK(tuple->Flags) = 0; HAS_LINK(tuple->Flags) = 0;
} else { } else
return -1; return -1;
}
if (SPACE(tuple->Flags)) { if (SPACE(tuple->Flags)) {
/* This is ugly, but a common CIS error is to code the long /* This is ugly, but a common CIS error is to code the long
link offset incorrectly, so we check the right spot... */ link offset incorrectly, so we check the right spot... */
...@@ -525,7 +519,8 @@ static int follow_link(struct pcmcia_socket *s, tuple_t *tuple) ...@@ -525,7 +519,8 @@ static int follow_link(struct pcmcia_socket *s, tuple_t *tuple)
return -1; return -1;
} }
int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple) int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function,
tuple_t *tuple)
{ {
u_char link[2], tmp; u_char link[2], tmp;
int ofs, i, attr; int ofs, i, attr;
...@@ -541,14 +536,15 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_ ...@@ -541,14 +536,15 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
attr = SPACE(tuple->Flags); attr = SPACE(tuple->Flags);
for (i = 0; i < MAX_TUPLES; i++) { for (i = 0; i < MAX_TUPLES; i++) {
if (link[1] == 0xff) { if (link[1] == 0xff)
link[0] = CISTPL_END; link[0] = CISTPL_END;
} else { else {
ret = read_cis_cache(s, attr, ofs, 2, link); ret = read_cis_cache(s, attr, ofs, 2, link);
if (ret) if (ret)
return -1; return -1;
if (link[0] == CISTPL_NULL) { if (link[0] == CISTPL_NULL) {
ofs++; continue; ofs++;
continue;
} }
} }
...@@ -574,20 +570,23 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_ ...@@ -574,20 +570,23 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
case CISTPL_LONGLINK_A: case CISTPL_LONGLINK_A:
HAS_LINK(tuple->Flags) = 1; HAS_LINK(tuple->Flags) = 1;
LINK_SPACE(tuple->Flags) = attr | IS_ATTR; LINK_SPACE(tuple->Flags) = attr | IS_ATTR;
ret = read_cis_cache(s, attr, ofs+2, 4, &tuple->LinkOffset); ret = read_cis_cache(s, attr, ofs+2, 4,
&tuple->LinkOffset);
if (ret) if (ret)
return -1; return -1;
break; break;
case CISTPL_LONGLINK_C: case CISTPL_LONGLINK_C:
HAS_LINK(tuple->Flags) = 1; HAS_LINK(tuple->Flags) = 1;
LINK_SPACE(tuple->Flags) = attr & ~IS_ATTR; LINK_SPACE(tuple->Flags) = attr & ~IS_ATTR;
ret = read_cis_cache(s, attr, ofs+2, 4, &tuple->LinkOffset); ret = read_cis_cache(s, attr, ofs+2, 4,
&tuple->LinkOffset);
if (ret) if (ret)
return -1; return -1;
break; break;
case CISTPL_INDIRECT: case CISTPL_INDIRECT:
HAS_LINK(tuple->Flags) = 1; HAS_LINK(tuple->Flags) = 1;
LINK_SPACE(tuple->Flags) = IS_ATTR | IS_INDIRECT; LINK_SPACE(tuple->Flags) = IS_ATTR |
IS_INDIRECT;
tuple->LinkOffset = 0; tuple->LinkOffset = 0;
break; break;
case CISTPL_LONGLINK_MFC: case CISTPL_LONGLINK_MFC:
...@@ -595,7 +594,8 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_ ...@@ -595,7 +594,8 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
LINK_SPACE(tuple->Flags) = attr; LINK_SPACE(tuple->Flags) = attr;
if (function == BIND_FN_ALL) { if (function == BIND_FN_ALL) {
/* Follow all the MFC links */ /* Follow all the MFC links */
ret = read_cis_cache(s, attr, ofs+2, 1, &tmp); ret = read_cis_cache(s, attr, ofs+2,
1, &tmp);
if (ret) if (ret)
return -1; return -1;
MFC_FN(tuple->Flags) = tmp; MFC_FN(tuple->Flags) = tmp;
...@@ -631,10 +631,6 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_ ...@@ -631,10 +631,6 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
return 0; return 0;
} }
/*====================================================================*/
#define _MIN(a, b) (((a) < (b)) ? (a) : (b))
int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple) int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple)
{ {
u_int len; u_int len;
...@@ -651,18 +647,15 @@ int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple) ...@@ -651,18 +647,15 @@ int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple)
return 0; return 0;
ret = read_cis_cache(s, SPACE(tuple->Flags), ret = read_cis_cache(s, SPACE(tuple->Flags),
tuple->CISOffset + tuple->TupleOffset, tuple->CISOffset + tuple->TupleOffset,
_MIN(len, tuple->TupleDataMax), tuple->TupleData); min(len, (u_int) tuple->TupleDataMax),
tuple->TupleData);
if (ret) if (ret)
return -1; return -1;
return 0; return 0;
} }
/*====================================================================== /* Parsing routines for individual tuples */
Parsing routines for individual tuples
======================================================================*/
static int parse_device(tuple_t *tuple, cistpl_device_t *device) static int parse_device(tuple_t *tuple, cistpl_device_t *device)
{ {
...@@ -724,7 +717,6 @@ static int parse_device(tuple_t *tuple, cistpl_device_t *device) ...@@ -724,7 +717,6 @@ static int parse_device(tuple_t *tuple, cistpl_device_t *device)
return 0; return 0;
} }
/*====================================================================*/
static int parse_checksum(tuple_t *tuple, cistpl_checksum_t *csum) static int parse_checksum(tuple_t *tuple, cistpl_checksum_t *csum)
{ {
...@@ -738,7 +730,6 @@ static int parse_checksum(tuple_t *tuple, cistpl_checksum_t *csum) ...@@ -738,7 +730,6 @@ static int parse_checksum(tuple_t *tuple, cistpl_checksum_t *csum)
return 0; return 0;
} }
/*====================================================================*/
static int parse_longlink(tuple_t *tuple, cistpl_longlink_t *link) static int parse_longlink(tuple_t *tuple, cistpl_longlink_t *link)
{ {
...@@ -748,10 +739,8 @@ static int parse_longlink(tuple_t *tuple, cistpl_longlink_t *link) ...@@ -748,10 +739,8 @@ static int parse_longlink(tuple_t *tuple, cistpl_longlink_t *link)
return 0; return 0;
} }
/*====================================================================*/
static int parse_longlink_mfc(tuple_t *tuple, static int parse_longlink_mfc(tuple_t *tuple, cistpl_longlink_mfc_t *link)
cistpl_longlink_mfc_t *link)
{ {
u_char *p; u_char *p;
int i; int i;
...@@ -769,7 +758,6 @@ static int parse_longlink_mfc(tuple_t *tuple, ...@@ -769,7 +758,6 @@ static int parse_longlink_mfc(tuple_t *tuple,
return 0; return 0;
} }
/*====================================================================*/
static int parse_strings(u_char *p, u_char *q, int max, static int parse_strings(u_char *p, u_char *q, int max,
char *s, u_char *ofs, u_char *found) char *s, u_char *ofs, u_char *found)
...@@ -797,12 +785,11 @@ static int parse_strings(u_char *p, u_char *q, int max, ...@@ -797,12 +785,11 @@ static int parse_strings(u_char *p, u_char *q, int max,
if (found) { if (found) {
*found = ns; *found = ns;
return 0; return 0;
} else {
return (ns == max) ? 0 : -EINVAL;
} }
return (ns == max) ? 0 : -EINVAL;
} }
/*====================================================================*/
static int parse_vers_1(tuple_t *tuple, cistpl_vers_1_t *vers_1) static int parse_vers_1(tuple_t *tuple, cistpl_vers_1_t *vers_1)
{ {
...@@ -820,7 +807,6 @@ static int parse_vers_1(tuple_t *tuple, cistpl_vers_1_t *vers_1) ...@@ -820,7 +807,6 @@ static int parse_vers_1(tuple_t *tuple, cistpl_vers_1_t *vers_1)
vers_1->str, vers_1->ofs, &vers_1->ns); vers_1->str, vers_1->ofs, &vers_1->ns);
} }
/*====================================================================*/
static int parse_altstr(tuple_t *tuple, cistpl_altstr_t *altstr) static int parse_altstr(tuple_t *tuple, cistpl_altstr_t *altstr)
{ {
...@@ -833,7 +819,6 @@ static int parse_altstr(tuple_t *tuple, cistpl_altstr_t *altstr) ...@@ -833,7 +819,6 @@ static int parse_altstr(tuple_t *tuple, cistpl_altstr_t *altstr)
altstr->str, altstr->ofs, &altstr->ns); altstr->str, altstr->ofs, &altstr->ns);
} }
/*====================================================================*/
static int parse_jedec(tuple_t *tuple, cistpl_jedec_t *jedec) static int parse_jedec(tuple_t *tuple, cistpl_jedec_t *jedec)
{ {
...@@ -854,7 +839,6 @@ static int parse_jedec(tuple_t *tuple, cistpl_jedec_t *jedec) ...@@ -854,7 +839,6 @@ static int parse_jedec(tuple_t *tuple, cistpl_jedec_t *jedec)
return 0; return 0;
} }
/*====================================================================*/
static int parse_manfid(tuple_t *tuple, cistpl_manfid_t *m) static int parse_manfid(tuple_t *tuple, cistpl_manfid_t *m)
{ {
...@@ -865,7 +849,6 @@ static int parse_manfid(tuple_t *tuple, cistpl_manfid_t *m) ...@@ -865,7 +849,6 @@ static int parse_manfid(tuple_t *tuple, cistpl_manfid_t *m)
return 0; return 0;
} }
/*====================================================================*/
static int parse_funcid(tuple_t *tuple, cistpl_funcid_t *f) static int parse_funcid(tuple_t *tuple, cistpl_funcid_t *f)
{ {
...@@ -878,7 +861,6 @@ static int parse_funcid(tuple_t *tuple, cistpl_funcid_t *f) ...@@ -878,7 +861,6 @@ static int parse_funcid(tuple_t *tuple, cistpl_funcid_t *f)
return 0; return 0;
} }
/*====================================================================*/
static int parse_funce(tuple_t *tuple, cistpl_funce_t *f) static int parse_funce(tuple_t *tuple, cistpl_funce_t *f)
{ {
...@@ -893,7 +875,6 @@ static int parse_funce(tuple_t *tuple, cistpl_funce_t *f) ...@@ -893,7 +875,6 @@ static int parse_funce(tuple_t *tuple, cistpl_funce_t *f)
return 0; return 0;
} }
/*====================================================================*/
static int parse_config(tuple_t *tuple, cistpl_config_t *config) static int parse_config(tuple_t *tuple, cistpl_config_t *config)
{ {
...@@ -919,15 +900,11 @@ static int parse_config(tuple_t *tuple, cistpl_config_t *config) ...@@ -919,15 +900,11 @@ static int parse_config(tuple_t *tuple, cistpl_config_t *config)
return 0; return 0;
} }
/*====================================================================== /* The following routines are all used to parse the nightmarish
* config table entries.
The following routines are all used to parse the nightmarish */
config table entries.
======================================================================*/
static u_char *parse_power(u_char *p, u_char *q, static u_char *parse_power(u_char *p, u_char *q, cistpl_power_t *pwr)
cistpl_power_t *pwr)
{ {
int i; int i;
u_int scale; u_int scale;
...@@ -947,7 +924,8 @@ static u_char *parse_power(u_char *p, u_char *q, ...@@ -947,7 +924,8 @@ static u_char *parse_power(u_char *p, u_char *q,
if (++p == q) if (++p == q)
return NULL; return NULL;
if ((*p & 0x7f) < 100) if ((*p & 0x7f) < 100)
pwr->param[i] += (*p & 0x7f) * scale / 100; pwr->param[i] +=
(*p & 0x7f) * scale / 100;
else if (*p == 0x7d) else if (*p == 0x7d)
pwr->flags |= CISTPL_POWER_HIGHZ_OK; pwr->flags |= CISTPL_POWER_HIGHZ_OK;
else if (*p == 0x7e) else if (*p == 0x7e)
...@@ -962,10 +940,8 @@ static u_char *parse_power(u_char *p, u_char *q, ...@@ -962,10 +940,8 @@ static u_char *parse_power(u_char *p, u_char *q,
return p; return p;
} }
/*====================================================================*/
static u_char *parse_timing(u_char *p, u_char *q, static u_char *parse_timing(u_char *p, u_char *q, cistpl_timing_t *timing)
cistpl_timing_t *timing)
{ {
u_char scale; u_char scale;
...@@ -999,7 +975,6 @@ static u_char *parse_timing(u_char *p, u_char *q, ...@@ -999,7 +975,6 @@ static u_char *parse_timing(u_char *p, u_char *q,
return p; return p;
} }
/*====================================================================*/
static u_char *parse_io(u_char *p, u_char *q, cistpl_io_t *io) static u_char *parse_io(u_char *p, u_char *q, cistpl_io_t *io)
{ {
...@@ -1044,7 +1019,6 @@ static u_char *parse_io(u_char *p, u_char *q, cistpl_io_t *io) ...@@ -1044,7 +1019,6 @@ static u_char *parse_io(u_char *p, u_char *q, cistpl_io_t *io)
return p; return p;
} }
/*====================================================================*/
static u_char *parse_mem(u_char *p, u_char *q, cistpl_mem_t *mem) static u_char *parse_mem(u_char *p, u_char *q, cistpl_mem_t *mem)
{ {
...@@ -1086,7 +1060,6 @@ static u_char *parse_mem(u_char *p, u_char *q, cistpl_mem_t *mem) ...@@ -1086,7 +1060,6 @@ static u_char *parse_mem(u_char *p, u_char *q, cistpl_mem_t *mem)
return p; return p;
} }
/*====================================================================*/
static u_char *parse_irq(u_char *p, u_char *q, cistpl_irq_t *irq) static u_char *parse_irq(u_char *p, u_char *q, cistpl_irq_t *irq)
{ {
...@@ -1102,7 +1075,6 @@ static u_char *parse_irq(u_char *p, u_char *q, cistpl_irq_t *irq) ...@@ -1102,7 +1075,6 @@ static u_char *parse_irq(u_char *p, u_char *q, cistpl_irq_t *irq)
return p; return p;
} }
/*====================================================================*/
static int parse_cftable_entry(tuple_t *tuple, static int parse_cftable_entry(tuple_t *tuple,
cistpl_cftable_entry_t *entry) cistpl_cftable_entry_t *entry)
...@@ -1227,7 +1199,6 @@ static int parse_cftable_entry(tuple_t *tuple, ...@@ -1227,7 +1199,6 @@ static int parse_cftable_entry(tuple_t *tuple,
return 0; return 0;
} }
/*====================================================================*/
static int parse_device_geo(tuple_t *tuple, cistpl_device_geo_t *geo) static int parse_device_geo(tuple_t *tuple, cistpl_device_geo_t *geo)
{ {
...@@ -1252,7 +1223,6 @@ static int parse_device_geo(tuple_t *tuple, cistpl_device_geo_t *geo) ...@@ -1252,7 +1223,6 @@ static int parse_device_geo(tuple_t *tuple, cistpl_device_geo_t *geo)
return 0; return 0;
} }
/*====================================================================*/
static int parse_vers_2(tuple_t *tuple, cistpl_vers_2_t *v2) static int parse_vers_2(tuple_t *tuple, cistpl_vers_2_t *v2)
{ {
...@@ -1274,7 +1244,6 @@ static int parse_vers_2(tuple_t *tuple, cistpl_vers_2_t *v2) ...@@ -1274,7 +1244,6 @@ static int parse_vers_2(tuple_t *tuple, cistpl_vers_2_t *v2)
return parse_strings(p, q, 2, v2->str, &v2->vendor, NULL); return parse_strings(p, q, 2, v2->str, &v2->vendor, NULL);
} }
/*====================================================================*/
static int parse_org(tuple_t *tuple, cistpl_org_t *org) static int parse_org(tuple_t *tuple, cistpl_org_t *org)
{ {
...@@ -1298,7 +1267,6 @@ static int parse_org(tuple_t *tuple, cistpl_org_t *org) ...@@ -1298,7 +1267,6 @@ static int parse_org(tuple_t *tuple, cistpl_org_t *org)
return 0; return 0;
} }
/*====================================================================*/
static int parse_format(tuple_t *tuple, cistpl_format_t *fmt) static int parse_format(tuple_t *tuple, cistpl_format_t *fmt)
{ {
...@@ -1317,7 +1285,6 @@ static int parse_format(tuple_t *tuple, cistpl_format_t *fmt) ...@@ -1317,7 +1285,6 @@ static int parse_format(tuple_t *tuple, cistpl_format_t *fmt)
return 0; return 0;
} }
/*====================================================================*/
int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse) int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse)
{ {
...@@ -1393,13 +1360,18 @@ int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse) ...@@ -1393,13 +1360,18 @@ int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse)
} }
EXPORT_SYMBOL(pcmcia_parse_tuple); EXPORT_SYMBOL(pcmcia_parse_tuple);
/*======================================================================
This is used internally by Card Services to look up CIS stuff.
======================================================================*/
int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t code, void *parse) /**
* pccard_read_tuple() - internal CIS tuple access
* @s: the struct pcmcia_socket where the card is inserted
* @function: the device function we loop for
* @code: which CIS code shall we look for?
* @parse: buffer where the tuple shall be parsed (or NULL, if no parse)
*
* pccard_read_tuple() reads out one tuple and attempts to parse it
*/
int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function,
cisdata_t code, void *parse)
{ {
tuple_t tuple; tuple_t tuple;
cisdata_t *buf; cisdata_t *buf;
......
...@@ -42,7 +42,6 @@ struct db1x_pcmcia_sock { ...@@ -42,7 +42,6 @@ struct db1x_pcmcia_sock {
int nr; /* socket number */ int nr; /* socket number */
void *virt_io; void *virt_io;
/* the "pseudo" addresses of the PCMCIA space. */
phys_addr_t phys_io; phys_addr_t phys_io;
phys_addr_t phys_attr; phys_addr_t phys_attr;
phys_addr_t phys_mem; phys_addr_t phys_mem;
...@@ -437,7 +436,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev) ...@@ -437,7 +436,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
* This includes IRQs for Carddetection/ejection, the card * This includes IRQs for Carddetection/ejection, the card
* itself and optional status change detection. * itself and optional status change detection.
* Also, the memory areas covered by a socket. For these * Also, the memory areas covered by a socket. For these
* we require the 32bit "pseudo" addresses (see the au1000.h * we require the real 36bit addresses (see the au1000.h
* header for more information). * header for more information).
*/ */
...@@ -459,11 +458,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev) ...@@ -459,11 +458,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
ret = -ENODEV; ret = -ENODEV;
/* /* 36bit PCMCIA Attribute area address */
* pseudo-attr: The 32bit address of the PCMCIA attribute space
* for this socket (usually the 36bit address shifted 4 to the
* right).
*/
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr"); r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
if (!r) { if (!r) {
printk(KERN_ERR "pcmcia%d has no 'pseudo-attr' resource!\n", printk(KERN_ERR "pcmcia%d has no 'pseudo-attr' resource!\n",
...@@ -472,10 +467,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev) ...@@ -472,10 +467,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
} }
sock->phys_attr = r->start; sock->phys_attr = r->start;
/* /* 36bit PCMCIA Memory area address */
* pseudo-mem: The 32bit address of the PCMCIA memory space for
* this socket (usually the 36bit address shifted 4 to the right)
*/
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem"); r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
if (!r) { if (!r) {
printk(KERN_ERR "pcmcia%d has no 'pseudo-mem' resource!\n", printk(KERN_ERR "pcmcia%d has no 'pseudo-mem' resource!\n",
...@@ -484,10 +476,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev) ...@@ -484,10 +476,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
} }
sock->phys_mem = r->start; sock->phys_mem = r->start;
/* /* 36bit PCMCIA IO area address */
* pseudo-io: The 32bit address of the PCMCIA IO space for this
* socket (usually the 36bit address shifted 4 to the right).
*/
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io"); r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
if (!r) { if (!r) {
printk(KERN_ERR "pcmcia%d has no 'pseudo-io' resource!\n", printk(KERN_ERR "pcmcia%d has no 'pseudo-io' resource!\n",
......
...@@ -48,23 +48,13 @@ MODULE_AUTHOR("Jun Komuro <komurojun-mbn@nifty.com>"); ...@@ -48,23 +48,13 @@ MODULE_AUTHOR("Jun Komuro <komurojun-mbn@nifty.com>");
* Specifies the interrupt delivery mode. The default (1) is to use PCI * Specifies the interrupt delivery mode. The default (1) is to use PCI
* interrupts; a value of 0 selects ISA interrupts. This must be set for * interrupts; a value of 0 selects ISA interrupts. This must be set for
* correct operation of PCI card readers. * correct operation of PCI card readers.
*
* irq_list=i,j,...
* This list limits the set of interrupts that can be used by PCMCIA
* cards.
* The default list is 3,4,5,7,9,10,11.
* (irq_list parameter is not used, if irq_mode = 1)
*/ */
static int irq_mode = 1; /* 0 = ISA interrupt, 1 = PCI interrupt */ static int irq_mode = 1; /* 0 = ISA interrupt, 1 = PCI interrupt */
static int irq_list[16];
static unsigned int irq_list_count = 0;
module_param(irq_mode, int, 0444); module_param(irq_mode, int, 0444);
module_param_array(irq_list, int, &irq_list_count, 0444);
MODULE_PARM_DESC(irq_mode, MODULE_PARM_DESC(irq_mode,
"interrupt delivery mode. 0 = ISA, 1 = PCI. default is 1"); "interrupt delivery mode. 0 = ISA, 1 = PCI. default is 1");
MODULE_PARM_DESC(irq_list, "interrupts that can be used by PCMCIA cards");
static DEFINE_SPINLOCK(port_lock); static DEFINE_SPINLOCK(port_lock);
...@@ -605,13 +595,7 @@ static u_int __devinit pd6729_isa_scan(void) ...@@ -605,13 +595,7 @@ static u_int __devinit pd6729_isa_scan(void)
return 0; return 0;
} }
if (irq_list_count == 0) mask0 = PD67_MASK;
mask0 = 0xffff;
else
for (i = mask0 = 0; i < irq_list_count; i++)
mask0 |= (1<<irq_list[i]);
mask0 &= PD67_MASK;
/* just find interrupts that aren't in use */ /* just find interrupts that aren't in use */
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
......
...@@ -79,10 +79,9 @@ static resource_size_t pcmcia_align(void *align_data, ...@@ -79,10 +79,9 @@ static resource_size_t pcmcia_align(void *align_data,
#ifdef CONFIG_X86 #ifdef CONFIG_X86
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
if (start & 0x300) { if (start & 0x300)
start = (start + 0x3ff) & ~0x3ff; start = (start + 0x3ff) & ~0x3ff;
} }
}
#endif #endif
#ifdef CONFIG_M68K #ifdef CONFIG_M68K
......
...@@ -218,11 +218,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev) ...@@ -218,11 +218,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
ret = -ENODEV; ret = -ENODEV;
/* /* 36bit PCMCIA Attribute area address */
* pseudo-attr: The 32bit address of the PCMCIA attribute space
* for this socket (usually the 36bit address shifted 4 to the
* right).
*/
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr"); r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
if (!r) { if (!r) {
dev_err(&pdev->dev, "missing 'pcmcia-attr' resource!\n"); dev_err(&pdev->dev, "missing 'pcmcia-attr' resource!\n");
...@@ -230,10 +226,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev) ...@@ -230,10 +226,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
} }
sock->phys_attr = r->start; sock->phys_attr = r->start;
/* /* 36bit PCMCIA Memory area address */
* pseudo-mem: The 32bit address of the PCMCIA memory space for
* this socket (usually the 36bit address shifted 4 to the right)
*/
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem"); r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
if (!r) { if (!r) {
dev_err(&pdev->dev, "missing 'pcmcia-mem' resource!\n"); dev_err(&pdev->dev, "missing 'pcmcia-mem' resource!\n");
...@@ -241,10 +234,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev) ...@@ -241,10 +234,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
} }
sock->phys_mem = r->start; sock->phys_mem = r->start;
/* /* 36bit PCMCIA IO area address */
* pseudo-io: The 32bit address of the PCMCIA IO space for this
* socket (usually the 36bit address shifted 4 to the right).
*/
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io"); r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
if (!r) { if (!r) {
dev_err(&pdev->dev, "missing 'pcmcia-io' resource!\n"); dev_err(&pdev->dev, "missing 'pcmcia-io' resource!\n");
......
...@@ -1408,10 +1408,10 @@ static struct pci_device_id yenta_table[] = { ...@@ -1408,10 +1408,10 @@ static struct pci_device_id yenta_table[] = {
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7510, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7510, TI12XX),
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7610, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7610, TI12XX),
CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_710, TI12XX), CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_710, ENE),
CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_712, TI12XX), CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_712, ENE),
CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_720, TI12XX), CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_720, ENE),
CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_722, TI12XX), CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_722, ENE),
CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1211, ENE), CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1211, ENE),
CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1225, ENE), CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1225, ENE),
CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1410, ENE), CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1410, ENE),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment