Matching USB modems on serial.port

Adrian Cox adrian at humboldt.co.uk
Thu Jan 29 04:12:21 PST 2009


----- "Danny Kukawka" <danny.kukawka at web.de> wrote:
> On Donnerstag, 29. Januar 2009, Adrian Cox wrote:
> > I'm working on HAL support for an unreleased 3G modem. I've noticed
> that a
> > lot of the USB modems in 10-modem.fdi match against the
> "serial.port" key,

[...]

> Depends on the machine. If there are more than one device where 
> @info.parent:usb.interface.number == 4 , you need a way to differ
> between 
> them. The serial.port key is then may a way.

I'm also matching on the parent device and vendor id above this level. Would device, vendor, and interface number be sufficient? The (redacted) fdi file is here:

<deviceinfo version="0.2">
  <device>
    <match key="info.category" string="serial">
     <match key="@info.parent:usb.vendor_id" int="0xXXXX">
        <match key="@info.parent:usb.product_id" int="0xXXXX">
	    <!-- Port 0 is the main modem port -->
            <match key="@info.parent:usb.interface.number" int="1">
              <append key="modem.command_sets" type="strlist">GSM-07.07</append>
              <append key="modem.command_sets" type="strlist">GSM-07.05</append>
            </match>
	    <!-- Hide these ports from the Ubuntu Intrepid NetworkManager -->
            <match key="@info.parent:usb.interface.number" int="3">
	      <merge key="modem.command_sets" type="strlist"></merge>
            </match>
            <match key="@info.parent:usb.interface.number" int="5">
	      <merge key="modem.command_sets" type="strlist"></merge>
            </match>
            <match key="@info.parent:usb.interface.number" int="7">
	      <merge key="modem.command_sets" type="strlist"></merge>
            </match>
        </match>
      </match>
   </match>
  </device>
</deviceinfo>


> > My testing indicates that the "serial.port" key changes  
> > depending on the plugging order, and what other devices are
> attached. 

[...]

> For /dev/ttyUSB* serial.port is now the real port of the device
> itself. (check 
> http://cgit.freedesktop.org/hal/commit/?id=b09774739efe4215aa03e7812bca8a50be65e2c1)

I hadn't spotted that before. 

> Maybe we have to change it also for ttyACM devices. Can you send the
> full 
> lshal output from your machine with the device attached to the
> machine.

It would make serial.port more useful - but I'd be happy to refer entirely to USB properties to get an exact match.

I'll have to hold off on the lshal output for now - I need to remove a few company details first.

-- 
Adrian Cox <adrian at humboldt.co.uk>



More information about the hal mailing list