Changeset 545764b in mainline
- Timestamp:
- 2011-04-14T21:08:07Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c9dc471
- Parents:
- 2471aaf
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/hcd_endpoint.c
r2471aaf r545764b 35 35 #include "hcd_endpoint.h" 36 36 37 static void hcd_ep_toggle_set(void *hcd_ep, int toggle) 38 { 39 hcd_endpoint_t *instance = hcd_ep; 40 assert(instance); 41 assert(instance->ed); 42 ed_toggle_set(instance->ed, toggle); 43 } 44 static int hcd_ep_toggle_get(void *hcd_ep) 45 { 46 hcd_endpoint_t *instance = hcd_ep; 47 assert(instance); 48 assert(instance->ed); 49 return ed_toggle_get(instance->ed); 50 } 51 52 37 53 hcd_endpoint_t * hcd_endpoint_assign(endpoint_t *ep) 38 54 { … … 57 73 ed_init(hcd_ep->ed, ep); 58 74 ed_set_td(hcd_ep->ed, hcd_ep->td); 59 endpoint_set_hc_data(ep, hcd_ep, NULL, NULL);75 endpoint_set_hc_data(ep, hcd_ep, hcd_ep_toggle_get, hcd_ep_toggle_set); 60 76 61 77 return hcd_ep; -
uspace/drv/ohci/hw_struct/endpoint_descriptor.h
r2471aaf r545764b 73 73 #define ED_TDHEAD_ZERO_SHIFT (2) 74 74 #define ED_TDHEAD_TOGGLE_CARRY (0x2) 75 #define ED_TDHEAD_HALTED_FLAG (0x1) 75 76 76 77 volatile uint32_t next; … … 106 107 instance->next = pa; 107 108 } 109 110 static inline int ed_toggle_get(ed_t *instance) 111 { 112 assert(instance); 113 return (instance->td_head & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0; 114 } 115 116 static inline void ed_toggle_set(ed_t *instance, int toggle) 117 { 118 assert(instance); 119 assert(toggle == 0 || toggle == 1); 120 if (toggle == 1) { 121 instance->td_head |= ED_TDHEAD_TOGGLE_CARRY; 122 } else { 123 /* clear halted flag when reseting toggle */ 124 instance->td_head &= ~ED_TDHEAD_TOGGLE_CARRY; 125 instance->td_head &= ~ED_TDHEAD_HALTED_FLAG; 126 } 127 } 108 128 #endif 109 129 /** -
uspace/lib/usb/src/host/endpoint.c
r2471aaf r545764b 123 123 if (instance->address == target.address && 124 124 (instance->endpoint == target.endpoint || target.endpoint == 0)) 125 instance->toggle = 0;125 endpoint_toggle_set(instance, 0); 126 126 } 127 127 /**
Note:
See TracChangeset
for help on using the changeset viewer.