Changeset 3bd96bb in mainline
- Timestamp:
- 2011-03-13T23:23:42Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 17ceb72
- Parents:
- f123909
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/batch.c
rf123909 r3bd96bb 45 45 #define DEFAULT_ERROR_COUNT 3 46 46 47 static int batch_schedule(batch_t *instance);48 49 47 static void batch_control(batch_t *instance, 50 48 usb_packet_id data_stage, usb_packet_id status_stage); … … 54 52 static void batch_call_in_and_dispose(batch_t *instance); 55 53 static void batch_call_out_and_dispose(batch_t *instance); 56 static void batch_dispose(batch_t *instance);57 54 58 55 … … 203 200 instance->next_step = batch_call_out_and_dispose; 204 201 usb_log_debug("Batch(%p) CONTROL WRITE initialized.\n", instance); 205 batch_schedule(instance);206 202 } 207 203 /*----------------------------------------------------------------------------*/ … … 216 212 instance->next_step = batch_call_in_and_dispose; 217 213 usb_log_debug("Batch(%p) CONTROL READ initialized.\n", instance); 218 batch_schedule(instance);219 214 } 220 215 /*----------------------------------------------------------------------------*/ … … 229 224 instance->next_step = batch_call_in_and_dispose; 230 225 usb_log_debug("Batch(%p) INTERRUPT IN initialized.\n", instance); 231 batch_schedule(instance);232 226 } 233 227 /*----------------------------------------------------------------------------*/ … … 244 238 instance->next_step = batch_call_out_and_dispose; 245 239 usb_log_debug("Batch(%p) INTERRUPT OUT initialized.\n", instance); 246 batch_schedule(instance);247 240 } 248 241 /*----------------------------------------------------------------------------*/ … … 257 250 instance->next_step = batch_call_in_and_dispose; 258 251 usb_log_debug("Batch(%p) BULK IN initialized.\n", instance); 259 batch_schedule(instance);260 252 } 261 253 /*----------------------------------------------------------------------------*/ … … 271 263 instance->next_step = batch_call_out_and_dispose; 272 264 usb_log_debug("Batch(%p) BULK OUT initialized.\n", instance); 273 batch_schedule(instance);274 265 } 275 266 /*----------------------------------------------------------------------------*/ … … 446 437 free(instance); 447 438 } 448 /*----------------------------------------------------------------------------*/449 int batch_schedule(batch_t *instance)450 {451 assert(instance);452 uhci_hc_t *hc = fun_to_uhci_hc(instance->fun);453 assert(hc);454 return uhci_hc_schedule(hc, instance);455 }456 439 /** 457 440 * @} -
uspace/drv/uhci-hcd/batch.h
rf123909 r3bd96bb 78 78 ); 79 79 80 void batch_dispose(batch_t *instance); 81 80 82 bool batch_is_complete(batch_t *instance); 81 83 -
uspace/drv/uhci-hcd/iface.c
rf123909 r3bd96bb 161 161 return ENOMEM; 162 162 batch_interrupt_out(batch); 163 const int ret = uhci_hc_schedule(hc, batch); 164 if (ret != EOK) { 165 batch_dispose(batch); 166 return ret; 167 } 163 168 return EOK; 164 169 } … … 192 197 return ENOMEM; 193 198 batch_interrupt_in(batch); 199 const int ret = uhci_hc_schedule(hc, batch); 200 if (ret != EOK) { 201 batch_dispose(batch); 202 return ret; 203 } 194 204 return EOK; 195 205 } … … 224 234 return ENOMEM; 225 235 batch_bulk_out(batch); 236 const int ret = uhci_hc_schedule(hc, batch); 237 if (ret != EOK) { 238 batch_dispose(batch); 239 return ret; 240 } 226 241 return EOK; 227 242 } … … 255 270 return ENOMEM; 256 271 batch_bulk_in(batch); 272 const int ret = uhci_hc_schedule(hc, batch); 273 if (ret != EOK) { 274 batch_dispose(batch); 275 return ret; 276 } 257 277 return EOK; 258 278 } … … 293 313 device_keeper_reset_if_need(&hc->device_manager, target, setup_data); 294 314 batch_control_write(batch); 315 const int ret = uhci_hc_schedule(hc, batch); 316 if (ret != EOK) { 317 batch_dispose(batch); 318 return ret; 319 } 295 320 return EOK; 296 321 } … … 327 352 return ENOMEM; 328 353 batch_control_read(batch); 354 const int ret = uhci_hc_schedule(hc, batch); 355 if (ret != EOK) { 356 batch_dispose(batch); 357 return ret; 358 } 329 359 return EOK; 330 360 }
Note:
See TracChangeset
for help on using the changeset viewer.