Bonjour,
alors voilà en voulons configurer mon accés internet (Freebox sur le port US
sous mdk 10.1 j'ai eu des problèmes de reconnaissance de la FREEBOX comme carte ethernet sur port USB.
une recherche sur le net m'a fait trouvé ceci (c'est en english)
mais je ne sais pas comment faire pour appliquer le patch ci-dessous??
si vous savez comment faire merci bien de me montrer la proc!!
-----------------------
source : [
www.mail-archive.com]
[linux-usb-devel] [PATCH] usb: extract sensible strings from buggy string descriptors
-------------------------------------------------------------------------
From: Duncan Sands
Subject: [linux-usb-devel] [PATCH] usb: extract sensible strings from buggy string descriptors
Date: Fri, 24 Sep 2004 02:21:22 -0700
--------------------------------------------------------------------------------
The Freebox is a USB modem popular in France. It returns bogus string
descriptors: while the string part is there, the length and type bytes
are both zero. This patch detects that case and tries to recover a
sensible string by scanning for printable Latin characters. This not
only causes the modem to spring to life (because usbnet gets a valid
MAC address) - it also means you get the correct Product and Manufacturer
strings in sysfs and elsewhere. This patch is in the "mostly harmless"
category.
Signed-off-by: Duncan Sands <[EMAIL PROTECTED]>
--- local-tree.orig/drivers/usb/core/message.c 2004-09-23 23:52:51.736541393 +0200
+++ local-tree/drivers/usb/core/message.c 2004-09-24 02:28:09.134127393 +0200
@@ -17,6 +17,8 @@
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/timer.h>
+#include <linux/ctype.h>
+#include <linux/device.h>
#include <asm/byteorder.h>
#include "hcd.h" /* for usbcore internals */
@@ -623,6 +625,20 @@
return result;
}
+static void usb_try_string_workarounds(unsigned char *buf, int *length)
+{
+ int newlength, oldlength = *length;
+
+ for(newlength = 2; newlength + 1 < oldlength; newlength += 2)
+ if (!isprint(buf[newlength]) || buf[newlength + 1])
+ break;
+
+ if (newlength > 2) {
+ buf[0] = newlength;
+ *length = newlength;
+ }
+}
+
static int usb_string_sub(struct usb_device *dev, unsigned int langid,
unsigned int index, unsigned char *buf)
{
@@ -634,19 +650,26 @@
/* If that failed try to read the descriptor length, then
* ask for just that many bytes */
- if (rc < 0) {
+ if (rc < 2) {
rc = usb_get_string(dev, langid, index, buf, 2);
if (rc == 2)
rc = usb_get_string(dev, langid, index, buf, buf[0]);
}
- if (rc >= 0) {
+ if (rc >= 2) {
+ if (!buf[0] && !buf[1])
+ usb_try_string_workarounds(buf, &rc);
+
/* There might be extra junk at the end of the descriptor */
if (buf[0] < rc)
rc = buf[0];
- if (rc < 2)
- rc = -EINVAL;
+
+ rc = rc - (rc & 1); /* force a multiple of two */
}
+
+ if (rc < 2)
+ rc = (rc < 0 ? rc : -EINVAL);
+
return rc;
}
@@ -724,6 +747,9 @@
buf[idx] = 0;
err = idx;
+ if (tbuf[1] != USB_DT_STRING)
+ dev_dbg(&dev->dev, "wrong descriptor type %02x for string %d
(\"%s\")\n", tbuf[1], index, buf);
+
errout:
kfree(tbuf);
return err;