Re: Is extra USB event possible in FreeBSD 8?

From: Sagara Wijetunga <sagara_at_tomahawk.com.sg>
Date: Fri, 17 Jul 2009 16:55:56 +0800
Hans Petter Selasky writes: 

>> Hi FreeBSD community 
>>
>> In case if my earlier post was not clear, here are bit more detail to
>> explain my question. 
>>
>> We want to catch device creation USB events at the devd and take actions as
>> specified in following devd rules: 
>>
>> attach 200 {
>> 	match "vendor"  "0x0718";
>>         match "product" "0x0081";
>>         match "sernum"  "14925B00";
>>         device-name     "da[0-9]+";
>> 	action "action $device-name otherparams";
>> };
> 
> It is not USB that creates /dev/daXXX. This is done by the CAM layer and its 
> subsystems. Also the CAM layer does not have any place to supply such 
> information. What we could possibly do is to fake a SCSI command providing the 
> CAM layer with the required information. 
> 
> Else, are you aware about disk-labels, to uniquely identify disks? 
> 

Hi Hans Petter 

Thank you very much for your prompt reply. 

Regarding "disk-labels", is it "label:" tag you specify for bsdlabel with -A 
option? 

If it is, this option is out. Almost all of the USB mass storage devices, 
eg. USB flash disks, cameras, audio players, etc. are already formatted. We 
cannot ask users to format first (ie. in FreeBSD terms create disk lables, 
create files systems, etc) before use as it make no sense at all. Eg. One 
buy a camera at the airport, take photos on a tour, after the tour wants to 
transfer photos to the computer. Now its too late to create labels. 

Therefore, your first option sounds interesting. I'm not sure is it the 
correct way forward. As you are the USB expert, could you recommend the 
correct solution? 

Best regards
Sagara
Received on Fri Jul 17 2009 - 10:14:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:52 UTC