#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/timer.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/device.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/prefetch.h>
#include <asm/byteorder.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/unaligned.h>
#include "goku_udc.h"
#define DRIVER_DESC …
#define DRIVER_VERSION …
static const char driver_name [] = …;
static const char driver_desc [] = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
static unsigned use_dma = …;
#if 0
module_param(use_dma, uint, S_IRUGO);
#endif
static void nuke(struct goku_ep *, int status);
static inline void
command(struct goku_udc_regs __iomem *regs, int command, unsigned epnum)
{ … }
static int
goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
{ … }
static void ep_reset(struct goku_udc_regs __iomem *regs, struct goku_ep *ep)
{ … }
static int goku_ep_disable(struct usb_ep *_ep)
{ … }
static struct usb_request *
goku_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags)
{ … }
static void
goku_free_request(struct usb_ep *_ep, struct usb_request *_req)
{ … }
static void
done(struct goku_ep *ep, struct goku_request *req, int status)
{ … }
static inline int
write_packet(u32 __iomem *fifo, u8 *buf, struct goku_request *req, unsigned max)
{ … }
static int write_fifo(struct goku_ep *ep, struct goku_request *req)
{ … }
static int read_fifo(struct goku_ep *ep, struct goku_request *req)
{ … }
static inline void
pio_irq_enable(struct goku_udc *dev,
struct goku_udc_regs __iomem *regs, int epnum)
{ … }
static inline void
pio_irq_disable(struct goku_udc *dev,
struct goku_udc_regs __iomem *regs, int epnum)
{ … }
static inline void
pio_advance(struct goku_ep *ep)
{ … }
static int start_dma(struct goku_ep *ep, struct goku_request *req)
{ … }
static void dma_advance(struct goku_udc *dev, struct goku_ep *ep)
{ … }
static void abort_dma(struct goku_ep *ep, int status)
{ … }
static int
goku_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
{ … }
static void nuke(struct goku_ep *ep, int status)
{ … }
static int goku_dequeue(struct usb_ep *_ep, struct usb_request *_req)
{ … }
static void goku_clear_halt(struct goku_ep *ep)
{ … }
static int goku_set_halt(struct usb_ep *_ep, int value)
{ … }
static int goku_fifo_status(struct usb_ep *_ep)
{ … }
static void goku_fifo_flush(struct usb_ep *_ep)
{ … }
static const struct usb_ep_ops goku_ep_ops = …;
static int goku_get_frame(struct usb_gadget *_gadget)
{ … }
static struct usb_ep *goku_match_ep(struct usb_gadget *g,
struct usb_endpoint_descriptor *desc,
struct usb_ss_ep_comp_descriptor *ep_comp)
{ … }
static int goku_udc_start(struct usb_gadget *g,
struct usb_gadget_driver *driver);
static int goku_udc_stop(struct usb_gadget *g);
static const struct usb_gadget_ops goku_ops = …;
static inline const char *dmastr(void)
{ … }
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
static const char proc_node_name [] = …;
#define FOURBITS …
#define EIGHTBITS …
static void dump_intmask(struct seq_file *m, const char *label, u32 mask)
{ … }
static const char *udc_ep_state(enum ep0state state)
{ … }
static const char *udc_ep_status(u32 status)
{ … }
static int udc_proc_read(struct seq_file *m, void *v)
{ … }
#endif
static void udc_reinit (struct goku_udc *dev)
{ … }
static void udc_reset(struct goku_udc *dev)
{ … }
static void ep0_start(struct goku_udc *dev)
{ … }
static void udc_enable(struct goku_udc *dev)
{ … }
static int goku_udc_start(struct usb_gadget *g,
struct usb_gadget_driver *driver)
{ … }
static void stop_activity(struct goku_udc *dev)
{ … }
static int goku_udc_stop(struct usb_gadget *g)
{ … }
static void ep0_setup(struct goku_udc *dev)
{ … }
#define ACK …
static irqreturn_t goku_irq(int irq, void *_dev)
{ … }
#undef ACK
static void gadget_release(struct device *_dev)
{ … }
static void goku_remove(struct pci_dev *pdev)
{ … }
static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{ … }
static const struct pci_device_id pci_ids[] = …;
MODULE_DEVICE_TABLE (pci, pci_ids);
static struct pci_driver goku_pci_driver = …;
module_pci_driver(…) …;