Commit 91a32a40 authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Russell King

[PCMCIA] Remove socket_info_t

Get rid of the

typedef struct pcmcia_socket socket_info_t;

by replacing all remaining usages of cs_internal's socket_info_t with
struct pcmcia_socket.
parent 5ec72d2e
...@@ -63,7 +63,7 @@ static int do_mtd_request(memory_handle_t handle, mtd_request_t *req, ...@@ -63,7 +63,7 @@ static int do_mtd_request(memory_handle_t handle, mtd_request_t *req,
{ {
int ret, tries; int ret, tries;
client_t *mtd; client_t *mtd;
socket_info_t *s; struct pcmcia_socket *s;
mtd = handle->mtd; mtd = handle->mtd;
if (mtd == NULL) if (mtd == NULL)
...@@ -130,7 +130,7 @@ static void retry_erase(erase_busy_t *busy, u_int cause) ...@@ -130,7 +130,7 @@ static void retry_erase(erase_busy_t *busy, u_int cause)
eraseq_entry_t *erase = busy->erase; eraseq_entry_t *erase = busy->erase;
mtd_request_t req; mtd_request_t req;
client_t *mtd; client_t *mtd;
socket_info_t *s; struct pcmcia_socket *s;
int ret; int ret;
DEBUG(2, "cs: trying erase request 0x%p...\n", busy); DEBUG(2, "cs: trying erase request 0x%p...\n", busy);
...@@ -265,7 +265,7 @@ static int mtd_modify_window(window_handle_t win, mtd_mod_win_t *req) ...@@ -265,7 +265,7 @@ static int mtd_modify_window(window_handle_t win, mtd_mod_win_t *req)
static int mtd_set_vpp(client_handle_t handle, mtd_vpp_req_t *req) static int mtd_set_vpp(client_handle_t handle, mtd_vpp_req_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
if (req->Vpp1 != req->Vpp2) if (req->Vpp1 != req->Vpp2)
...@@ -279,7 +279,7 @@ static int mtd_set_vpp(client_handle_t handle, mtd_vpp_req_t *req) ...@@ -279,7 +279,7 @@ static int mtd_set_vpp(client_handle_t handle, mtd_vpp_req_t *req)
static int mtd_rdy_mask(client_handle_t handle, mtd_rdy_req_t *req) static int mtd_rdy_mask(client_handle_t handle, mtd_rdy_req_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
s = SOCKET(handle); s = SOCKET(handle);
...@@ -417,7 +417,7 @@ static int match_region(client_handle_t handle, memory_handle_t list, ...@@ -417,7 +417,7 @@ static int match_region(client_handle_t handle, memory_handle_t list,
int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn) int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn)
{ {
socket_info_t *s = SOCKET(handle); struct pcmcia_socket *s = SOCKET(handle);
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
...@@ -450,7 +450,7 @@ int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn) ...@@ -450,7 +450,7 @@ int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn)
int pcmcia_register_mtd(client_handle_t handle, mtd_reg_t *reg) int pcmcia_register_mtd(client_handle_t handle, mtd_reg_t *reg)
{ {
memory_handle_t list; memory_handle_t list;
socket_info_t *s; struct pcmcia_socket *s;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
......
...@@ -119,11 +119,11 @@ static u_int xlate_rom_addr(u_char * b, u_int addr) ...@@ -119,11 +119,11 @@ static u_int xlate_rom_addr(u_char * b, u_int addr)
These are similar to setup_cis_mem and release_cis_mem for 16-bit These are similar to setup_cis_mem and release_cis_mem for 16-bit
cards. The "result" that is used externally is the cb_cis_virt cards. The "result" that is used externally is the cb_cis_virt
pointer in the socket_info_t structure. pointer in the struct pcmcia_socket structure.
=====================================================================*/ =====================================================================*/
static void cb_release_cis_mem(socket_info_t * s) static void cb_release_cis_mem(struct pcmcia_socket * s)
{ {
if (s->cb_cis_virt) { if (s->cb_cis_virt) {
DEBUG(1, "cs: cb_release_cis_mem()\n"); DEBUG(1, "cs: cb_release_cis_mem()\n");
...@@ -133,7 +133,7 @@ static void cb_release_cis_mem(socket_info_t * s) ...@@ -133,7 +133,7 @@ static void cb_release_cis_mem(socket_info_t * s)
} }
} }
static int cb_setup_cis_mem(socket_info_t * s, struct resource *res) static int cb_setup_cis_mem(struct pcmcia_socket * s, struct resource *res)
{ {
unsigned int start, size; unsigned int start, size;
...@@ -162,7 +162,7 @@ static int cb_setup_cis_mem(socket_info_t * s, struct resource *res) ...@@ -162,7 +162,7 @@ static int cb_setup_cis_mem(socket_info_t * s, struct resource *res)
=====================================================================*/ =====================================================================*/
int read_cb_mem(socket_info_t * s, int space, u_int addr, u_int len, void *ptr) int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void *ptr)
{ {
struct pci_dev *dev; struct pci_dev *dev;
struct resource *res; struct resource *res;
...@@ -237,7 +237,7 @@ static void cardbus_assign_irqs(struct pci_bus *bus, int irq) ...@@ -237,7 +237,7 @@ static void cardbus_assign_irqs(struct pci_bus *bus, int irq)
} }
} }
int cb_alloc(socket_info_t * s) int cb_alloc(struct pcmcia_socket * s)
{ {
struct pci_bus *bus = s->cap.cb_dev->subordinate; struct pci_bus *bus = s->cap.cb_dev->subordinate;
struct pci_dev *dev; struct pci_dev *dev;
...@@ -266,7 +266,7 @@ int cb_alloc(socket_info_t * s) ...@@ -266,7 +266,7 @@ int cb_alloc(socket_info_t * s)
return CS_SUCCESS; return CS_SUCCESS;
} }
void cb_free(socket_info_t * s) void cb_free(struct pcmcia_socket * s)
{ {
struct pci_dev *bridge = s->cap.cb_dev; struct pci_dev *bridge = s->cap.cb_dev;
......
...@@ -82,7 +82,7 @@ static const u_int exponent[] = { ...@@ -82,7 +82,7 @@ static const u_int exponent[] = {
INT_MODULE_PARM(cis_width, 0); /* 16-bit CIS? */ INT_MODULE_PARM(cis_width, 0); /* 16-bit CIS? */
void release_cis_mem(socket_info_t *s) 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;
...@@ -101,7 +101,7 @@ void release_cis_mem(socket_info_t *s) ...@@ -101,7 +101,7 @@ void release_cis_mem(socket_info_t *s)
* map the memory space. * map the memory space.
*/ */
static unsigned char * static unsigned char *
set_cis_map(socket_info_t *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->cap.features & SS_CAP_STATIC_MAP) &&
...@@ -139,7 +139,7 @@ set_cis_map(socket_info_t *s, unsigned int card_offset, unsigned int flags) ...@@ -139,7 +139,7 @@ set_cis_map(socket_info_t *s, unsigned int card_offset, unsigned int flags)
#define IS_ATTR 1 #define IS_ATTR 1
#define IS_INDIRECT 8 #define IS_INDIRECT 8
int read_cis_mem(socket_info_t *s, int attr, u_int addr, int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
u_int len, void *ptr) u_int len, void *ptr)
{ {
u_char *sys, *end, *buf = ptr; u_char *sys, *end, *buf = ptr;
...@@ -202,7 +202,7 @@ int read_cis_mem(socket_info_t *s, int attr, u_int addr, ...@@ -202,7 +202,7 @@ int read_cis_mem(socket_info_t *s, int attr, u_int addr,
return 0; return 0;
} }
void write_cis_mem(socket_info_t *s, int attr, u_int addr, void write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
u_int len, void *ptr) u_int len, void *ptr)
{ {
u_char *sys, *end, *buf = ptr; u_char *sys, *end, *buf = ptr;
...@@ -266,7 +266,7 @@ void write_cis_mem(socket_info_t *s, int attr, u_int addr, ...@@ -266,7 +266,7 @@ void write_cis_mem(socket_info_t *s, int attr, u_int addr,
======================================================================*/ ======================================================================*/
static void read_cis_cache(socket_info_t *s, int attr, u_int addr, static void read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr,
u_int len, void *ptr) u_int len, void *ptr)
{ {
struct cis_cache_entry *cis; struct cis_cache_entry *cis;
...@@ -306,7 +306,7 @@ static void read_cis_cache(socket_info_t *s, int attr, u_int addr, ...@@ -306,7 +306,7 @@ static void read_cis_cache(socket_info_t *s, int attr, u_int addr,
} }
static void static void
remove_cis_cache(socket_info_t *s, int attr, u_int addr, u_int len) remove_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, u_int len)
{ {
struct cis_cache_entry *cis; struct cis_cache_entry *cis;
...@@ -318,7 +318,7 @@ remove_cis_cache(socket_info_t *s, int attr, u_int addr, u_int len) ...@@ -318,7 +318,7 @@ remove_cis_cache(socket_info_t *s, int attr, u_int addr, u_int len)
} }
} }
void destroy_cis_cache(socket_info_t *s) void destroy_cis_cache(struct pcmcia_socket *s)
{ {
struct list_head *l, *n; struct list_head *l, *n;
...@@ -337,7 +337,7 @@ void destroy_cis_cache(socket_info_t *s) ...@@ -337,7 +337,7 @@ void destroy_cis_cache(socket_info_t *s)
======================================================================*/ ======================================================================*/
int verify_cis_cache(socket_info_t *s) int verify_cis_cache(struct pcmcia_socket *s)
{ {
struct cis_cache_entry *cis; struct cis_cache_entry *cis;
char buf[256]; char buf[256];
...@@ -369,7 +369,7 @@ int verify_cis_cache(socket_info_t *s) ...@@ -369,7 +369,7 @@ int verify_cis_cache(socket_info_t *s)
int pcmcia_replace_cis(client_handle_t handle, cisdump_t *cis) int pcmcia_replace_cis(client_handle_t handle, cisdump_t *cis)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
s = SOCKET(handle); s = SOCKET(handle);
...@@ -409,7 +409,7 @@ int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple); ...@@ -409,7 +409,7 @@ int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple);
int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple) int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
s = SOCKET(handle); s = SOCKET(handle);
...@@ -445,7 +445,7 @@ int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple) ...@@ -445,7 +445,7 @@ int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple)
return pcmcia_get_next_tuple(handle, tuple); return pcmcia_get_next_tuple(handle, tuple);
} }
static int follow_link(socket_info_t *s, tuple_t *tuple) static int follow_link(struct pcmcia_socket *s, tuple_t *tuple)
{ {
u_char link[5]; u_char link[5];
u_int ofs; u_int ofs;
...@@ -487,7 +487,7 @@ static int follow_link(socket_info_t *s, tuple_t *tuple) ...@@ -487,7 +487,7 @@ static int follow_link(socket_info_t *s, tuple_t *tuple)
int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple) int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple)
{ {
socket_info_t *s; struct pcmcia_socket *s;
u_char link[2], tmp; u_char link[2], tmp;
int ofs, i, attr; int ofs, i, attr;
...@@ -588,7 +588,7 @@ int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple) ...@@ -588,7 +588,7 @@ int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple)
int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple) int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple)
{ {
socket_info_t *s; struct pcmcia_socket *s;
u_int len; u_int len;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
......
...@@ -237,7 +237,7 @@ static const lookup_t service_table[] = { ...@@ -237,7 +237,7 @@ static const lookup_t service_table[] = {
======================================================================*/ ======================================================================*/
static int register_callback(socket_info_t *s, void (*handler)(void *, unsigned int), void * info) static int register_callback(struct pcmcia_socket *s, void (*handler)(void *, unsigned int), void * info)
{ {
int error; int error;
...@@ -249,33 +249,33 @@ static int register_callback(socket_info_t *s, void (*handler)(void *, unsigned ...@@ -249,33 +249,33 @@ static int register_callback(socket_info_t *s, void (*handler)(void *, unsigned
return error; return error;
} }
static int get_socket_status(socket_info_t *s, int *val) static int get_socket_status(struct pcmcia_socket *s, int *val)
{ {
return s->ss_entry->get_status(s, val); return s->ss_entry->get_status(s, val);
} }
static int set_socket(socket_info_t *s, socket_state_t *state) static int set_socket(struct pcmcia_socket *s, socket_state_t *state)
{ {
return s->ss_entry->set_socket(s, state); return s->ss_entry->set_socket(s, state);
} }
static int set_io_map(socket_info_t *s, struct pccard_io_map *io) static int set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io)
{ {
return s->ss_entry->set_io_map(s, io); return s->ss_entry->set_io_map(s, io);
} }
static int set_mem_map(socket_info_t *s, struct pccard_mem_map *mem) static int set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
{ {
return s->ss_entry->set_mem_map(s, mem); return s->ss_entry->set_mem_map(s, mem);
} }
static int suspend_socket(socket_info_t *s) static int suspend_socket(struct pcmcia_socket *s)
{ {
s->socket = dead_socket; s->socket = dead_socket;
return s->ss_entry->suspend(s); return s->ss_entry->suspend(s);
} }
static int init_socket(socket_info_t *s) static int init_socket(struct pcmcia_socket *s)
{ {
s->socket = dead_socket; s->socket = dead_socket;
return s->ss_entry->init(s); return s->ss_entry->init(s);
...@@ -287,7 +287,7 @@ static int init_socket(socket_info_t *s) ...@@ -287,7 +287,7 @@ static int init_socket(socket_info_t *s)
static int proc_read_clients(char *buf, char **start, off_t pos, static int proc_read_clients(char *buf, char **start, off_t pos,
int count, int *eof, void *data) int count, int *eof, void *data)
{ {
socket_info_t *s = data; struct pcmcia_socket *s = data;
client_handle_t c; client_handle_t c;
char *p = buf; char *p = buf;
...@@ -313,8 +313,8 @@ static int proc_read_clients(char *buf, char **start, off_t pos, ...@@ -313,8 +313,8 @@ static int proc_read_clients(char *buf, char **start, off_t pos,
* These functions check for the appropriate struct pcmcia_soket arrays, * These functions check for the appropriate struct pcmcia_soket arrays,
* and pass them to the low-level functions pcmcia_{suspend,resume}_socket * and pass them to the low-level functions pcmcia_{suspend,resume}_socket
*/ */
static int socket_resume(socket_info_t *skt); static int socket_resume(struct pcmcia_socket *skt);
static int socket_suspend(socket_info_t *skt); static int socket_suspend(struct pcmcia_socket *skt);
int pcmcia_socket_dev_suspend(struct device *dev, u32 state, u32 level) int pcmcia_socket_dev_suspend(struct device *dev, u32 state, u32 level)
{ {
...@@ -548,9 +548,9 @@ static void free_regions(memory_handle_t *list) ...@@ -548,9 +548,9 @@ static void free_regions(memory_handle_t *list)
} }
} }
static int send_event(socket_info_t *s, event_t event, int priority); static int send_event(struct pcmcia_socket *s, event_t event, int priority);
static void shutdown_socket(socket_info_t *s) static void shutdown_socket(struct pcmcia_socket *s)
{ {
client_t **c; client_t **c;
...@@ -605,7 +605,7 @@ static void shutdown_socket(socket_info_t *s) ...@@ -605,7 +605,7 @@ static void shutdown_socket(socket_info_t *s)
======================================================================*/ ======================================================================*/
static int send_event(socket_info_t *s, event_t event, int priority) static int send_event(struct pcmcia_socket *s, event_t event, int priority)
{ {
client_t *client = s->clients; client_t *client = s->clients;
int ret; int ret;
...@@ -626,7 +626,7 @@ static int send_event(socket_info_t *s, event_t event, int priority) ...@@ -626,7 +626,7 @@ static int send_event(socket_info_t *s, event_t event, int priority)
return ret; return ret;
} /* send_event */ } /* send_event */
static void pcmcia_error(socket_info_t *skt, const char *fmt, ...) static void pcmcia_error(struct pcmcia_socket *skt, const char *fmt, ...)
{ {
static char buf[128]; static char buf[128];
va_list ap; va_list ap;
...@@ -642,7 +642,7 @@ static void pcmcia_error(socket_info_t *skt, const char *fmt, ...) ...@@ -642,7 +642,7 @@ static void pcmcia_error(socket_info_t *skt, const char *fmt, ...)
#define cs_to_timeout(cs) (((cs) * HZ + 99) / 100) #define cs_to_timeout(cs) (((cs) * HZ + 99) / 100)
static void socket_remove_drivers(socket_info_t *skt) static void socket_remove_drivers(struct pcmcia_socket *skt)
{ {
client_t *client; client_t *client;
...@@ -653,7 +653,7 @@ static void socket_remove_drivers(socket_info_t *skt) ...@@ -653,7 +653,7 @@ static void socket_remove_drivers(socket_info_t *skt)
client->state |= CLIENT_STALE; client->state |= CLIENT_STALE;
} }
static void socket_shutdown(socket_info_t *skt) static void socket_shutdown(struct pcmcia_socket *skt)
{ {
socket_remove_drivers(skt); socket_remove_drivers(skt);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
...@@ -662,7 +662,7 @@ static void socket_shutdown(socket_info_t *skt) ...@@ -662,7 +662,7 @@ static void socket_shutdown(socket_info_t *skt)
shutdown_socket(skt); shutdown_socket(skt);
} }
static int socket_reset(socket_info_t *skt) static int socket_reset(struct pcmcia_socket *skt)
{ {
int status, i; int status, i;
...@@ -692,7 +692,7 @@ static int socket_reset(socket_info_t *skt) ...@@ -692,7 +692,7 @@ static int socket_reset(socket_info_t *skt)
return CS_GENERAL_FAILURE; return CS_GENERAL_FAILURE;
} }
static int socket_setup(socket_info_t *skt, int initial_delay) static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
{ {
int status, i; int status, i;
...@@ -756,7 +756,7 @@ static int socket_setup(socket_info_t *skt, int initial_delay) ...@@ -756,7 +756,7 @@ static int socket_setup(socket_info_t *skt, int initial_delay)
* Handle card insertion. Setup the socket, reset the card, * Handle card insertion. Setup the socket, reset the card,
* and then tell the rest of PCMCIA that a card is present. * and then tell the rest of PCMCIA that a card is present.
*/ */
static int socket_insert(socket_info_t *skt) static int socket_insert(struct pcmcia_socket *skt)
{ {
int ret; int ret;
...@@ -776,7 +776,7 @@ static int socket_insert(socket_info_t *skt) ...@@ -776,7 +776,7 @@ static int socket_insert(socket_info_t *skt)
return ret; return ret;
} }
static int socket_suspend(socket_info_t *skt) static int socket_suspend(struct pcmcia_socket *skt)
{ {
if (skt->state & SOCKET_SUSPEND) if (skt->state & SOCKET_SUSPEND)
return CS_IN_USE; return CS_IN_USE;
...@@ -793,7 +793,7 @@ static int socket_suspend(socket_info_t *skt) ...@@ -793,7 +793,7 @@ static int socket_suspend(socket_info_t *skt)
* our cached copy. If they are different, the card has been * our cached copy. If they are different, the card has been
* replaced, and we need to tell the drivers. * replaced, and we need to tell the drivers.
*/ */
static int socket_resume(socket_info_t *skt) static int socket_resume(struct pcmcia_socket *skt)
{ {
int ret; int ret;
...@@ -825,7 +825,7 @@ static int socket_resume(socket_info_t *skt) ...@@ -825,7 +825,7 @@ static int socket_resume(socket_info_t *skt)
static int pccardd(void *__skt) static int pccardd(void *__skt)
{ {
socket_info_t *skt = __skt; struct pcmcia_socket *skt = __skt;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
daemonize("pccardd"); daemonize("pccardd");
...@@ -882,7 +882,7 @@ static int pccardd(void *__skt) ...@@ -882,7 +882,7 @@ static int pccardd(void *__skt)
static void parse_events(void *info, u_int events) static void parse_events(void *info, u_int events)
{ {
socket_info_t *s = info; struct pcmcia_socket *s = info;
spin_lock(&s->thread_lock); spin_lock(&s->thread_lock);
s->thread_events |= events; s->thread_events |= events;
...@@ -898,7 +898,7 @@ static void parse_events(void *info, u_int events) ...@@ -898,7 +898,7 @@ static void parse_events(void *info, u_int events)
======================================================================*/ ======================================================================*/
static int alloc_io_space(socket_info_t *s, u_int attr, ioaddr_t *base, static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
ioaddr_t num, u_int lines, char *name) ioaddr_t num, u_int lines, char *name)
{ {
int i; int i;
...@@ -962,7 +962,7 @@ static int alloc_io_space(socket_info_t *s, u_int attr, ioaddr_t *base, ...@@ -962,7 +962,7 @@ static int alloc_io_space(socket_info_t *s, u_int attr, ioaddr_t *base,
return (i == MAX_IO_WIN); return (i == MAX_IO_WIN);
} /* alloc_io_space */ } /* alloc_io_space */
static void release_io_space(socket_info_t *s, ioaddr_t base, static void release_io_space(struct pcmcia_socket *s, ioaddr_t base,
ioaddr_t num) ioaddr_t num)
{ {
int i; int i;
...@@ -990,7 +990,7 @@ static void release_io_space(socket_info_t *s, ioaddr_t base, ...@@ -990,7 +990,7 @@ static void release_io_space(socket_info_t *s, ioaddr_t base,
int pcmcia_access_configuration_register(client_handle_t handle, int pcmcia_access_configuration_register(client_handle_t handle,
conf_reg_t *reg) conf_reg_t *reg)
{ {
socket_info_t *s; struct pcmcia_socket *s;
config_t *c; config_t *c;
int addr; int addr;
u_char val; u_char val;
...@@ -1076,7 +1076,7 @@ int pcmcia_bind_device(bind_req_t *req) ...@@ -1076,7 +1076,7 @@ int pcmcia_bind_device(bind_req_t *req)
int pcmcia_bind_mtd(mtd_bind_t *req) int pcmcia_bind_mtd(mtd_bind_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
memory_handle_t region; memory_handle_t region;
s = req->Socket; s = req->Socket;
...@@ -1106,7 +1106,7 @@ int pcmcia_bind_mtd(mtd_bind_t *req) ...@@ -1106,7 +1106,7 @@ int pcmcia_bind_mtd(mtd_bind_t *req)
int pcmcia_deregister_client(client_handle_t handle) int pcmcia_deregister_client(client_handle_t handle)
{ {
client_t **client; client_t **client;
socket_info_t *s; struct pcmcia_socket *s;
memory_handle_t region; memory_handle_t region;
u_long flags; u_long flags;
int i; int i;
...@@ -1161,7 +1161,7 @@ int pcmcia_deregister_client(client_handle_t handle) ...@@ -1161,7 +1161,7 @@ int pcmcia_deregister_client(client_handle_t handle)
int pcmcia_get_configuration_info(client_handle_t handle, int pcmcia_get_configuration_info(client_handle_t handle,
config_info_t *config) config_info_t *config)
{ {
socket_info_t *s; struct pcmcia_socket *s;
config_t *c; config_t *c;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
...@@ -1256,7 +1256,7 @@ int pcmcia_get_card_services_info(servinfo_t *info) ...@@ -1256,7 +1256,7 @@ int pcmcia_get_card_services_info(servinfo_t *info)
int pcmcia_get_first_client(client_handle_t *handle, client_req_t *req) int pcmcia_get_first_client(client_handle_t *handle, client_req_t *req)
{ {
socket_t s; socket_t s;
socket_info_t *socket; struct pcmcia_socket *socket;
if (req->Attributes & CLIENT_THIS_SOCKET) if (req->Attributes & CLIENT_THIS_SOCKET)
s = req->Socket; s = req->Socket;
else else
...@@ -1274,7 +1274,7 @@ int pcmcia_get_first_client(client_handle_t *handle, client_req_t *req) ...@@ -1274,7 +1274,7 @@ int pcmcia_get_first_client(client_handle_t *handle, client_req_t *req)
int pcmcia_get_next_client(client_handle_t *handle, client_req_t *req) int pcmcia_get_next_client(client_handle_t *handle, client_req_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if ((handle == NULL) || CHECK_HANDLE(*handle)) if ((handle == NULL) || CHECK_HANDLE(*handle))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
if ((*handle)->next == NULL) { if ((*handle)->next == NULL) {
...@@ -1293,7 +1293,7 @@ int pcmcia_get_next_client(client_handle_t *handle, client_req_t *req) ...@@ -1293,7 +1293,7 @@ int pcmcia_get_next_client(client_handle_t *handle, client_req_t *req)
int pcmcia_get_window(window_handle_t *handle, int idx, win_req_t *req) int pcmcia_get_window(window_handle_t *handle, int idx, win_req_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
window_t *win; window_t *win;
int w; int w;
...@@ -1348,7 +1348,7 @@ int pcmcia_get_next_window(window_handle_t *win, win_req_t *req) ...@@ -1348,7 +1348,7 @@ int pcmcia_get_next_window(window_handle_t *win, win_req_t *req)
struct pci_bus *pcmcia_lookup_bus(client_handle_t handle) struct pci_bus *pcmcia_lookup_bus(client_handle_t handle)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
return NULL; return NULL;
...@@ -1372,7 +1372,7 @@ EXPORT_SYMBOL(pcmcia_lookup_bus); ...@@ -1372,7 +1372,7 @@ EXPORT_SYMBOL(pcmcia_lookup_bus);
int pcmcia_get_status(client_handle_t handle, cs_status_t *status) int pcmcia_get_status(client_handle_t handle, cs_status_t *status)
{ {
socket_info_t *s; struct pcmcia_socket *s;
config_t *c; config_t *c;
int val; int val;
...@@ -1451,7 +1451,7 @@ int pcmcia_get_mem_page(window_handle_t win, memreq_t *req) ...@@ -1451,7 +1451,7 @@ int pcmcia_get_mem_page(window_handle_t win, memreq_t *req)
int pcmcia_map_mem_page(window_handle_t win, memreq_t *req) int pcmcia_map_mem_page(window_handle_t win, memreq_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if ((win == NULL) || (win->magic != WINDOW_MAGIC)) if ((win == NULL) || (win->magic != WINDOW_MAGIC))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
if (req->Page != 0) if (req->Page != 0)
...@@ -1472,7 +1472,7 @@ int pcmcia_map_mem_page(window_handle_t win, memreq_t *req) ...@@ -1472,7 +1472,7 @@ int pcmcia_map_mem_page(window_handle_t win, memreq_t *req)
int pcmcia_modify_configuration(client_handle_t handle, int pcmcia_modify_configuration(client_handle_t handle,
modconf_t *mod) modconf_t *mod)
{ {
socket_info_t *s; struct pcmcia_socket *s;
config_t *c; config_t *c;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
...@@ -1618,7 +1618,7 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req) ...@@ -1618,7 +1618,7 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
int pcmcia_release_configuration(client_handle_t handle) int pcmcia_release_configuration(client_handle_t handle)
{ {
pccard_io_map io = { 0, 0, 0, 0, 1 }; pccard_io_map io = { 0, 0, 0, 0, 1 };
socket_info_t *s; struct pcmcia_socket *s;
int i; int i;
if (CHECK_HANDLE(handle) || if (CHECK_HANDLE(handle) ||
...@@ -1668,7 +1668,7 @@ int pcmcia_release_configuration(client_handle_t handle) ...@@ -1668,7 +1668,7 @@ int pcmcia_release_configuration(client_handle_t handle)
int pcmcia_release_io(client_handle_t handle, io_req_t *req) int pcmcia_release_io(client_handle_t handle, io_req_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if (CHECK_HANDLE(handle) || !(handle->state & CLIENT_IO_REQ)) if (CHECK_HANDLE(handle) || !(handle->state & CLIENT_IO_REQ))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
...@@ -1703,7 +1703,7 @@ int pcmcia_release_io(client_handle_t handle, io_req_t *req) ...@@ -1703,7 +1703,7 @@ int pcmcia_release_io(client_handle_t handle, io_req_t *req)
int pcmcia_release_irq(client_handle_t handle, irq_req_t *req) int pcmcia_release_irq(client_handle_t handle, irq_req_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if (CHECK_HANDLE(handle) || !(handle->state & CLIENT_IRQ_REQ)) if (CHECK_HANDLE(handle) || !(handle->state & CLIENT_IRQ_REQ))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
handle->state &= ~CLIENT_IRQ_REQ; handle->state &= ~CLIENT_IRQ_REQ;
...@@ -1739,7 +1739,7 @@ int pcmcia_release_irq(client_handle_t handle, irq_req_t *req) ...@@ -1739,7 +1739,7 @@ int pcmcia_release_irq(client_handle_t handle, irq_req_t *req)
int pcmcia_release_window(window_handle_t win) int pcmcia_release_window(window_handle_t win)
{ {
socket_info_t *s; struct pcmcia_socket *s;
if ((win == NULL) || (win->magic != WINDOW_MAGIC)) if ((win == NULL) || (win->magic != WINDOW_MAGIC))
return CS_BAD_HANDLE; return CS_BAD_HANDLE;
...@@ -1769,7 +1769,7 @@ int pcmcia_request_configuration(client_handle_t handle, ...@@ -1769,7 +1769,7 @@ int pcmcia_request_configuration(client_handle_t handle,
{ {
int i; int i;
u_int base; u_int base;
socket_info_t *s; struct pcmcia_socket *s;
config_t *c; config_t *c;
pccard_io_map iomap; pccard_io_map iomap;
...@@ -1898,7 +1898,7 @@ int pcmcia_request_configuration(client_handle_t handle, ...@@ -1898,7 +1898,7 @@ int pcmcia_request_configuration(client_handle_t handle,
int pcmcia_request_io(client_handle_t handle, io_req_t *req) int pcmcia_request_io(client_handle_t handle, io_req_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
config_t *c; config_t *c;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
...@@ -1962,7 +1962,7 @@ int pcmcia_request_io(client_handle_t handle, io_req_t *req) ...@@ -1962,7 +1962,7 @@ int pcmcia_request_io(client_handle_t handle, io_req_t *req)
int pcmcia_request_irq(client_handle_t handle, irq_req_t *req) int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
{ {
socket_info_t *s; struct pcmcia_socket *s;
config_t *c; config_t *c;
int ret = 0, irq = 0; int ret = 0, irq = 0;
...@@ -2037,7 +2037,7 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req) ...@@ -2037,7 +2037,7 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle_t *wh) int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle_t *wh)
{ {
socket_info_t *s; struct pcmcia_socket *s;
window_t *win; window_t *win;
u_long align; u_long align;
int w; int w;
...@@ -2122,7 +2122,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle ...@@ -2122,7 +2122,7 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
int pcmcia_reset_card(client_handle_t handle, client_req_t *req) int pcmcia_reset_card(client_handle_t handle, client_req_t *req)
{ {
socket_info_t *skt; struct pcmcia_socket *skt;
int ret; int ret;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
...@@ -2171,7 +2171,7 @@ int pcmcia_reset_card(client_handle_t handle, client_req_t *req) ...@@ -2171,7 +2171,7 @@ int pcmcia_reset_card(client_handle_t handle, client_req_t *req)
int pcmcia_suspend_card(client_handle_t handle, client_req_t *req) int pcmcia_suspend_card(client_handle_t handle, client_req_t *req)
{ {
socket_info_t *skt; struct pcmcia_socket *skt;
int ret; int ret;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
...@@ -2198,7 +2198,7 @@ int pcmcia_suspend_card(client_handle_t handle, client_req_t *req) ...@@ -2198,7 +2198,7 @@ int pcmcia_suspend_card(client_handle_t handle, client_req_t *req)
int pcmcia_resume_card(client_handle_t handle, client_req_t *req) int pcmcia_resume_card(client_handle_t handle, client_req_t *req)
{ {
socket_info_t *skt; struct pcmcia_socket *skt;
int ret; int ret;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
...@@ -2231,7 +2231,7 @@ int pcmcia_resume_card(client_handle_t handle, client_req_t *req) ...@@ -2231,7 +2231,7 @@ int pcmcia_resume_card(client_handle_t handle, client_req_t *req)
int pcmcia_eject_card(client_handle_t handle, client_req_t *req) int pcmcia_eject_card(client_handle_t handle, client_req_t *req)
{ {
socket_info_t *skt; struct pcmcia_socket *skt;
int ret; int ret;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
...@@ -2260,7 +2260,7 @@ int pcmcia_eject_card(client_handle_t handle, client_req_t *req) ...@@ -2260,7 +2260,7 @@ int pcmcia_eject_card(client_handle_t handle, client_req_t *req)
int pcmcia_insert_card(client_handle_t handle, client_req_t *req) int pcmcia_insert_card(client_handle_t handle, client_req_t *req)
{ {
socket_info_t *skt; struct pcmcia_socket *skt;
int ret; int ret;
if (CHECK_HANDLE(handle)) if (CHECK_HANDLE(handle))
......
...@@ -92,9 +92,6 @@ struct cis_cache_entry { ...@@ -92,9 +92,6 @@ struct cis_cache_entry {
unsigned char cache[0]; unsigned char cache[0];
}; };
/* deprecated - use struct pcmcia_socket instead */
typedef struct pcmcia_socket socket_info_t;
/* Flags in config state */ /* Flags in config state */
#define CONFIG_LOCKED 0x01 #define CONFIG_LOCKED 0x01
#define CONFIG_IRQ_REQ 0x02 #define CONFIG_IRQ_REQ 0x02
...@@ -131,19 +128,19 @@ typedef struct pcmcia_socket socket_info_t; ...@@ -131,19 +128,19 @@ typedef struct pcmcia_socket socket_info_t;
((h)->event_handler((e), (p), &(h)->event_callback_args)) ((h)->event_handler((e), (p), &(h)->event_callback_args))
/* In cardbus.c */ /* In cardbus.c */
int cb_alloc(socket_info_t *s); int cb_alloc(struct pcmcia_socket *s);
void cb_free(socket_info_t *s); void cb_free(struct pcmcia_socket *s);
int read_cb_mem(socket_info_t *s, int space, u_int addr, u_int len, void *ptr); int read_cb_mem(struct pcmcia_socket *s, int space, u_int addr, u_int len, void *ptr);
/* In cistpl.c */ /* In cistpl.c */
int read_cis_mem(socket_info_t *s, int attr, int read_cis_mem(struct pcmcia_socket *s, int attr,
u_int addr, u_int len, void *ptr); u_int addr, u_int len, void *ptr);
void write_cis_mem(socket_info_t *s, int attr, void write_cis_mem(struct pcmcia_socket *s, int attr,
u_int addr, u_int len, void *ptr); u_int addr, u_int len, void *ptr);
void release_cis_mem(socket_info_t *s); void release_cis_mem(struct pcmcia_socket *s);
void destroy_cis_cache(socket_info_t *s); void destroy_cis_cache(struct pcmcia_socket *s);
int verify_cis_cache(socket_info_t *s); int verify_cis_cache(struct pcmcia_socket *s);
void preload_cis_cache(socket_info_t *s); void preload_cis_cache(struct pcmcia_socket *s);
int get_first_tuple(client_handle_t handle, tuple_t *tuple); int get_first_tuple(client_handle_t handle, tuple_t *tuple);
int get_next_tuple(client_handle_t handle, tuple_t *tuple); int get_next_tuple(client_handle_t handle, tuple_t *tuple);
int get_tuple_data(client_handle_t handle, tuple_t *tuple); int get_tuple_data(client_handle_t handle, tuple_t *tuple);
...@@ -167,11 +164,11 @@ int write_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf); ...@@ -167,11 +164,11 @@ int write_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf);
int copy_memory(memory_handle_t handle, copy_op_t *req); int copy_memory(memory_handle_t handle, copy_op_t *req);
/* In rsrc_mgr */ /* In rsrc_mgr */
void validate_mem(socket_info_t *s); void validate_mem(struct pcmcia_socket *s);
int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align, int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align,
char *name, socket_info_t *s); char *name, struct pcmcia_socket *s);
int find_mem_region(u_long *base, u_long num, u_long align, int find_mem_region(u_long *base, u_long num, u_long align,
int force_low, char *name, socket_info_t *s); int force_low, char *name, struct pcmcia_socket *s);
int try_irq(u_int Attributes, int irq, int specific); 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);
......
...@@ -90,7 +90,7 @@ static DECLARE_MUTEX(rsrc_sem); ...@@ -90,7 +90,7 @@ static DECLARE_MUTEX(rsrc_sem);
typedef struct irq_info_t { typedef struct irq_info_t {
u_int Attributes; u_int Attributes;
int time_share, dyn_share; int time_share, dyn_share;
struct socket_info_t *Socket; struct pcmcia_socket *Socket;
} irq_info_t; } irq_info_t;
/* Table of IRQ assignments */ /* Table of IRQ assignments */
...@@ -341,7 +341,7 @@ static void do_io_probe(ioaddr_t base, ioaddr_t num) ...@@ -341,7 +341,7 @@ static void do_io_probe(ioaddr_t base, ioaddr_t num)
======================================================================*/ ======================================================================*/
/* Validation function for cards with a valid CIS */ /* Validation function for cards with a valid CIS */
static int cis_readable(socket_info_t *s, u_long base) static int cis_readable(struct pcmcia_socket *s, u_long base)
{ {
cisinfo_t info1, info2; cisinfo_t info1, info2;
int ret; int ret;
...@@ -364,7 +364,7 @@ static int cis_readable(socket_info_t *s, u_long base) ...@@ -364,7 +364,7 @@ static int cis_readable(socket_info_t *s, u_long base)
} }
/* Validation function for simple memory cards */ /* Validation function for simple memory cards */
static int checksum(socket_info_t *s, u_long base) 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;
...@@ -383,7 +383,7 @@ static int checksum(socket_info_t *s, u_long base) ...@@ -383,7 +383,7 @@ static int checksum(socket_info_t *s, u_long base)
return (b == -1) ? -1 : (a>>1); return (b == -1) ? -1 : (a>>1);
} }
static int checksum_match(socket_info_t *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->cap.map_size);
return ((a == b) && (a >= 0)); return ((a == b) && (a >= 0));
...@@ -397,7 +397,7 @@ static int checksum_match(socket_info_t *s, u_long base) ...@@ -397,7 +397,7 @@ static int checksum_match(socket_info_t *s, u_long base)
======================================================================*/ ======================================================================*/
static int do_mem_probe(u_long base, u_long num, socket_info_t *s) static int do_mem_probe(u_long base, u_long num, struct pcmcia_socket *s)
{ {
u_long i, j, bad, fail, step; u_long i, j, bad, fail, step;
...@@ -435,7 +435,7 @@ static int do_mem_probe(u_long base, u_long num, socket_info_t *s) ...@@ -435,7 +435,7 @@ static int do_mem_probe(u_long base, u_long num, socket_info_t *s)
#ifdef CONFIG_PCMCIA_PROBE #ifdef CONFIG_PCMCIA_PROBE
static u_long inv_probe(resource_map_t *m, socket_info_t *s) static u_long inv_probe(resource_map_t *m, struct pcmcia_socket *s)
{ {
u_long ok; u_long ok;
if (m == &mem_db) if (m == &mem_db)
...@@ -451,7 +451,7 @@ static u_long inv_probe(resource_map_t *m, socket_info_t *s) ...@@ -451,7 +451,7 @@ static u_long inv_probe(resource_map_t *m, socket_info_t *s)
return do_mem_probe(m->base, m->num, s); return do_mem_probe(m->base, m->num, s);
} }
void validate_mem(socket_info_t *s) void validate_mem(struct pcmcia_socket *s)
{ {
resource_map_t *m, *n; resource_map_t *m, *n;
static u_char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 }; static u_char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 };
...@@ -497,7 +497,7 @@ void validate_mem(socket_info_t *s) ...@@ -497,7 +497,7 @@ void validate_mem(socket_info_t *s)
#else /* CONFIG_PCMCIA_PROBE */ #else /* CONFIG_PCMCIA_PROBE */
void validate_mem(socket_info_t *s) void validate_mem(struct pcmcia_socket *s)
{ {
resource_map_t *m, *n; resource_map_t *m, *n;
static int done = 0; static int done = 0;
...@@ -529,7 +529,7 @@ void validate_mem(socket_info_t *s) ...@@ -529,7 +529,7 @@ void validate_mem(socket_info_t *s)
======================================================================*/ ======================================================================*/
int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align, int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align,
char *name, socket_info_t *s) char *name, struct pcmcia_socket *s)
{ {
ioaddr_t try; ioaddr_t try;
resource_map_t *m; resource_map_t *m;
...@@ -556,7 +556,7 @@ int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align, ...@@ -556,7 +556,7 @@ int find_io_region(ioaddr_t *base, ioaddr_t num, ioaddr_t align,
} }
int find_mem_region(u_long *base, u_long num, u_long align, int find_mem_region(u_long *base, u_long num, u_long align,
int force_low, char *name, socket_info_t *s) int force_low, char *name, struct pcmcia_socket *s)
{ {
u_long try; u_long try;
resource_map_t *m; resource_map_t *m;
......
...@@ -189,10 +189,6 @@ typedef struct window_t { ...@@ -189,10 +189,6 @@ typedef struct window_t {
struct config_t; struct config_t;
struct region_t; struct region_t;
/* in parts of drivers/pcmcia/ this is still known as
* socket_info_t
*/
struct pcmcia_socket { struct pcmcia_socket {
spinlock_t lock; spinlock_t lock;
struct pccard_operations * ss_entry; struct pccard_operations * ss_entry;
......
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