Changeset c6f82e5 in mainline for uspace/drv
- Timestamp:
- 2018-01-19T20:56:14Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7ec7b7e
- Parents:
- 69b2dfee
- Location:
- uspace/drv/bus/usb
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_bus.c
r69b2dfee rc6f82e5 43 43 #include "hc.h" 44 44 45 /** Callback to set toggle on ED. 45 /** 46 * Callback to set toggle on ED. 46 47 * 47 48 * @param[in] hcd_ep hcd endpoint structure 48 49 * @param[in] toggle new value of toggle bit 49 50 */ 50 staticvoid ehci_ep_toggle_reset(endpoint_t *ep)51 void ehci_ep_toggle_reset(endpoint_t *ep) 51 52 { 52 53 ehci_endpoint_t *instance = ehci_endpoint_get(ep); … … 54 55 usb_log_warning("EP(%p): Resetting toggle bit for transfer directed EP", instance); 55 56 qh_toggle_set(instance->qh, 0); 56 ep->toggle = 0;57 57 } 58 58 … … 169 169 .interrupt = ehci_hc_interrupt, 170 170 .status = ehci_hc_status, 171 171 172 .endpoint_destroy = ehci_endpoint_destroy, 172 173 .endpoint_create = ehci_endpoint_create, 173 174 .endpoint_register = ehci_register_ep, 174 175 .endpoint_unregister = ehci_unregister_ep, 175 .endpoint_toggle_reset = ehci_ep_toggle_reset,176 176 .endpoint_count_bw = bandwidth_count_usb20, 177 177 178 .batch_create = ehci_create_batch, 178 179 .batch_destroy = ehci_destroy_batch, -
uspace/drv/bus/usb/ehci/ehci_bus.h
r69b2dfee rc6f82e5 68 68 } ehci_bus_t; 69 69 70 void ehci_ep_toggle_reset(endpoint_t *); 70 71 void ehci_bus_prepare_ops(void); 71 72 -
uspace/drv/bus/usb/ehci/hc.c
r69b2dfee rc6f82e5 45 45 #include <usb/debug.h> 46 46 #include <usb/usb.h> 47 #include <usb/host/utility.h> 47 48 48 49 #include "ehci_batch.h" … … 379 380 list_remove(current); 380 381 endpoint_del_ref(&ep->base); 382 hc_reset_toggles(&batch->base, &ehci_ep_toggle_reset); 381 383 usb_transfer_batch_finish(&batch->base); 382 384 } -
uspace/drv/bus/usb/ohci/hc.c
r69b2dfee rc6f82e5 45 45 46 46 #include <usb/debug.h> 47 #include <usb/host/utility.h> 47 48 #include <usb/usb.h> 48 49 … … 377 378 list_remove(current); 378 379 endpoint_del_ref(&ep->base); 380 hc_reset_toggles(&batch->base, &ohci_ep_toggle_reset); 379 381 usb_transfer_batch_finish(&batch->base); 380 382 } -
uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c
r69b2dfee rc6f82e5 100 100 OHCI_MEM32_WR(instance->td_head, pa & ED_TDHEAD_PTR_MASK); 101 101 OHCI_MEM32_WR(instance->td_tail, pa & ED_TDTAIL_PTR_MASK); 102 103 /* Set toggle bit */104 if (ep->toggle)105 OHCI_MEM32_SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);106 107 102 } 108 103 /** -
uspace/drv/bus/usb/ohci/ohci_bus.c
r69b2dfee rc6f82e5 43 43 #include "hc.h" 44 44 45 /** Callback to reset toggle on ED. 45 /** 46 * Callback to reset toggle on ED. 46 47 * 47 48 * @param[in] hcd_ep hcd endpoint structure 48 49 * @param[in] toggle new value of toggle bit 49 50 */ 50 staticvoid ohci_ep_toggle_reset(endpoint_t *ep)51 void ohci_ep_toggle_reset(endpoint_t *ep) 51 52 { 52 53 ohci_endpoint_t *instance = ohci_endpoint_get(ep); 53 54 assert(instance); 54 55 assert(instance->ed); 55 ep->toggle = 0;56 56 ed_toggle_set(instance->ed, 0); 57 57 } … … 179 179 .endpoint_unregister = ohci_unregister_ep, 180 180 .endpoint_count_bw = bandwidth_count_usb11, 181 .endpoint_toggle_reset = ohci_ep_toggle_reset, 181 182 182 .batch_create = ohci_create_batch, 183 183 .batch_destroy = ohci_destroy_batch, -
uspace/drv/bus/usb/ohci/ohci_bus.h
r69b2dfee rc6f82e5 65 65 66 66 int ohci_bus_init(ohci_bus_t *, hc_t *); 67 void ohci_ep_toggle_reset(endpoint_t *); 67 68 68 69 /** Get and convert assigned ohci_endpoint_t structure -
uspace/drv/bus/usb/uhci/hc.h
r69b2dfee rc6f82e5 127 127 } hc_t; 128 128 129 typedef struct uhci_endpoint { 130 endpoint_t base; 131 132 bool toggle; 133 } uhci_endpoint_t; 134 129 135 static inline hc_t *hcd_to_hc(hc_device_t *hcd) 130 136 { -
uspace/drv/bus/usb/uhci/transfer_list.c
r69b2dfee rc6f82e5 41 41 #include <usb/host/usb_transfer_batch.h> 42 42 #include <usb/host/utils/malloc32.h> 43 #include <usb/host/utility.h> 43 44 44 45 #include "hw_struct/link_pointer.h" 45 46 #include "transfer_list.h" 47 #include "hc.h" 46 48 47 49 /** Initialize transfer list structures. … … 155 157 } 156 158 159 /** 160 * Reset toggle on endpoint callback. 161 */ 162 static void uhci_reset_toggle(endpoint_t *ep) 163 { 164 uhci_endpoint_t *uhci_ep = (uhci_endpoint_t *) ep; 165 uhci_ep->toggle = 0; 166 } 167 157 168 /** Add completed batches to the provided list. 158 169 * … … 176 187 fibril_mutex_lock(&batch->base.ep->guard); 177 188 assert(batch->base.ep->active_batch == &batch->base); 189 hc_reset_toggles(&batch->base, &uhci_reset_toggle); 178 190 endpoint_deactivate_locked(batch->base.ep); 179 191 transfer_list_remove_batch(instance, batch); -
uspace/drv/bus/usb/uhci/uhci_batch.c
r69b2dfee rc6f82e5 46 46 47 47 #include "uhci_batch.h" 48 #include "hc.h" 48 49 #include "hw_struct/transfer_descriptor.h" 49 50 … … 164 165 batch->transfered_size = 0; 165 166 167 uhci_endpoint_t *uhci_ep = (uhci_endpoint_t *) batch->ep; 168 166 169 for (size_t i = 0;i < uhci_batch->td_count; ++i) { 167 170 if (td_is_active(&uhci_batch->tds[i])) { … … 178 181 td_print_status(&uhci_batch->tds[i]); 179 182 180 batch->ep->toggle = td_toggle(&uhci_batch->tds[i]);183 uhci_ep->toggle = td_toggle(&uhci_batch->tds[i]); 181 184 goto substract_ret; 182 185 } … … 230 233 const size_t mps = uhci_batch->base.ep->max_packet_size; 231 234 232 int toggle = uhci_batch->base.ep->toggle; 235 uhci_endpoint_t *uhci_ep = (uhci_endpoint_t *) uhci_batch->base.ep; 236 237 int toggle = uhci_ep->toggle; 233 238 assert(toggle == 0 || toggle == 1); 234 239 … … 254 259 } 255 260 td_set_ioc(&uhci_batch->tds[td - 1]); 256 uhci_ batch->base.ep->toggle = toggle;261 uhci_ep->toggle = toggle; 257 262 usb_log_debug2( 258 263 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.", \
Note:
See TracChangeset
for help on using the changeset viewer.