From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Mglnn-0005HL-Dh for garchives@archives.gentoo.org; Thu, 27 Aug 2009 20:42:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EA7DDE0845; Fri, 28 Aug 2009 01:51:46 +0000 (UTC) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.211.181]) by pigeon.gentoo.org (Postfix) with ESMTP id CACAEE0845 for ; Fri, 28 Aug 2009 01:51:46 +0000 (UTC) Received: by ywh11 with SMTP id 11so3066680ywh.16 for ; Thu, 27 Aug 2009 18:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Tvr9P8z9Ls3APwrza3kq2BbpuNayA0NecJ2C/WQnhkI=; b=VhJ9exNpjpVLKvoGln/KAfO5DWs8EQRCTCGCahPYEn9uaiUVn2lHquudaVXFsN23Hh ln9WWwdxbJ2L7uoYV8EnDjnpiDYJ5jSFQ2NOEfkrhub/jCUocvAlNnShalpDOwXE27pV t+anXXSHFWso2KEaCTrlzSjk9oik9ngTshr7k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=aBlqBKW0JJNn94L54KODvMW5H7u23qL8UJWWdH8VtKChiaOnFV10pb8OFHlvkuIR1k e1jM7jytpLVe2C5l5CTTIOUB3UOxrylfM7tbtG5gb8FjlF9M3iuMLnD/0rTtGARby81H H0JVSQb0YxWSbSilGELjEMSQqpA3Sh85RDNBQ= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.91.178.19 with SMTP id f19mr456881agp.33.1251424306414; Thu, 27 Aug 2009 18:51:46 -0700 (PDT) In-Reply-To: <4A965962.7070402@konstantinhansen.de> References: <4A965962.7070402@konstantinhansen.de> Date: Fri, 28 Aug 2009 09:51:46 +0800 Message-ID: Subject: Re: [gentoo-user] How to set udev rule? From: Song Zhiwei To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 X-Archives-Salt: 321bf068-f4cd-44c0-9d6f-5549e905b0f8 X-Archives-Hash: 0cdf3e42290d4dab864e24ea7f8d219d Actually, I have read the guilds and tried, but it didnot work. So I asked here. Two devices related with "can usb" were found when I used the udevadm: #udevadm info -a -p /sys/devices/pci0000\:00/0000\:00\:0f.4/usb2/2- 2/2-2\:1.0 looking at device '/devices/pci0000:00/0000:00:0f.4/usb2/2-2/2-2:1.0': KERNEL=="2-2:1.0" SUBSYSTEM=="usb" DRIVER=="CAN_USB331" ATTR{bInterfaceNumber}=="00" ATTR{bAlternateSetting}==" 0" ATTR{bNumEndpoints}=="04" ATTR{bInterfaceClass}=="00" ATTR{bInterfaceSubClass}=="00" ATTR{bInterfaceProtocol}=="00" ATTR{modalias}=="usb:v0AB4p0001d0002dc00dsc00dp00ic00isc00ip00" looking at parent device '/devices/pci0000:00/0000:00:0f.4/usb2/2-2': KERNELS=="2-2" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{configuration}=="" ATTRS{bNumInterfaces}==" 1" ATTRS{bConfigurationValue}=="1" ATTRS{bmAttributes}=="80" ATTRS{bMaxPower}=="500mA" ATTRS{urbnum}=="20" ATTRS{idVendor}=="0ab4" ATTRS{idProduct}=="0001" ATTRS{bcdDevice}=="0002" ATTRS{bDeviceClass}=="00" ATTRS{bDeviceSubClass}=="00" ATTRS{bDeviceProtocol}=="00" ATTRS{bNumConfigurations}=="1" ATTRS{bMaxPacketSize0}=="16" ATTRS{speed}=="12" ATTRS{busnum}=="2" ATTRS{devnum}=="2" ATTRS{version}==" 1.00" ATTRS{maxchild}=="0" ATTRS{quirks}=="0x0" ATTRS{authorized}=="1" ATTRS{manufacturer}=="esd-gmbh" ATTRS{product}=="CAN-USB 543" ATTRS{serial}=="GD001494" The module was loaded by an alias in /etc/modules.d/esdcan: alias char-major-50 esdcan-usb331 But I cannot find the major:minor informations in the udev info above. I tried the rules: SUBSYSTEM=="usb", DRIVER=="CAN_USB331", ATTR{serial}=="GD001494", NAME="can0" SUBSYSTEM=="usb", DRIVER=="CAN_USB331", NAME="can0" DRIVER=="CAN_USB331", NAME="can0" and SUBSYSTEM=="usb", ATTR{serial}=="GD001494", NAME="can%n" But any one of them does not work. Anyone can help me? 2009/8/27 KH : > Song Zhiwei schrieb: >> Hi all, >> >> I complied a driver esdcan_usb331.so. I'd like use udev to create >> character devices /dev/can0 and /dev/can1 with major 50 and minor 0/1 >> for the driver. How to write the udev rule for it? >> >> The dmesg is: >> esd CAN driver: CAN_USB331 >> esd CAN driver: baudrate not set >> esd CAN driver: mode = 0x00000000, major = 50, verbose = 0x00000001 >> esd CAN driver: version 3.8.3 06:03:32 Aug 24 2009: successfully loaded >> usbcore: registered new interface driver CAN_USB331 >> > > Hi, > > there are two good guides for this: > > http://www.gentoo.org/doc/en/udev-guide.xml > http://www.reactivated.net/writing_udev_rules.html > > Regards kh > >