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,
{
int ret, tries;
client_t *mtd;
socket_info_t *s;
struct pcmcia_socket *s;
mtd = handle->mtd;
if (mtd == NULL)
......@@ -130,7 +130,7 @@ static void retry_erase(erase_busy_t *busy, u_int cause)
eraseq_entry_t *erase = busy->erase;
mtd_request_t req;
client_t *mtd;
socket_info_t *s;
struct pcmcia_socket *s;
int ret;
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)
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))
return CS_BAD_HANDLE;
if (req->Vpp1 != req->Vpp2)
......@@ -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)
{
socket_info_t *s;
struct pcmcia_socket *s;
if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE;
s = SOCKET(handle);
......@@ -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)
{
socket_info_t *s = SOCKET(handle);
struct pcmcia_socket *s = SOCKET(handle);
if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE;
......@@ -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)
{
memory_handle_t list;
socket_info_t *s;
struct pcmcia_socket *s;
if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE;
......
......@@ -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
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) {
DEBUG(1, "cs: cb_release_cis_mem()\n");
......@@ -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;
......@@ -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 resource *res;
......@@ -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_dev *dev;
......@@ -266,7 +266,7 @@ int cb_alloc(socket_info_t * s)
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;
......
......@@ -82,7 +82,7 @@ static const u_int exponent[] = {
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) {
s->cis_mem.flags &= ~MAP_ACTIVE;
......@@ -101,7 +101,7 @@ void release_cis_mem(socket_info_t *s)
* map the memory space.
*/
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;
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)
#define IS_ATTR 1
#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_char *sys, *end, *buf = ptr;
......@@ -202,7 +202,7 @@ int read_cis_mem(socket_info_t *s, int attr, u_int addr,
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_char *sys, *end, *buf = ptr;
......@@ -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)
{
struct cis_cache_entry *cis;
......@@ -306,7 +306,7 @@ static void read_cis_cache(socket_info_t *s, int attr, u_int addr,
}
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;
......@@ -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;
......@@ -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;
char buf[256];
......@@ -369,7 +369,7 @@ int verify_cis_cache(socket_info_t *s)
int pcmcia_replace_cis(client_handle_t handle, cisdump_t *cis)
{
socket_info_t *s;
struct pcmcia_socket *s;
if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE;
s = SOCKET(handle);
......@@ -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)
{
socket_info_t *s;
struct pcmcia_socket *s;
if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE;
s = SOCKET(handle);
......@@ -445,7 +445,7 @@ int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *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_int ofs;
......@@ -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)
{
socket_info_t *s;
struct pcmcia_socket *s;
u_char link[2], tmp;
int ofs, i, attr;
......@@ -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)
{
socket_info_t *s;
struct pcmcia_socket *s;
u_int len;
if (CHECK_HANDLE(handle))
......
This diff is collapsed.
......@@ -92,9 +92,6 @@ struct cis_cache_entry {
unsigned char cache[0];
};
/* deprecated - use struct pcmcia_socket instead */
typedef struct pcmcia_socket socket_info_t;
/* Flags in config state */
#define CONFIG_LOCKED 0x01
#define CONFIG_IRQ_REQ 0x02
......@@ -131,19 +128,19 @@ typedef struct pcmcia_socket socket_info_t;
((h)->event_handler((e), (p), &(h)->event_callback_args))
/* In cardbus.c */
int cb_alloc(socket_info_t *s);
void cb_free(socket_info_t *s);
int read_cb_mem(socket_info_t *s, int space, u_int addr, u_int len, void *ptr);
int cb_alloc(struct pcmcia_socket *s);
void cb_free(struct pcmcia_socket *s);
int read_cb_mem(struct pcmcia_socket *s, int space, u_int addr, u_int len, void *ptr);
/* 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);
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);
void release_cis_mem(socket_info_t *s);
void destroy_cis_cache(socket_info_t *s);
int verify_cis_cache(socket_info_t *s);
void preload_cis_cache(socket_info_t *s);
void release_cis_mem(struct pcmcia_socket *s);
void destroy_cis_cache(struct pcmcia_socket *s);
int verify_cis_cache(struct pcmcia_socket *s);
void preload_cis_cache(struct pcmcia_socket *s);
int get_first_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);
......@@ -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);
/* 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,
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 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);
void undo_irq(u_int Attributes, int irq);
int adjust_resource_info(client_handle_t handle, adjust_t *adj);
......
......@@ -90,7 +90,7 @@ static DECLARE_MUTEX(rsrc_sem);
typedef struct irq_info_t {
u_int Attributes;
int time_share, dyn_share;
struct socket_info_t *Socket;
struct pcmcia_socket *Socket;
} irq_info_t;
/* Table of IRQ assignments */
......@@ -341,7 +341,7 @@ static void do_io_probe(ioaddr_t base, ioaddr_t num)
======================================================================*/
/* 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;
int ret;
......@@ -364,7 +364,7 @@ static int cis_readable(socket_info_t *s, u_long base)
}
/* 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;
s->cis_mem.sys_start = base;
......@@ -383,7 +383,7 @@ static int checksum(socket_info_t *s, u_long base)
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);
return ((a == b) && (a >= 0));
......@@ -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;
......@@ -435,7 +435,7 @@ static int do_mem_probe(u_long base, u_long num, socket_info_t *s)
#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;
if (m == &mem_db)
......@@ -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);
}
void validate_mem(socket_info_t *s)
void validate_mem(struct pcmcia_socket *s)
{
resource_map_t *m, *n;
static u_char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 };
......@@ -497,7 +497,7 @@ void validate_mem(socket_info_t *s)
#else /* CONFIG_PCMCIA_PROBE */
void validate_mem(socket_info_t *s)
void validate_mem(struct pcmcia_socket *s)
{
resource_map_t *m, *n;
static int done = 0;
......@@ -529,7 +529,7 @@ void validate_mem(socket_info_t *s)
======================================================================*/
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;
resource_map_t *m;
......@@ -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 force_low, char *name, socket_info_t *s)
int force_low, char *name, struct pcmcia_socket *s)
{
u_long try;
resource_map_t *m;
......
......@@ -189,10 +189,6 @@ typedef struct window_t {
struct config_t;
struct region_t;
/* in parts of drivers/pcmcia/ this is still known as
* socket_info_t
*/
struct pcmcia_socket {
spinlock_t lock;
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