Changeset df6ded8 in mainline for uspace/drv/bus/usb/ohci/ohci_bus.h
- Timestamp:
- 2018-02-28T16:37:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b20da0
- Parents:
- f5e5f73 (diff), b2dca8de (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Jakub Jermar <jakub@…> (2018-02-28 16:06:42)
- git-committer:
- Jakub Jermar <jakub@…> (2018-02-28 16:37:50)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci_bus.h
rf5e5f73 rdf6ded8 1 1 /* 2 2 * Copyright (c) 2011 Jan Vesely 3 * Copyright (c) 2018 Ondrej Hlavaty 3 4 * All rights reserved. 4 5 * … … 32 33 * @brief OHCI driver 33 34 */ 34 #ifndef DRV_OHCI_HCD_ ENDPOINT_H35 #define DRV_OHCI_HCD_ ENDPOINT_H35 #ifndef DRV_OHCI_HCD_BUS_H 36 #define DRV_OHCI_HCD_BUS_H 36 37 37 38 #include <assert.h> 38 39 #include <adt/list.h> 39 #include <usb/ host/endpoint.h>40 #include <usb/host/ hcd.h>40 #include <usb/dma_buffer.h> 41 #include <usb/host/usb2_bus.h> 41 42 42 43 #include "hw_struct/endpoint_descriptor.h" 43 44 #include "hw_struct/transfer_descriptor.h" 44 45 45 /** Connector structure linking ED to to prepared TD. */ 46 /** 47 * Connector structure linking ED to to prepared TD. 48 * 49 * OHCI requires new transfers to be appended at the end of a queue. But it has 50 * a weird semantics of a leftover TD, which serves as a placeholder. This left 51 * TD is overwritten with first TD of a new transfer, and the spare one is used 52 * as the next placeholder. Then the two are swapped for the next transaction. 53 */ 46 54 typedef struct ohci_endpoint { 55 endpoint_t base; 56 47 57 /** OHCI endpoint descriptor */ 48 58 ed_t *ed; 49 /** Currently enqueued transfer descriptor */ 50 td_t *td; 51 /** Linked list used by driver software */ 52 link_t link; 59 /** TDs to be used at the beginning and end of transaction */ 60 td_t *tds [2]; 61 62 /** Buffer to back ED + 2 TD */ 63 dma_buffer_t dma_buffer; 64 65 /** Link in endpoint_list*/ 66 link_t eplist_link; 67 /** Link in pending_endpoints */ 68 link_t pending_link; 53 69 } ohci_endpoint_t; 54 70 55 errno_t ohci_endpoint_init(hcd_t *hcd, endpoint_t *ep); 56 void ohci_endpoint_fini(hcd_t *hcd, endpoint_t *ep); 71 typedef struct hc hc_t; 72 73 typedef struct { 74 bus_t base; 75 usb2_bus_helper_t helper; 76 hc_t *hc; 77 } ohci_bus_t; 78 79 errno_t ohci_bus_init(ohci_bus_t *, hc_t *); 80 void ohci_ep_toggle_reset(endpoint_t *); 57 81 58 82 /** Get and convert assigned ohci_endpoint_t structure … … 63 87 { 64 88 assert(ep); 65 return ep->hc_data.data;89 return (ohci_endpoint_t *) ep; 66 90 } 67 91
Note:
See TracChangeset
for help on using the changeset viewer.