All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Panin <pazke@donpac.ru>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Patch to enable the USB handoff on Dell 650
Date: Thu, 10 Mar 2005 11:16:10 +0300	[thread overview]
Message-ID: <20050310081610.GC9262@pazke> (raw)
In-Reply-To: <20050304121740.07a3af47@localhost.localdomain>

On 063, 03 04, 2005 at 12:17:40 -0800, Pete Zaitcev wrote:
> On Wed, 2 Feb 2005 10:18:47 +0300 Andrey Panin <pazke@donpac.ru> wrote:
> 
> > > +++ linux-2.6.11-rc2-lem/arch/i386/kernel/dmi_scan.c	2005-01-31 20:42:16.163592792 -0800
> 
> > > +static __init int enable_usb_handoff(struct dmi_blacklist *d)
> > > +{
> 
> > Please don't add new quirks into dmi_scan.c. Use dmi_check_system()
> > where possible.
> 
> Do you have a suggestion for a good place where to add a suitable
> call for dmi_check_system for the USB handoff? Please observe that
> it does not belong with the USB code, in fact we have this code
> there already. It has to happen before any device drivers are
> initiated.
 
What about this patch ?

diff -urdpNX /usr/share/dontdiff linux-2.6.11.vanilla/drivers/pci/quirks.c linux-2.6.11/drivers/pci/quirks.c
--- linux-2.6.11.vanilla/drivers/pci/quirks.c	2005-03-02 10:37:31.000000000 +0300
+++ linux-2.6.11/drivers/pci/quirks.c	2005-03-10 10:45:19.000000000 +0300
@@ -18,6 +18,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/dmi.h>
 
 #undef DEBUG
 
@@ -886,6 +887,40 @@ static int __init usb_handoff_early(char
 }
 __setup("usb-handoff", usb_handoff_early);
 
+static int __init enable_usb_handoff(struct dmi_system_id *d)
+{
+	/*
+	 * A printk is probably unnecessary. There's no way this causes
+	 * any harm (famous last words). But seriously, we only add systems
+	 * to the list if we know that they need handoff for sure.
+	 */
+	usb_early_handoff = 1;
+	return 0;
+}
+
+static __initdata struct dmi_system_id usb_handoff_dmi_table[] = {
+	/*
+	 *	Boxes which need USB taken over from BIOS explicitly.
+	 */
+	{
+		.callback = enable_usb_handoff,
+		.ident = "Dell PW650",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 650"),
+		},
+	}
+};
+
+static int __init usb_handoff_dmi_init(void)
+{
+	dmi_check_system(usb_handoff_dmi_table);
+	return 0;
+}
+
+core_initcall(usb_handoff_dmi_init);
+
+
 static void __devinit quirk_usb_handoff_uhci(struct pci_dev *pdev)
 {
 	unsigned long base = 0;

-- 
Andrey Panin		| Linux and UNIX system administrator
pazke@donpac.ru		| PGP key: wwwkeys.pgp.net

      reply	other threads:[~2005-03-10  8:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-01 18:02 Patch to enable the USB handoff on Dell 650 Pete Zaitcev
2005-02-02  7:18 ` Andrey Panin
2005-03-04 20:17   ` Pete Zaitcev
2005-03-10  8:16     ` Andrey Panin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050310081610.GC9262@pazke \
    --to=pazke@donpac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.