Changeset 0511549 in mainline for uspace/app/devctl/devctl.c
- Timestamp:
- 2013-09-10T23:11:34Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- de3d15b4
- Parents:
- 5df1963
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/devctl/devctl.c
r5df1963 r0511549 159 159 } 160 160 161 static int drv_list(void) 162 { 163 devman_handle_t *drvs; 164 size_t ndrvs; 165 size_t i; 166 int rc; 167 168 rc = devman_get_drivers(&drvs, &ndrvs); 169 if (rc != EOK) 170 return rc; 171 172 printf("Got %d handles\n", ndrvs); 173 for (i = 0; i < ndrvs; i++) { 174 rc = devman_driver_get_name(drvs[i], drv_name, MAX_NAME_LENGTH); 175 if (rc != EOK) 176 continue; 177 printf("%3d %s\n", (int)drvs[i], drv_name); 178 } 179 free(drvs); 180 181 return EOK; 182 } 183 161 184 static void print_syntax(void) 162 185 { 163 printf("syntax: devctl [(online|offline) <function>]\n"); 186 printf("syntax:\n"); 187 printf("\tdevctl\n"); 188 printf("\tdevctl online <function>]\n"); 189 printf("\tdevctl offline <function>]\n"); 190 printf("\tdevctl list-drv\n"); 164 191 } 165 192 … … 194 221 return 2; 195 222 } 223 } else if (str_cmp(argv[1], "list-drv") == 0) { 224 rc = drv_list(); 225 if (rc != EOK) 226 return 2; 196 227 } else { 197 228 printf(NAME ": Invalid argument '%s'.\n", argv[1]);
Note:
See TracChangeset
for help on using the changeset viewer.