diff options
Diffstat (limited to 'drivers/usb/renesas_usbhs/pipe.h')
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/usb/renesas_usbhs/pipe.h b/drivers/usb/renesas_usbhs/pipe.h index 41534cb0e734..6334fc644cc0 100644 --- a/drivers/usb/renesas_usbhs/pipe.h +++ b/drivers/usb/renesas_usbhs/pipe.h | |||
@@ -30,11 +30,15 @@ struct usbhs_pipe { | |||
30 | struct usbhs_fifo *fifo; | 30 | struct usbhs_fifo *fifo; |
31 | struct list_head list; | 31 | struct list_head list; |
32 | 32 | ||
33 | int maxp; | ||
34 | |||
33 | u32 flags; | 35 | u32 flags; |
34 | #define USBHS_PIPE_FLAGS_IS_USED (1 << 0) | 36 | #define USBHS_PIPE_FLAGS_IS_USED (1 << 0) |
35 | #define USBHS_PIPE_FLAGS_IS_DIR_IN (1 << 1) | 37 | #define USBHS_PIPE_FLAGS_IS_DIR_IN (1 << 1) |
36 | #define USBHS_PIPE_FLAGS_IS_DIR_HOST (1 << 2) | 38 | #define USBHS_PIPE_FLAGS_IS_DIR_HOST (1 << 2) |
37 | 39 | ||
40 | struct usbhs_pkt_handle *handler; | ||
41 | |||
38 | void *mod_private; | 42 | void *mod_private; |
39 | }; | 43 | }; |
40 | 44 | ||
@@ -43,7 +47,6 @@ struct usbhs_pipe_info { | |||
43 | int size; /* array size of "pipe" */ | 47 | int size; /* array size of "pipe" */ |
44 | int bufnmb_last; /* FIXME : driver needs good allocator */ | 48 | int bufnmb_last; /* FIXME : driver needs good allocator */ |
45 | 49 | ||
46 | void (*done)(struct usbhs_pkt *pkt); | ||
47 | int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map); | 50 | int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map); |
48 | }; | 51 | }; |
49 | 52 | ||
@@ -67,32 +70,30 @@ struct usbhs_pipe_info { | |||
67 | #define usbhs_priv_to_pipeinfo(pr) (&(pr)->pipe_info) | 70 | #define usbhs_priv_to_pipeinfo(pr) (&(pr)->pipe_info) |
68 | 71 | ||
69 | /* | 72 | /* |
70 | * usb request | ||
71 | */ | ||
72 | void usbhs_usbreq_get_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req); | ||
73 | void usbhs_usbreq_set_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req); | ||
74 | |||
75 | /* | ||
76 | * pipe control | 73 | * pipe control |
77 | */ | 74 | */ |
75 | char *usbhs_pipe_name(struct usbhs_pipe *pipe); | ||
78 | struct usbhs_pipe | 76 | struct usbhs_pipe |
79 | *usbhs_pipe_malloc(struct usbhs_priv *priv, | 77 | *usbhs_pipe_malloc(struct usbhs_priv *priv, int endpoint_type, int dir_in); |
80 | const struct usb_endpoint_descriptor *desc); | ||
81 | int usbhs_pipe_probe(struct usbhs_priv *priv); | 78 | int usbhs_pipe_probe(struct usbhs_priv *priv); |
82 | void usbhs_pipe_remove(struct usbhs_priv *priv); | 79 | void usbhs_pipe_remove(struct usbhs_priv *priv); |
83 | int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe); | 80 | int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe); |
84 | int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe); | 81 | int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe); |
85 | void usbhs_pipe_init(struct usbhs_priv *priv, | 82 | void usbhs_pipe_init(struct usbhs_priv *priv, |
86 | void (*done)(struct usbhs_pkt *pkt), | ||
87 | int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map)); | 83 | int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map)); |
88 | int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe); | 84 | int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe); |
89 | void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe); | ||
90 | void usbhs_pipe_clear(struct usbhs_pipe *pipe); | 85 | void usbhs_pipe_clear(struct usbhs_pipe *pipe); |
91 | int usbhs_pipe_is_accessible(struct usbhs_pipe *pipe); | 86 | int usbhs_pipe_is_accessible(struct usbhs_pipe *pipe); |
92 | void usbhs_pipe_enable(struct usbhs_pipe *pipe); | 87 | void usbhs_pipe_enable(struct usbhs_pipe *pipe); |
93 | void usbhs_pipe_disable(struct usbhs_pipe *pipe); | 88 | void usbhs_pipe_disable(struct usbhs_pipe *pipe); |
94 | void usbhs_pipe_stall(struct usbhs_pipe *pipe); | 89 | void usbhs_pipe_stall(struct usbhs_pipe *pipe); |
95 | void usbhs_pipe_select_fifo(struct usbhs_pipe *pipe, struct usbhs_fifo *fifo); | 90 | void usbhs_pipe_select_fifo(struct usbhs_pipe *pipe, struct usbhs_fifo *fifo); |
91 | void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 devsel, | ||
92 | u16 epnum, u16 maxp); | ||
93 | |||
94 | #define usbhs_pipe_sequence_data0(pipe) usbhs_pipe_data_sequence(pipe, 0) | ||
95 | #define usbhs_pipe_sequence_data1(pipe) usbhs_pipe_data_sequence(pipe, 1) | ||
96 | void usbhs_pipe_data_sequence(struct usbhs_pipe *pipe, int data); | ||
96 | 97 | ||
97 | #define usbhs_pipe_to_priv(p) ((p)->priv) | 98 | #define usbhs_pipe_to_priv(p) ((p)->priv) |
98 | #define usbhs_pipe_number(p) (int)((p) - (p)->priv->pipe_info.pipe) | 99 | #define usbhs_pipe_number(p) (int)((p) - (p)->priv->pipe_info.pipe) |
@@ -100,10 +101,14 @@ void usbhs_pipe_select_fifo(struct usbhs_pipe *pipe, struct usbhs_fifo *fifo); | |||
100 | #define usbhs_pipe_to_fifo(p) ((p)->fifo) | 101 | #define usbhs_pipe_to_fifo(p) ((p)->fifo) |
101 | #define usbhs_pipe_is_busy(p) usbhs_pipe_to_fifo(p) | 102 | #define usbhs_pipe_is_busy(p) usbhs_pipe_to_fifo(p) |
102 | 103 | ||
104 | #define usbhs_pipe_type(p) ((p)->pipe_type) | ||
105 | #define usbhs_pipe_type_is(p, t) ((p)->pipe_type == t) | ||
106 | |||
103 | /* | 107 | /* |
104 | * dcp control | 108 | * dcp control |
105 | */ | 109 | */ |
106 | struct usbhs_pipe *usbhs_dcp_malloc(struct usbhs_priv *priv); | 110 | struct usbhs_pipe *usbhs_dcp_malloc(struct usbhs_priv *priv); |
107 | void usbhs_dcp_control_transfer_done(struct usbhs_pipe *pipe); | 111 | void usbhs_dcp_control_transfer_done(struct usbhs_pipe *pipe); |
112 | void usbhs_dcp_dir_for_host(struct usbhs_pipe *pipe, int dir_out); | ||
108 | 113 | ||
109 | #endif /* RENESAS_USB_PIPE_H */ | 114 | #endif /* RENESAS_USB_PIPE_H */ |