linux/drivers/usb/host/xen-hcd.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * xen-hcd.c
 *
 * Xen USB Virtual Host Controller driver
 *
 * Copyright (C) 2009, FUJITSU LABORATORIES LTD.
 * Author: Noboru Iwamatsu <[email protected]>
 */

#include <linux/module.h>
#include <linux/usb.h>
#include <linux/list.h>
#include <linux/usb/hcd.h>
#include <linux/io.h>

#include <xen/xen.h>
#include <xen/xenbus.h>
#include <xen/grant_table.h>
#include <xen/events.h>
#include <xen/page.h>

#include <xen/interface/io/usbif.h>

/* Private per-URB data */
struct urb_priv {};

/* virtual roothub port status */
struct rhport_status {};

/* status of attached device */
struct vdevice_status {};

/* RING request shadow */
struct usb_shadow {};

struct xenhcd_info {};

#define XENHCD_RING_JIFFIES
#define XENHCD_SCAN_JIFFIES

enum xenhcd_timer_action {};

static struct kmem_cache *xenhcd_urbp_cachep;

static inline struct xenhcd_info *xenhcd_hcd_to_info(struct usb_hcd *hcd)
{}

static inline struct usb_hcd *xenhcd_info_to_hcd(struct xenhcd_info *info)
{}

static void xenhcd_set_error(struct xenhcd_info *info, const char *msg)
{}

static inline void xenhcd_timer_action_done(struct xenhcd_info *info,
					    enum xenhcd_timer_action action)
{}

static void xenhcd_timer_action(struct xenhcd_info *info,
				enum xenhcd_timer_action action)
{}

/*
 * set virtual port connection status
 */
static void xenhcd_set_connect_state(struct xenhcd_info *info, int portnum)
{}

/*
 * set virtual device connection status
 */
static int xenhcd_rhport_connect(struct xenhcd_info *info, __u8 portnum,
				 __u8 speed)
{}

/*
 * SetPortFeature(PORT_SUSPENDED)
 */
static void xenhcd_rhport_suspend(struct xenhcd_info *info, int portnum)
{}

/*
 * ClearPortFeature(PORT_SUSPENDED)
 */
static void xenhcd_rhport_resume(struct xenhcd_info *info, int portnum)
{}

/*
 * SetPortFeature(PORT_POWER)
 */
static void xenhcd_rhport_power_on(struct xenhcd_info *info, int portnum)
{}

/*
 * ClearPortFeature(PORT_POWER)
 * SetConfiguration(non-zero)
 * Power_Source_Off
 * Over-current
 */
static void xenhcd_rhport_power_off(struct xenhcd_info *info, int portnum)
{}

/*
 * ClearPortFeature(PORT_ENABLE)
 */
static void xenhcd_rhport_disable(struct xenhcd_info *info, int portnum)
{}

/*
 * SetPortFeature(PORT_RESET)
 */
static void xenhcd_rhport_reset(struct xenhcd_info *info, int portnum)
{}

#ifdef CONFIG_PM
static int xenhcd_bus_suspend(struct usb_hcd *hcd)
{}

static int xenhcd_bus_resume(struct usb_hcd *hcd)
{}
#endif

static void xenhcd_hub_descriptor(struct xenhcd_info *info,
				  struct usb_hub_descriptor *desc)
{}

/* port status change mask for hub_status_data */
#define PORT_C_MASK

/*
 * See USB 2.0 Spec, 11.12.4 Hub and Port Status Change Bitmap.
 * If port status changed, writes the bitmap to buf and return
 * that length(number of bytes).
 * If Nothing changed, return 0.
 */
static int xenhcd_hub_status_data(struct usb_hcd *hcd, char *buf)
{}

static int xenhcd_hub_control(struct usb_hcd *hcd, __u16 typeReq, __u16 wValue,
			      __u16 wIndex, char *buf, __u16 wLength)
{}

static void xenhcd_free_urb_priv(struct urb_priv *urbp)
{}

static inline unsigned int xenhcd_get_id_from_freelist(struct xenhcd_info *info)
{}

static inline void xenhcd_add_id_to_freelist(struct xenhcd_info *info,
					     unsigned int id)
{}

static inline int xenhcd_count_pages(void *addr, int length)
{}

static void xenhcd_gnttab_map(struct xenhcd_info *info, void *addr, int length,
			      grant_ref_t *gref_head,
			      struct xenusb_request_segment *seg,
			      int nr_pages, int flags)
{}

static __u32 xenhcd_pipe_urb_to_xenusb(__u32 urb_pipe, __u8 port)
{}

static int xenhcd_map_urb_for_request(struct xenhcd_info *info, struct urb *urb,
				      struct xenusb_urb_request *req)
{}

static void xenhcd_gnttab_done(struct xenhcd_info *info, unsigned int id)
{}

static int xenhcd_translate_status(int status)
{}

static void xenhcd_giveback_urb(struct xenhcd_info *info, struct urb *urb,
				int status)
{}

static int xenhcd_do_request(struct xenhcd_info *info, struct urb_priv *urbp)
{}

static void xenhcd_kick_pending_urbs(struct xenhcd_info *info)
{}

/*
 * caller must lock info->lock
 */
static void xenhcd_cancel_all_enqueued_urbs(struct xenhcd_info *info)
{}

/*
 * caller must lock info->lock
 */
static void xenhcd_giveback_unlinked_urbs(struct xenhcd_info *info)
{}

static int xenhcd_submit_urb(struct xenhcd_info *info, struct urb_priv *urbp)
{}

static int xenhcd_unlink_urb(struct xenhcd_info *info, struct urb_priv *urbp)
{}

static void xenhcd_res_to_urb(struct xenhcd_info *info,
			      struct xenusb_urb_response *res, struct urb *urb)
{}

static int xenhcd_urb_request_done(struct xenhcd_info *info,
				   unsigned int *eoiflag)
{}

static int xenhcd_conn_notify(struct xenhcd_info *info, unsigned int *eoiflag)
{}

static irqreturn_t xenhcd_int(int irq, void *dev_id)
{}

static void xenhcd_destroy_rings(struct xenhcd_info *info)
{}

static int xenhcd_setup_rings(struct xenbus_device *dev,
			      struct xenhcd_info *info)
{}

static int xenhcd_talk_to_backend(struct xenbus_device *dev,
				  struct xenhcd_info *info)
{}

static int xenhcd_connect(struct xenbus_device *dev)
{}

static void xenhcd_disconnect(struct xenbus_device *dev)
{}

static void xenhcd_watchdog(struct timer_list *timer)
{}

/*
 * one-time HC init
 */
static int xenhcd_setup(struct usb_hcd *hcd)
{}

/*
 * start HC running
 */
static int xenhcd_run(struct usb_hcd *hcd)
{}

/*
 * stop running HC
 */
static void xenhcd_stop(struct usb_hcd *hcd)
{}

/*
 * called as .urb_enqueue()
 * non-error returns are promise to giveback the urb later
 */
static int xenhcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
			      gfp_t mem_flags)
{}

/*
 * called as .urb_dequeue()
 */
static int xenhcd_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
{}

/*
 * called from usb_get_current_frame_number(),
 * but, almost all drivers not use such function.
 */
static int xenhcd_get_frame(struct usb_hcd *hcd)
{}

static struct hc_driver xenhcd_usb20_hc_driver =;

static struct hc_driver xenhcd_usb11_hc_driver =;

static struct usb_hcd *xenhcd_create_hcd(struct xenbus_device *dev)
{}

static void xenhcd_backend_changed(struct xenbus_device *dev,
				   enum xenbus_state backend_state)
{}

static void xenhcd_remove(struct xenbus_device *dev)
{}

static int xenhcd_probe(struct xenbus_device *dev,
			const struct xenbus_device_id *id)
{}

static const struct xenbus_device_id xenhcd_ids[] =;

static struct xenbus_driver xenhcd_driver =;

static int __init xenhcd_init(void)
{}
module_init();

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

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