2 * Copyright (c) 1999-2002 by The XFree86 Project, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
22 * Except as contained in this notice, the name of the copyright holder(s)
23 * and author(s) shall not be used in advertising or otherwise to promote
24 * the sale, use or other dealings in this Software without prior written
25 * authorization from the copyright holder(s) and author(s).
29 * Finish setting up the server.
30 * Call the functions from the scanpci module.
33 #ifdef HAVE_XORG_CONFIG_H
34 #include <xorg-config.h>
42 #include "loaderProcs.h"
46 #include "xf86ScanPci.h"
49 void DoScanPci(int argc
, char **argv
, int i
)
51 int j
,skip
,globalVerbose
,scanpciVerbose
;
52 ScanPciSetupProcPtr PciSetup
;
53 ScanPciDisplayCardInfoProcPtr DisplayPCICardInfo
;
57 * first we need to finish setup of the OS so that we can call other
58 * functions in the server
63 * The old verbosity processing that was here isn't useful anymore, but
64 * for compatibility purposes, ignore verbosity changes after the -scanpci
67 globalVerbose
= xf86Verbose
;
70 * next we process the arguments that are remaining on the command line,
71 * so that things like the module path can be set there
73 for ( j
= i
+1; j
< argc
; j
++ ) {
74 if ((skip
= ddxProcessArgument(argc
, argv
, j
)))
79 * Was the verbosity level increased? If so, set it back.
81 if (xf86Verbose
> globalVerbose
)
82 xf86SetVerbosity(globalVerbose
);
85 * Setting scanpciVerbose to 0 will ensure that the output will go to
86 * stderr for all reasonable default stderr verbosity levels.
91 * now get the loader set up and load the scanpci module
93 /* Initialise the loader */
95 /* Tell the loader the default module search path */
96 LoaderSetPath(xf86ModulePath
);
98 if (!LoadModule("scanpci", NULL
, NULL
, NULL
, NULL
, NULL
,
100 LoaderErrorMsg(NULL
, "scanpci", errmaj
, errmin
);
103 PciSetup
= (ScanPciSetupProcPtr
)LoaderSymbol("ScanPciSetupPciIds");
105 (ScanPciDisplayCardInfoProcPtr
)LoaderSymbol("ScanPciDisplayPCICardInfo");
108 FatalError("ScanPciSetupPciIds() failed\n");
109 (*DisplayPCICardInfo
)(scanpciVerbose
);
112 * That's it; we really should clean things up, but a simple
113 * exit seems to be all we need.