From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Farmer, John" Newsgroups: gmane.os.tru64.managers Subject: C programming language / query for hardware attributes question. Date: Mon, 11 Apr 2005 10:48:45 -0400 Message-ID: <6C774F36DDBFE34C8D3DC8DA8313F5BC2A5A8B@tanorw-ex01.thcg.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1113230864 17609 80.91.229.2 (11 Apr 2005 14:47:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Apr 2005 14:47:44 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Mon Apr 11 16:47:41 2005 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by ciao.gmane.org with smtp (Exim 4.43) id 1DL0BP-0001ii-CB for gotm-tru64-unix-managers@gmane.org; Mon, 11 Apr 2005 16:46:35 +0200 Original-Received: (qmail 4355 invoked by uid 5); 11 Apr 2005 14:49:19 -0000 Original-Sender: tru64-unix-managers-owner@ornl.gov Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 4340 invoked by uid 49501); 11 Apr 2005 14:49:18 -0000 Original-Received: from John.Farmer@TycoHealthcare.com by sws1 by uid 49491 with qmail-scanner-1.21 (clamdscan: 0.70-rc. iscan: v3.1/v5.600-1011/847/50540. spamassassin: 2.63. Clear:RC:0(160.91.4.119):SA:0(-2.6/5.0):. Processed in 0.704396 secs); 11 Apr 2005 14:49:18 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 11 Apr 2005 14:49:18 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0IES00K86EI3MA@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT Tru64-UNIX-Managers@ornl.gov) ; Mon, 11 Apr 2005 10:49:16 -0400 (EDT) Original-Received: from VIRUSCAN-DAEMON.emroute1.cind.ornl.gov by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) id <0IES00H02EHIXW@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT Tru64-UNIX-Managers@ornl.gov) ; Mon, 11 Apr 2005 10:49:01 -0400 (EDT) Original-Received: from mail01.tycohealthcare.com (mail01.tycohealthcare.com [216.75.208.55]) by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0IES00AI3EHAZF@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT Tru64-UNIX-Managers@ornl.gov) ; Mon, 11 Apr 2005 10:48:49 -0400 (EDT) Original-Received: from nasmtp01.thcg.net ([10.0.201.21]) by mail01.tycohealthcare.com with Microsoft SMTPSVC(6.0.3790.211); Mon, 11 Apr 2005 10:48:43 -0400 Original-Received: by nasmtp01.thcg.net with Internet Mail Service (5.5.2658.27) id <2VG8VZ4H>; Mon, 11 Apr 2005 10:48:45 -0400 Content-return: allowed Original-To: Tru64-UNIX-Managers@ornl.gov X-Mailer: Internet Mail Service (5.5.2658.27) X-Envelope-From: X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on email.cind.ornl.gov X-Spam-Level: X-OriginalArrivalTime: 11 Apr 2005 14:48:43.0671 (UTC) FILETIME=[8ED3FA70:01C53EA5] Xref: news.gmane.org gmane.os.tru64.managers:8201 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:8201 Tru64 5.1A and/or 5.1B. # hwmgr -view devices -cat disk HWID: Device Name Mfg Model Location ---------------------------------------------------------------------------- -- 123: /dev/disk/dsk1c COMPAQ HSV110 (C)COMPAQ IDENTIFIER=11 # hwmgr -get attributes -a dev_base_name=dsk1 -a phys_location 123: dev_base_name = dsk1 phys_location = IDENTIFIER=11 Above are two samples of the use of the hwmgr utility to query a system to determine the 'location' (i.e. IDENTIFIER=11) associated with a specific device base name. I am currently writing a program in 'C' for which I need a function which will programmatically obtain the above information. Loose Pseudo-code example of what I am looking for: struct hw_structure_definition *a a=some_routine_to_query_system_for_hw_info("dsk1") printf("%s\n",a->phys_location) Please note the above is pseudo-code - the text does not represent actual structure names, variable names or function names. I suspect that the functions I need are in existence but not documented in the normal man pages (perhaps in the "Writing Device Drivers" manual?? which I do not have a copy of for 5.1x stream) Over the phone HP support has indicated that they think it is going to involve some combination of the use of the table() function and the ioctl() function. They are getting back to me on the specifics and I am diligently reading through the man pages and querying my friends on tru64 managers list in the meanwhile. Searching around the /usr/include/io/cam directory I found some interesting function names that might relate to what I am looking for but without an associated man page I cannot be sure. Example: cam3.h xpt_get_phys_attribute(). If anyone knows a function/routine and its associated calling standard that would achieve the above I would be very appreciative. John Farmer, Senior Systems Programmer Tyco Healthcare/US Surgical 150 Glover Ave Norwalk, CT 06856