Changeset e20eaed in mainline for uspace/drv/bus/usb/ohci/ohci_endpoint.c
- Timestamp:
- 2011-08-25T13:53:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 620c710
- Parents:
- 23b0fe8
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci_endpoint.c
r23b0fe8 re20eaed 33 33 */ 34 34 #include "utils/malloc32.h" 35 #include " hcd_endpoint.h"35 #include "ohci_endpoint.h" 36 36 37 37 /** Callback to set toggle on ED. … … 40 40 * @param[in] toggle new value of toggle bit 41 41 */ 42 static void hcd_ep_toggle_set(void *hcd_ep, int toggle)42 static void ohci_ep_toggle_set(void *ohci_ep, int toggle) 43 43 { 44 hcd_endpoint_t *instance = hcd_ep;44 ohci_endpoint_t *instance = ohci_ep; 45 45 assert(instance); 46 46 assert(instance->ed); … … 53 53 * @return Current value of toggle bit. 54 54 */ 55 static int hcd_ep_toggle_get(void *hcd_ep)55 static int ohci_ep_toggle_get(void *ohci_ep) 56 56 { 57 hcd_endpoint_t *instance = hcd_ep;57 ohci_endpoint_t *instance = ohci_ep; 58 58 assert(instance); 59 59 assert(instance->ed); … … 65 65 * @param[in] hcd_ep endpoint structure 66 66 */ 67 static void hcd_ep_destroy(void *hcd_ep)67 static void ohci_ep_destroy(void *ohci_ep) 68 68 { 69 if ( hcd_ep) {70 hcd_endpoint_t *instance = hcd_ep;69 if (ohci_ep) { 70 ohci_endpoint_t *instance = ohci_ep; 71 71 free32(instance->ed); 72 72 free32(instance->td); … … 80 80 * @return pointer to a new hcd endpoint structure, NULL on failure. 81 81 */ 82 int hcd_endpoint_assign(endpoint_t *ep)82 int ohci_endpoint_assign(hcd_t *hcd, endpoint_t *ep) 83 83 { 84 84 assert(ep); 85 hcd_endpoint_t *hcd_ep = malloc(sizeof(hcd_endpoint_t));86 if ( hcd_ep == NULL)85 ohci_endpoint_t *ohci_ep = malloc(sizeof(ohci_endpoint_t)); 86 if (ohci_ep == NULL) 87 87 return ENOMEM; 88 88 89 hcd_ep->ed = malloc32(sizeof(ed_t));90 if ( hcd_ep->ed == NULL) {91 free( hcd_ep);89 ohci_ep->ed = malloc32(sizeof(ed_t)); 90 if (ohci_ep->ed == NULL) { 91 free(ohci_ep); 92 92 return ENOMEM; 93 93 } 94 94 95 hcd_ep->td = malloc32(sizeof(td_t));96 if ( hcd_ep->td == NULL) {97 free32( hcd_ep->ed);98 free( hcd_ep);95 ohci_ep->td = malloc32(sizeof(td_t)); 96 if (ohci_ep->td == NULL) { 97 free32(ohci_ep->ed); 98 free(ohci_ep); 99 99 return ENOMEM; 100 100 } 101 101 102 ed_init( hcd_ep->ed, ep);103 ed_set_td( hcd_ep->ed, hcd_ep->td);102 ed_init(ohci_ep->ed, ep); 103 ed_set_td(ohci_ep->ed, ohci_ep->td); 104 104 endpoint_set_hc_data( 105 ep, hcd_ep, hcd_ep_destroy, hcd_ep_toggle_get, hcd_ep_toggle_set);105 ep, ohci_ep, ohci_ep_destroy, ohci_ep_toggle_get, ohci_ep_toggle_set); 106 106 107 107 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.