Changeset 94e46c9 in mainline for uspace/lib
- Timestamp:
- 2015-05-23T04:09:11Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b5143bd
- Parents:
- a25d893 (diff), 0683992 (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/lib
- Files:
-
- 18 added
- 13 edited
-
c/generic/dhcp.c (modified) (1 diff)
-
c/generic/irq.c (modified) (2 diffs)
-
c/include/ieee80211/ieee80211.h (added)
-
c/include/inet/dhcp.h (modified) (1 diff)
-
c/include/ipc/dev_iface.h (modified) (1 diff)
-
c/include/ipc/dhcp.h (modified) (1 diff)
-
crypto/Makefile (added)
-
crypto/aes.c (added)
-
crypto/crypto.c (added)
-
crypto/crypto.h (added)
-
crypto/rc4.c (added)
-
drv/Makefile (modified) (1 diff)
-
drv/generic/dev_iface.c (modified) (2 diffs)
-
drv/generic/interrupt.c (modified) (1 diff)
-
drv/generic/private/remote_ieee80211.h (added)
-
drv/generic/remote_ieee80211.c (added)
-
drv/include/ieee80211_iface.h (added)
-
drv/include/ops/ieee80211.h (added)
-
ext4/libext4_directory.c (modified) (1 diff)
-
ext4/libext4_extent.c (modified) (1 diff)
-
ext4/libext4_filesystem.c (modified) (3 diffs)
-
ext4/libext4_superblock.c (modified) (1 diff)
-
ext4/libext4_superblock.h (modified) (1 diff)
-
ieee80211/Makefile (added)
-
ieee80211/include/ieee80211.h (added)
-
ieee80211/include/ieee80211_iface_impl.h (added)
-
ieee80211/include/ieee80211_impl.h (added)
-
ieee80211/include/ieee80211_private.h (added)
-
ieee80211/src/ieee80211.c (added)
-
ieee80211/src/ieee80211_iface_impl.c (added)
-
ieee80211/src/ieee80211_impl.c (added)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/dhcp.c
ra25d893 r94e46c9 84 84 } 85 85 86 int dhcp_discover(sysarg_t link_id) 87 { 88 async_exch_t *exch = async_exchange_begin(dhcp_sess); 89 90 int rc = async_req_1_0(exch, DHCP_DISCOVER, link_id); 91 async_exchange_end(exch); 92 93 return rc; 94 } 95 86 96 /** @} 87 97 */ -
uspace/lib/c/generic/irq.c
ra25d893 r94e46c9 35 35 #include <ipc/irq.h> 36 36 #include <libc.h> 37 #include <stdlib.h> 38 #include <macros.h> 39 40 static irq_cmd_t default_cmds[] = { 41 { 42 .cmd = CMD_ACCEPT 43 } 44 }; 45 46 static const irq_code_t default_ucode = { 47 0, 48 NULL, 49 ARRAY_SIZE(default_cmds), 50 default_cmds 51 }; 37 52 38 53 /** Subscribe to IRQ notification. … … 49 64 const irq_code_t *ucode) 50 65 { 66 if (ucode == NULL) 67 ucode = &default_ucode; 68 51 69 return __SYSCALL4(SYS_IPC_IRQ_SUBSCRIBE, inr, devno, method, 52 70 (sysarg_t) ucode); -
uspace/lib/c/include/inet/dhcp.h
ra25d893 r94e46c9 41 41 extern int dhcp_link_add(sysarg_t); 42 42 extern int dhcp_link_remove(sysarg_t); 43 extern int dhcp_discover(sysarg_t); 43 44 44 45 #endif -
uspace/lib/c/include/ipc/dev_iface.h
ra25d893 r94e46c9 48 48 /** Network interface controller interface */ 49 49 NIC_DEV_IFACE, 50 51 /** IEEE 802.11 interface controller interface */ 52 IEEE80211_DEV_IFACE, 50 53 51 54 /** Interface provided by any PCI device. */ -
uspace/lib/c/include/ipc/dhcp.h
ra25d893 r94e46c9 41 41 typedef enum { 42 42 DHCP_LINK_ADD = IPC_FIRST_USER_METHOD, 43 DHCP_LINK_REMOVE 43 DHCP_LINK_REMOVE, 44 DHCP_DISCOVER 44 45 } dhcp_request_t; 45 46 -
uspace/lib/drv/Makefile
ra25d893 r94e46c9 48 48 generic/remote_char_dev.c \ 49 49 generic/remote_nic.c \ 50 generic/remote_ieee80211.c \ 50 51 generic/remote_usb.c \ 51 52 generic/remote_pci.c \ -
uspace/lib/drv/generic/dev_iface.c
ra25d893 r94e46c9 46 46 #include "remote_battery_dev.h" 47 47 #include "remote_nic.h" 48 #include "remote_ieee80211.h" 48 49 #include "remote_usb.h" 49 50 #include "remote_usbhc.h" … … 62 63 [CHAR_DEV_IFACE] = &remote_char_dev_iface, 63 64 [NIC_DEV_IFACE] = &remote_nic_iface, 65 [IEEE80211_DEV_IFACE] = &remote_ieee80211_iface, 64 66 [PCI_DEV_IFACE] = &remote_pci_iface, 65 67 [USB_DEV_IFACE] = &remote_usb_iface, -
uspace/lib/drv/generic/interrupt.c
ra25d893 r94e46c9 44 44 #include "private/driver.h" 45 45 46 static irq_cmd_t default_cmds[] = {47 {48 .cmd = CMD_ACCEPT49 }50 };51 52 static const irq_code_t default_pseudocode = {53 0,54 NULL,55 ARRAY_SIZE(default_cmds),56 default_cmds57 };58 59 46 int register_interrupt_handler(ddf_dev_t *dev, int irq, 60 47 interrupt_handler_t *handler, const irq_code_t *pseudocode) -
uspace/lib/ext4/libext4_directory.c
ra25d893 r94e46c9 390 390 (ext4_inode_has_flag(parent->inode, EXT4_INODE_FLAG_INDEX))) { 391 391 int rc = ext4_directory_dx_add_entry(parent, child, name); 392 392 393 393 /* Check if index is not corrupted */ 394 if (rc != EXT4_ERR_BAD_DX_DIR) { 395 if (rc != EOK) 396 return rc; 397 398 return EOK; 399 } 400 394 if (rc != EXT4_ERR_BAD_DX_DIR) 395 return rc; 396 401 397 /* Needed to clear dir index flag if corrupted */ 402 398 ext4_inode_clear_flag(parent->inode, EXT4_INODE_FLAG_INDEX); -
uspace/lib/ext4/libext4_extent.c
ra25d893 r94e46c9 797 797 if (rc != EOK) { 798 798 ext4_balloc_free_block(inode_ref, fblock); 799 block_put(block); 799 800 return rc; 800 801 } -
uspace/lib/ext4/libext4_filesystem.c
ra25d893 r94e46c9 53 53 enum cache_mode cmode) 54 54 { 55 ext4_superblock_t *temp_superblock = NULL; 56 55 57 fs->device = service_id; 56 58 57 59 /* Initialize block library (4096 is size of communication channel) */ 58 60 int rc = block_init(EXCHANGE_SERIALIZE, fs->device, 4096); 59 61 if (rc != EOK) 60 return rc;61 62 goto err; 63 62 64 /* Read superblock from device to memory */ 63 ext4_superblock_t *temp_superblock;64 65 rc = ext4_superblock_read_direct(fs->device, &temp_superblock); 65 if (rc != EOK) { 66 block_fini(fs->device); 67 return rc; 68 } 69 66 if (rc != EOK) 67 goto err_1; 68 70 69 /* Read block size from superblock and check */ 71 70 uint32_t block_size = ext4_superblock_get_block_size(temp_superblock); 72 71 if (block_size > EXT4_MAX_BLOCK_SIZE) { 73 block_fini(fs->device);74 return ENOTSUP;75 } 76 72 rc = ENOTSUP; 73 goto err_1; 74 } 75 77 76 /* Initialize block caching by libblock */ 78 77 rc = block_cache_init(service_id, block_size, 0, cmode); 79 if (rc != EOK) { 80 block_fini(fs->device); 81 return rc; 82 } 83 78 if (rc != EOK) 79 goto err_1; 80 84 81 /* Compute limits for indirect block levels */ 85 82 uint32_t block_ids_per_block = block_size / sizeof(uint32_t); … … 92 89 fs->inode_blocks_per_level[i]; 93 90 } 94 91 95 92 /* Return loaded superblock */ 96 93 fs->superblock = temp_superblock; 97 94 98 95 uint16_t state = ext4_superblock_get_state(fs->superblock); 99 96 100 97 if (((state & EXT4_SUPERBLOCK_STATE_VALID_FS) != 101 98 EXT4_SUPERBLOCK_STATE_VALID_FS) || 102 99 ((state & EXT4_SUPERBLOCK_STATE_ERROR_FS) == 103 100 EXT4_SUPERBLOCK_STATE_ERROR_FS)) { 104 block_cache_fini(fs->device); 105 block_fini(fs->device); 106 return ENOTSUP; 107 } 108 101 rc = ENOTSUP; 102 goto err_2; 103 } 104 109 105 /* Mark system as mounted */ 110 106 ext4_superblock_set_state(fs->superblock, EXT4_SUPERBLOCK_STATE_ERROR_FS); 111 107 rc = ext4_superblock_write_direct(fs->device, fs->superblock); 112 if (rc != EOK) { 113 block_cache_fini(fs->device); 114 block_fini(fs->device); 115 return rc; 116 } 117 108 if (rc != EOK) 109 goto err_2; 110 118 111 uint16_t mnt_count = ext4_superblock_get_mount_count(fs->superblock); 119 112 ext4_superblock_set_mount_count(fs->superblock, mnt_count + 1); 120 113 121 114 return EOK; 115 116 err_2: 117 block_cache_fini(fs->device); 118 err_1: 119 block_fini(fs->device); 120 err: 121 if (temp_superblock) 122 ext4_superblock_release(temp_superblock); 123 return rc; 122 124 } 123 125 … … 845 847 846 848 rc = block_put(subblock); 847 if (rc != EOK) 849 if (rc != EOK) { 850 block_put(block); 848 851 return rc; 852 } 849 853 } 850 854 -
uspace/lib/ext4/libext4_superblock.c
ra25d893 r94e46c9 1178 1178 } 1179 1179 1180 /** Release the memory allocated for the superblock structure 1181 * 1182 * @param sb Superblock to be freed 1183 * 1184 */ 1185 void ext4_superblock_release(ext4_superblock_t *sb) 1186 { 1187 free(sb); 1188 } 1189 1180 1190 /** Check sanity of the superblock. 1181 1191 * -
uspace/lib/ext4/libext4_superblock.h
ra25d893 r94e46c9 145 145 extern int ext4_superblock_read_direct(service_id_t, ext4_superblock_t **); 146 146 extern int ext4_superblock_write_direct(service_id_t, ext4_superblock_t *); 147 extern void ext4_superblock_release(ext4_superblock_t *); 147 148 extern int ext4_superblock_check_sanity(ext4_superblock_t *); 148 149
Note:
See TracChangeset
for help on using the changeset viewer.
