linux/drivers/pcmcia/ds.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ds.c -- 16-bit PCMCIA core support
 *
 * 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
 * (C) 2003 - 2010	Dominik Brodowski
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/list.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/crc32.h>
#include <linux/firmware.h>
#include <linux/kref.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>

#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include <pcmcia/ss.h>

#include "cs_internal.h"

/*====================================================================*/

/* Module parameters */

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();


/*====================================================================*/

static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
{}


/*======================================================================*/


struct pcmcia_dynid {};

/**
 * new_id_store() - add a new PCMCIA device ID to this driver and re-probe devices
 * @driver: target device driver
 * @buf: buffer for scanning device ID data
 * @count: input size
 *
 * Adds a new dynamic PCMCIA device ID to this driver,
 * and causes the driver to probe for all devices again.
 */
static ssize_t
new_id_store(struct device_driver *driver, const char *buf, size_t count)
{}
static DRIVER_ATTR_WO(new_id);

static void
pcmcia_free_dynids(struct pcmcia_driver *drv)
{}

static int
pcmcia_create_newid_file(struct pcmcia_driver *drv)
{}

static void
pcmcia_remove_newid_file(struct pcmcia_driver *drv)
{}

/**
 * pcmcia_register_driver - register a PCMCIA driver with the bus core
 * @driver: the &driver being registered
 *
 * Registers a PCMCIA driver with the PCMCIA bus core.
 */
int pcmcia_register_driver(struct pcmcia_driver *driver)
{}
EXPORT_SYMBOL();

/**
 * pcmcia_unregister_driver - unregister a PCMCIA driver with the bus core
 * @driver: the &driver being unregistered
 */
void pcmcia_unregister_driver(struct pcmcia_driver *driver)
{}
EXPORT_SYMBOL();


/* pcmcia_device handling */

static struct pcmcia_device *pcmcia_get_dev(struct pcmcia_device *p_dev)
{}

static void pcmcia_put_dev(struct pcmcia_device *p_dev)
{}

static void pcmcia_release_function(struct kref *ref)
{}

static void pcmcia_release_dev(struct device *dev)
{}


static int pcmcia_device_probe(struct device *dev)
{}


/*
 * Removes a PCMCIA card from the device tree and socket list.
 */
static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *leftover)
{}

static void pcmcia_device_remove(struct device *dev)
{}


/*
 * pcmcia_device_query -- determine information about a pcmcia device
 */
static int pcmcia_device_query(struct pcmcia_device *p_dev)
{}


static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,
					       unsigned int function)
{}


static int pcmcia_card_add(struct pcmcia_socket *s)
{}


static int pcmcia_requery_callback(struct device *dev, void *_data)
{}


static void pcmcia_requery(struct pcmcia_socket *s)
{}


#ifdef CONFIG_PCMCIA_LOAD_CIS

/**
 * pcmcia_load_firmware - load CIS from userspace if device-provided is broken
 * @dev: the pcmcia device which needs a CIS override
 * @filename: requested filename in /lib/firmware/
 *
 * This uses the in-kernel firmware loading mechanism to use a "fake CIS" if
 * the one provided by the card is broken. The firmware files reside in
 * /lib/firmware/ in userspace.
 */
static int pcmcia_load_firmware(struct pcmcia_device *dev, char *filename)
{}

#else /* !CONFIG_PCMCIA_LOAD_CIS */

static inline int pcmcia_load_firmware(struct pcmcia_device *dev,
				       char *filename)
{
	return -ENODEV;
}

#endif


static inline int pcmcia_devmatch(struct pcmcia_device *dev,
				  const struct pcmcia_device_id *did)
{}


static int pcmcia_bus_match(struct device *dev, const struct device_driver *drv)
{}

static int pcmcia_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
{}

/************************ runtime PM support ***************************/

static int pcmcia_dev_suspend(struct device *dev);
static int pcmcia_dev_resume(struct device *dev);

static int runtime_suspend(struct device *dev)
{}

static int runtime_resume(struct device *dev)
{}

/************************ per-device sysfs output ***************************/

#define pcmcia_device_attr(field, test, format)

#define pcmcia_device_stringattr(name, field)

pcmcia_device_attr(func_id, has_func_id, "0x%02x\n");
pcmcia_device_attr(manf_id, has_manf_id, "0x%04x\n");
pcmcia_device_attr(card_id, has_card_id, "0x%04x\n");
pcmcia_device_stringattr(prod_id1, prod_id[0]);
pcmcia_device_stringattr(prod_id2, prod_id[1]);
pcmcia_device_stringattr(prod_id3, prod_id[2]);
pcmcia_device_stringattr(prod_id4, prod_id[3]);

static ssize_t function_show(struct device *dev, struct device_attribute *attr,
			     char *buf)
{}
static DEVICE_ATTR_RO(function);

static ssize_t resources_show(struct device *dev,
			      struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(resources);

static ssize_t pm_state_show(struct device *dev, struct device_attribute *attr, char *buf)
{}

static ssize_t pm_state_store(struct device *dev, struct device_attribute *attr,
			      const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(pm_state);

static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(modalias);

static ssize_t allow_func_id_match_store(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{}
static DEVICE_ATTR_WO(allow_func_id_match);

static struct attribute *pcmcia_dev_attrs[] =;
ATTRIBUTE_GROUPS();

/* PM support, also needed for reset */

static int pcmcia_dev_suspend(struct device *dev)
{}


static int pcmcia_dev_resume(struct device *dev)
{}


static int pcmcia_bus_suspend_callback(struct device *dev, void *_data)
{}

static int pcmcia_bus_resume_callback(struct device *dev, void *_data)
{}

static int pcmcia_bus_resume(struct pcmcia_socket *skt)
{}

static int pcmcia_bus_suspend(struct pcmcia_socket *skt)
{}

static int pcmcia_bus_remove(struct pcmcia_socket *skt)
{}

static int pcmcia_bus_add(struct pcmcia_socket *skt)
{}

static int pcmcia_bus_early_resume(struct pcmcia_socket *skt)
{}


/*
 * NOTE: This is racy. There's no guarantee the card will still be
 * physically present, even if the call to this function returns
 * non-NULL. Furthermore, the device driver most likely is unbound
 * almost immediately, so the timeframe where pcmcia_dev_present
 * returns NULL is probably really really small.
 */
struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *_p_dev)
{}
EXPORT_SYMBOL();


static struct pcmcia_callback pcmcia_bus_callback =;

static int pcmcia_bus_add_socket(struct device *dev)
{}

static void pcmcia_bus_remove_socket(struct device *dev)
{}


/* the pcmcia_bus_interface is used to handle pcmcia socket devices */
static struct class_interface pcmcia_bus_interface __refdata =;

static const struct dev_pm_ops pcmcia_bus_pm_ops =;

const struct bus_type pcmcia_bus_type =;


static int __init init_pcmcia_bus(void)
{}
fs_initcall(init_pcmcia_bus); /* one level after subsys_initcall so that
			       * pcmcia_socket_class is already registered */


static void __exit exit_pcmcia_bus(void)
{}
module_exit(exit_pcmcia_bus);


MODULE_ALIAS();