lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed, 28 Sep 2011 11:14:11 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Sudarshan Jagadale <snjagadale@...il.com>
cc:	linux-pci@...r.kernel.org, <linux-kernel@...r.kernel.org>,
	<linux-hotplug@...r.kernel.org>, <linux-usb@...r.kernel.org>,
	Kay Sievers <kay.sievers@...y.org>
Subject: Re: hot plug stable pci name or active pci name detection from /sys
 file system

On Tue, 27 Sep 2011, Sudarshan Jagadale wrote:

> Hi ,
> 
> I want to create "dev->bus->bus_name" without using usb.h file/writting
> kenel module. is there any way to do this or read the active pci name from
> /sys/ diectory on linux os?
> 
> i need to generate the bus info field as follows created by usb_make_path().
> 
> please help to resolve this?

There's probably a way to do it using libudev, but I don't know 
anything about it.

Another way to do it is to read the "serial" file in the sysfs 
directory for the device's root hub.  For example, suppose your USB 
device has a sysfs name like 7-1.2.  The bus number is the part before 
the '-' character, in this example, 7.  Then the file you should read 
would be /sys/bus/usb/devices/usb7/serial.  Replace the '7' with the 
appropriate bus number for whatever device you're working on.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ