From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Borzenkov Date: Wed, 06 Aug 2003 19:32:23 +0000 Subject: Re: [PATCH] usb.agent - fix interpretation of hex values (PRODUCT and sysfs) MIME-Version: 1 Content-Type: multipart/mixed; boundary="Boundary-00=_HfVM/mwYhzzsvoU" Message-Id: List-Id: References: In-Reply-To: To: linux-hotplug@vger.kernel.org --Boundary-00=_HfVM/mwYhzzsvoU Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 06 August 2003 23:09, Andrey Borzenkov wrote: > Both PRODUCT and all values in sysfs are passed as hex while bash attempts > to evaluate them as decimal by default. > oops, it sneaked in by mistake from some unrelated experiments. PRODUCT is already OK of course, sorry. updated patch attached -andrey --Boundary-00=_HfVM/mwYhzzsvoU Content-Type: text/x-diff; charset="iso-8859-1"; name="hotplug-2003_08_05-USB_sysfs_is_hex.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="hotplug-2003_08_05-USB_sysfs_is_hex.patch" --- hotplug-2003_08_05/etc/hotplug/usb.agent.sysfs_is_hex 2003-08-06 23:04:43.000000000 +0400 +++ hotplug-2003_08_05/etc/hotplug/usb.agent 2003-08-06 23:24:40.000000000 +0400 @@ -195,9 +195,9 @@ usb_bDeviceProtocol=$3 IFS="$DEFAULT_IFS" elif [ -r $SYSFS/$DEVPATH/bDeviceClass ]; then - usb_bDeviceClass=$(cat $SYSFS/$DEVPATH/bDeviceClass) - usb_bDeviceSubClass=$(cat $SYSFS/$DEVPATH/bDeviceSubClass) - usb_bDeviceProtocol=$(cat $SYSFS/$DEVPATH/bDeviceProtocol) + usb_bDeviceClass=0x$(cat $SYSFS/$DEVPATH/bDeviceClass) + usb_bDeviceSubClass=0x$(cat $SYSFS/$DEVPATH/bDeviceSubClass) + usb_bDeviceProtocol=0x$(cat $SYSFS/$DEVPATH/bDeviceProtocol) else # out-of-range values usb_bDeviceClass=1000 @@ -213,9 +213,9 @@ usb_bInterfaceProtocol=$3 IFS="$DEFAULT_IFS" elif [ -r $SYSFS/$DEVPATH/bInterfaceClass ]; then - usb_bInterfaceClass=$(cat $SYSFS/$DEVPATH/bInterfaceClass) - usb_bInterfaceSubClass=$(cat $SYSFS/$DEVPATH/bInterfaceSubClass) - usb_bInterfaceProtocol=$(cat $SYSFS/$DEVPATH/bInterfaceProtocol) + usb_bInterfaceClass=0x$(cat $SYSFS/$DEVPATH/bInterfaceClass) + usb_bInterfaceSubClass=0x$(cat $SYSFS/$DEVPATH/bInterfaceSubClass) + usb_bInterfaceProtocol=0x$(cat $SYSFS/$DEVPATH/bInterfaceProtocol) else # out-of-range values usb_bInterfaceClass=1000 --Boundary-00=_HfVM/mwYhzzsvoU-- ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel