lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 8 Jul 2010 12:11:22 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Frédéric Brière <fbriere@...iere.net>
Cc:	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
	linux-parport@...ts.infradead.org
Subject: Re: [PATCH] parport/serial: add support for Timedia/SUNIX cards to
 parport_serial

On Fri, 25 Jun 2010 20:23:43 -0400
Frédéric Brière <fbriere@...iere.net> wrote:

> Timedia/SUNIX PCI cards with both serial and parallel ports are
> currently supported by 8250_pci and parport_pc individually.  Moving
> that support into parport_serial allows using both types of ports at the
> same time.

This seems to have fallen on silence so I'm getting around to looking at
it.  I'm not sure the sunix hack to avoid lots of entries is a good idea
- it'll eventually break horribly somewhere.


> + * Devices with a parallel port can be identified by their subdevice ID
> + * matching xx[7-9]x.  We thus mark them as class OTHER, so that they will be
> + * ignored by 8250_pci, and claimed by parport_serial instead.
> + */
> +static void __devinit quirk_timedia(struct pci_dev *dev)
> +{
> +	/* 0,2,3,5,6: serial only -- 7,8,9: serial + parallel */
> +	if ((dev->subsystem_device & 0x00f0) >= 0x70) {
> +		dev_info(&dev->dev, "Timedia %04x; "
> +			"changing class SERIAL to OTHER (use parport_serial)\n",
> +			dev->subsystem_device);
> +		dev->class = (PCI_CLASS_COMMUNICATION_OTHER << 8) |
> +		    (dev->class & 0xff);
> +	}
> +}
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
> +		quirk_timedia);

And this check probably should be done in the serial driver so that it
doesn't bind, rather than changing the class, which then lies to other
bits of the kernel so can have funny side effects.

If you did that check in the serial driver and returned -ENODEV to the
probe the id will be handed on to the next driver that matches (ie
parport_serial)

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ