linux/include/pcmcia/ss.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * ss.h
 *
 * The initial developer of the original code is David A. Hinds
 * <[email protected]>.  Portions created by David A. Hinds
 * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
 *
 * (C) 1999             David A. Hinds
 */

#ifndef _LINUX_SS_H
#define _LINUX_SS_H

#include <linux/device.h>
#include <linux/sched.h>	/* task_struct, completion */
#include <linux/mutex.h>

#ifdef CONFIG_CARDBUS
#include <linux/pci.h>
#endif

/* Definitions for card status flags for GetStatus */
#define SS_WRPROT
#define SS_CARDLOCK
#define SS_EJECTION
#define SS_INSERTION
#define SS_BATDEAD
#define SS_BATWARN
#define SS_READY
#define SS_DETECT
#define SS_POWERON
#define SS_GPI
#define SS_STSCHG
#define SS_CARDBUS
#define SS_3VCARD
#define SS_XVCARD
#define SS_PENDING
#define SS_ZVCARD

/* InquireSocket capabilities */
#define SS_CAP_PAGE_REGS
#define SS_CAP_VIRTUAL_BUS
#define SS_CAP_MEM_ALIGN
#define SS_CAP_STATIC_MAP
#define SS_CAP_PCCARD
#define SS_CAP_CARDBUS

/* for GetSocket, SetSocket */
socket_state_t;

extern socket_state_t dead_socket;

/* Socket configuration flags */
#define SS_PWR_AUTO
#define SS_IOCARD
#define SS_RESET
#define SS_DMA_MODE
#define SS_SPKR_ENA
#define SS_OUTPUT_ENA

/* Flags for I/O port and memory windows */
#define MAP_ACTIVE
#define MAP_16BIT
#define MAP_AUTOSZ
#define MAP_0WS
#define MAP_WRPROT
#define MAP_ATTRIB
#define MAP_USE_WAIT
#define MAP_PREFETCH

/* Use this just for bridge windows */
#define MAP_IOSPACE

/* power hook operations */
#define HOOK_POWER_PRE
#define HOOK_POWER_POST

pccard_io_map;

pccard_mem_map;

io_window_t;

/* Maximum number of IO windows per socket */
#define MAX_IO_WIN

/* Maximum number of memory windows per socket */
#define MAX_WIN


/*
 * Socket operations.
 */
struct pcmcia_socket;
struct pccard_resource_ops;
struct config_t;
struct pcmcia_callback;
struct user_info_t;

struct pccard_operations {};

struct pcmcia_socket {};


/* socket drivers must define the resource operations type they use. There
 * are three options:
 * - pccard_static_ops		iomem and ioport areas are assigned statically
 * - pccard_iodyn_ops		iomem areas is assigned statically, ioport
 *				areas dynamically
 *				If this option is selected, use
 *				"select PCCARD_IODYN" in Kconfig.
 * - pccard_nonstatic_ops	iomem and ioport areas are assigned dynamically.
 *				If this option is selected, use
 *				"select PCCARD_NONSTATIC" in Kconfig.
 *
 */
extern struct pccard_resource_ops pccard_static_ops;
#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
extern struct pccard_resource_ops pccard_iodyn_ops;
extern struct pccard_resource_ops pccard_nonstatic_ops;
#else
/* If PCMCIA is not used, but only CARDBUS, these functions are not used
 * at all. Therefore, do not use the large (240K!) rsrc_nonstatic module
 */
#define pccard_iodyn_ops
#define pccard_nonstatic_ops
#endif


/* socket drivers use this callback in their IRQ handler */
extern void pcmcia_parse_events(struct pcmcia_socket *socket,
				unsigned int events);

/* to register and unregister a socket */
extern int pcmcia_register_socket(struct pcmcia_socket *socket);
extern void pcmcia_unregister_socket(struct pcmcia_socket *socket);


#endif /* _LINUX_SS_H */