lkml.org 
[lkml]   [2002]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 2.5.14 IDE 56
On Wed May 08, 2002 at 01:18:47PM +0100, Alan Cox wrote:
> I can't speak directly for the Kudzu maintainer but I can say that having
> a sane way to obtain the list of ide devices (all of them not just non
> pcmcia) and the device bindings/type has been a long standing request.

Can't one simply do something like:

char device_string[20];
int i, type, major=0, minor=0;
for(i=0; i<26; i++) {
snprintf(device_string, sizeof(device_string), "/dev/hd%c", 'a'+i);
if ((fd=open(device_string, O_RDONLY | O_NONBLOCK)) < 0) {
continue;
}
switch ('a'+i) {
case 'a':
major=3;minor=0;
break;
case 'b':
major=3;minor=64;
break;
case 'c':
major=22;minor=0;
break;
case 'd':
major=22;minor=64;
break;
.....
}

etc.... to detect the available ide devices without groveling
through /proc/ide?

-Erik

--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.214 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site