Commit e1104a6f authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk/linux-2.5-pcmcia

into home.transmeta.com:/home/torvalds/v2.5/linux
parents c665225a dfd3ad98
......@@ -39,7 +39,6 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/proc_fs.h>
#define IN_CARD_SERVICES
#include <pcmcia/cs_types.h>
......
......@@ -169,7 +169,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void
DEBUG(3, "cs: read_cb_mem(%d, %#x, %u)\n", space, addr, len);
dev = pci_find_slot(s->cap.cb_dev->subordinate->number, 0);
dev = pci_find_slot(s->cb_dev->subordinate->number, 0);
if (!dev)
goto fail;
......@@ -239,7 +239,7 @@ static void cardbus_assign_irqs(struct pci_bus *bus, int irq)
int cb_alloc(struct pcmcia_socket * s)
{
struct pci_bus *bus = s->cap.cb_dev->subordinate;
struct pci_bus *bus = s->cb_dev->subordinate;
struct pci_dev *dev;
unsigned int max, pass;
......@@ -258,17 +258,17 @@ int cb_alloc(struct pcmcia_socket * s)
*/
pci_bus_size_bridges(bus);
pci_bus_assign_resources(bus);
cardbus_assign_irqs(bus, s->cap.pci_irq);
cardbus_assign_irqs(bus, s->pci_irq);
pci_enable_bridges(bus);
pci_bus_add_devices(bus);
s->irq.AssignedIRQ = s->cap.pci_irq;
s->irq.AssignedIRQ = s->pci_irq;
return CS_SUCCESS;
}
void cb_free(struct pcmcia_socket * s)
{
struct pci_dev *bridge = s->cap.cb_dev;
struct pci_dev *bridge = s->cb_dev;
cb_release_cis_mem(s);
......
......@@ -87,8 +87,8 @@ void release_cis_mem(struct pcmcia_socket *s)
if (s->cis_mem.sys_start != 0) {
s->cis_mem.flags &= ~MAP_ACTIVE;
s->ss_entry->set_mem_map(s, &s->cis_mem);
if (!(s->cap.features & SS_CAP_STATIC_MAP))
release_mem_region(s->cis_mem.sys_start, s->cap.map_size);
if (!(s->features & SS_CAP_STATIC_MAP))
release_mem_region(s->cis_mem.sys_start, s->map_size);
iounmap(s->cis_virt);
s->cis_mem.sys_start = 0;
s->cis_virt = NULL;
......@@ -104,26 +104,26 @@ static unsigned char *
set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flags)
{
pccard_mem_map *mem = &s->cis_mem;
if (!(s->cap.features & SS_CAP_STATIC_MAP) &&
if (!(s->features & SS_CAP_STATIC_MAP) &&
mem->sys_start == 0) {
int low = !(s->cap.features & SS_CAP_PAGE_REGS);
int low = !(s->features & SS_CAP_PAGE_REGS);
validate_mem(s);
mem->sys_start = 0;
if (find_mem_region(&mem->sys_start, s->cap.map_size,
s->cap.map_size, low, "card services", s)) {
if (find_mem_region(&mem->sys_start, s->map_size,
s->map_size, low, "card services", s)) {
printk(KERN_NOTICE "cs: unable to map card memory!\n");
return NULL;
}
mem->sys_stop = mem->sys_start+s->cap.map_size-1;
s->cis_virt = ioremap(mem->sys_start, s->cap.map_size);
mem->sys_stop = mem->sys_start+s->map_size-1;
s->cis_virt = ioremap(mem->sys_start, s->map_size);
}
mem->card_start = card_offset;
mem->flags = flags;
s->ss_entry->set_mem_map(s, mem);
if (s->cap.features & SS_CAP_STATIC_MAP) {
if (s->features & SS_CAP_STATIC_MAP) {
if (s->cis_virt)
iounmap(s->cis_virt);
s->cis_virt = ioremap(mem->sys_start, s->cap.map_size);
s->cis_virt = ioremap(mem->sys_start, s->map_size);
}
return s->cis_virt;
}
......@@ -178,21 +178,21 @@ int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
addr *= 2;
}
card_offset = addr & ~(s->cap.map_size-1);
card_offset = addr & ~(s->map_size-1);
while (len) {
sys = set_cis_map(s, card_offset, flags);
if (!sys) {
memset(ptr, 0xff, len);
return -1;
}
end = sys + s->cap.map_size;
sys = sys + (addr & (s->cap.map_size-1));
end = sys + s->map_size;
sys = sys + (addr & (s->map_size-1));
for ( ; len > 0; len--, buf++, sys += inc) {
if (sys == end)
break;
*buf = readb(sys);
}
card_offset += s->cap.map_size;
card_offset += s->map_size;
addr = 0;
}
}
......@@ -239,20 +239,20 @@ void write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
addr *= 2;
}
card_offset = addr & ~(s->cap.map_size-1);
card_offset = addr & ~(s->map_size-1);
while (len) {
sys = set_cis_map(s, card_offset, flags);
if (!sys)
return; /* FIXME: error */
end = sys + s->cap.map_size;
sys = sys + (addr & (s->cap.map_size-1));
end = sys + s->map_size;
sys = sys + (addr & (s->map_size-1));
for ( ; len > 0; len--, buf++, sys += inc) {
if (sys == end)
break;
writeb(*buf, sys);
}
card_offset += s->cap.map_size;
card_offset += s->map_size;
addr = 0;
}
}
......@@ -418,7 +418,7 @@ int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple)
tuple->TupleLink = tuple->Flags = 0;
#ifdef CONFIG_CARDBUS
if (s->state & SOCKET_CARDBUS) {
struct pci_dev *dev = s->cap.cb_dev;
struct pci_dev *dev = s->cb_dev;
u_int ptr;
pci_bus_read_config_dword(dev->subordinate, 0, PCI_CARDBUS_CIS, &ptr);
tuple->CISOffset = ptr & ~7;
......
......@@ -44,7 +44,6 @@
#include <linux/timer.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/pm.h>
#include <linux/pci.h>
#include <linux/device.h>
......@@ -129,11 +128,6 @@ socket_state_t dead_socket = {
LIST_HEAD(pcmcia_socket_list);
DECLARE_RWSEM(pcmcia_socket_list_rwsem);
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc_pccard = NULL;
#endif
/*====================================================================*/
/* String tables for error messages */
......@@ -281,24 +275,7 @@ static int init_socket(struct pcmcia_socket *s)
return s->ss_entry->init(s);
}
/*====================================================================*/
#if defined(CONFIG_PROC_FS) && defined(PCMCIA_DEBUG)
static int proc_read_clients(char *buf, char **start, off_t pos,
int count, int *eof, void *data)
{
struct pcmcia_socket *s = data;
client_handle_t c;
char *p = buf;
for (c = s->clients; c; c = c->next)
p += sprintf(p, "fn %x: '%s' [attr 0x%04x] [state 0x%04x]\n",
c->Function, c->dev_info, c->Attributes, c->state);
return (p - buf);
}
#endif
/*======================================================================
/*====================================================================
Low-level PC Card interface drivers need to register with Card
Services using these calls.
......@@ -375,7 +352,6 @@ static int pcmcia_add_socket(struct class_device *class_dev)
spin_lock_init(&socket->lock);
init_socket(socket);
socket->ss_entry->inquire_socket(socket, &socket->cap);
init_completion(&socket->thread_done);
init_waitqueue_head(&socket->thread_wait);
......@@ -388,20 +364,6 @@ static int pcmcia_add_socket(struct class_device *class_dev)
wait_for_completion(&socket->thread_done);
BUG_ON(!socket->thread);
#ifdef CONFIG_PROC_FS
if (proc_pccard) {
char name[3];
sprintf(name, "%02d", socket->sock);
socket->proc = proc_mkdir(name, proc_pccard);
if (socket->proc)
socket->ss_entry->proc_setup(socket, socket->proc);
#ifdef PCMCIA_DEBUG
if (socket->proc)
create_proc_read_entry("clients", 0, socket->proc,
proc_read_clients, socket);
#endif
}
#endif
return 0;
}
......@@ -410,16 +372,6 @@ static void pcmcia_remove_socket(struct class_device *class_dev)
struct pcmcia_socket *socket = class_get_devdata(class_dev);
client_t *client;
#ifdef CONFIG_PROC_FS
if (proc_pccard) {
char name[3];
sprintf(name, "%02d", socket->sock);
#ifdef PCMCIA_DEBUG
remove_proc_entry("clients", socket->proc);
#endif
remove_proc_entry(name, proc_pccard);
}
#endif
if (socket->thread) {
init_completion(&socket->thread_done);
socket->thread = NULL;
......@@ -435,6 +387,12 @@ static void pcmcia_remove_socket(struct class_device *class_dev)
socket->ss_entry = NULL;
}
static void pcmcia_release_socket(struct class_device *class_dev)
{
struct pcmcia_socket *socket = class_get_devdata(class_dev);
complete(&socket->socket_released);
}
/**
* pcmcia_register_socket - add a new pcmcia socket device
......@@ -473,7 +431,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
/* set proper values in socket->dev */
socket->dev.class_data = socket;
socket->dev.class = &pcmcia_socket_class;
snprintf(socket->dev.class_id, BUS_ID_SIZE, "pcmcia_socket%u\n", socket->sock);
snprintf(socket->dev.class_id, BUS_ID_SIZE, "pcmcia_socket%u", socket->sock);
/* register with the device core */
if (class_device_register(&socket->dev)) {
......@@ -498,6 +456,8 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
DEBUG(0, "cs: pcmcia_unregister_socket(0x%p)\n", socket->ss_entry);
init_completion(&socket->socket_released);
/* remove from the device core */
class_device_unregister(&socket->dev);
......@@ -505,6 +465,9 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
down_write(&pcmcia_socket_list_rwsem);
list_del(&socket->socket_list);
up_write(&pcmcia_socket_list_rwsem);
/* wait for sysfs to drop all references */
wait_for_completion(&socket->socket_released);
} /* pcmcia_unregister_socket */
EXPORT_SYMBOL(pcmcia_unregister_socket);
......@@ -918,8 +881,8 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
*base, align);
align = 0;
}
if ((s->cap.features & SS_CAP_STATIC_MAP) && s->cap.io_offset) {
*base = s->cap.io_offset | (*base & 0x0fff);
if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) {
*base = s->io_offset | (*base & 0x0fff);
return 0;
}
/* Check for an already-allocated window that must conflict with
......@@ -966,7 +929,7 @@ static void release_io_space(struct pcmcia_socket *s, ioaddr_t base,
ioaddr_t num)
{
int i;
if(!(s->cap.features & SS_CAP_STATIC_MAP))
if(!(s->features & SS_CAP_STATIC_MAP))
release_region(base, num);
for (i = 0; i < MAX_IO_WIN; i++) {
if ((s->io[i].BasePort <= base) &&
......@@ -1183,7 +1146,7 @@ int pcmcia_get_configuration_info(client_handle_t handle,
config->Function = fn;
config->Vcc = s->socket.Vcc;
config->Vpp1 = config->Vpp2 = s->socket.Vpp;
config->Option = s->cap.cb_dev->subordinate->number;
config->Option = s->cb_dev->subordinate->number;
if (s->state & SOCKET_CARDBUS_CONFIG) {
config->Attributes = CONF_VALID_CLIENT;
config->IntType = INT_CARDBUS;
......@@ -1356,7 +1319,7 @@ struct pci_bus *pcmcia_lookup_bus(client_handle_t handle)
if (!(s->state & SOCKET_CARDBUS))
return NULL;
return s->cap.cb_dev->subordinate;
return s->cb_dev->subordinate;
}
EXPORT_SYMBOL(pcmcia_lookup_bus);
......@@ -1728,7 +1691,7 @@ int pcmcia_release_irq(client_handle_t handle, irq_req_t *req)
}
#ifdef CONFIG_PCMCIA_PROBE
if (req->AssignedIRQ != s->cap.pci_irq)
if (req->AssignedIRQ != s->pci_irq)
undo_irq(req->Attributes, req->AssignedIRQ);
#endif
......@@ -1753,7 +1716,7 @@ int pcmcia_release_window(window_handle_t win)
s->state &= ~SOCKET_WIN_REQ(win->index);
/* Release system memory */
if(!(s->cap.features & SS_CAP_STATIC_MAP))
if(!(s->features & SS_CAP_STATIC_MAP))
release_mem_region(win->base, win->size);
win->handle->state &= ~CLIENT_WIN_REQ(win->index);
......@@ -1978,22 +1941,22 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
return CS_IN_USE;
/* Short cut: if there are no ISA interrupts, then it is PCI */
if (!s->cap.irq_mask) {
irq = s->cap.pci_irq;
if (!s->irq_mask) {
irq = s->pci_irq;
ret = (irq) ? 0 : CS_IN_USE;
#ifdef CONFIG_PCMCIA_PROBE
} else if (s->irq.AssignedIRQ != 0) {
/* If the interrupt is already assigned, it must match */
irq = s->irq.AssignedIRQ;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
u_int mask = req->IRQInfo2 & s->cap.irq_mask;
u_int mask = req->IRQInfo2 & s->irq_mask;
ret = ((mask >> irq) & 1) ? 0 : CS_BAD_ARGS;
} else
ret = ((req->IRQInfo1&IRQ_MASK) == irq) ? 0 : CS_BAD_ARGS;
} else {
ret = CS_IN_USE;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
u_int try, mask = req->IRQInfo2 & s->cap.irq_mask;
u_int try, mask = req->IRQInfo2 & s->irq_mask;
for (try = 0; try < 2; try++) {
for (irq = 0; irq < 32; irq++)
if ((mask >> irq) & 1) {
......@@ -2014,7 +1977,7 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
if (request_irq(irq, req->Handler,
((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||
(s->functions > 1) ||
(irq == s->cap.pci_irq)) ? SA_SHIRQ : 0,
(irq == s->pci_irq)) ? SA_SHIRQ : 0,
handle->dev_info, req->Instance))
return CS_IN_USE;
}
......@@ -2052,13 +2015,13 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
/* Window size defaults to smallest available */
if (req->Size == 0)
req->Size = s->cap.map_size;
align = (((s->cap.features & SS_CAP_MEM_ALIGN) ||
req->Size = s->map_size;
align = (((s->features & SS_CAP_MEM_ALIGN) ||
(req->Attributes & WIN_STRICT_ALIGN)) ?
req->Size : s->cap.map_size);
if (req->Size & (s->cap.map_size-1))
req->Size : s->map_size);
if (req->Size & (s->map_size-1))
return CS_BAD_SIZE;
if ((req->Base && (s->cap.features & SS_CAP_STATIC_MAP)) ||
if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) ||
(req->Base & (align-1)))
return CS_BAD_BASE;
if (req->Base)
......@@ -2078,10 +2041,10 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
win->base = req->Base;
win->size = req->Size;
if (!(s->cap.features & SS_CAP_STATIC_MAP) &&
if (!(s->features & SS_CAP_STATIC_MAP) &&
find_mem_region(&win->base, win->size, align,
(req->Attributes & WIN_MAP_BELOW_1MB) ||
!(s->cap.features & SS_CAP_PAGE_REGS),
!(s->features & SS_CAP_PAGE_REGS),
(*handle)->dev_info, s))
return CS_IN_USE;
(*handle)->state |= CLIENT_WIN_REQ(w);
......@@ -2541,12 +2504,10 @@ EXPORT_SYMBOL(pcmcia_write_memory);
EXPORT_SYMBOL(dead_socket);
EXPORT_SYMBOL(CardServices);
EXPORT_SYMBOL(MTDHelperEntry);
#ifdef CONFIG_PROC_FS
EXPORT_SYMBOL(proc_pccard);
#endif
struct class pcmcia_socket_class = {
.name = "pcmcia_socket",
.release = pcmcia_release_socket,
};
EXPORT_SYMBOL(pcmcia_socket_class);
......@@ -2564,9 +2525,6 @@ static int __init init_pcmcia_cs(void)
DEBUG(0, "%s\n", version);
class_register(&pcmcia_socket_class);
class_interface_register(&pcmcia_socket);
#ifdef CONFIG_PROC_FS
proc_pccard = proc_mkdir("pccard", proc_bus);
#endif
return 0;
}
......@@ -2574,11 +2532,6 @@ static int __init init_pcmcia_cs(void)
static void __exit exit_pcmcia_cs(void)
{
printk(KERN_INFO "unloading Kernel Card Services\n");
#ifdef CONFIG_PROC_FS
if (proc_pccard) {
remove_proc_entry("pccard", proc_bus);
}
#endif
release_resource_db();
class_interface_unregister(&pcmcia_socket);
class_unregister(&pcmcia_socket_class);
......
......@@ -173,18 +173,10 @@ int try_irq(u_int Attributes, int irq, int specific);
void undo_irq(u_int Attributes, int irq);
int adjust_resource_info(client_handle_t handle, adjust_t *adj);
void release_resource_db(void);
int proc_read_io(char *buf, char **start, off_t pos,
int count, int *eof, void *data);
int proc_read_mem(char *buf, char **start, off_t pos,
int count, int *eof, void *data);
extern struct rw_semaphore pcmcia_socket_list_rwsem;
extern struct list_head pcmcia_socket_list;
#ifdef CONFIG_PROC_FS
extern struct proc_dir_entry *proc_pccard;
#endif
#ifdef PCMCIA_DEBUG
extern int pc_debug;
#define DEBUG(n, args...) do { if (pc_debug>(n)) printk(KERN_DEBUG args); } while (0)
......
......@@ -164,6 +164,8 @@ void pcmcia_unregister_driver(struct pcmcia_driver *driver)
EXPORT_SYMBOL(pcmcia_unregister_driver);
#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *proc_pccard = NULL;
static int proc_read_drivers_callback(struct device_driver *driver, void *d)
{
char **p = d;
......@@ -929,6 +931,7 @@ static int __init init_pcmcia_bus(void)
major_dev = i;
#ifdef CONFIG_PROC_FS
proc_pccard = proc_mkdir("pccard", proc_bus);
if (proc_pccard)
create_proc_read_entry("drivers",0,proc_pccard,proc_read_drivers,NULL);
#endif
......@@ -944,8 +947,10 @@ static void __exit exit_pcmcia_bus(void)
class_interface_unregister(&pcmcia_bus_interface);
#ifdef CONFIG_PROC_FS
if (proc_pccard)
if (proc_pccard) {
remove_proc_entry("drivers", proc_pccard);
remove_proc_entry("pccard", proc_bus);
}
#endif
if (major_dev != -1)
unregister_chrdev(major_dev, "pcmcia");
......
......@@ -68,13 +68,11 @@ static struct pccard_operations i82092aa_operations = {
.init = i82092aa_init,
.suspend = i82092aa_suspend,
.register_callback = i82092aa_register_callback,
.inquire_socket = i82092aa_inquire_socket,
.get_status = i82092aa_get_status,
.get_socket = i82092aa_get_socket,
.set_socket = i82092aa_set_socket,
.set_io_map = i82092aa_set_io_map,
.set_mem_map = i82092aa_set_mem_map,
.proc_setup = i82092aa_proc_setup,
};
/* The card can do upto 4 sockets, allocate a structure for each of them */
......@@ -86,7 +84,6 @@ struct socket_info {
2 = card but not initialized,
3 = operational card */
int io_base; /* base io address of the socket */
socket_cap_t cap;
unsigned int pending_events; /* Pending events on this interface */
......@@ -141,10 +138,10 @@ static int __init i82092aa_pci_probe(struct pci_dev *dev, const struct pci_devic
for (i = 0;i<socket_count;i++) {
sockets[i].card_state = 1; /* 1 = present but empty */
sockets[i].io_base = pci_resource_start(dev, 0);
sockets[i].cap.features |= SS_CAP_PCCARD;
sockets[i].cap.map_size = 0x1000;
sockets[i].cap.irq_mask = 0;
sockets[i].cap.pci_irq = dev->irq;
sockets[i].socket.features |= SS_CAP_PCCARD;
sockets[i].socket.map_size = 0x1000;
sockets[i].socket.irq_mask = 0;
sockets[i].socket.pci_irq = dev->irq;
sockets[i].number = i;
......@@ -488,16 +485,6 @@ static int i82092aa_register_callback(struct pcmcia_socket *socket, void (*handl
return 0;
} /* i82092aa_register_callback */
static int i82092aa_inquire_socket(struct pcmcia_socket *socket, socket_cap_t *cap)
{
unsigned int sock = container_of(socket, struct socket_info, socket)->number;
enter("i82092aa_inquire_socket");
*cap = sockets[sock].cap;
leave("i82092aa_inquire_socket");
return 0;
} /* i82092aa_inquire_socket */
static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
{
unsigned int sock = container_of(socket, struct socket_info, socket)->number;
......@@ -832,12 +819,6 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
return 0;
}
static void i82092aa_proc_setup(struct pcmcia_socket *socket, struct proc_dir_entry *base)
{
}
/* Module stuff */
static int i82092aa_module_init(void)
{
enter("i82092aa_module_init");
......
......@@ -36,8 +36,6 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
static int i82092aa_init(struct pcmcia_socket *socket);
static int i82092aa_suspend(struct pcmcia_socket *socket);
static int i82092aa_register_callback(struct pcmcia_socket *socket, void (*handler)(void *, unsigned int), void * info);
static int i82092aa_inquire_socket(struct pcmcia_socket *socket, socket_cap_t *cap);
static void i82092aa_proc_setup(struct pcmcia_socket *socket, struct proc_dir_entry *base);
#endif
......@@ -45,7 +45,6 @@
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/device.h>
......@@ -162,15 +161,11 @@ struct i82365_socket {
u_short type, flags;
struct pcmcia_socket socket;
unsigned int number;
socket_cap_t cap;
ioaddr_t ioaddr;
u_short psock;
u_char cs_irq, intr;
void (*handler)(void *info, u_int events);
void *info;
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc;
#endif
union {
cirrus_state_t cirrus;
vg46x_state_t vg46x;
......@@ -762,9 +757,9 @@ static void __init add_pcic(int ns, int type)
/* Update socket interrupt information, capabilities */
for (i = 0; i < ns; i++) {
t[i].cap.features |= SS_CAP_PCCARD;
t[i].cap.map_size = 0x1000;
t[i].cap.irq_mask = mask;
t[i].socket.features |= SS_CAP_PCCARD;
t[i].socket.map_size = 0x1000;
t[i].socket.irq_mask = mask;
t[i].cs_irq = isa_irq;
}
......@@ -911,7 +906,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev,
active = 0;
for (i = 0; i < sockets; i++) {
if ((socket[i].cs_irq != irq) &&
(socket[i].cap.pci_irq != irq))
(socket[i].socket.pci_irq != irq))
continue;
handled = 1;
ISA_LOCK(i, flags);
......@@ -983,15 +978,6 @@ static int pcic_register_callback(struct pcmcia_socket *s, void (*handler)(void
/*====================================================================*/
static int pcic_inquire_socket(struct pcmcia_socket *s, socket_cap_t *cap)
{
unsigned int sock = container_of(s, struct i82365_socket, socket)->number;
*cap = socket[sock].cap;
return 0;
} /* pcic_inquire_socket */
/*====================================================================*/
static int i365_get_status(u_short sock, u_int *value)
{
u_int status;
......@@ -1113,7 +1099,7 @@ static int i365_set_socket(u_short sock, socket_state_t *state)
/* IO card, RESET flag, IO interrupt */
reg = t->intr;
if (state->io_irq != t->cap.pci_irq) reg |= state->io_irq;
if (state->io_irq != t->socket.pci_irq) reg |= state->io_irq;
reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET;
reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0;
i365_set(sock, I365_INTCTL, reg);
......@@ -1288,71 +1274,42 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
/*======================================================================
Routines for accessing socket information and register dumps via
/proc/bus/pccard/...
/sys/class/pcmcia_socket/...
======================================================================*/
#ifdef CONFIG_PROC_FS
static int proc_read_info(char *buf, char **start, off_t pos,
int count, int *eof, void *data)
static ssize_t show_info(struct class_device *class_dev, char *buf)
{
struct i82365_socket *s = data;
char *p = buf;
p += sprintf(p, "type: %s\npsock: %d\n",
struct i82365_socket *s = container_of(class_dev, struct i82365_socket, socket.dev);
return sprintf(buf, "type: %s\npsock: %d\n",
pcic[s->type].name, s->psock);
return (p - buf);
}
static int proc_read_exca(char *buf, char **start, off_t pos,
int count, int *eof, void *data)
static ssize_t show_exca(struct class_device *class_dev, char *buf)
{
u_short sock = (struct i82365_socket *)data - socket;
char *p = buf;
int i, top;
struct i82365_socket *s = container_of(class_dev, struct i82365_socket, socket.dev);
unsigned short sock;
int i;
ssize_t ret = 0;
unsigned long flags = 0;
sock = s->number;
u_long flags = 0;
ISA_LOCK(sock, flags);
top = 0x40;
for (i = 0; i < top; i += 4) {
if (i == 0x50) {
p += sprintf(p, "\n");
i = 0x100;
}
p += sprintf(p, "%02x %02x %02x %02x%s",
for (i = 0; i < 0x40; i += 4) {
ret += sprintf(buf, "%02x %02x %02x %02x%s",
i365_get(sock,i), i365_get(sock,i+1),
i365_get(sock,i+2), i365_get(sock,i+3),
((i % 16) == 12) ? "\n" : " ");
buf += ret;
}
ISA_UNLOCK(sock, flags);
return (p - buf);
}
static void pcic_proc_setup(struct pcmcia_socket *sock, struct proc_dir_entry *base)
{
struct i82365_socket *s = container_of(sock, struct i82365_socket, socket);
if (s->flags & IS_ALIVE)
return;
create_proc_read_entry("info", 0, base, proc_read_info, s);
create_proc_read_entry("exca", 0, base, proc_read_exca, s);
s->proc = base;
return ret;
}
static void pcic_proc_remove(u_short sock)
{
struct proc_dir_entry *base = socket[sock].proc;
if (base == NULL) return;
remove_proc_entry("info", base);
remove_proc_entry("exca", base);
}
#else
#define pcic_proc_setup NULL
#endif /* CONFIG_PROC_FS */
static CLASS_DEVICE_ATTR(exca, S_IRUGO, show_exca, NULL);
static CLASS_DEVICE_ATTR(info, S_IRUGO, show_info, NULL);
/*====================================================================*/
......@@ -1447,13 +1404,11 @@ static struct pccard_operations pcic_operations = {
.init = pcic_init,
.suspend = pcic_suspend,
.register_callback = pcic_register_callback,
.inquire_socket = pcic_inquire_socket,
.get_status = pcic_get_status,
.get_socket = pcic_get_socket,
.set_socket = pcic_set_socket,
.set_io_map = pcic_set_io_map,
.set_mem_map = pcic_set_mem_map,
.proc_setup = pcic_proc_setup,
};
/*====================================================================*/
......@@ -1527,6 +1482,9 @@ static int __init init_i82365(void)
add_timer(&poll_timer);
}
class_device_create_file(&socket[i].socket.dev, &class_device_attr_info);
class_device_create_file(&socket[i].socket.dev, &class_device_attr_exca);
return 0;
} /* init_i82365 */
......@@ -1534,11 +1492,9 @@ static int __init init_i82365(void)
static void __exit exit_i82365(void)
{
int i;
for (i = 0; i < sockets; i++) {
pcmcia_unregister_socket(&socket[i].socket);
#ifdef CONFIG_PROC_FS
pcic_proc_remove(i);
#endif
}
platform_device_unregister(&i82365_device);
if (poll_interval != 0)
......
......@@ -41,7 +41,6 @@
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/timer.h>
#include <linux/proc_fs.h>
#include <linux/pci.h>
#include <asm/irq.h>
#include <asm/io.h>
......@@ -346,17 +345,17 @@ static int cis_readable(struct pcmcia_socket *s, u_long base)
cisinfo_t info1, info2;
int ret;
s->cis_mem.sys_start = base;
s->cis_mem.sys_stop = base+s->cap.map_size-1;
s->cis_virt = ioremap(base, s->cap.map_size);
s->cis_mem.sys_stop = base+s->map_size-1;
s->cis_virt = ioremap(base, s->map_size);
ret = pcmcia_validate_cis(s->clients, &info1);
/* invalidate mapping and CIS cache */
iounmap(s->cis_virt);
destroy_cis_cache(s);
if ((ret != 0) || (info1.Chains == 0))
return 0;
s->cis_mem.sys_start = base+s->cap.map_size;
s->cis_mem.sys_stop = base+2*s->cap.map_size-1;
s->cis_virt = ioremap(base+s->cap.map_size, s->cap.map_size);
s->cis_mem.sys_start = base+s->map_size;
s->cis_mem.sys_stop = base+2*s->map_size-1;
s->cis_virt = ioremap(base+s->map_size, s->map_size);
ret = pcmcia_validate_cis(s->clients, &info2);
iounmap(s->cis_virt);
destroy_cis_cache(s);
......@@ -368,14 +367,14 @@ static int checksum(struct pcmcia_socket *s, u_long base)
{
int i, a, b, d;
s->cis_mem.sys_start = base;
s->cis_mem.sys_stop = base+s->cap.map_size-1;
s->cis_virt = ioremap(base, s->cap.map_size);
s->cis_mem.sys_stop = base+s->map_size-1;
s->cis_virt = ioremap(base, s->map_size);
s->cis_mem.card_start = 0;
s->cis_mem.flags = MAP_ACTIVE;
s->ss_entry->set_mem_map(s, &s->cis_mem);
/* Don't bother checking every word... */
a = 0; b = -1;
for (i = 0; i < s->cap.map_size; i += 44) {
for (i = 0; i < s->map_size; i += 44) {
d = readl(s->cis_virt+i);
a += d; b &= d;
}
......@@ -385,7 +384,7 @@ static int checksum(struct pcmcia_socket *s, u_long base)
static int checksum_match(struct pcmcia_socket *s, u_long base)
{
int a = checksum(s, base), b = checksum(s, base+s->cap.map_size);
int a = checksum(s, base), b = checksum(s, base+s->map_size);
return ((a == b) && (a >= 0));
}
......@@ -406,19 +405,19 @@ static int do_mem_probe(u_long base, u_long num, struct pcmcia_socket *s)
bad = fail = 0;
step = (num < 0x20000) ? 0x2000 : ((num>>4) & ~0x1fff);
/* cis_readable wants to map 2x map_size */
if (step < 2 * s->cap.map_size)
step = 2 * s->cap.map_size;
if (step < 2 * s->map_size)
step = 2 * s->map_size;
for (i = j = base; i < base+num; i = j + step) {
if (!fail) {
for (j = i; j < base+num; j += step)
if ((check_mem_resource(j, step, s->cap.cb_dev) == 0) &&
if ((check_mem_resource(j, step, s->cb_dev) == 0) &&
cis_readable(s, j))
break;
fail = ((i == base) && (j == base+num));
}
if (fail) {
for (j = i; j < base+num; j += 2*step)
if ((check_mem_resource(j, 2*step, s->cap.cb_dev) == 0) &&
if ((check_mem_resource(j, 2*step, s->cb_dev) == 0) &&
checksum_match(s, j) && checksum_match(s, j + step))
break;
}
......@@ -457,7 +456,7 @@ void validate_mem(struct pcmcia_socket *s)
static u_char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 };
static int hi = 0, lo = 0;
u_long b, i, ok = 0;
int force_low = !(s->cap.features & SS_CAP_PAGE_REGS);
int force_low = !(s->features & SS_CAP_PAGE_REGS);
if (!probe_mem)
return;
......@@ -541,7 +540,7 @@ int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align,
for (try = (try >= m->base) ? try : try+align;
(try >= m->base) && (try+num <= m->base+m->num);
try += align) {
if (request_io_resource(try, num, name, s->cap.cb_dev) == 0) {
if (request_io_resource(try, num, name, s->cb_dev) == 0) {
*base = try;
ret = 0;
goto out;
......@@ -573,7 +572,7 @@ int find_mem_region(u_long *base, u_long num, u_long align,
for (try = (try >= m->base) ? try : try+align;
(try >= m->base) && (try+num <= m->base+m->num);
try += align) {
if (request_mem_resource(try, num, name, s->cap.cb_dev) == 0) {
if (request_mem_resource(try, num, name, s->cb_dev) == 0) {
*base = try;
ret = 0;
goto out;
......
......@@ -37,7 +37,6 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/config.h>
#include <linux/proc_fs.h>
#include <pcmcia/version.h>
#include <pcmcia/cs_types.h>
......
......@@ -12,7 +12,6 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <pcmcia/ss.h>
#include <asm/hardware.h>
......
......@@ -45,7 +45,6 @@
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/notifier.h>
#include <linux/proc_fs.h>
#include <linux/version.h>
#include <linux/interrupt.h>
......@@ -370,51 +369,6 @@ sa1100_pcmcia_register_callback(struct pcmcia_socket *sock,
}
/* sa1100_pcmcia_inquire_socket()
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Implements the inquire_socket() operation for the in-kernel PCMCIA
* service (formerly SS_InquireSocket in Card Services). We set
* SS_CAP_STATIC_MAP, which disables the memory resource database
* check. (Mapped memory is set up within the socket driver itself.)
*
* In conjunction with the STATIC_MAP capability is a new field,
* `io_offset', recommended by David Hinds. Rather than go through
* the SetIOMap interface (which is not quite suited for communicating
* window locations up from the socket driver), we just pass up
* an offset which is applied to client-requested base I/O addresses
* in alloc_io_space().
*
* SS_CAP_STATIC_MAP: don't bother with the (user-configured) memory
* resource database; we instead pass up physical address ranges
* and allow other parts of Card Services to deal with remapping.
*
* SS_CAP_PCCARD: we can deal with 16-bit PCMCIA & CF cards, but
* not 32-bit CardBus devices.
*
* Return value is irrelevant; the pcmcia subsystem ignores it.
*/
static int
sa1100_pcmcia_inquire_socket(struct pcmcia_socket *sock, socket_cap_t *cap)
{
struct sa1100_pcmcia_socket *skt = to_sa1100_socket(sock);
int ret = -1;
if (skt) {
DEBUG(2, "%s() for sock %u\n", __FUNCTION__, skt->nr);
cap->features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
cap->irq_mask = 0;
cap->map_size = PAGE_SIZE;
cap->pci_irq = skt->irq;
cap->io_offset = (unsigned long)skt->virt_io;
ret = 0;
}
return ret;
}
/* sa1100_pcmcia_get_status()
* ^^^^^^^^^^^^^^^^^^^^^^^^^^
* Implements the get_status() operation for the in-kernel PCMCIA
......@@ -615,9 +569,6 @@ sa1100_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *map
return 0;
}
#if defined(CONFIG_PROC_FS)
struct bittbl {
unsigned int mask;
const char *name;
......@@ -659,17 +610,16 @@ dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, i
*p = b;
}
/* sa1100_pcmcia_proc_status()
/* show_status()
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Implements the /proc/bus/pccard/??/status file.
* Implements the /sys/class/pcmcia_socket/??/status file.
*
* Returns: the number of characters added to the buffer
*/
static int
sa1100_pcmcia_proc_status(char *buf, char **start, off_t pos,
int count, int *eof, void *data)
static ssize_t show_status(struct class_device *class_dev, char *buf)
{
struct sa1100_pcmcia_socket *skt = data;
struct sa1100_pcmcia_socket *skt = container_of(class_dev,
struct sa1100_pcmcia_socket, socket.dev);
unsigned int clock = cpufreq_get(0);
unsigned long mecr = MECR;
char *p = buf;
......@@ -701,42 +651,19 @@ sa1100_pcmcia_proc_status(char *buf, char **start, off_t pos,
return p-buf;
}
static CLASS_DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
/* sa1100_pcmcia_proc_setup()
* ^^^^^^^^^^^^^^^^^^^^^^^^^^
* Implements the proc_setup() operation for the in-kernel PCMCIA
* service (formerly SS_ProcSetup in Card Services).
*
* Returns: 0 on success, -1 on error
*/
static void
sa1100_pcmcia_proc_setup(struct pcmcia_socket *sock, struct proc_dir_entry *base)
{
struct proc_dir_entry *entry;
if ((entry = create_proc_entry("status", 0, base)) == NULL){
printk(KERN_ERR "unable to install \"status\" procfs entry\n");
return;
}
entry->read_proc = sa1100_pcmcia_proc_status;
entry->data = to_sa1100_socket(sock);
}
#else
#define sa1100_pcmcia_proc_setup NULL
#endif /* defined(CONFIG_PROC_FS) */
static struct pccard_operations sa11xx_pcmcia_operations = {
.owner = THIS_MODULE,
.init = sa1100_pcmcia_sock_init,
.suspend = sa1100_pcmcia_suspend,
.register_callback = sa1100_pcmcia_register_callback,
.inquire_socket = sa1100_pcmcia_inquire_socket,
.get_status = sa1100_pcmcia_get_status,
.get_socket = sa1100_pcmcia_get_socket,
.set_socket = sa1100_pcmcia_set_socket,
.set_io_map = sa1100_pcmcia_set_io_map,
.set_mem_map = sa1100_pcmcia_set_mem_map,
.proc_setup = sa1100_pcmcia_proc_setup
};
int sa11xx_request_irqs(struct sa1100_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr)
......@@ -905,6 +832,12 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in
if (ret)
goto out_err_6;
skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
skt->socket.irq_mask = 0;
skt->socket.map_size = PAGE_SIZE;
skt->socket.pci_irq = skt->irq;
skt->socket.io_offset = (unsigned long)skt->virt_io;
skt->status = sa1100_pcmcia_skt_state(skt);
ret = pcmcia_register_socket(&skt->socket);
......@@ -914,6 +847,8 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in
WARN_ON(skt->socket.sock != i);
add_timer(&skt->poll_timer);
class_device_create_file(&skt->socket.dev, &class_device_attr_status);
}
dev_set_drvdata(dev, sinfo);
......
......@@ -9,7 +9,6 @@
#ifndef _ASM_ARCH_PCMCIA
#define _ASM_ARCH_PCMCIA
#include <linux/proc_fs.h>
/* include the world */
#include <pcmcia/version.h>
#include <pcmcia/cs_types.h>
......
......@@ -42,7 +42,6 @@
#include <linux/timer.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/workqueue.h>
#include <linux/device.h>
......@@ -130,14 +129,6 @@ static int tcic_timer_pending;
static int sockets;
static struct tcic_socket socket_table[2];
static socket_cap_t tcic_cap = {
/* only 16-bit cards, memory windows must be size-aligned */
.features = SS_CAP_PCCARD | SS_CAP_MEM_ALIGN,
.irq_mask = 0x4cf8, /* irq 14, 11, 10, 7, 6, 5, 4, 3 */
.map_size = 0x1000, /* 4K minimum window size */
/* No PCI or CardBus support */
};
/*====================================================================*/
/* Trick when selecting interrupts: the TCIC sktirq pin is supposed
......@@ -445,6 +436,14 @@ static int __init init_tcic(void)
socket_table[sockets].handler = NULL;
socket_table[sockets].info = NULL;
socket_table[sockets].id = get_tcic_id();
/* only 16-bit cards, memory windows must be size-aligned */
/* No PCI or CardBus support */
socket_table[sockets].socket.features = SS_CAP_PCCARD | SS_CAP_MEM_ALIGN;
/* irq 14, 11, 10, 7, 6, 5, 4, 3 */
socket_table[sockets].socket.irq_mask = 0x4cf8;
/* 4K minimum window size */
socket_table[sockets].socket.map_size = 0x1000;
sockets++;
}
......@@ -479,11 +478,13 @@ static int __init init_tcic(void)
else
for (i = mask = 0; i < 16; i++)
mask |= (1<<irq_list[i]);
mask &= tcic_cap.irq_mask;
/* irq 14, 11, 10, 7, 6, 5, 4, 3 */
mask &= 0x4cf8;
/* Scan interrupts */
mask = irq_scan(mask);
tcic_cap.irq_mask = mask;
for (i=0;i<sockets;i++)
socket_table[i].socket.irq_mask = mask;
/* Check for only two interrupts available */
scan = (mask & (mask-1));
......@@ -502,7 +503,7 @@ static int __init init_tcic(void)
if (cs_irq == 0) poll_interval = HZ;
}
if (tcic_cap.irq_mask & (1 << 11))
if (socket_table[0].socket.irq_mask & (1 << 11))
printk("sktirq is irq 11, ");
if (cs_irq != 0)
printk("status change on irq %d\n", cs_irq);
......@@ -680,14 +681,6 @@ static int tcic_get_status(struct pcmcia_socket *sock, u_int *value)
/*====================================================================*/
static int tcic_inquire_socket(struct pcmcia_socket *sock, socket_cap_t *cap)
{
*cap = tcic_cap;
return 0;
} /* tcic_inquire_socket */
/*====================================================================*/
static int tcic_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
{
u_short psock = container_of(sock, struct tcic_socket, socket)->psock;
......@@ -897,10 +890,6 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m
/*====================================================================*/
static void tcic_proc_setup(struct pcmcia_socket *sock, struct proc_dir_entry *base)
{
}
static int tcic_init(struct pcmcia_socket *s)
{
int i;
......@@ -930,13 +919,11 @@ static struct pccard_operations tcic_operations = {
.init = tcic_init,
.suspend = tcic_suspend,
.register_callback = tcic_register_callback,
.inquire_socket = tcic_inquire_socket,
.get_status = tcic_get_status,
.get_socket = tcic_get_socket,
.set_socket = tcic_set_socket,
.set_io_map = tcic_set_io_map,
.set_mem_map = tcic_set_mem_map,
.proc_setup = tcic_proc_setup,
};
/*====================================================================*/
......
......@@ -394,10 +394,6 @@ static int yenta_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *
return 0;
}
static void yenta_proc_setup(struct pcmcia_socket *sock, struct proc_dir_entry *base)
{
/* Not done yet */
}
static unsigned int yenta_events(struct yenta_socket *socket)
{
......@@ -519,22 +515,13 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas
*/
static void yenta_get_socket_capabilities(struct yenta_socket *socket, u32 isa_irq_mask)
{
socket->cap.features |= SS_CAP_PAGE_REGS | SS_CAP_PCCARD | SS_CAP_CARDBUS;
socket->cap.map_size = 0x1000;
socket->cap.pci_irq = socket->cb_irq;
socket->cap.irq_mask = yenta_probe_irq(socket, isa_irq_mask);
socket->cap.cb_dev = socket->dev;
printk("Yenta IRQ list %04x, PCI irq%d\n", socket->cap.irq_mask, socket->cb_irq);
}
static int yenta_inquire_socket(struct pcmcia_socket *sock, socket_cap_t *cap)
{
struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
*cap = socket->cap;
socket->socket.features |= SS_CAP_PAGE_REGS | SS_CAP_PCCARD | SS_CAP_CARDBUS;
socket->socket.map_size = 0x1000;
socket->socket.pci_irq = socket->cb_irq;
socket->socket.irq_mask = yenta_probe_irq(socket, isa_irq_mask);
socket->socket.cb_dev = socket->dev;
return 0;
printk("Yenta IRQ list %04x, PCI irq%d\n", socket->socket.irq_mask, socket->cb_irq);
}
......@@ -764,6 +751,9 @@ static void yenta_close(struct pci_dev *dev)
{
struct yenta_socket *sock = pci_get_drvdata(dev);
/* we don't want a dying socket registered */
pcmcia_unregister_socket(&sock->socket);
/* Disable all events so we don't die in an IRQ storm */
cb_writel(sock, CB_SOCKET_MASK, 0x0);
exca_writeb(sock, I365_CSCINT, 0);
......@@ -777,7 +767,6 @@ static void yenta_close(struct pci_dev *dev)
iounmap(sock->base);
yenta_free_resources(sock);
pcmcia_unregister_socket(&sock->socket);
pci_set_drvdata(dev, NULL);
}
......@@ -797,13 +786,11 @@ static struct pccard_operations yenta_socket_operations = {
.init = yenta_init,
.suspend = yenta_suspend,
.register_callback = yenta_register_callback,
.inquire_socket = yenta_inquire_socket,
.get_status = yenta_get_status,
.get_socket = yenta_get_socket,
.set_socket = yenta_set_socket,
.set_io_map = yenta_set_io_map,
.set_mem_map = yenta_set_mem_map,
.proc_setup = yenta_proc_setup,
};
......
......@@ -101,7 +101,6 @@ struct yenta_socket {
void *base;
void (*handler)(void *, unsigned int);
void *info;
socket_cap_t cap;
spinlock_t event_lock;
unsigned int events;
struct work_struct tq_task;
......
......@@ -52,16 +52,6 @@
#define SS_XVCARD 0x2000
#define SS_PENDING 0x4000
/* for InquireSocket */
typedef struct socket_cap_t {
u_int features;
u_int irq_mask;
u_int map_size;
ioaddr_t io_offset;
u_char pci_irq;
struct pci_dev *cb_dev;
} socket_cap_t;
/* InquireSocket capabilities */
#define SS_CAP_PAGE_REGS 0x0001
#define SS_CAP_VIRTUAL_BUS 0x0002
......@@ -133,13 +123,11 @@ struct pccard_operations {
int (*init)(struct pcmcia_socket *sock);
int (*suspend)(struct pcmcia_socket *sock);
int (*register_callback)(struct pcmcia_socket *sock, void (*handler)(void *, unsigned int), void * info);
int (*inquire_socket)(struct pcmcia_socket *sock, socket_cap_t *cap);
int (*get_status)(struct pcmcia_socket *sock, u_int *value);
int (*get_socket)(struct pcmcia_socket *sock, socket_state_t *state);
int (*set_socket)(struct pcmcia_socket *sock, socket_state_t *state);
int (*set_io_map)(struct pcmcia_socket *sock, struct pccard_io_map *io);
int (*set_mem_map)(struct pcmcia_socket *sock, struct pccard_mem_map *mem);
void (*proc_setup)(struct pcmcia_socket *sock, struct proc_dir_entry *base);
};
/*
......@@ -147,15 +135,6 @@ struct pccard_operations {
*/
struct pcmcia_socket;
struct pcmcia_socket_class_data {
unsigned int nsock; /* number of sockets */
unsigned int sock_offset; /* socket # (which is
* returned to driver) = sock_offset + (0, 1, .. , (nsock-1) */
struct pccard_operations *ops; /* see above */
struct pcmcia_socket *s_info;
struct class_device class_dev; /* generic class structure */
};
typedef struct erase_busy_t {
eraseq_entry_t *erase;
client_handle_t client;
......@@ -193,7 +172,6 @@ struct pcmcia_socket {
spinlock_t lock;
struct pccard_operations * ss_entry;
socket_state_t socket;
socket_cap_t cap;
u_int state;
u_short functions;
u_short lock_count;
......@@ -215,13 +193,19 @@ struct pcmcia_socket {
char *fake_cis;
struct list_head socket_list;
struct completion socket_released;
/* deprecated */
unsigned int sock; /* socket number */
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc;
#endif
/* socket capabilities */
u_int features;
u_int irq_mask;
u_int map_size;
ioaddr_t io_offset;
u_char pci_irq;
struct pci_dev * cb_dev;
/* state thread */
struct semaphore skt_sem; /* protects socket h/w state */
......
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