Changeset 122 for trunk/src/os2ahci/os2ahci.c
- Timestamp:
- Sep 1, 2011, 1:32:43 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/os2ahci.c
r121 r122 33 33 34 34 /* parse integer command line parameter */ 35 #define drv_parm_int(s, value, type, radix) \36 { \37 char _far *_ep; \38 if ((s)[1] != ':') { \39 cprintf(" missing colon (:) after /%c\n", *(s));\40 goto init_fail; \41 } \42 value = (type) strtol((s) + 2, \43 (const char _far* _far*) &_ep, \44 radix); \45 s = _ep; \35 #define drv_parm_int(s, value, type, radix) \ 36 { \ 37 char _far *_ep; \ 38 if ((s)[1] != ':') { \ 39 cprintf("%s: missing colon (:) after /%c\n", drv_name, *(s)); \ 40 goto init_fail; \ 41 } \ 42 value = (type) strtol((s) + 2, \ 43 (const char _far* _far*) &_ep, \ 44 radix); \ 45 s = _ep; \ 46 46 } 47 47 … … 73 73 int thorough_scan = 1; /* if != 0, perform thorough PCI scan */ 74 74 int init_reset; /* if != 0, reset ports during init */ 75 int verbosity; /* if > 0, show some info during boot */ 75 int verbosity = 1; /* == 1 -> show sign on banner 76 * > 1 -> show adapter info during boot */ 76 77 77 78 PFN Device_Help = 0; /* pointer to device helper entry point */ … … 83 84 USHORT add_handle; /* driver handle (RegisterDeviceClass) */ 84 85 UCHAR timer_pool[TIMER_POOL_SIZE]; /* timer pool */ 86 char drv_name[] = "OS2AHCI"; /* driver name as string */ 85 87 86 88 /* resource manager driver information structure */ 87 89 DRIVERSTRUCT rm_drvinfo = { 88 "OS2AHCI",/* driver name */90 drv_name, /* driver name */ 89 91 "AHCI SATA Driver", /* driver description */ 90 92 "GNU", /* vendor name */ … … 112 114 u8 track_size[MAX_AD][AHCI_MAX_PORTS]; 113 115 114 static char init_msg[] = " OS2AHCIdriver version %d.%02d\n";115 static char exit_msg[] = " OS2AHCIdriver *not* installed\n";116 static char init_msg[] = "%s driver version %d.%02d\n"; 117 static char exit_msg[] = "%s driver *not* installed\n"; 116 118 117 119 /* ----------------------------- start of code ----------------------------- */ … … 179 181 init_libc(); 180 182 181 /* print initialization message */182 cprintf(init_msg, VERSION / 100, VERSION % 100);183 184 #ifdef ECS_BUILD185 cprintf("This driver is licensed for use only in conjunction with eComStation.");186 #endif187 188 183 /* register driver with resource manager */ 189 184 if ((rmrc = RMCreateDriver(&rm_drvinfo, &rm_drvh)) != RMRC_SUCCESS) { 190 cprintf("failed to register driver with resource manager (rc = %d)\n", rmrc); 185 cprintf("%s: failed to register driver with resource manager (rc = %d)\n", 186 drv_name, rmrc); 191 187 goto init_fail; 192 188 } … … 205 201 case '\0': 206 202 /* end of command line; can only happen if command line is incorrect */ 207 cprintf(" incomplete command line option\n");203 cprintf("%s: incomplete command line option\n", drv_name); 208 204 goto init_fail; 209 205 … … 223 219 drv_parm_int(s, device, u16, 16); 224 220 if (add_pci_id(vendor, device)) { 225 cprintf(" failed to add PCI ID %04x:%04x\n", vendor, device);221 cprintf("%s: failed to add PCI ID %04x:%04x\n", drv_name, vendor, device); 226 222 goto init_fail; 227 223 } … … 243 239 drv_parm_int(s, adapter_index, int, 10); 244 240 if (adapter_index < 0 || adapter_index >= MAX_AD) { 245 cprintf(" invalid adapter index (%d)\n", adapter_index);241 cprintf("%s: invalid adapter index (%d)\n", drv_name, adapter_index); 246 242 goto init_fail; 247 243 } … … 252 248 drv_parm_int(s, port_index, int, 10); 253 249 if (port_index < 0 || port_index >= AHCI_MAX_PORTS) { 254 cprintf(" invalid port index (%d)\n", port_index);250 cprintf("%s: invalid port index (%d)\n", drv_name, port_index); 255 251 goto init_fail; 256 252 } … … 289 285 break; 290 286 default: 291 cprintf(" invalid link parameter (%c)\n", *s);287 cprintf("%s: invalid link parameter (%c)\n", drv_name, *s); 292 288 goto init_fail; 293 289 } … … 308 304 break; 309 305 306 case 'q': 307 /* be quiet */ 308 verbosity = -1000; 309 break; 310 310 311 default: 311 cprintf(" unknown option: /%c\n", *s);312 cprintf("%s: unknown option: /%c\n", drv_name, *s); 312 313 goto init_fail; 313 314 } 314 315 } 315 316 } 317 318 /* print initialization message */ 319 cvprintf(init_msg, drv_name, VERSION / 100, VERSION % 100); 320 321 #ifdef ECS_BUILD 322 cvprintf("This driver is licensed for use only in conjunction with eComStation."); 323 #endif 316 324 317 325 if (debug) { … … 334 342 mdelay_cal(); 335 343 336 if (DevHelp_RegisterDeviceClass( "OS2AHCI", (PFN) add_entry, 0, 1,344 if (DevHelp_RegisterDeviceClass(drv_name, (PFN) add_entry, 0, 1, 337 345 &add_handle)) { 338 cprintf(" error: couldn't register device class\n");346 cprintf("%s: couldn't register device class\n", drv_name); 339 347 goto init_fail; 340 348 } … … 344 352 DevHelp_AllocateCtxHook(mk_NPFN(reset_hook), &reset_ctxhook_h) != 0 || 345 353 DevHelp_AllocateCtxHook(mk_NPFN(engine_hook), &engine_ctxhook_h)) { 346 cprintf(" failed to allocate task-time context hooks\n");354 cprintf("%s: failed to allocate task-time context hooks\n", drv_name); 347 355 goto init_fail; 348 356 } … … 354 362 } else { 355 363 /* no adapters found */ 356 c printf(" No adapters found.\n");364 cvprintf(" No adapters found.\n"); 357 365 } 358 366 … … 372 380 } 373 381 374 c printf(exit_msg);382 cvprintf(exit_msg, drv_name); 375 383 return(STDON | ERROR_I24_QUIET_INIT_FAIL); 376 384 }
Note:
See TracChangeset
for help on using the changeset viewer.