usb.h (326ea986ac150acdc7656d57fca647db80b50158) usb.h (5853e1335cfc76c230cc28c4226b4d513ddb7542)
1/*
2 * (C) Copyright 2001
3 * Denis Peter, MPL AG Switzerland
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 * Note: Part of this code has been derived from linux
7 *
8 */

--- 111 unchanged lines hidden (view full) ---

120 unsigned long status;
121 int act_len; /* transfered bytes */
122 int maxchild; /* Number of ports if hub */
123 int portnr;
124 struct usb_device *parent;
125 struct usb_device *children[USB_MAXCHILDREN];
126
127 void *controller; /* hardware controller private data */
1/*
2 * (C) Copyright 2001
3 * Denis Peter, MPL AG Switzerland
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 * Note: Part of this code has been derived from linux
7 *
8 */

--- 111 unchanged lines hidden (view full) ---

120 unsigned long status;
121 int act_len; /* transfered bytes */
122 int maxchild; /* Number of ports if hub */
123 int portnr;
124 struct usb_device *parent;
125 struct usb_device *children[USB_MAXCHILDREN];
126
127 void *controller; /* hardware controller private data */
128 /* slot_id - for xHCI enabled devices */
129 unsigned int slot_id;
128};
129
130/**********************************************************************
131 * this is how the lowlevel part communicate with the outer world
132 */
133
134#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
135 defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
136 defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
137 defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
138 defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \
139 defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X) || \
140 defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
130};
131
132/**********************************************************************
133 * this is how the lowlevel part communicate with the outer world
134 */
135
136#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
137 defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
138 defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
139 defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
140 defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \
141 defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X) || \
142 defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
141 defined(CONFIG_USB_MUSB_OMAP2PLUS)
143 defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_XHCI)
142
143int usb_lowlevel_init(int index, void **controller);
144int usb_lowlevel_stop(int index);
145
146int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
147 void *buffer, int transfer_len);
148int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
149 int transfer_len, struct devrequest *setup);

--- 183 unchanged lines hidden (view full) ---

333#define usb_pipeendpoint(pipe) (((pipe) >> 15) & 0xf)
334#define usb_pipedata(pipe) (((pipe) >> 19) & 1)
335#define usb_pipetype(pipe) (((pipe) >> 30) & 3)
336#define usb_pipeisoc(pipe) (usb_pipetype((pipe)) == PIPE_ISOCHRONOUS)
337#define usb_pipeint(pipe) (usb_pipetype((pipe)) == PIPE_INTERRUPT)
338#define usb_pipecontrol(pipe) (usb_pipetype((pipe)) == PIPE_CONTROL)
339#define usb_pipebulk(pipe) (usb_pipetype((pipe)) == PIPE_BULK)
340
144
145int usb_lowlevel_init(int index, void **controller);
146int usb_lowlevel_stop(int index);
147
148int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
149 void *buffer, int transfer_len);
150int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
151 int transfer_len, struct devrequest *setup);

--- 183 unchanged lines hidden (view full) ---

335#define usb_pipeendpoint(pipe) (((pipe) >> 15) & 0xf)
336#define usb_pipedata(pipe) (((pipe) >> 19) & 1)
337#define usb_pipetype(pipe) (((pipe) >> 30) & 3)
338#define usb_pipeisoc(pipe) (usb_pipetype((pipe)) == PIPE_ISOCHRONOUS)
339#define usb_pipeint(pipe) (usb_pipetype((pipe)) == PIPE_INTERRUPT)
340#define usb_pipecontrol(pipe) (usb_pipetype((pipe)) == PIPE_CONTROL)
341#define usb_pipebulk(pipe) (usb_pipetype((pipe)) == PIPE_BULK)
342
343#define usb_pipe_ep_index(pipe) \
344 usb_pipecontrol(pipe) ? (usb_pipeendpoint(pipe) * 2) : \
345 ((usb_pipeendpoint(pipe) * 2) - \
346 (usb_pipein(pipe) ? 0 : 1))
341
342/*************************************************************************
343 * Hub Stuff
344 */
345struct usb_port_status {
346 unsigned short wPortStatus;
347 unsigned short wPortChange;
348} __attribute__ ((packed));

--- 28 unchanged lines hidden (view full) ---

377void usb_hub_reset(void);
378int hub_port_reset(struct usb_device *dev, int port,
379 unsigned short *portstat);
380
381struct usb_device *usb_alloc_new_device(void *controller);
382
383int usb_new_device(struct usb_device *dev);
384void usb_free_device(void);
347
348/*************************************************************************
349 * Hub Stuff
350 */
351struct usb_port_status {
352 unsigned short wPortStatus;
353 unsigned short wPortChange;
354} __attribute__ ((packed));

--- 28 unchanged lines hidden (view full) ---

383void usb_hub_reset(void);
384int hub_port_reset(struct usb_device *dev, int port,
385 unsigned short *portstat);
386
387struct usb_device *usb_alloc_new_device(void *controller);
388
389int usb_new_device(struct usb_device *dev);
390void usb_free_device(void);
391int usb_alloc_device(struct usb_device *dev);
385
386#endif /*_USB_H_ */
392
393#endif /*_USB_H_ */