Changeset 5dd9209 in mainline
- Timestamp:
- 2011-03-04T17:19:14Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3faf416c
- Parents:
- 21bb58d (diff), 969a6ff (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:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/pciintel/pci.c
r21bb58d r5dd9209 94 94 sysarg_t apic; 95 95 sysarg_t i8259; 96 96 97 int irc_phone = -1; 97 98 int irc_service = 0; … … 103 104 } 104 105 105 if (irc_service) { 106 while (irc_phone < 0) 107 irc_phone = service_connect_blocking(irc_service, 0, 0); 108 } else { 106 if (irc_service == 0) 109 107 return false; 110 } 108 109 irc_phone = service_connect_blocking(irc_service, 0, 0); 110 if (irc_phone < 0) 111 return false; 111 112 112 113 size_t i; … … 114 115 if (dev_data->hw_resources.resources[i].type == INTERRUPT) { 115 116 int irq = dev_data->hw_resources.resources[i].res.interrupt.irq; 116 async_msg_1(irc_phone, IRC_ENABLE_INTERRUPT, irq); 117 int rc = async_req_1_0(irc_phone, IRC_ENABLE_INTERRUPT, irq); 118 if (rc != EOK) { 119 async_hangup(irc_phone); 120 return false; 121 } 117 122 } 118 123 } -
uspace/drv/uhci-hcd/batch.c
r21bb58d r5dd9209 35 35 #include <str_error.h> 36 36 37 #include <usb/usb.h> 37 38 #include <usb/debug.h> 38 39 … … 46 47 static int batch_schedule(batch_t *instance); 47 48 49 static void batch_control( 50 batch_t *instance, int data_stage, int status_stage); 48 51 static void batch_call_in(batch_t *instance); 49 52 static void batch_call_out(batch_t *instance); … … 93 96 instance->transport_buffer = 94 97 (size > 0) ? malloc32(transport_size) : NULL; 98 95 99 if ((size > 0) && (instance->transport_buffer == NULL)) { 96 100 usb_log_error("Failed to allocate device accessible buffer.\n"); … … 168 172 { 169 173 assert(instance); 170 171 174 /* we are data out, we are supposed to provide data */ 172 175 memcpy(instance->transport_buffer, instance->buffer, instance->buffer_size); 173 174 const bool low_speed = instance->speed == USB_SPEED_LOW; 175 int toggle = 0; 176 /* setup stage */ 177 transfer_descriptor_init(instance->tds, DEFAULT_ERROR_COUNT, 178 instance->setup_size, toggle, false, low_speed, 179 instance->target, USB_PID_SETUP, instance->setup_buffer, 180 &instance->tds[1]); 181 182 /* data stage */ 183 size_t i = 1; 184 for (;i < instance->packets - 1; ++i) { 185 char *data = 186 instance->transport_buffer + ((i - 1) * instance->max_packet_size); 187 toggle = 1 - toggle; 188 189 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 190 instance->max_packet_size, toggle++, false, low_speed, 191 instance->target, USB_PID_OUT, data, &instance->tds[i + 1]); 192 } 193 194 /* status stage */ 195 i = instance->packets - 1; 196 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 197 0, 1, false, low_speed, instance->target, USB_PID_IN, NULL, NULL); 198 199 instance->tds[i].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG; 200 usb_log_debug2("Control write last TD status: %x.\n", 201 instance->tds[i].status); 202 176 batch_control(instance, USB_PID_OUT, USB_PID_IN); 203 177 instance->next_step = batch_call_out_and_dispose; 204 178 usb_log_debug("Batch(%p) CONTROL WRITE initialized.\n", instance); … … 209 183 { 210 184 assert(instance); 211 212 const bool low_speed = instance->speed == USB_SPEED_LOW; 213 int toggle = 0; 214 /* setup stage */ 215 transfer_descriptor_init(instance->tds, DEFAULT_ERROR_COUNT, 216 instance->setup_size, toggle, false, low_speed, instance->target, 217 USB_PID_SETUP, instance->setup_buffer, &instance->tds[1]); 218 219 /* data stage */ 220 size_t i = 1; 221 for (;i < instance->packets - 1; ++i) { 222 char *data = 223 instance->transport_buffer + ((i - 1) * instance->max_packet_size); 224 toggle = 1 - toggle; 225 226 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 227 instance->max_packet_size, toggle, false, low_speed, 228 instance->target, USB_PID_IN, data, &instance->tds[i + 1]); 229 } 230 231 /* status stage */ 232 i = instance->packets - 1; 233 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 234 0, 1, false, low_speed, instance->target, USB_PID_OUT, NULL, NULL); 235 236 instance->tds[i].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG; 237 usb_log_debug2("Control read last TD status: %x.\n", 238 instance->tds[i].status); 239 185 batch_control(instance, USB_PID_IN, USB_PID_OUT); 240 186 instance->next_step = batch_call_in_and_dispose; 241 187 usb_log_debug("Batch(%p) CONTROL READ initialized.\n", instance); … … 272 218 { 273 219 assert(instance); 274 275 220 memcpy(instance->transport_buffer, instance->buffer, instance->buffer_size); 276 221 … … 297 242 } 298 243 /*----------------------------------------------------------------------------*/ 244 static void batch_control( 245 batch_t *instance, int data_stage, int status_stage) 246 { 247 assert(instance); 248 249 const bool low_speed = instance->speed == USB_SPEED_LOW; 250 int toggle = 0; 251 /* setup stage */ 252 transfer_descriptor_init(instance->tds, DEFAULT_ERROR_COUNT, 253 instance->setup_size, toggle, false, low_speed, instance->target, 254 USB_PID_SETUP, instance->setup_buffer, &instance->tds[1]); 255 256 /* data stage */ 257 size_t packet = 1; 258 size_t remain_size = instance->buffer_size; 259 while (remain_size > 0) { 260 char *data = 261 instance->transport_buffer + instance->buffer_size 262 - remain_size; 263 264 toggle = 1 - toggle; 265 266 const size_t packet_size = 267 (instance->max_packet_size > remain_size) ? 268 remain_size : instance->max_packet_size; 269 270 transfer_descriptor_init(&instance->tds[packet], 271 DEFAULT_ERROR_COUNT, packet_size, toggle, false, low_speed, 272 instance->target, data_stage, data, 273 &instance->tds[packet + 1]); 274 275 ++packet; 276 assert(packet < instance->packets); 277 assert(packet_size <= remain_size); 278 remain_size -= packet_size; 279 } 280 281 /* status stage */ 282 assert(packet == instance->packets - 1); 283 transfer_descriptor_init(&instance->tds[packet], DEFAULT_ERROR_COUNT, 284 0, 1, false, low_speed, instance->target, status_stage, NULL, NULL); 285 286 287 instance->tds[packet].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG; 288 usb_log_debug2("Control last TD status: %x.\n", 289 instance->tds[packet].status); 290 } 291 /*----------------------------------------------------------------------------*/ 299 292 void batch_call_in(batch_t *instance) 300 293 { -
uspace/drv/usbhid/hiddev.c
r21bb58d r5dd9209 206 206 assert(endpoint_mapping[0].interface != NULL); 207 207 208 /* 209 * Save polling interval 210 */ 211 hid_dev->poll_interval = endpoint_mapping[0].descriptor->poll_interval; 212 assert(hid_dev->poll_interval > 0); 213 208 214 rc = usbhid_dev_get_report_descriptor(hid_dev, 209 215 descriptors, descriptors_size, -
uspace/drv/usbhid/hiddev.h
r21bb58d r5dd9209 57 57 usb_endpoint_pipe_t poll_pipe; 58 58 59 short poll_interval; 60 59 61 uint16_t iface; 60 62 -
uspace/drv/usbhid/kbddev.c
r21bb58d r5dd9209 593 593 594 594 while (true) { 595 async_usleep(1000 * 10);596 597 595 sess_rc = usb_endpoint_pipe_start_session( 598 596 &kbd_dev->hid_dev->poll_pipe); … … 635 633 usb_log_debug("Calling usbhid_kbd_process_data()\n"); 636 634 usbhid_kbd_process_data(kbd_dev, buffer, actual_size); 635 636 async_usleep(kbd_dev->hid_dev->poll_interval); 637 637 } 638 638 -
uspace/drv/usbhub/usbhub.c
r21bb58d r5dd9209 243 243 dprintf(USB_LOG_LEVEL_ERROR, "failed when receiving hub descriptor, badcode = %d",opResult); 244 244 free(serialized_descriptor); 245 return result; 245 free(result); 246 return NULL; 246 247 } 247 248 dprintf(USB_LOG_LEVEL_DEBUG2, "deserializing descriptor"); … … 249 250 if(descriptor==NULL){ 250 251 dprintf(USB_LOG_LEVEL_WARNING, "could not deserialize descriptor "); 251 result->port_count = 1;///\TODO this code is only for debug!!!252 return result;252 free(result); 253 return NULL; 253 254 } 254 255 … … 286 287 287 288 usb_hub_info_t * hub_info = usb_create_hub_info(dev); 289 if(!hub_info){ 290 return EINTR; 291 } 288 292 289 293 int opResult; … … 294 298 opResult = usb_hub_process_configuration_descriptors(hub_info); 295 299 if(opResult != EOK){ 296 dprintf(USB_LOG_LEVEL_ERROR,"could not get con diguration descriptors, %d",300 dprintf(USB_LOG_LEVEL_ERROR,"could not get configuration descriptors, %d", 297 301 opResult); 298 302 return opResult; -
uspace/drv/usbmid/explore.c
r21bb58d r5dd9209 159 159 } 160 160 161 /* Select the first configuration */ 162 rc = usb_request_set_configuration(&dev->ctrl_pipe, 163 config_descriptor->configuration_number); 164 if (rc != EOK) { 165 usb_log_error("Failed to set device configuration: %s.\n", 166 str_error(rc)); 167 free(config_descriptor_raw); 168 free(interface_descriptors); 169 return false; 170 } 171 172 173 /* Create control function */ 161 174 ddf_fun_t *ctl_fun = ddf_fun_create(dev->dev, fun_exposed, "ctl"); 162 175 if (ctl_fun == NULL) { … … 175 188 } 176 189 190 /* Spawn interface children */ 177 191 size_t i; 178 192 for (i = 0; i < interface_descriptors_count; i++) { -
uspace/srv/fs/fat/fat_dentry.c
r21bb58d r5dd9209 42 42 static bool is_d_char(const char ch) 43 43 { 44 if (isalnum(ch) || ch == '_' )44 if (isalnum(ch) || ch == '_' || ch == '-') 45 45 return true; 46 46 else
Note:
See TracChangeset
for help on using the changeset viewer.