~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/staging/usbip/vhci.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * USA.
18
18
 */
19
19
 
20
 
#include <linux/platform_device.h>
 
20
#include <linux/device.h>
 
21
#include <linux/list.h>
 
22
#include <linux/spinlock.h>
 
23
#include <linux/sysfs.h>
 
24
#include <linux/types.h>
 
25
#include <linux/usb.h>
21
26
#include <linux/usb/hcd.h>
22
 
 
 
27
#include <linux/wait.h>
23
28
 
24
29
struct vhci_device {
25
30
        struct usb_device *udev;
33
38
        /* speed of a remote device */
34
39
        enum usb_device_speed speed;
35
40
 
36
 
        /*  vhci root-hub port to which this device is attached  */
 
41
        /* vhci root-hub port to which this device is attached */
37
42
        __u32 rhport;
38
43
 
39
44
        struct usbip_device ud;
40
45
 
41
 
 
42
46
        /* lock for the below link lists */
43
47
        spinlock_t priv_lock;
44
48
 
54
58
        wait_queue_head_t waitq_tx;
55
59
};
56
60
 
57
 
 
58
61
/* urb->hcpriv, use container_of() */
59
62
struct vhci_priv {
60
63
        unsigned long seqnum;
64
67
        struct urb *urb;
65
68
};
66
69
 
67
 
 
68
70
struct vhci_unlink {
69
71
        /* seqnum of this request */
70
72
        unsigned long seqnum;
85
87
 
86
88
/* for usb_bus.hcpriv */
87
89
struct vhci_hcd {
88
 
        spinlock_t      lock;
89
 
 
90
 
        u32     port_status[VHCI_NPORTS];
91
 
 
92
 
        unsigned        resuming:1;
93
 
        unsigned long   re_timeout;
 
90
        spinlock_t lock;
 
91
 
 
92
        u32 port_status[VHCI_NPORTS];
 
93
 
 
94
        unsigned resuming:1;
 
95
        unsigned long re_timeout;
94
96
 
95
97
        atomic_t seqnum;
96
98
 
102
104
        struct vhci_device vdev[VHCI_NPORTS];
103
105
};
104
106
 
105
 
 
106
107
extern struct vhci_hcd *the_controller;
107
108
extern struct attribute_group dev_attr_group;
108
 
 
109
 
 
110
 
/*-------------------------------------------------------------------------*/
111
 
/* prototype declaration */
 
109
#define hardware (&the_controller->pdev.dev)
112
110
 
113
111
/* vhci_hcd.c */
114
112
void rh_port_connect(int rhport, enum usb_device_speed speed);
115
113
void rh_port_disconnect(int rhport);
116
 
void vhci_rx_loop(struct usbip_task *ut);
117
 
void vhci_tx_loop(struct usbip_task *ut);
118
 
 
119
 
struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev,
120
 
                                            __u32 seqnum);
121
 
 
122
 
#define hardware                (&the_controller->pdev.dev)
 
114
 
 
115
/* vhci_rx.c */
 
116
struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, __u32 seqnum);
 
117
int vhci_rx_loop(void *data);
 
118
 
 
119
/* vhci_tx.c */
 
120
int vhci_tx_loop(void *data);
123
121
 
124
122
static inline struct vhci_device *port_to_vdev(__u32 port)
125
123
{