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