Changeset 1433ecda in mainline for uspace/srv
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- uspace/srv
- Files:
-
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/audio_data.h
r47b2d7e3 r1433ecda 67 67 } audio_pipe_t; 68 68 69 audio_data_t * 69 audio_data_t *audio_data_create(const void *data, size_t size, 70 70 pcm_format_t format); 71 71 void audio_data_addref(audio_data_t *adata); -
uspace/srv/audio/hound/audio_device.c
r47b2d7e3 r1433ecda 54 54 static errno_t device_source_connection_callback(audio_source_t *source, bool new); 55 55 static void device_event_callback(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg); 56 static errno_t device_check_format(audio_sink_t *sink);56 static errno_t device_check_format(audio_sink_t *sink); 57 57 static errno_t get_buffer(audio_device_t *dev); 58 58 static errno_t release_buffer(audio_device_t *dev); … … 118 118 * capable of capturing audio. 119 119 */ 120 audio_source_t * 120 audio_source_t *audio_device_get_source(audio_device_t *dev) 121 121 { 122 122 assert(dev); … … 134 134 * capable of audio playback. 135 135 */ 136 audio_sink_t * 136 audio_sink_t *audio_device_get_sink(audio_device_t *dev) 137 137 { 138 138 assert(dev); … … 153 153 * connections. 154 154 */ 155 static errno_t device_sink_connection_callback(audio_sink_t *sink, bool new)155 static errno_t device_sink_connection_callback(audio_sink_t *sink, bool new) 156 156 { 157 157 assert(sink); … … 275 275 cap_call_handle_t chandle = async_get_call(&call); 276 276 async_answer_0(chandle, EOK); 277 switch (IPC_GET_IMETHOD(call)) {277 switch (IPC_GET_IMETHOD(call)) { 278 278 case PCM_EVENT_FRAMES_PLAYED: 279 279 getuptime(&time1); … … 327 327 * @return Error code. 328 328 */ 329 static errno_t device_check_format(audio_sink_t *sink)329 static errno_t device_check_format(audio_sink_t *sink) 330 330 { 331 331 assert(sink); -
uspace/srv/audio/hound/audio_device.h
r47b2d7e3 r1433ecda 71 71 72 72 /** Linked list instance helper */ 73 static inline audio_device_t * 73 static inline audio_device_t *audio_device_list_instance(link_t *l) 74 74 { 75 75 return l ? list_get_instance(l, audio_device_t, link) : NULL; … … 78 78 errno_t audio_device_init(audio_device_t *dev, service_id_t id, const char *name); 79 79 void audio_device_fini(audio_device_t *dev); 80 audio_source_t * 81 audio_sink_t * 80 audio_source_t *audio_device_get_source(audio_device_t *dev); 81 audio_sink_t *audio_device_get_sink(audio_device_t *dev); 82 82 errno_t audio_device_recorded_data(audio_device_t *dev, void **base, size_t *size); 83 83 errno_t audio_device_available_buffer(audio_device_t *dev, void **base, size_t *size); -
uspace/srv/audio/hound/audio_sink.c
r47b2d7e3 r1433ecda 134 134 * @return Error code. 135 135 */ 136 void audio_sink_mix_inputs(audio_sink_t *sink, void *dest, size_t size)136 void audio_sink_mix_inputs(audio_sink_t *sink, void *dest, size_t size) 137 137 { 138 138 assert(sink); -
uspace/srv/audio/hound/audio_sink.h
r47b2d7e3 r1433ecda 72 72 * @return pointer to a sink structure, NULL on failure. 73 73 */ 74 static inline audio_sink_t * 74 static inline audio_sink_t *audio_sink_list_instance(link_t *l) 75 75 { 76 76 return l ? list_get_instance(l, audio_sink_t, link) : NULL; … … 84 84 void audio_sink_fini(audio_sink_t *sink); 85 85 errno_t audio_sink_set_format(audio_sink_t *sink, const pcm_format_t *format); 86 void audio_sink_mix_inputs(audio_sink_t *sink, void *dest, size_t size);86 void audio_sink_mix_inputs(audio_sink_t *sink, void *dest, size_t size); 87 87 88 88 #endif -
uspace/srv/audio/hound/audio_source.h
r47b2d7e3 r1433ecda 65 65 * @return pointer to a source structure, NULL on failure. 66 66 */ 67 static inline audio_source_t * 67 static inline audio_source_t *audio_source_list_instance(link_t *l) 68 68 { 69 69 return l ? list_get_instance(l, audio_source_t, link) : NULL; -
uspace/srv/audio/hound/connection.h
r47b2d7e3 r1433ecda 66 66 * @return pointer to a connection structure, NULL on failure. 67 67 */ 68 static inline connection_t * 68 static inline connection_t *connection_from_source_list(link_t *l) 69 69 { 70 70 return l ? list_get_instance(l, connection_t, source_link) : NULL; … … 76 76 * @return pointer to a connection structure, NULL on failure. 77 77 */ 78 static inline connection_t * 78 static inline connection_t *connection_from_hound_list(link_t *l) 79 79 { 80 80 return l ? list_get_instance(l, connection_t, hound_link) : NULL; -
uspace/srv/audio/hound/hound.c
r47b2d7e3 r1433ecda 111 111 } 112 112 113 static errno_t hound_disconnect_internal(hound_t *hound, const char * source_name, const char*sink_name);113 static errno_t hound_disconnect_internal(hound_t *hound, const char *source_name, const char *sink_name); 114 114 115 115 /** … … 287 287 if (ret != EOK) { 288 288 log_debug("Failed to initialize new audio device: %s", 289 289 str_error(ret)); 290 290 free(dev); 291 291 return ret; … … 517 517 * @return Error code. 518 518 */ 519 errno_t hound_connect(hound_t *hound, const char * source_name, const char*sink_name)519 errno_t hound_connect(hound_t *hound, const char *source_name, const char *sink_name) 520 520 { 521 521 assert(hound); … … 526 526 audio_source_list_instance(list_first(&hound->sources)); 527 527 if (str_cmp(source_name, "default") != 0) 528 528 source = find_source_by_name(&hound->sources, source_name); 529 529 530 530 audio_sink_t *sink = 531 531 audio_sink_list_instance(list_first(&hound->sinks)); 532 532 if (str_cmp(sink_name, "default") != 0) 533 533 sink = find_sink_by_name(&hound->sinks, sink_name); 534 534 535 535 if (!source || !sink) { … … 556 556 * @return Error code. 557 557 */ 558 errno_t hound_disconnect(hound_t *hound, const char * source_name, const char*sink_name)558 errno_t hound_disconnect(hound_t *hound, const char *source_name, const char *sink_name) 559 559 { 560 560 assert(hound); … … 574 574 * This function has to be called with the list_guard lock held. 575 575 */ 576 static errno_t hound_disconnect_internal(hound_t *hound, const char *source_name,577 const char *sink_name)576 static errno_t hound_disconnect_internal(hound_t *hound, const char *source_name, 577 const char *sink_name) 578 578 { 579 579 assert(hound); … … 585 585 if (str_cmp(connection_source_name(conn), source_name) == 0 || 586 586 str_cmp(connection_sink_name(conn), sink_name) == 0) { 587 588 589 590 587 log_debug("Removing %s -> %s", connection_source_name(conn), 588 connection_sink_name(conn)); 589 list_remove(it); 590 connection_destroy(conn); 591 591 } 592 592 } -
uspace/srv/bd/file_bd/file_bd.c
r47b2d7e3 r1433ecda 97 97 block_size = DEFAULT_BLOCK_SIZE; 98 98 99 ++argv; --argc; 99 ++argv; 100 --argc; 100 101 while (*argv != NULL && (*argv)[0] == '-') { 101 102 /* Option */ … … 113 114 return -1; 114 115 } 115 ++argv; --argc; 116 ++argv; 117 --argc; 116 118 } else { 117 119 printf("Invalid option '%s'.\n", *argv); … … 119 121 return -1; 120 122 } 121 ++argv; --argc; 123 ++argv; 124 --argc; 122 125 } 123 126 -
uspace/srv/bd/sata_bd/sata_bd.c
r47b2d7e3 r1433ecda 97 97 /* If device is SATA, add device to the disk array. */ 98 98 disk[disk_count].sess = ahci_get_sess(funh, &disk[disk_count].dev_name); 99 if (disk[disk_count].sess != NULL) {99 if (disk[disk_count].sess != NULL) { 100 100 101 101 ahci_get_sata_device_name(disk[disk_count].sess, … … 113 113 printf("Device %s - %s , blocks: %lu, block_size: %lu\n", 114 114 disk[disk_count].dev_name, disk[disk_count].sata_dev_name, 115 116 115 (long unsigned int) disk[disk_count].blocks, 116 (long unsigned int) disk[disk_count].block_size); 117 117 118 118 ++disk_count; … … 268 268 } 269 269 270 for (int i = 0; i < disk_count; i++) {270 for (int i = 0; i < disk_count; i++) { 271 271 char name[1024]; 272 272 snprintf(name, 1024, "%s/%s", NAMESPACE, disk[i].dev_name); -
uspace/srv/bd/vbd/disk.c
r47b2d7e3 r1433ecda 181 181 182 182 list_foreach(vbds_disks, ldisks, vbds_disk_t, disk) 183 183 disk->present = false; 184 184 185 185 for (i = 0; i < count; i++) { -
uspace/srv/devman/devtree.c
r47b2d7e3 r1433ecda 44 44 static inline size_t handle_key_hash(void *key) 45 45 { 46 devman_handle_t handle = *(devman_handle_t *)key;46 devman_handle_t handle = *(devman_handle_t *)key; 47 47 return handle; 48 48 } … … 62 62 static bool devman_devices_key_equal(void *key, const ht_link_t *item) 63 63 { 64 devman_handle_t handle = *(devman_handle_t *)key;64 devman_handle_t handle = *(devman_handle_t *)key; 65 65 dev_node_t *dev = hash_table_get_inst(item, dev_node_t, devman_dev); 66 66 return dev->handle == handle; … … 69 69 static bool devman_functions_key_equal(void *key, const ht_link_t *item) 70 70 { 71 devman_handle_t handle = *(devman_handle_t *)key;71 devman_handle_t handle = *(devman_handle_t *)key; 72 72 fun_node_t *fun = hash_table_get_inst(item, fun_node_t, devman_fun); 73 73 return fun->handle == handle; … … 76 76 static inline size_t service_id_key_hash(void *key) 77 77 { 78 service_id_t service_id = *(service_id_t *)key;78 service_id_t service_id = *(service_id_t *)key; 79 79 return service_id; 80 80 } … … 88 88 static bool loc_functions_key_equal(void *key, const ht_link_t *item) 89 89 { 90 service_id_t service_id = *(service_id_t *)key;90 service_id_t service_id = *(service_id_t *)key; 91 91 fun_node_t *fun = hash_table_get_inst(item, fun_node_t, loc_fun); 92 92 return fun->service_id == service_id; -
uspace/srv/devman/match.c
r47b2d7e3 r1433ecda 231 231 232 232 size_t read_bytes; 233 rc = vfs_read(fd, (aoff64_t []) { 0}, buf, len, &read_bytes);233 rc = vfs_read(fd, (aoff64_t []) { 0 }, buf, len, &read_bytes); 234 234 if (rc != EOK) { 235 235 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s': %s.", conf_path, -
uspace/srv/devman/util.c
r47b2d7e3 r1433ecda 83 83 size_t len = 0; 84 84 85 while (*str != '\0' && !isspace(*str)) {85 while (*str != '\0' && !isspace(*str)) { 86 86 len++; 87 87 str++; -
uspace/srv/fs/cdfs/cdfs_endian.h
r47b2d7e3 r1433ecda 37 37 38 38 #if !(defined(__BE__) ^ defined(__LE__)) 39 39 #error The architecture must be either big-endian or little-endian. 40 40 #endif 41 41 -
uspace/srv/fs/exfat/exfat.h
r47b2d7e3 r1433ecda 81 81 uint8_t minor; 82 82 uint8_t major; 83 } __attribute__ 83 } __attribute__((packed)) version; 84 84 uint16_t volume_flags; /* 0x6A volume state flags */ 85 85 uint8_t bytes_per_sector; /* 0x6C sector size as (1 << n) */ -
uspace/srv/fs/exfat/exfat_bitmap.c
r47b2d7e3 r1433ecda 167 167 clst = firstc; 168 168 169 while (clst < firstc + count 169 while (clst < firstc + count) { 170 170 rc = exfat_bitmap_set_cluster(bs, service_id, clst); 171 171 if (rc != EOK) { … … 211 211 endc++; 212 212 } 213 startc = endc +1;213 startc = endc + 1; 214 214 } 215 215 return ENOSPC; … … 229 229 clst = lastc + 1; 230 230 while (exfat_bitmap_is_free(bs, nodep->idx->service_id, clst) == EOK) { 231 if (clst - lastc == count) {231 if (clst - lastc == count) { 232 232 return exfat_bitmap_set_clusters(bs, nodep->idx->service_id, 233 233 lastc + 1, count); -
uspace/srv/fs/exfat/exfat_dentry.h
r47b2d7e3 r1433ecda 64 64 uint16_t label[11]; 65 65 uint8_t _reserved[8]; 66 } __attribute__ 66 } __attribute__((packed)) exfat_vollabel_dentry_t; 67 67 68 68 typedef struct { … … 71 71 uint32_t firstc; 72 72 uint64_t size; 73 } __attribute__ 73 } __attribute__((packed)) exfat_bitmap_dentry_t; 74 74 75 75 typedef struct { … … 79 79 uint32_t firstc; 80 80 uint64_t size; 81 } __attribute__ 81 } __attribute__((packed)) exfat_uctable_dentry_t; 82 82 83 83 typedef struct { … … 87 87 uint8_t guid[16]; 88 88 uint8_t _reserved[10]; 89 } __attribute__ 89 } __attribute__((packed)) exfat_guid_dentry_t; 90 90 91 91 typedef struct { … … 103 103 uint8_t atime_tz; 104 104 uint8_t _reserved2[7]; 105 } __attribute__ 105 } __attribute__((packed)) exfat_file_dentry_t; 106 106 107 107 typedef struct { … … 115 115 uint32_t firstc; 116 116 uint64_t data_size; 117 } __attribute__ 117 } __attribute__((packed)) exfat_stream_dentry_t; 118 118 119 119 typedef struct { 120 120 uint8_t flags; 121 121 uint16_t name[EXFAT_NAME_PART_LEN]; 122 } __attribute__ 122 } __attribute__((packed)) exfat_name_dentry_t; 123 123 124 124 … … 134 134 exfat_name_dentry_t name; 135 135 }; 136 } __attribute__ 136 } __attribute__((packed)) exfat_dentry_t; 137 137 138 138 -
uspace/srv/fs/fat/fat.h
r47b2d7e3 r1433ecda 105 105 /** Boot sector signature. */ 106 106 uint16_t signature; 107 } __attribute__ 107 } __attribute__((packed)); 108 108 struct { 109 109 /* FAT32 only */ … … 136 136 /** Signature. */ 137 137 uint16_t signature; 138 } __attribute__ 138 } __attribute__((packed)) fat32; 139 139 }; 140 } __attribute__ 140 } __attribute__((packed)) fat_bs_t; 141 141 142 142 #define FAT32_FSINFO_SIG1 "RRaA" … … 152 152 uint8_t res2[12]; 153 153 uint8_t sig3[4]; 154 } __attribute__ 154 } __attribute__((packed)) fat32_fsinfo_t; 155 155 156 156 typedef enum { -
uspace/srv/fs/fat/fat_dentry.c
r47b2d7e3 r1433ecda 382 382 { 383 383 wchar_t ch; 384 size_t offset =0;384 size_t offset = 0; 385 385 bool result = true; 386 386 -
uspace/srv/fs/fat/fat_dentry.h
r47b2d7e3 r1433ecda 117 117 uint16_t eaidx; /* FAT12/FAT16 */ 118 118 uint16_t firstc_hi; /* FAT32 */ 119 } __attribute__ 119 } __attribute__((packed)); 120 120 uint16_t mtime; 121 121 uint16_t mdate; … … 123 123 uint16_t firstc; /* FAT12/FAT16 */ 124 124 uint16_t firstc_lo; /* FAT32 */ 125 } __attribute__ 125 } __attribute__((packed)); 126 126 uint32_t size; 127 } __attribute__ 127 } __attribute__((packed)); 128 128 struct { 129 129 uint8_t order; … … 135 135 uint16_t firstc_lo; /* MUST be 0 */ 136 136 uint16_t part3[FAT_LFN_PART3_SIZE]; 137 } __attribute__ 138 } __attribute__ 137 } __attribute__((packed)) lfn; 138 } __attribute__((packed)) fat_dentry_t; 139 139 140 140 extern int fat_dentry_namecmp(char *, const char *); -
uspace/srv/fs/fat/fat_directory.c
r47b2d7e3 r1433ecda 383 383 /* Copy number */ 384 384 size_t offset; 385 if (str_size(name) +str_size(number) + 1 > FAT_NAME_LEN)385 if (str_size(name) + str_size(number) + 1 > FAT_NAME_LEN) 386 386 offset = FAT_NAME_LEN - str_size(number) - 1; 387 387 else -
uspace/srv/fs/udf/udf_file.h
r47b2d7e3 r1433ecda 104 104 uint8_t implementation_use[0]; 105 105 udf_dstring file_id[0]; 106 } __attribute__((packed)) udf_file_identifier_descriptor_t;106 } __attribute__((packed)) udf_file_identifier_descriptor_t; 107 107 108 108 /* ICB tag - Information Control Block (ECMA 167 4/14.6) */ … … 184 184 uint32_t ad_lenght; 185 185 uint8_t allocation_descriptors[0]; 186 } __attribute__((packed)) udf_unallocated_space_entry_descriptor_t;186 } __attribute__((packed)) udf_unallocated_space_entry_descriptor_t; 187 187 188 188 /* Space Bitmap Descriptor format (ECMA 167 4/14.12) */ … … 192 192 uint32_t byts_number; 193 193 uint8_t bitmap[0]; 194 } __attribute__((packed)) udf_space_bitmap_descriptor_t;194 } __attribute__((packed)) udf_space_bitmap_descriptor_t; 195 195 196 196 extern errno_t udf_node_get_core(udf_node_t *); -
uspace/srv/hid/console/console.c
r47b2d7e3 r1433ecda 280 280 } 281 281 282 static errno_t input_ev_abs_move(input_t *input, unsigned x 282 static errno_t input_ev_abs_move(input_t *input, unsigned x, unsigned y, 283 283 unsigned max_x, unsigned max_y) 284 284 { -
uspace/srv/hid/input/gsp.c
r47b2d7e3 r1433ecda 123 123 mods = *dp++; 124 124 key = *dp++; 125 if (key == 0) break; 125 if (key == 0) 126 break; 126 127 127 128 /* Insert one sequence. */ … … 252 253 253 254 item = hash_table_find(&p->trans, &key); 254 if (item == NULL) return NULL; 255 if (item == NULL) 256 return NULL; 255 257 256 258 return hash_table_get_inst(item, gsp_trans_t, link); -
uspace/srv/hid/input/proto/mousedev.c
r47b2d7e3 r1433ecda 96 96 case MOUSEEV_ABS_MOVE_EVENT: 97 97 mouse_push_event_abs_move(mousedev->mouse_dev, 98 99 98 IPC_GET_ARG1(call), IPC_GET_ARG2(call), 99 IPC_GET_ARG3(call), IPC_GET_ARG4(call)); 100 100 retval = EOK; 101 101 break; -
uspace/srv/hid/isdv4_tablet/isdv4.c
r47b2d7e3 r1433ecda 98 98 event.button = 1; 99 99 state->emit_event_fn(&event); 100 } 101 else if (finger1 && !state->finger1_pressed) { 100 } else if (finger1 && !state->finger1_pressed) { 102 101 state->finger1_pressed = true; 103 102 … … 105 104 event.button = 1; 106 105 state->emit_event_fn(&event); 107 } 108 else { 106 } else { 109 107 event.type = MOVE; 110 108 event.button = 1; … … 112 110 } 113 111 } 114 } 115 else { 112 } else { 116 113 if (size != 9) 117 114 return true; … … 133 130 event.type = PROXIMITY_IN; 134 131 state->emit_event_fn(&event); 135 } 136 else if (!proximity && state->stylus_in_proximity) { 132 } else if (!proximity && state->stylus_in_proximity) { 137 133 /* Stylus came out of proximity */ 138 134 state->stylus_in_proximity = false; … … 140 136 event.type = PROXIMITY_OUT; 141 137 state->emit_event_fn(&event); 142 } 143 else { 138 } else { 144 139 /* Proximity state didn't change, but we need to check if it is still eraser */ 145 140 if (state->stylus_is_eraser && !button2) { … … 151 146 state->emit_event_fn(&event); 152 147 state->stylus_is_eraser = false; 153 } 154 else if (!state->stylus_is_eraser && !tip && button2) { 148 } else if (!state->stylus_is_eraser && !tip && button2) { 155 149 event.type = PROXIMITY_OUT; 156 150 event.source = STYLUS_TIP; … … 170 164 event.button = 1; 171 165 state->emit_event_fn(&event); 172 } 173 else if (!tip && state->tip_pressed) { 166 } else if (!tip && state->tip_pressed) { 174 167 state->tip_pressed = false; 175 168 event.type = RELEASE; … … 184 177 event.button = 2; 185 178 state->emit_event_fn(&event); 186 } 187 else if (!button1 && state->button1_pressed) { 179 } else if (!button1 && state->button1_pressed) { 188 180 state->button1_pressed = false; 189 181 event.type = RELEASE; … … 198 190 event.button = 3; 199 191 state->emit_event_fn(&event); 200 } 201 else if (!button2 && state->button2_pressed) { 192 } else if (!button2 && state->button2_pressed) { 202 193 state->button2_pressed = false; 203 194 event.type = RELEASE; … … 210 201 event.button = 0; 211 202 state->emit_event_fn(&event); 212 } 213 else { 203 } else { 214 204 if (tip && !state->tip_pressed) { 215 205 state->tip_pressed = true; … … 218 208 event.button = 1; 219 209 state->emit_event_fn(&event); 220 } 221 else if (!tip && state->tip_pressed) { 210 } else if (!tip && state->tip_pressed) { 222 211 state->tip_pressed = false; 223 212 event.type = RELEASE; … … 310 299 311 300 /* Skip data until a start of packet is found */ 312 while (i < state->buf_end && (state->buf[i] & START_OF_PACKET) == 0) i++; 301 while (i < state->buf_end && (state->buf[i] & START_OF_PACKET) == 0) 302 i++; 313 303 314 304 size_t start = i; … … 322 312 if (state->buf[i] & CONTROL_PACKET) { 323 313 packet_remaining = 11; 324 } 325 else if (state->buf[i] & TOUCH_EVENT) { 314 } else if (state->buf[i] & TOUCH_EVENT) { 326 315 packet_remaining = 5; 327 } 328 else { 316 } else { 329 317 packet_remaining = 9; 330 318 } -
uspace/srv/hid/isdv4_tablet/main.c
r47b2d7e3 r1433ecda 94 94 fibril_mutex_unlock(&client_mutex); 95 95 96 if (!sess) return; 96 if (!sess) 97 return; 97 98 98 99 async_exch_t *exch = async_exchange_begin(sess); … … 105 106 } 106 107 async_msg_4(exch, MOUSEEV_ABS_MOVE_EVENT, event->x, event->y, 107 108 max_x, max_y); 108 109 if (event->type == PRESS || event->type == RELEASE) { 109 110 async_msg_2(exch, MOUSEEV_BUTTON_EVENT, event->button, 110 111 event->type == PRESS); 111 112 } 112 113 } … … 118 119 const char *type = NULL; 119 120 switch (event->type) { 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 121 case PRESS: 122 type = "PRESS"; 123 break; 124 case RELEASE: 125 type = "RELEASE"; 126 break; 127 case PROXIMITY_IN: 128 type = "PROXIMITY IN"; 129 break; 130 case PROXIMITY_OUT: 131 type = "PROXIMITY OUT"; 132 break; 133 case MOVE: 134 type = "MOVE"; 135 break; 136 default: 137 type = "UNKNOWN"; 138 break; 138 139 } 139 140 140 141 const char *source = NULL; 141 142 switch (event->source) { 142 143 144 145 146 147 148 149 150 143 case STYLUS_TIP: 144 source = "stylus tip"; 145 break; 146 case STYLUS_ERASER: 147 source = "stylus eraser"; 148 break; 149 case TOUCH: 150 source = "touch"; 151 break; 151 152 } 152 153 … … 160 161 { 161 162 switch (data_id) { 162 163 164 165 166 167 168 169 170 171 172 163 case 0: 164 return "resistive+stylus"; 165 case 1: 166 return "capacitive+stylus"; 167 case 2: 168 return "resistive"; 169 case 3: 170 case 4: 171 return "capacitive"; 172 case 5: 173 return "penabled"; 173 174 } 174 175 return "unknown"; … … 189 190 if (argc > arg && str_test_prefix(argv[arg], "--baud=")) { 190 191 size_t arg_offset = str_lsize(argv[arg], 7); 191 char *arg_str = argv[arg] + arg_offset;192 char *arg_str = argv[arg] + arg_offset; 192 193 if (str_length(arg_str) == 0) { 193 194 fprintf(stderr, "--baud requires an argument\n"); … … 219 220 } 220 221 arg++; 221 } 222 else { 222 } else { 223 223 category_id_t serial_cat_id; 224 224 … … 233 233 size_t svc_count; 234 234 235 rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count); if (rc != EOK) { 235 rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count); 236 if (rc != EOK) { 236 237 fprintf(stderr, "Failed getting list of services\n"); 237 238 return 1; … … 301 302 if (state.stylus_tilt_supported) { 302 303 printf("%ux%u\n", state.stylus_max_xtilt, state.stylus_max_ytilt); 303 } 304 else { 304 } else { 305 305 printf("not supported\n"); 306 306 } 307 307 printf(" Touch: %ux%u type: %s\n", state.touch_max_x, state.touch_max_y, 308 308 touch_type(state.touch_type)); 309 309 310 310 fid_t fibril = fibril_create(read_fibril, NULL); … … 337 337 if (rc != EOK) { 338 338 printf(NAME ": Unable to get mouse category id.\n"); 339 } 340 else { 339 } else { 341 340 rc = loc_service_add_to_cat(service_id, mouse_category); 342 341 if (rc != EOK) { -
uspace/srv/hid/output/port/ega.c
r47b2d7e3 r1433ecda 214 214 return rc; 215 215 216 rc = pio_enable((void *)EGA_IO_BASE, EGA_IO_SIZE, NULL);216 rc = pio_enable((void *)EGA_IO_BASE, EGA_IO_SIZE, NULL); 217 217 if (rc != EOK) 218 218 return rc; -
uspace/srv/hid/output/proto/vt100.c
r47b2d7e3 r1433ecda 140 140 vt100_state_t *vt100_state_create(sysarg_t cols, sysarg_t rows, 141 141 vt100_putchar_t putchar_fn, vt100_control_puts_t control_puts_fn, 142 142 vt100_flush_t flush_fn) 143 143 { 144 144 vt100_state_t *state = malloc(sizeof(vt100_state_t)); -
uspace/srv/hid/remcons/user.c
r47b2d7e3 r1433ecda 219 219 * @param c Pressed character. 220 220 */ 221 static kbd_event_t* new_kbd_event(kbd_event_type_t type, wchar_t c) { 221 static kbd_event_t *new_kbd_event(kbd_event_type_t type, wchar_t c) 222 { 222 223 kbd_event_t *event = malloc(sizeof(kbd_event_t)); 223 224 assert(event); -
uspace/srv/hid/rfb/main.c
r47b2d7e3 r1433ecda 91 91 rfb.damage_rect.height = height; 92 92 rfb.damage_valid = true; 93 } 94 else { 93 } else { 95 94 if (x0 < rfb.damage_rect.x) { 96 95 rfb.damage_rect.width += rfb.damage_rect.x - x0; -
uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
r47b2d7e3 r1433ecda 172 172 con = con | ADCCON_PRSCEN; 173 173 174 174 pio_write_32(&ts->io->con, con); 175 175 176 176 /* … … 256 256 257 257 /* Enable auto xy-conversion mode */ 258 pio_write_32(&ts->io->tsc, (pio_read_32(&ts->io->tsc) 259 & ~3) | 4); 258 pio_write_32(&ts->io->tsc, (pio_read_32(&ts->io->tsc) & ~3) | 4); 260 259 261 260 /* Start the conversion. */ 262 pio_write_32(&ts->io->con, pio_read_32(&ts->io->con) 263 | ADCCON_ENABLE_START); 261 pio_write_32(&ts->io->con, pio_read_32(&ts->io->con) | ADCCON_ENABLE_START); 264 262 } 265 263 -
uspace/srv/klog/klog.c
r47b2d7e3 r1433ecda 53 53 #define NAME "klog" 54 54 55 typedef size_t __attribute__ 55 typedef size_t __attribute__((aligned(1))) unaligned_size_t; 56 56 57 57 typedef struct { -
uspace/srv/net/inetsrv/inet_link.c
r47b2d7e3 r1433ecda 68 68 69 69 static addr128_t link_local_node_ip = 70 { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xfe, 0, 0, 0};70 { 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xfe, 0, 0, 0 }; 71 71 72 72 static void inet_link_local_node_ip(addr48_t mac_addr, -
uspace/srv/net/inetsrv/inetsrv.c
r47b2d7e3 r1433ecda 65 65 static inet_naddr_t solicited_node_mask = { 66 66 .version = ip_v6, 67 .addr6 = { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0},67 .addr6 = { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0 }, 68 68 .prefix = 104 69 69 }; … … 76 76 static inet_addr_t multicast_all_nodes = { 77 77 .version = ip_v6, 78 .addr6 = { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01}78 .addr6 = { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01 } 79 79 }; 80 80 … … 182 182 183 183 if (dgram->src.version != ip_v4 || 184 184 dgram->dest.version != ip_v4) 185 185 return EINVAL; 186 186 -
uspace/srv/net/inetsrv/ndp.c
r47b2d7e3 r1433ecda 49 49 50 50 static addr128_t solicited_node_ip = 51 { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0};51 { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0xff, 0, 0, 0 }; 52 52 53 53 /** Compute solicited node IPv6 multicast address from target IPv6 address -
uspace/srv/net/tcp/iqueue.c
r47b2d7e3 r1433ecda 110 110 link = list_first(&iqueue->list); 111 111 while (link != NULL) { 112 112 log_msg(LOG_DEFAULT, LVL_NOTE, "tcp_iqueue_remove_seg() - next"); 113 113 qe = list_get_instance(link, 114 114 tcp_iqueue_entry_t, link); … … 162 162 tcp_segment_delete(iqe->seg); 163 163 164 164 link = list_first(&iqueue->list); 165 165 if (link == NULL) { 166 166 log_msg(LOG_DEFAULT, LVL_DEBUG, "iqueue is empty"); -
uspace/srv/net/tcp/service.c
r47b2d7e3 r1433ecda 116 116 117 117 /* XXX Failed to establish connection */ 118 if (0) tcp_ev_conn_failed(cconn); 118 if (0) 119 tcp_ev_conn_failed(cconn); 119 120 } 120 121 -
uspace/srv/net/tcp/tcp.c
r47b2d7e3 r1433ecda 74 74 tcp_ncsim_fibril_start(); 75 75 76 if (0) tcp_test(); 76 if (0) 77 tcp_test(); 77 78 78 79 rc = tcp_inet_init(); -
uspace/srv/net/tcp/test.c
r47b2d7e3 r1433ecda 79 79 printf("S: User received %zu bytes '%s'.\n", rcvd, rcv_buf); 80 80 81 async_usleep(1000 *1000*2);81 async_usleep(1000 * 1000 * 2); 82 82 } 83 83 84 async_usleep(/*10**/1000 *1000);84 async_usleep(/*10**/1000 * 1000); 85 85 86 86 printf("S: User close...\n"); … … 107 107 epp.remote.port = 80; 108 108 109 async_usleep(1000 *1000*3);109 async_usleep(1000 * 1000 * 3); 110 110 printf("C: User open...\n"); 111 111 tcp_uc_open(&epp, ap_active, 0, &conn); 112 112 conn->name = (char *) "C"; 113 113 114 async_usleep(1000 *1000*10);114 async_usleep(1000 * 1000 * 10); 115 115 printf("C: User send...\n"); 116 116 tcp_uc_send(conn, (void *)msg, str_size(msg), 0); 117 117 118 async_usleep(1000 *1000*20/**20*2*/);118 async_usleep(1000 * 1000 * 20/**20*2*/); 119 119 printf("C: User close...\n"); 120 120 tcp_uc_close(conn); … … 130 130 printf("tcp_test()\n"); 131 131 132 async_usleep(1000 *1000);132 async_usleep(1000 * 1000); 133 133 134 134 if (0) { -
uspace/srv/ns/task.c
r47b2d7e3 r1433ecda 58 58 static size_t task_key_hash(void *key) 59 59 { 60 return *(task_id_t *)key;60 return *(task_id_t *)key; 61 61 } 62 62 … … 70 70 { 71 71 hashed_task_t *ht = hash_table_get_inst(item, hashed_task_t, link); 72 return ht->id == *(task_id_t *)key;72 return ht->id == *(task_id_t *)key; 73 73 } 74 74 … … 101 101 static size_t p2i_key_hash(void *key) 102 102 { 103 sysarg_t in_phone_hash = *(sysarg_t *)key;103 sysarg_t in_phone_hash = *(sysarg_t *)key; 104 104 return in_phone_hash; 105 105 } … … 113 113 static bool p2i_key_equal(void *key, const ht_link_t *item) 114 114 { 115 sysarg_t in_phone_hash = *(sysarg_t *)key;115 sysarg_t in_phone_hash = *(sysarg_t *)key; 116 116 p2i_entry_t *entry = hash_table_get_inst(item, p2i_entry_t, link); 117 117 -
uspace/srv/taskmon/taskmon.c
r47b2d7e3 r1433ecda 49 49 static bool write_core_files; 50 50 51 static void corecfg_client_conn(cap_call_handle_t 51 static void corecfg_client_conn(cap_call_handle_t, ipc_call_t *, void *); 52 52 53 53 static void fault_event(ipc_call_t *call, void *arg) -
uspace/srv/vfs/vfs.h
r47b2d7e3 r1433ecda 47 47 48 48 #ifndef dprintf 49 49 #define dprintf(...) 50 50 #endif 51 51 -
uspace/srv/vfs/vfs_file.c
r47b2d7e3 r1433ecda 185 185 } 186 186 vfs_node_delref(file->node); 187 187 } 188 188 free(file); 189 189 } -
uspace/srv/vfs/vfs_ipc.c
r47b2d7e3 r1433ecda 149 149 int outfd = 0; 150 150 rc = vfs_op_mount(mpfd, service_id, flags, instance, opts, fs_name, 151 151 &outfd); 152 152 async_answer_1(req_handle, rc, outfd); 153 153 -
uspace/srv/vfs/vfs_lookup.c
r47b2d7e3 r1433ecda 276 276 goto out; 277 277 } 278 278 if (!base->mount) { 279 279 vfs_node_put(base); 280 280 rc = ENOENT; -
uspace/srv/vfs/vfs_ops.c
r47b2d7e3 r1433ecda 265 265 266 266 rc = vfs_connect_internal(service_id, flags, instance, opts, fs_name, 267 267 &root); 268 268 if (rc == EOK && !(flags & VFS_MOUNT_CONNECT_ONLY)) { 269 269 vfs_node_addref(mp->node); … … 347 347 } 348 348 349 typedef errno_t (* 349 typedef errno_t (*rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t, 350 350 ipc_call_t *, bool, void *); 351 351 -
uspace/srv/volsrv/volsrv.c
r47b2d7e3 r1433ecda 262 262 263 263 printf("vol_part_mkfs_srv: label=%p\n", label); 264 if (label!=NULL) printf("vol_part_mkfs_srv: label='%s'\n", label); 264 if (label != NULL) 265 printf("vol_part_mkfs_srv: label='%s'\n", label); 265 266 266 267 rc = vol_part_find_by_id(sid, &part);
Note:
See TracChangeset
for help on using the changeset viewer.