Changeset 69b1f3d in mainline
- Timestamp:
- 2011-02-14T22:19:05Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f294926
- Parents:
- d4ee4e2 (diff), daec5e04 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/connhost.c
rd4ee4e2 r69b1f3d 64 64 65 65 static void universal_callback(void *buffer, size_t size, 66 usb_transaction_outcome_t outcome, void *arg)66 int outcome, void *arg) 67 67 { 68 68 transfer_info_t *transfer = (transfer_info_t *) arg; … … 107 107 108 108 static void control_abort_prematurely(control_transfer_info_t *transfer, 109 size_t size, usb_transaction_outcome_t outcome)109 size_t size, int outcome) 110 110 { 111 111 switch (transfer->direction) { … … 127 127 128 128 static void control_callback_two(void *buffer, size_t size, 129 usb_transaction_outcome_t outcome, void *arg)129 int outcome, void *arg) 130 130 { 131 131 control_transfer_info_t *ctrl_transfer = (control_transfer_info_t *) arg; 132 132 133 if (outcome != USB_OUTCOME_OK) {133 if (outcome != EOK) { 134 134 control_abort_prematurely(ctrl_transfer, outcome, size); 135 135 free(ctrl_transfer); … … 165 165 166 166 static void control_callback_one(void *buffer, size_t size, 167 usb_transaction_outcome_t outcome, void *arg)167 int outcome, void *arg) 168 168 { 169 169 control_transfer_info_t *transfer = (control_transfer_info_t *) arg; 170 170 171 if (outcome != USB_OUTCOME_OK) {171 if (outcome != EOK) { 172 172 control_abort_prematurely(transfer, outcome, size); 173 173 free(transfer); -
uspace/drv/vhc/devices.c
rd4ee4e2 r69b1f3d 112 112 * @param transaction Transaction to be sent over the bus. 113 113 */ 114 usb_transaction_outcome_t virtdev_send_to_all(transaction_t *transaction)114 int virtdev_send_to_all(transaction_t *transaction) 115 115 { 116 116 /* For easier debugging. */ … … 126 126 assert(false && "unreachable branch in switch()"); 127 127 } 128 usb_transaction_outcome_t outcome = USB_OUTCOME_BABBLE;128 int outcome = EBADCHECKSUM; 129 129 130 130 link_t *pos; … … 185 185 */ 186 186 if (rc == EOK) { 187 outcome = USB_OUTCOME_OK;187 outcome = EOK; 188 188 } 189 189 } … … 221 221 break; 222 222 } 223 outcome = USB_OUTCOME_OK;223 outcome = EOK; 224 224 } 225 225 -
uspace/drv/vhc/devices.h
rd4ee4e2 r69b1f3d 54 54 virtdev_connection_t *virtdev_find(sysarg_t); 55 55 void virtdev_destroy_device(virtdev_connection_t *); 56 usb_transaction_outcome_t virtdev_send_to_all(transaction_t *);56 int virtdev_send_to_all(transaction_t *); 57 57 58 58 #endif -
uspace/drv/vhc/hc.c
rd4ee4e2 r69b1f3d 89 89 */ 90 90 static void process_transaction_with_outcome(transaction_t * transaction, 91 usb_transaction_outcome_t outcome)91 int outcome) 92 92 { 93 93 usb_log_debug2("Transaction " TRANSACTION_FORMAT " done: %s.\n", 94 94 TRANSACTION_PRINTF(*transaction), 95 usb_str_transaction_outcome(outcome));95 str_error(outcome)); 96 96 97 97 transaction->callback(transaction->buffer, transaction->actual_len, … … 127 127 TRANSACTION_PRINTF(*transaction), ports); 128 128 129 usb_transaction_outcome_t outcome;129 int outcome; 130 130 outcome = virtdev_send_to_all(transaction); 131 131 -
uspace/drv/vhc/hc.h
rd4ee4e2 r69b1f3d 47 47 */ 48 48 typedef void (*hc_transaction_done_callback_t)(void *buffer, size_t size, 49 usb_transaction_outcome_t outcome, void *arg);49 int outcome, void *arg); 50 50 51 51 /** Pending transaction details. */ -
uspace/lib/c/generic/str_error.c
rd4ee4e2 r69b1f3d 33 33 */ 34 34 35 #include <errno.h> 35 36 #include <str_error.h> 36 37 #include <stdio.h> … … 63 64 static fibril_local char noerr[NOERR_LEN]; 64 65 65 const char *str_error(const int e rrno)66 const char *str_error(const int e) 66 67 { 67 if ((e rrno <= 0) && (errno>= MIN_ERRNO))68 return err_desc[-e rrno];68 if ((e <= 0) && (e >= MIN_ERRNO)) 69 return err_desc[-e]; 69 70 70 snprintf(noerr, NOERR_LEN, "Unkown error code %d", errno); 71 /* Ad hoc descriptions of error codes interesting for USB. */ 72 switch (e) { 73 case EBADCHECKSUM: 74 return "Bad checksum"; 75 case EAGAIN: 76 return "Resource temporarily unavailable"; 77 default: 78 break; 79 } 80 81 snprintf(noerr, NOERR_LEN, "Unkown error code %d", e); 71 82 return noerr; 72 83 } -
uspace/lib/c/include/errno.h
rd4ee4e2 r69b1f3d 56 56 #define EMLINK (-266) 57 57 58 /** Bad checksum. */ 59 #define EBADCHECKSUM (-300) 60 58 61 /** An API function is called while another blocking function is in progress. */ 59 62 #define EINPROGRESS (-10036) -
uspace/lib/drv/generic/remote_usbhc.c
rd4ee4e2 r69b1f3d 240 240 241 241 static void callback_out(device_t *device, 242 usb_transaction_outcome_t outcome, void *arg)242 int outcome, void *arg) 243 243 { 244 244 async_transaction_t *trans = (async_transaction_t *)arg; … … 250 250 251 251 static void callback_in(device_t *device, 252 usb_transaction_outcome_t outcome, size_t actual_size, void *arg)252 int outcome, size_t actual_size, void *arg) 253 253 { 254 254 async_transaction_t *trans = (async_transaction_t *)arg; 255 255 256 if (outcome != USB_OUTCOME_OK) {256 if (outcome != EOK) { 257 257 async_answer_0(trans->caller, outcome); 258 258 if (trans->data_caller) { … … 270 270 } 271 271 272 async_answer_0(trans->caller, USB_OUTCOME_OK);272 async_answer_0(trans->caller, EOK); 273 273 274 274 async_transaction_destroy(trans); -
uspace/lib/drv/include/usbhc_iface.h
rd4ee4e2 r69b1f3d 207 207 /** Callback for outgoing transfer. */ 208 208 typedef void (*usbhc_iface_transfer_out_callback_t)(device_t *, 209 usb_transaction_outcome_t, void *);209 int, void *); 210 210 211 211 /** Callback for incoming transfer. */ 212 212 typedef void (*usbhc_iface_transfer_in_callback_t)(device_t *, 213 usb_transaction_outcome_t, size_t, void *);213 int, size_t, void *); 214 214 215 215 -
uspace/lib/usb/include/usb/usb.h
rd4ee4e2 r69b1f3d 83 83 } usb_request_recipient_t; 84 84 85 /** USB transaction outcome. */86 typedef enum {87 USB_OUTCOME_OK,88 USB_OUTCOME_CRCERROR,89 USB_OUTCOME_BABBLE90 } usb_transaction_outcome_t;91 92 const char * usb_str_transaction_outcome(usb_transaction_outcome_t o);93 94 85 /** USB address type. 95 86 * Negative values could be used to indicate error. -
uspace/lib/usb/src/usb.c
rd4ee4e2 r69b1f3d 54 54 } 55 55 56 /** String representation of USB transaction outcome. */57 const char * usb_str_transaction_outcome(usb_transaction_outcome_t o)58 {59 switch (o) {60 case USB_OUTCOME_OK:61 return "ok";62 case USB_OUTCOME_CRCERROR:63 return "CRC error";64 case USB_OUTCOME_BABBLE:65 return "babble";66 default:67 return "unknown";68 }69 }70 71 72 56 /** 73 57 * @}
Note:
See TracChangeset
for help on using the changeset viewer.