You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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: (23 commits)
pcmcia: Fix ide-cs sparse warning
pcmcia: ide-cs debugging bugfix
pcmcia: allow for longer CIS firmware files
pcmcia: cm40x0 cdev lock_kernel() pushdown
pcmcia: (re)move {pcmcia,pccard}_get_status
pcmcia: kill IN_CARD_SERVICES
pcmcia: Remove unused header file code
pcmcia: remove unused bulkmem.h
pcmcia: simplify pccard_validate_cis
pcmcia: carve out ioctl adjust function to pcmcia_ioctl
pcmcia: irq probe can be done without risking an IRQ storm
pcmcia: Fix ti12xx_2nd_slot_empty always failing
pcmcia: check for pointer instead of pointer address
pcmcia: switch cm4000_cs.c to unlocked_ioctl
pcmcia: simplify rsrc_nonstatic attributes
pcmcia: add support CompactFlash PCMCIA support for Blackfin.
pcmcia: remove version.h
pcmcia: cs: kill thread_wait
pcmcia: i82365.c: check request_irq return value
pcmcia: fix Alchemy warnings
...
This commit is contained in:
@@ -32,8 +32,9 @@
|
||||
#include <linux/fs.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/bitrev.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/cs.h>
|
||||
@@ -1405,11 +1406,11 @@ static void stop_monitor(struct cm4000_dev *dev)
|
||||
DEBUGP(3, dev, "<- stop_monitor\n");
|
||||
}
|
||||
|
||||
static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct cm4000_dev *dev = filp->private_data;
|
||||
unsigned int iobase = dev->p_dev->io.BasePort1;
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
struct pcmcia_device *link;
|
||||
int size;
|
||||
int rc;
|
||||
@@ -1426,38 +1427,42 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
DEBUGP(3, dev, "cmm_ioctl(device=%d.%d) %s\n", imajor(inode),
|
||||
iminor(inode), ioctl_names[_IOC_NR(cmd)]);
|
||||
|
||||
lock_kernel();
|
||||
rc = -ENODEV;
|
||||
link = dev_table[iminor(inode)];
|
||||
if (!pcmcia_dev_present(link)) {
|
||||
DEBUGP(4, dev, "DEV_OK false\n");
|
||||
return -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (test_bit(IS_CMM_ABSENT, &dev->flags)) {
|
||||
DEBUGP(4, dev, "CMM_ABSENT flag set\n");
|
||||
return -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
rc = EINVAL;
|
||||
|
||||
if (_IOC_TYPE(cmd) != CM_IOC_MAGIC) {
|
||||
DEBUGP(4, dev, "ioctype mismatch\n");
|
||||
return -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (_IOC_NR(cmd) > CM_IOC_MAXNR) {
|
||||
DEBUGP(4, dev, "iocnr mismatch\n");
|
||||
return -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
size = _IOC_SIZE(cmd);
|
||||
rc = 0;
|
||||
rc = -EFAULT;
|
||||
DEBUGP(4, dev, "iocdir=%.4x iocr=%.4x iocw=%.4x iocsize=%d cmd=%.4x\n",
|
||||
_IOC_DIR(cmd), _IOC_READ, _IOC_WRITE, size, cmd);
|
||||
|
||||
if (_IOC_DIR(cmd) & _IOC_READ) {
|
||||
if (!access_ok(VERIFY_WRITE, argp, size))
|
||||
return -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
if (_IOC_DIR(cmd) & _IOC_WRITE) {
|
||||
if (!access_ok(VERIFY_READ, argp, size))
|
||||
return -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
rc = 0;
|
||||
|
||||
switch (cmd) {
|
||||
case CM_IOCGSTATUS:
|
||||
@@ -1477,9 +1482,9 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
if (test_bit(IS_BAD_CARD, &dev->flags))
|
||||
status |= CM_BAD_CARD;
|
||||
if (copy_to_user(argp, &status, sizeof(int)))
|
||||
return -EFAULT;
|
||||
rc = -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
case CM_IOCGATR:
|
||||
DEBUGP(4, dev, "... in CM_IOCGATR\n");
|
||||
{
|
||||
@@ -1492,25 +1497,29 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
|| (test_bit(IS_ATR_PRESENT, (void *)&dev->flags)
|
||||
!= 0)))) {
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
return -ERESTARTSYS;
|
||||
rc = -EAGAIN;
|
||||
else
|
||||
rc = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
|
||||
rc = -EFAULT;
|
||||
if (test_bit(IS_ATR_VALID, &dev->flags) == 0) {
|
||||
tmp = -1;
|
||||
if (copy_to_user(&(atreq->atr_len), &tmp,
|
||||
sizeof(int)))
|
||||
return -EFAULT;
|
||||
break;
|
||||
} else {
|
||||
if (copy_to_user(atreq->atr, dev->atr,
|
||||
dev->atr_len))
|
||||
return -EFAULT;
|
||||
break;
|
||||
|
||||
tmp = dev->atr_len;
|
||||
if (copy_to_user(&(atreq->atr_len), &tmp, sizeof(int)))
|
||||
return -EFAULT;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
case CM_IOCARDOFF:
|
||||
|
||||
@@ -1538,8 +1547,10 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
|| (test_and_set_bit(LOCK_IO, (void *)&dev->flags)
|
||||
== 0)))) {
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
return -ERESTARTSYS;
|
||||
rc = -EAGAIN;
|
||||
else
|
||||
rc = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
/* Set Flags0 = 0x42 */
|
||||
DEBUGP(4, dev, "Set Flags0=0x42 \n");
|
||||
@@ -1554,8 +1565,10 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
|| (test_bit(IS_ATR_VALID, (void *)&dev->flags) !=
|
||||
0)))) {
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
return -ERESTARTSYS;
|
||||
rc = -EAGAIN;
|
||||
else
|
||||
rc = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* release lock */
|
||||
@@ -1568,8 +1581,10 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
struct ptsreq krnptsreq;
|
||||
|
||||
if (copy_from_user(&krnptsreq, argp,
|
||||
sizeof(struct ptsreq)))
|
||||
return -EFAULT;
|
||||
sizeof(struct ptsreq))) {
|
||||
rc = -EFAULT;
|
||||
break;
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
DEBUGP(4, dev, "... in CM_IOCSPTS\n");
|
||||
@@ -1580,8 +1595,10 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
|| (test_bit(IS_ATR_PRESENT, (void *)&dev->flags)
|
||||
!= 0)))) {
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
return -ERESTARTSYS;
|
||||
rc = -EAGAIN;
|
||||
else
|
||||
rc = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
/* get IO lock */
|
||||
if (wait_event_interruptible
|
||||
@@ -1590,8 +1607,10 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
|| (test_and_set_bit(LOCK_IO, (void *)&dev->flags)
|
||||
== 0)))) {
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
return -ERESTARTSYS;
|
||||
rc = -EAGAIN;
|
||||
else
|
||||
rc = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((rc = set_protocol(dev, &krnptsreq)) != 0) {
|
||||
@@ -1604,7 +1623,7 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
wake_up_interruptible(&dev->ioq);
|
||||
|
||||
}
|
||||
return rc;
|
||||
break;
|
||||
#ifdef PCMCIA_DEBUG
|
||||
case CM_IOSDBGLVL: /* set debug log level */
|
||||
{
|
||||
@@ -1612,18 +1631,20 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
|
||||
old_pc_debug = pc_debug;
|
||||
if (copy_from_user(&pc_debug, argp, sizeof(int)))
|
||||
return -EFAULT;
|
||||
|
||||
if (old_pc_debug != pc_debug)
|
||||
rc = -EFAULT;
|
||||
else if (old_pc_debug != pc_debug)
|
||||
DEBUGP(0, dev, "Changed debug log level "
|
||||
"to %i\n", pc_debug);
|
||||
}
|
||||
return rc;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
DEBUGP(4, dev, "... in default (unknown IOCTL code)\n");
|
||||
return -EINVAL;
|
||||
rc = -ENOTTY;
|
||||
}
|
||||
out:
|
||||
unlock_kernel();
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int cmm_open(struct inode *inode, struct file *filp)
|
||||
@@ -1631,16 +1652,22 @@ static int cmm_open(struct inode *inode, struct file *filp)
|
||||
struct cm4000_dev *dev;
|
||||
struct pcmcia_device *link;
|
||||
int minor = iminor(inode);
|
||||
int ret;
|
||||
|
||||
if (minor >= CM4000_MAX_DEV)
|
||||
return -ENODEV;
|
||||
|
||||
lock_kernel();
|
||||
link = dev_table[minor];
|
||||
if (link == NULL || !pcmcia_dev_present(link))
|
||||
return -ENODEV;
|
||||
if (link == NULL || !pcmcia_dev_present(link)) {
|
||||
ret = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (link->open)
|
||||
return -EBUSY;
|
||||
if (link->open) {
|
||||
ret = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev = link->priv;
|
||||
filp->private_data = dev;
|
||||
@@ -1660,8 +1687,10 @@ static int cmm_open(struct inode *inode, struct file *filp)
|
||||
* vaild = block until valid (or card
|
||||
* inserted)
|
||||
*/
|
||||
if (filp->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
if (filp->f_flags & O_NONBLOCK) {
|
||||
ret = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev->mdelay = T_50MSEC;
|
||||
|
||||
@@ -1671,7 +1700,10 @@ static int cmm_open(struct inode *inode, struct file *filp)
|
||||
link->open = 1; /* only one open per device */
|
||||
|
||||
DEBUGP(2, dev, "<- cmm_open\n");
|
||||
return nonseekable_open(inode, filp);
|
||||
ret = nonseekable_open(inode, filp);
|
||||
out:
|
||||
unlock_kernel();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int cmm_close(struct inode *inode, struct file *filp)
|
||||
@@ -1897,7 +1929,7 @@ static const struct file_operations cm4000_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = cmm_read,
|
||||
.write = cmm_write,
|
||||
.ioctl = cmm_ioctl,
|
||||
.unlocked_ioctl = cmm_ioctl,
|
||||
.open = cmm_open,
|
||||
.release= cmm_close,
|
||||
};
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <linux/fs.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/wait.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
@@ -448,23 +449,30 @@ static int cm4040_open(struct inode *inode, struct file *filp)
|
||||
struct reader_dev *dev;
|
||||
struct pcmcia_device *link;
|
||||
int minor = iminor(inode);
|
||||
int ret;
|
||||
|
||||
if (minor >= CM_MAX_DEV)
|
||||
return -ENODEV;
|
||||
|
||||
lock_kernel();
|
||||
link = dev_table[minor];
|
||||
if (link == NULL || !pcmcia_dev_present(link))
|
||||
return -ENODEV;
|
||||
if (link == NULL || !pcmcia_dev_present(link)) {
|
||||
ret = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (link->open)
|
||||
return -EBUSY;
|
||||
if (link->open) {
|
||||
ret = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev = link->priv;
|
||||
filp->private_data = dev;
|
||||
|
||||
if (filp->f_flags & O_NONBLOCK) {
|
||||
DEBUGP(4, dev, "filep->f_flags O_NONBLOCK set\n");
|
||||
return -EAGAIN;
|
||||
ret = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
link->open = 1;
|
||||
@@ -473,7 +481,10 @@ static int cm4040_open(struct inode *inode, struct file *filp)
|
||||
mod_timer(&dev->poll_timer, jiffies + POLL_PERIOD);
|
||||
|
||||
DEBUGP(2, dev, "<- cm4040_open (successfully)\n");
|
||||
return nonseekable_open(inode, filp);
|
||||
ret = nonseekable_open(inode, filp);
|
||||
out:
|
||||
unlock_kernel();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int cm4040_close(struct inode *inode, struct file *filp)
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <pcmcia/version.h>
|
||||
#include <pcmcia/cisreg.h>
|
||||
#include <pcmcia/device_id.h>
|
||||
#include <pcmcia/ss.h>
|
||||
|
||||
@@ -63,11 +63,11 @@ MODULE_LICENSE("Dual MPL/GPL");
|
||||
|
||||
#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
|
||||
|
||||
#ifdef PCMCIA_DEBUG
|
||||
INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
|
||||
#ifdef CONFIG_PCMCIA_DEBUG
|
||||
INT_MODULE_PARM(pc_debug, 0);
|
||||
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
|
||||
static char *version =
|
||||
"ide-cs.c 1.3 2002/10/26 05:45:31 (David Hinds)";
|
||||
/*static char *version =
|
||||
"ide-cs.c 1.3 2002/10/26 05:45:31 (David Hinds)";*/
|
||||
#else
|
||||
#define DEBUG(n, args...)
|
||||
#endif
|
||||
@@ -375,7 +375,7 @@ failed:
|
||||
|
||||
======================================================================*/
|
||||
|
||||
void ide_release(struct pcmcia_device *link)
|
||||
static void ide_release(struct pcmcia_device *link)
|
||||
{
|
||||
ide_info_t *info = link->priv;
|
||||
ide_hwif_t *hwif = info->hwif;
|
||||
|
||||
@@ -130,10 +130,6 @@ typedef struct partition_t {
|
||||
u_int16_t DataUnits;
|
||||
u_int32_t BlocksPerUnit;
|
||||
erase_unit_header_t header;
|
||||
#if 0
|
||||
region_info_t region;
|
||||
memory_handle_t handle;
|
||||
#endif
|
||||
} partition_t;
|
||||
|
||||
/* Partition state flags */
|
||||
|
||||
@@ -498,17 +498,14 @@ static int pcmciamtd_config(struct pcmcia_device *link)
|
||||
int i;
|
||||
config_info_t t;
|
||||
static char *probes[] = { "jedec_probe", "cfi_probe" };
|
||||
cisinfo_t cisinfo;
|
||||
int new_name = 0;
|
||||
|
||||
DEBUG(3, "link=0x%p", link);
|
||||
|
||||
DEBUG(2, "Validating CIS");
|
||||
ret = pcmcia_validate_cis(link, &cisinfo);
|
||||
ret = pcmcia_validate_cis(link, NULL);
|
||||
if(ret != CS_SUCCESS) {
|
||||
cs_error(link, GetTupleData, ret);
|
||||
} else {
|
||||
DEBUG(2, "ValidateCIS found %d chains", cisinfo.Chains);
|
||||
}
|
||||
|
||||
card_settings(dev, link, &new_name);
|
||||
@@ -563,9 +560,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
|
||||
DEBUG(1, "Allocated a window of %dKiB", dev->win_size >> 10);
|
||||
|
||||
/* Get write protect status */
|
||||
CS_CHECK(GetStatus, pcmcia_get_status(link, &status));
|
||||
DEBUG(2, "status value: 0x%x window handle = 0x%8.8lx",
|
||||
status.CardState, (unsigned long)link->win);
|
||||
DEBUG(2, "window handle = 0x%8.8lx", (unsigned long)link->win);
|
||||
dev->win_base = ioremap(req.Base, req.Size);
|
||||
if(!dev->win_base) {
|
||||
err("ioremap(%lu, %u) failed", req.Base, req.Size);
|
||||
|
||||
@@ -263,6 +263,13 @@ config OMAP_CF
|
||||
Say Y here to support the CompactFlash controller on OMAP.
|
||||
Note that this doesn't support "True IDE" mode.
|
||||
|
||||
config BFIN_CFPCMCIA
|
||||
tristate "Blackfin CompactFlash PCMCIA Driver"
|
||||
depends on PCMCIA && BLACKFIN
|
||||
help
|
||||
Say Y here to support the CompactFlash PCMCIA driver for Blackfin.
|
||||
|
||||
|
||||
config AT91_CF
|
||||
tristate "AT91 CompactFlash Controller"
|
||||
depends on PCMCIA && ARCH_AT91RM9200
|
||||
|
||||
@@ -36,6 +36,7 @@ obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o
|
||||
obj-$(CONFIG_PCMCIA_VRC4171) += vrc4171_card.o
|
||||
obj-$(CONFIG_PCMCIA_VRC4173) += vrc4173_cardu.o
|
||||
obj-$(CONFIG_OMAP_CF) += omap_cf.o
|
||||
obj-$(CONFIG_BFIN_CFPCMCIA) += bfin_cf_pcmcia.o
|
||||
obj-$(CONFIG_AT91_CF) += at91_cf.o
|
||||
obj-$(CONFIG_ELECTRA_CF) += electra_cf.o
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/cs.h>
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/bulkmem.h>
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include "cs_internal.h"
|
||||
|
||||
@@ -34,9 +33,9 @@
|
||||
#define AU1000_PCMCIA_IO_SPEED (255)
|
||||
#define AU1000_PCMCIA_MEM_SPEED (300)
|
||||
|
||||
#define AU1X_SOCK0_IO 0xF00000000
|
||||
#define AU1X_SOCK0_PHYS_ATTR 0xF40000000
|
||||
#define AU1X_SOCK0_PHYS_MEM 0xF80000000
|
||||
#define AU1X_SOCK0_IO 0xF00000000ULL
|
||||
#define AU1X_SOCK0_PHYS_ATTR 0xF40000000ULL
|
||||
#define AU1X_SOCK0_PHYS_MEM 0xF80000000ULL
|
||||
/* pseudo 32 bit phys addresses, which get fixed up to the
|
||||
* real 36 bit address in fixup_bigphys_addr() */
|
||||
#define AU1X_SOCK0_PSEUDO_PHYS_ATTR 0xF4000000
|
||||
@@ -45,16 +44,20 @@
|
||||
/* pcmcia socket 1 needs external glue logic so the memory map
|
||||
* differs from board to board.
|
||||
*/
|
||||
#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_PB1200)
|
||||
#define AU1X_SOCK1_IO 0xF08000000
|
||||
#define AU1X_SOCK1_PHYS_ATTR 0xF48000000
|
||||
#define AU1X_SOCK1_PHYS_MEM 0xF88000000
|
||||
#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || \
|
||||
defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1550) || \
|
||||
defined(CONFIG_MIPS_PB1200)
|
||||
#define AU1X_SOCK1_IO 0xF08000000ULL
|
||||
#define AU1X_SOCK1_PHYS_ATTR 0xF48000000ULL
|
||||
#define AU1X_SOCK1_PHYS_MEM 0xF88000000ULL
|
||||
#define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4800000
|
||||
#define AU1X_SOCK1_PSEUDO_PHYS_MEM 0xF8800000
|
||||
#elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550) || defined(CONFIG_MIPS_DB1200)
|
||||
#define AU1X_SOCK1_IO 0xF04000000
|
||||
#define AU1X_SOCK1_PHYS_ATTR 0xF44000000
|
||||
#define AU1X_SOCK1_PHYS_MEM 0xF84000000
|
||||
#elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || \
|
||||
defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550) || \
|
||||
defined(CONFIG_MIPS_DB1200)
|
||||
#define AU1X_SOCK1_IO 0xF04000000ULL
|
||||
#define AU1X_SOCK1_PHYS_ATTR 0xF44000000ULL
|
||||
#define AU1X_SOCK1_PHYS_MEM 0xF84000000ULL
|
||||
#define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4400000
|
||||
#define AU1X_SOCK1_PSEUDO_PHYS_MEM 0xF8400000
|
||||
#endif
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/cs.h>
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/bulkmem.h>
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include <pcmcia/bus_ops.h>
|
||||
#include "cs_internal.h"
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/cs.h>
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/bulkmem.h>
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include <pcmcia/bus_ops.h>
|
||||
#include "cs_internal.h"
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
/*
|
||||
* file: drivers/pcmcia/bfin_cf.c
|
||||
*
|
||||
* based on: drivers/pcmcia/omap_cf.c
|
||||
* omap_cf.c -- OMAP 16xx CompactFlash controller driver
|
||||
*
|
||||
* Copyright (c) 2005 David Brownell
|
||||
* Copyright (c) 2006-2008 Michael Hennerich Analog Devices Inc.
|
||||
*
|
||||
* bugs: enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* this program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the gnu general public license as published by
|
||||
* the free software foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* this program is distributed in the hope that it will be useful,
|
||||
* but without any warranty; without even the implied warranty of
|
||||
* merchantability or fitness for a particular purpose. see the
|
||||
* gnu general public license for more details.
|
||||
*
|
||||
* you should have received a copy of the gnu general public license
|
||||
* along with this program; see the file copying.
|
||||
* if not, write to the free software foundation,
|
||||
* 59 temple place - suite 330, boston, ma 02111-1307, usa.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/cisreg.h>
|
||||
#include <asm/gpio.h>
|
||||
|
||||
#define SZ_1K 0x00000400
|
||||
#define SZ_8K 0x00002000
|
||||
#define SZ_2K (2 * SZ_1K)
|
||||
|
||||
#define POLL_INTERVAL (2 * HZ)
|
||||
|
||||
#define CF_ATASEL_ENA 0x20311802 /* Inverts RESET */
|
||||
#define CF_ATASEL_DIS 0x20311800
|
||||
|
||||
#define bfin_cf_present(pfx) (gpio_get_value(pfx))
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
static const char driver_name[] = "bfin_cf_pcmcia";
|
||||
|
||||
struct bfin_cf_socket {
|
||||
struct pcmcia_socket socket;
|
||||
|
||||
struct timer_list timer;
|
||||
unsigned present:1;
|
||||
unsigned active:1;
|
||||
|
||||
struct platform_device *pdev;
|
||||
unsigned long phys_cf_io;
|
||||
unsigned long phys_cf_attr;
|
||||
u_int irq;
|
||||
u_short cd_pfx;
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
static int bfin_cf_reset(void)
|
||||
{
|
||||
outw(0, CF_ATASEL_ENA);
|
||||
mdelay(200);
|
||||
outw(0, CF_ATASEL_DIS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bfin_cf_ss_init(struct pcmcia_socket *s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* the timer is primarily to kick this socket's pccardd */
|
||||
static void bfin_cf_timer(unsigned long _cf)
|
||||
{
|
||||
struct bfin_cf_socket *cf = (void *)_cf;
|
||||
unsigned short present = bfin_cf_present(cf->cd_pfx);
|
||||
|
||||
if (present != cf->present) {
|
||||
cf->present = present;
|
||||
dev_dbg(&cf->pdev->dev, ": card %s\n",
|
||||
present ? "present" : "gone");
|
||||
pcmcia_parse_events(&cf->socket, SS_DETECT);
|
||||
}
|
||||
|
||||
if (cf->active)
|
||||
mod_timer(&cf->timer, jiffies + POLL_INTERVAL);
|
||||
}
|
||||
|
||||
static int bfin_cf_get_status(struct pcmcia_socket *s, u_int *sp)
|
||||
{
|
||||
struct bfin_cf_socket *cf;
|
||||
|
||||
if (!sp)
|
||||
return -EINVAL;
|
||||
|
||||
cf = container_of(s, struct bfin_cf_socket, socket);
|
||||
|
||||
if (bfin_cf_present(cf->cd_pfx)) {
|
||||
*sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
|
||||
s->irq.AssignedIRQ = 0;
|
||||
s->pci_irq = cf->irq;
|
||||
|
||||
} else
|
||||
*sp = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
bfin_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s)
|
||||
{
|
||||
|
||||
struct bfin_cf_socket *cf;
|
||||
cf = container_of(sock, struct bfin_cf_socket, socket);
|
||||
|
||||
switch (s->Vcc) {
|
||||
case 0:
|
||||
case 33:
|
||||
break;
|
||||
case 50:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (s->flags & SS_RESET) {
|
||||
disable_irq(cf->irq);
|
||||
bfin_cf_reset();
|
||||
enable_irq(cf->irq);
|
||||
}
|
||||
|
||||
dev_dbg(&cf->pdev->dev, ": Vcc %d, io_irq %d, flags %04x csc %04x\n",
|
||||
s->Vcc, s->io_irq, s->flags, s->csc_mask);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bfin_cf_ss_suspend(struct pcmcia_socket *s)
|
||||
{
|
||||
return bfin_cf_set_socket(s, &dead_socket);
|
||||
}
|
||||
|
||||
/* regions are 2K each: mem, attrib, io (and reserved-for-ide) */
|
||||
|
||||
static int bfin_cf_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io)
|
||||
{
|
||||
struct bfin_cf_socket *cf;
|
||||
|
||||
cf = container_of(s, struct bfin_cf_socket, socket);
|
||||
io->flags &= MAP_ACTIVE | MAP_ATTRIB | MAP_16BIT;
|
||||
io->start = cf->phys_cf_io;
|
||||
io->stop = io->start + SZ_2K - 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
bfin_cf_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *map)
|
||||
{
|
||||
struct bfin_cf_socket *cf;
|
||||
|
||||
if (map->card_start)
|
||||
return -EINVAL;
|
||||
cf = container_of(s, struct bfin_cf_socket, socket);
|
||||
map->static_start = cf->phys_cf_io;
|
||||
map->flags &= MAP_ACTIVE | MAP_ATTRIB | MAP_16BIT;
|
||||
if (map->flags & MAP_ATTRIB)
|
||||
map->static_start = cf->phys_cf_attr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct pccard_operations bfin_cf_ops = {
|
||||
.init = bfin_cf_ss_init,
|
||||
.suspend = bfin_cf_ss_suspend,
|
||||
.get_status = bfin_cf_get_status,
|
||||
.set_socket = bfin_cf_set_socket,
|
||||
.set_io_map = bfin_cf_set_io_map,
|
||||
.set_mem_map = bfin_cf_set_mem_map,
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
static int __devinit bfin_cf_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct bfin_cf_socket *cf;
|
||||
struct resource *io_mem, *attr_mem;
|
||||
int irq;
|
||||
unsigned short cd_pfx;
|
||||
int status = 0;
|
||||
|
||||
dev_info(&pdev->dev, "Blackfin CompactFlash/PCMCIA Socket Driver\n");
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (!irq)
|
||||
return -EINVAL;
|
||||
|
||||
cd_pfx = platform_get_irq(pdev, 1); /*Card Detect GPIO PIN */
|
||||
|
||||
if (gpio_request(cd_pfx, "pcmcia: CD")) {
|
||||
dev_err(&pdev->dev,
|
||||
"Failed ro request Card Detect GPIO_%d\n",
|
||||
cd_pfx);
|
||||
return -EBUSY;
|
||||
}
|
||||
gpio_direction_input(cd_pfx);
|
||||
|
||||
cf = kzalloc(sizeof *cf, GFP_KERNEL);
|
||||
if (!cf) {
|
||||
gpio_free(cd_pfx);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
cf->cd_pfx = cd_pfx;
|
||||
|
||||
setup_timer(&cf->timer, bfin_cf_timer, (unsigned long)cf);
|
||||
|
||||
cf->pdev = pdev;
|
||||
platform_set_drvdata(pdev, cf);
|
||||
|
||||
cf->irq = irq;
|
||||
cf->socket.pci_irq = irq;
|
||||
|
||||
set_irq_type(irq, IRQF_TRIGGER_LOW);
|
||||
|
||||
io_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
attr_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
||||
|
||||
if (!io_mem || !attr_mem)
|
||||
goto fail0;
|
||||
|
||||
cf->phys_cf_io = io_mem->start;
|
||||
cf->phys_cf_attr = attr_mem->start;
|
||||
|
||||
/* pcmcia layer only remaps "real" memory */
|
||||
cf->socket.io_offset = (unsigned long)
|
||||
ioremap(cf->phys_cf_io, SZ_2K);
|
||||
|
||||
if (!cf->socket.io_offset)
|
||||
goto fail0;
|
||||
|
||||
dev_err(&pdev->dev, ": on irq %d\n", irq);
|
||||
|
||||
dev_dbg(&pdev->dev, ": %s\n",
|
||||
bfin_cf_present(cf->cd_pfx) ? "present" : "(not present)");
|
||||
|
||||
cf->socket.owner = THIS_MODULE;
|
||||
cf->socket.dev.parent = &pdev->dev;
|
||||
cf->socket.ops = &bfin_cf_ops;
|
||||
cf->socket.resource_ops = &pccard_static_ops;
|
||||
cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
|
||||
| SS_CAP_MEM_ALIGN;
|
||||
cf->socket.map_size = SZ_2K;
|
||||
|
||||
status = pcmcia_register_socket(&cf->socket);
|
||||
if (status < 0)
|
||||
goto fail2;
|
||||
|
||||
cf->active = 1;
|
||||
mod_timer(&cf->timer, jiffies + POLL_INTERVAL);
|
||||
return 0;
|
||||
|
||||
fail2:
|
||||
iounmap((void __iomem *)cf->socket.io_offset);
|
||||
release_mem_region(cf->phys_cf_io, SZ_8K);
|
||||
|
||||
fail0:
|
||||
gpio_free(cf->cd_pfx);
|
||||
kfree(cf);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static int __devexit bfin_cf_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct bfin_cf_socket *cf = platform_get_drvdata(pdev);
|
||||
|
||||
gpio_free(cf->cd_pfx);
|
||||
cf->active = 0;
|
||||
pcmcia_unregister_socket(&cf->socket);
|
||||
del_timer_sync(&cf->timer);
|
||||
iounmap((void __iomem *)cf->socket.io_offset);
|
||||
release_mem_region(cf->phys_cf_io, SZ_8K);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
kfree(cf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bfin_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
|
||||
{
|
||||
return pcmcia_socket_dev_suspend(&pdev->dev, mesg);
|
||||
}
|
||||
|
||||
static int bfin_cf_resume(struct platform_device *pdev)
|
||||
{
|
||||
return pcmcia_socket_dev_resume(&pdev->dev);
|
||||
}
|
||||
|
||||
static struct platform_driver bfin_cf_driver = {
|
||||
.driver = {
|
||||
.name = (char *)driver_name,
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
.probe = bfin_cf_probe,
|
||||
.remove = __devexit_p(bfin_cf_remove),
|
||||
.suspend = bfin_cf_suspend,
|
||||
.resume = bfin_cf_resume,
|
||||
};
|
||||
|
||||
static int __init bfin_cf_init(void)
|
||||
{
|
||||
return platform_driver_register(&bfin_cf_driver);
|
||||
}
|
||||
|
||||
static void __exit bfin_cf_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&bfin_cf_driver);
|
||||
}
|
||||
|
||||
module_init(bfin_cf_init);
|
||||
module_exit(bfin_cf_exit);
|
||||
|
||||
MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>")
|
||||
MODULE_DESCRIPTION("BFIN CF/PCMCIA Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -30,11 +30,9 @@
|
||||
#include <asm/irq.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#define IN_CARD_SERVICES
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/cs.h>
|
||||
#include <pcmcia/bulkmem.h>
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include "cs_internal.h"
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/cs.h>
|
||||
#include <pcmcia/bulkmem.h>
|
||||
#include <pcmcia/cisreg.h>
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include "cs_internal.h"
|
||||
@@ -1439,10 +1438,11 @@ EXPORT_SYMBOL(pccard_read_tuple);
|
||||
|
||||
======================================================================*/
|
||||
|
||||
int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info)
|
||||
int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, unsigned int *info)
|
||||
{
|
||||
tuple_t *tuple;
|
||||
cisparse_t *p;
|
||||
unsigned int count = 0;
|
||||
int ret, reserved, dev_ok = 0, ident_ok = 0;
|
||||
|
||||
if (!s)
|
||||
@@ -1457,7 +1457,7 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_
|
||||
return CS_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
info->Chains = reserved = 0;
|
||||
count = reserved = 0;
|
||||
tuple->DesiredTuple = RETURN_FIRST_TUPLE;
|
||||
tuple->Attributes = TUPLE_RETURN_COMMON;
|
||||
ret = pccard_get_first_tuple(s, function, tuple);
|
||||
@@ -1482,7 +1482,7 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_
|
||||
if (!dev_ok && !ident_ok)
|
||||
goto done;
|
||||
|
||||
for (info->Chains = 1; info->Chains < MAX_TUPLES; info->Chains++) {
|
||||
for (count = 1; count < MAX_TUPLES; count++) {
|
||||
ret = pccard_get_next_tuple(s, function, tuple);
|
||||
if (ret != CS_SUCCESS) break;
|
||||
if (((tuple->TupleCode > 0x23) && (tuple->TupleCode < 0x40)) ||
|
||||
@@ -1490,11 +1490,13 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_
|
||||
((tuple->TupleCode > 0x90) && (tuple->TupleCode < 0xff)))
|
||||
reserved++;
|
||||
}
|
||||
if ((info->Chains == MAX_TUPLES) || (reserved > 5) ||
|
||||
((!dev_ok || !ident_ok) && (info->Chains > 10)))
|
||||
info->Chains = 0;
|
||||
if ((count) || (reserved > 5) ||
|
||||
((!dev_ok || !ident_ok) && (count > 10)))
|
||||
count = 0;
|
||||
|
||||
done:
|
||||
if (info)
|
||||
*info = count;
|
||||
kfree(tuple);
|
||||
kfree(p);
|
||||
return CS_SUCCESS;
|
||||
|
||||
+3
-11
@@ -32,11 +32,9 @@
|
||||
#include <asm/system.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#define IN_CARD_SERVICES
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/cs.h>
|
||||
#include <pcmcia/bulkmem.h>
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include <pcmcia/cisreg.h>
|
||||
#include <pcmcia/ds.h>
|
||||
@@ -238,7 +236,6 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
|
||||
|
||||
init_completion(&socket->socket_released);
|
||||
init_completion(&socket->thread_done);
|
||||
init_waitqueue_head(&socket->thread_wait);
|
||||
mutex_init(&socket->skt_mutex);
|
||||
spin_lock_init(&socket->thread_lock);
|
||||
|
||||
@@ -278,10 +275,9 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
|
||||
|
||||
cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
|
||||
|
||||
if (socket->thread) {
|
||||
wake_up(&socket->thread_wait);
|
||||
if (socket->thread)
|
||||
kthread_stop(socket->thread);
|
||||
}
|
||||
|
||||
release_cis_mem(socket);
|
||||
|
||||
/* remove from our own list */
|
||||
@@ -635,7 +631,6 @@ static void socket_detect_change(struct pcmcia_socket *skt)
|
||||
static int pccardd(void *__skt)
|
||||
{
|
||||
struct pcmcia_socket *skt = __skt;
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
int ret;
|
||||
|
||||
skt->thread = current;
|
||||
@@ -656,7 +651,6 @@ static int pccardd(void *__skt)
|
||||
if (ret)
|
||||
dev_warn(&skt->dev, "err %d adding socket attributes\n", ret);
|
||||
|
||||
add_wait_queue(&skt->thread_wait, &wait);
|
||||
complete(&skt->thread_done);
|
||||
|
||||
set_freezable();
|
||||
@@ -694,8 +688,6 @@ static int pccardd(void *__skt)
|
||||
/* make sure we are running before we exit */
|
||||
set_current_state(TASK_RUNNING);
|
||||
|
||||
remove_wait_queue(&skt->thread_wait, &wait);
|
||||
|
||||
/* remove from the device core */
|
||||
pccard_sysfs_remove_socket(&skt->dev);
|
||||
device_unregister(&skt->dev);
|
||||
@@ -716,7 +708,7 @@ void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
|
||||
s->thread_events |= events;
|
||||
spin_unlock_irqrestore(&s->thread_lock, flags);
|
||||
|
||||
wake_up(&s->thread_wait);
|
||||
wake_up_process(s->thread);
|
||||
}
|
||||
} /* pcmcia_parse_events */
|
||||
EXPORT_SYMBOL(pcmcia_parse_events);
|
||||
|
||||
@@ -26,18 +26,6 @@
|
||||
#define CLIENT_WIN_REQ(i) (0x1<<(i))
|
||||
#define CLIENT_CARDBUS 0x8000
|
||||
|
||||
#define REGION_MAGIC 0xE3C9
|
||||
typedef struct region_t {
|
||||
u_short region_magic;
|
||||
u_short state;
|
||||
dev_info_t dev_info;
|
||||
struct pcmcia_device *mtd;
|
||||
u_int MediaID;
|
||||
region_info_t info;
|
||||
} region_t;
|
||||
|
||||
#define REGION_STALE 0x01
|
||||
|
||||
/* Each card function gets one of these guys */
|
||||
typedef struct config_t {
|
||||
struct kref ref;
|
||||
@@ -130,7 +118,6 @@ extern struct list_head pcmcia_socket_list;
|
||||
int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle, int idx, win_req_t *req);
|
||||
int pccard_get_configuration_info(struct pcmcia_socket *s, struct pcmcia_device *p_dev, config_info_t *config);
|
||||
int pccard_reset_card(struct pcmcia_socket *skt);
|
||||
int pccard_get_status(struct pcmcia_socket *s, struct pcmcia_device *p_dev, cs_status_t *status);
|
||||
|
||||
|
||||
struct pcmcia_callback{
|
||||
|
||||
+5
-7
@@ -25,7 +25,6 @@
|
||||
#include <linux/kref.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
||||
#define IN_CARD_SERVICES
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/cs.h>
|
||||
#include <pcmcia/cistpl.h>
|
||||
@@ -741,9 +740,8 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
|
||||
|
||||
static int pcmcia_card_add(struct pcmcia_socket *s)
|
||||
{
|
||||
cisinfo_t cisinfo;
|
||||
cistpl_longlink_mfc_t mfc;
|
||||
unsigned int no_funcs, i;
|
||||
unsigned int no_funcs, i, no_chains;
|
||||
int ret = 0;
|
||||
|
||||
if (!(s->resource_setup_done)) {
|
||||
@@ -757,8 +755,8 @@ static int pcmcia_card_add(struct pcmcia_socket *s)
|
||||
return -EAGAIN; /* try again, but later... */
|
||||
}
|
||||
|
||||
ret = pccard_validate_cis(s, BIND_FN_ALL, &cisinfo);
|
||||
if (ret || !cisinfo.Chains) {
|
||||
ret = pccard_validate_cis(s, BIND_FN_ALL, &no_chains);
|
||||
if (ret || !no_chains) {
|
||||
ds_dbg(0, "invalid CIS or invalid resources\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -852,7 +850,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
|
||||
{
|
||||
struct pcmcia_socket *s = dev->socket;
|
||||
const struct firmware *fw;
|
||||
char path[20];
|
||||
char path[FIRMWARE_NAME_MAX];
|
||||
int ret = -ENOMEM;
|
||||
int no_funcs;
|
||||
int old_funcs;
|
||||
@@ -864,7 +862,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
|
||||
|
||||
ds_dbg(1, "trying to load CIS file %s\n", filename);
|
||||
|
||||
if (strlen(filename) > 14) {
|
||||
if (strlen(filename) > (FIRMWARE_NAME_MAX - 1)) {
|
||||
printk(KERN_WARNING "pcmcia: CIS filename is too long [%s]\n",
|
||||
filename);
|
||||
return -EINVAL;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* $Id: hd64465_ss.c,v 1.7 2003/07/06 14:42:50 lethal Exp $
|
||||
*
|
||||
* Device driver for the PCMCIA controller module of the
|
||||
* Hitachi HD64465 handheld companion chip.
|
||||
*
|
||||
@@ -48,7 +46,6 @@
|
||||
#include <pcmcia/cistpl.h>
|
||||
#include <pcmcia/ds.h>
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/bulkmem.h>
|
||||
#include "cs_internal.h"
|
||||
|
||||
#define MODNAME "hd64465_ss"
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
*
|
||||
* Author: Arjan Van De Ven <arjanv@redhat.com>
|
||||
* Loosly based on i82365.c from the pcmcia-cs package
|
||||
*
|
||||
* $Id: i82092aa.c,v 1.2 2001/10/23 14:43:34 arjanv Exp $
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
/* $Id: i82092aa.h,v 1.1.1.1 2001/09/19 14:53:15 dwmw2 Exp $ */
|
||||
|
||||
/* Debuging defines */
|
||||
#ifdef NOTRACE
|
||||
#define enter(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user