Changeset 5f57929 in mainline
- Timestamp:
- 2011-09-01T00:08:44Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0f1586d0
- Parents:
- 7bce1fc
- Location:
- uspace/drv/bus/usb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci_batch.c
r7bce1fc r5f57929 147 147 /** Check batch TDs' status. 148 148 * 149 * @param[in] instanceBatch structure to use.149 * @param[in] ohci_batch Batch structure to use. 150 150 * @return False, if there is an active TD, true otherwise. 151 151 * … … 213 213 /** Starts execution of the TD list 214 214 * 215 * @param[in] instanceBatch structure to use215 * @param[in] ohci_batch Batch structure to use 216 216 */ 217 217 void ohci_transfer_batch_commit(ohci_transfer_batch_t *ohci_batch) … … 223 223 /** Prepare generic control transfer 224 224 * 225 * @param[in] instanceBatch structure to use.225 * @param[in] ohci_batch Batch structure to use. 226 226 * @param[in] data_dir Direction to use for data stage. 227 227 * @param[in] status_dir Direction to use for status stage. … … 289 289 } 290 290 /*----------------------------------------------------------------------------*/ 291 #define LOG_BATCH_INITIALIZED(batch, name, dir) \292 usb_log_debug2("Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \293 (batch), (name), (dir), USB_TRANSFER_BATCH_ARGS(*(batch)))294 295 291 /** Prepare generic data transfer 296 292 * 297 * @param[in] instanceBatch structure to use.293 * @param[in] ohci_batch Batch structure to use. 298 294 * 299 295 * Direction is supplied by the associated ep and toggle is maintained by the … … 330 326 ++td_current; 331 327 } 332 LOG_BATCH_INITIALIZED(ohci_batch->usb_batch, 328 usb_log_debug2( 329 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \ 330 ohci_batch->usb_batch, 333 331 usb_str_transfer_type(ohci_batch->usb_batch->ep->transfer_type), 334 usb_str_direction(ohci_batch->usb_batch->ep->direction)); 332 usb_str_direction(ohci_batch->usb_batch->ep->direction), 333 USB_TRANSFER_BATCH_ARGS(*ohci_batch->usb_batch)); 335 334 } 336 335 /*----------------------------------------------------------------------------*/ … … 338 337 { 339 338 // TODO Find a better way to do this 339 /* Check first bit of the first setup request byte 340 * (it signals hc-> dev or dev->hc communication) */ 341 const char *direction; 340 342 if (ohci_batch->device_buffer[0] & (1 << 7)) { 341 343 batch_control(ohci_batch, USB_DIRECTION_IN, USB_DIRECTION_OUT); 342 LOG_BATCH_INITIALIZED(ohci_batch->usb_batch, "control", "write");344 direction = "read"; 343 345 } else { 344 346 batch_control(ohci_batch, USB_DIRECTION_OUT, USB_DIRECTION_IN); 345 LOG_BATCH_INITIALIZED(ohci_batch->usb_batch, "control", "write"); 346 } 347 direction = "write"; 348 } 349 usb_log_debug2( 350 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \ 351 ohci_batch->usb_batch, 352 usb_str_transfer_type(ohci_batch->usb_batch->ep->transfer_type), 353 direction, USB_TRANSFER_BATCH_ARGS(*ohci_batch->usb_batch)); 347 354 } 348 355 /*----------------------------------------------------------------------------*/ -
uspace/drv/bus/usb/uhci/uhci_batch.c
r7bce1fc r5f57929 152 152 /** Check batch TDs for activity. 153 153 * 154 * @param[in] instanceBatch structure to use.154 * @param[in] uhci_batch Batch structure to use. 155 155 * @return False, if there is an active TD, true otherwise. 156 156 * … … 202 202 return true; 203 203 } 204 205 #define LOG_BATCH_INITIALIZED(batch, name, dir) \206 usb_log_debug2("Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \207 (batch), (name), (dir), USB_TRANSFER_BATCH_ARGS(*(batch)))208 209 204 /*----------------------------------------------------------------------------*/ 210 205 /** Prepare generic data transfer 211 206 * 212 * @param[in] instanceBatch structure to use.207 * @param[in] uhci_batch Batch structure to use. 213 208 * @param[in] pid Pid to use for data transactions. 214 209 * … … 261 256 td_set_ioc(&uhci_batch->tds[td - 1]); 262 257 endpoint_toggle_set(uhci_batch->usb_batch->ep, toggle); 263 LOG_BATCH_INITIALIZED(uhci_batch->usb_batch, 258 usb_log_debug2( 259 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \ 260 uhci_batch->usb_batch, 264 261 usb_str_transfer_type(uhci_batch->usb_batch->ep->transfer_type), 265 usb_str_direction(uhci_batch->usb_batch->ep->direction)); 262 usb_str_direction(uhci_batch->usb_batch->ep->direction), 263 USB_TRANSFER_BATCH_ARGS(*uhci_batch->usb_batch)); 266 264 } 267 265 /*----------------------------------------------------------------------------*/ 268 266 /** Prepare generic control transfer 269 267 * 270 * @param[in] instanceBatch structure to use.268 * @param[in] uhci_batch Batch structure to use. 271 269 * @param[in] data_stage Pid to use for data tds. 272 270 * @param[in] status_stage Pid to use for data tds. … … 341 339 /* Check first bit of the first setup request byte 342 340 * (it signals hc-> dev or dev->hc communication) */ 341 const char *direction = NULL; 343 342 if (uhci_batch->usb_batch->setup_buffer[0] & (1 << 7)) { 344 343 batch_control(uhci_batch, USB_PID_IN, USB_PID_OUT); 345 LOG_BATCH_INITIALIZED(uhci_batch->usb_batch, "control", "read");344 direction = "read"; 346 345 } else { 347 346 batch_control(uhci_batch, USB_PID_OUT, USB_PID_IN); 348 LOG_BATCH_INITIALIZED(uhci_batch->usb_batch, "control", "write"); 349 } 347 direction = "write"; 348 } 349 usb_log_debug2( 350 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \ 351 uhci_batch->usb_batch, 352 usb_str_transfer_type(uhci_batch->usb_batch->ep->transfer_type), 353 direction, USB_TRANSFER_BATCH_ARGS(*uhci_batch->usb_batch)); 350 354 } 351 355 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.