Re: [PATCH v2] VNIC: Adding support for Cavium ThunderX network controller

2014-11-12 Thread Andrey Panin
On 313, 11 09, 2014 at 09:14:05PM -0800, Robert Richter wrote:

I apologize for possibly repeated mail, my mailsystem was misconfigured :(

Some comments from quick look are below.


> +static int nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> +{
> + struct device *dev = >dev;
> + struct net_device *netdev;
> + struct nicpf *nic;
> + interr;
> +
> + netdev = alloc_etherdev(sizeof(struct nicpf));
> + if (!netdev)
> + return -ENOMEM;
> +
> + pci_set_drvdata(pdev, netdev);
> +
> + SET_NETDEV_DEV(netdev, >dev);
> +
> + nic = netdev_priv(netdev);
> + nic->netdev = netdev;
> + nic->pdev = pdev;
> +
> + err = pci_enable_device(pdev);
> + if (err) {
> + dev_err(dev, "Failed to enable PCI device\n");
> + goto exit;

Looks like you leaked netdev here.

> + }
> +
> + err = pci_request_regions(pdev, DRV_NAME);
> + if (err) {
> + dev_err(dev, "PCI request regions failed 0x%x\n", err);
> + goto err_disable_device;
> + }
> +
> + err = pci_set_dma_mask(pdev, DMA_BIT_MASK(48));
> + if (err) {
> + dev_err(dev, "Unable to get usable DMA configuration\n");
> + goto err_release_regions;
> + }
> +
> + err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(48));
> + if (err) {
> + dev_err(dev, "unable to get 48-bit DMA for consistent 
> allocations\n");
> + goto err_release_regions;
> + }
> +
> + /* MAP PF's configuration registers */
> + nic->reg_base = (uint64_t)pci_ioremap_bar(pdev, PCI_CFG_REG_BAR_NUM);
> + if (!nic->reg_base) {
> + dev_err(dev, "Cannot map config register space, aborting\n");
> + err = -ENOMEM;
> + goto err_release_regions;
> + }
> + nic->node = NIC_NODE_ID(pci_resource_start(pdev, PCI_CFG_REG_BAR_NUM));
> +
> + /* By default set NIC in TNS bypass mode */
> + nic->flags &= ~NIC_TNS_ENABLED;
> + nic_set_lmac_vf_mapping(nic);
> +
> + /* Initialize hardware */
> + nic_init_hw(nic);
> +
> + /* Set RSS TBL size for each VF */
> + nic->rss_ind_tbl_size = max((NIC_RSSI_COUNT / nic->num_vf_en),
> + NIC_MAX_RSS_IDR_TBL_SIZE);
> + nic->rss_ind_tbl_size = rounddown_pow_of_two(nic->rss_ind_tbl_size);
> +
> + /* Register interrupts */
> + if (nic_register_interrupts(nic))
> + goto err_unmap_resources;
> +
> + /* Configure SRIOV */
> + if (!nic_sriov_init(pdev, nic))
> + goto err_unmap_resources;
> +
> + goto exit;

Why not simply return 0; ?

> +
> +err_unmap_resources:
> + if (nic->reg_base)

This check looks unnecessary.

> + iounmap((void *)nic->reg_base);
> +err_release_regions:
> + pci_release_regions(pdev);
> +err_disable_device:
> + pci_disable_device(pdev);
> +exit:
> + return err;
> +}


> +static int bgx_register_interrupts(struct bgx *bgx, uint8_t lmac)
> +{
> + int irq, ret = 0;
> +
> + /* Register only link interrupts now */
> + irq = SPUX_INT + (lmac * BGX_LMAC_VEC_OFFSET);
> + sprintf(bgx->irq_name[irq], "LMAC%d", lmac);
> + ret = request_irq(bgx->msix_entries[irq].vector,
> +   bgx_lmac_intr_handler, 0, bgx->irq_name[irq], bgx);
> + if (ret)
> + goto fail;
> + else

This else just hurts readability.

> + bgx->irq_allocated[irq] = 1;
> +
> + /* Enable link interrupt */
> + bgx_enable_link_intr(bgx, lmac);
> + return 0;
> +
> +fail:

The code below copypasted from bgx_unregister_interrupts()
Looks like good candidate for helper function.

> + dev_err(>pdev->dev, "Request irq failed\n");
> + for (irq = 0; irq < bgx->num_vec; irq++) {
> + if (bgx->irq_allocated[irq])
> + free_irq(bgx->msix_entries[irq].vector, bgx);
> + bgx->irq_allocated[irq] = 0;
> + }
> + return 1;
> +}
> +
> +static void bgx_unregister_interrupts(struct bgx *bgx)
> +{
> + int irq;
> + /* Free registered interrupts */
> + for (irq = 0; irq < bgx->num_vec; irq++) {
> + if (bgx->irq_allocated[irq])
> + free_irq(bgx->msix_entries[irq].vector, bgx);
> + bgx->irq_allocated[irq] = 0;
> + }
> + /* Disable MSI-X */
> + bgx_disable_msix(bgx);
> +}
> +

> +void bgx_lmac_enable(struct bgx *bgx, int8_t lmac)
> +{
> + uint64_t dmac_bcast = (1ULL << 48) - 1;
> +
> + bgx_reg_write(bgx, lmac, BGX_CMRX_CFG,
> +   (1 << 15) | (1 << 14) | (1 << 13));
> +
> + /* Register interrupts */
> + bgx_register_interrupts(bgx, lmac);

bgx_register_interrupts() can fail (due to request_irq), but it's return
value is not checked.

> +
> + /* Add broadcast MAC into all LMAC's DMAC filters */
> + for (lmac = 0; lmac < bgx->lmac_count; lmac++)
> + bgx_add_dmac_addr(dmac_bcast, 0, bgx->bgx_id, lmac);
> +}

> 

Re: [PATCH v2] VNIC: Adding support for Cavium ThunderX network controller

2014-11-12 Thread Andrey Panin
On 313, 11 09, 2014 at 09:14:05PM -0800, Robert Richter wrote:

I apologize for possibly repeated mail, my mailsystem was misconfigured :(

Some comments from quick look are below.


 +static int nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 +{
 + struct device *dev = pdev-dev;
 + struct net_device *netdev;
 + struct nicpf *nic;
 + interr;
 +
 + netdev = alloc_etherdev(sizeof(struct nicpf));
 + if (!netdev)
 + return -ENOMEM;
 +
 + pci_set_drvdata(pdev, netdev);
 +
 + SET_NETDEV_DEV(netdev, pdev-dev);
 +
 + nic = netdev_priv(netdev);
 + nic-netdev = netdev;
 + nic-pdev = pdev;
 +
 + err = pci_enable_device(pdev);
 + if (err) {
 + dev_err(dev, Failed to enable PCI device\n);
 + goto exit;

Looks like you leaked netdev here.

 + }
 +
 + err = pci_request_regions(pdev, DRV_NAME);
 + if (err) {
 + dev_err(dev, PCI request regions failed 0x%x\n, err);
 + goto err_disable_device;
 + }
 +
 + err = pci_set_dma_mask(pdev, DMA_BIT_MASK(48));
 + if (err) {
 + dev_err(dev, Unable to get usable DMA configuration\n);
 + goto err_release_regions;
 + }
 +
 + err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(48));
 + if (err) {
 + dev_err(dev, unable to get 48-bit DMA for consistent 
 allocations\n);
 + goto err_release_regions;
 + }
 +
 + /* MAP PF's configuration registers */
 + nic-reg_base = (uint64_t)pci_ioremap_bar(pdev, PCI_CFG_REG_BAR_NUM);
 + if (!nic-reg_base) {
 + dev_err(dev, Cannot map config register space, aborting\n);
 + err = -ENOMEM;
 + goto err_release_regions;
 + }
 + nic-node = NIC_NODE_ID(pci_resource_start(pdev, PCI_CFG_REG_BAR_NUM));
 +
 + /* By default set NIC in TNS bypass mode */
 + nic-flags = ~NIC_TNS_ENABLED;
 + nic_set_lmac_vf_mapping(nic);
 +
 + /* Initialize hardware */
 + nic_init_hw(nic);
 +
 + /* Set RSS TBL size for each VF */
 + nic-rss_ind_tbl_size = max((NIC_RSSI_COUNT / nic-num_vf_en),
 + NIC_MAX_RSS_IDR_TBL_SIZE);
 + nic-rss_ind_tbl_size = rounddown_pow_of_two(nic-rss_ind_tbl_size);
 +
 + /* Register interrupts */
 + if (nic_register_interrupts(nic))
 + goto err_unmap_resources;
 +
 + /* Configure SRIOV */
 + if (!nic_sriov_init(pdev, nic))
 + goto err_unmap_resources;
 +
 + goto exit;

Why not simply return 0; ?

 +
 +err_unmap_resources:
 + if (nic-reg_base)

This check looks unnecessary.

 + iounmap((void *)nic-reg_base);
 +err_release_regions:
 + pci_release_regions(pdev);
 +err_disable_device:
 + pci_disable_device(pdev);
 +exit:
 + return err;
 +}


 +static int bgx_register_interrupts(struct bgx *bgx, uint8_t lmac)
 +{
 + int irq, ret = 0;
 +
 + /* Register only link interrupts now */
 + irq = SPUX_INT + (lmac * BGX_LMAC_VEC_OFFSET);
 + sprintf(bgx-irq_name[irq], LMAC%d, lmac);
 + ret = request_irq(bgx-msix_entries[irq].vector,
 +   bgx_lmac_intr_handler, 0, bgx-irq_name[irq], bgx);
 + if (ret)
 + goto fail;
 + else

This else just hurts readability.

 + bgx-irq_allocated[irq] = 1;
 +
 + /* Enable link interrupt */
 + bgx_enable_link_intr(bgx, lmac);
 + return 0;
 +
 +fail:

The code below copypasted from bgx_unregister_interrupts()
Looks like good candidate for helper function.

 + dev_err(bgx-pdev-dev, Request irq failed\n);
 + for (irq = 0; irq  bgx-num_vec; irq++) {
 + if (bgx-irq_allocated[irq])
 + free_irq(bgx-msix_entries[irq].vector, bgx);
 + bgx-irq_allocated[irq] = 0;
 + }
 + return 1;
 +}
 +
 +static void bgx_unregister_interrupts(struct bgx *bgx)
 +{
 + int irq;
 + /* Free registered interrupts */
 + for (irq = 0; irq  bgx-num_vec; irq++) {
 + if (bgx-irq_allocated[irq])
 + free_irq(bgx-msix_entries[irq].vector, bgx);
 + bgx-irq_allocated[irq] = 0;
 + }
 + /* Disable MSI-X */
 + bgx_disable_msix(bgx);
 +}
 +

 +void bgx_lmac_enable(struct bgx *bgx, int8_t lmac)
 +{
 + uint64_t dmac_bcast = (1ULL  48) - 1;
 +
 + bgx_reg_write(bgx, lmac, BGX_CMRX_CFG,
 +   (1  15) | (1  14) | (1  13));
 +
 + /* Register interrupts */
 + bgx_register_interrupts(bgx, lmac);

bgx_register_interrupts() can fail (due to request_irq), but it's return
value is not checked.

 +
 + /* Add broadcast MAC into all LMAC's DMAC filters */
 + for (lmac = 0; lmac  bgx-lmac_count; lmac++)
 + bgx_add_dmac_addr(dmac_bcast, 0, bgx-bgx_id, lmac);
 +}

 +static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 +{
 + struct device *dev = pdev-dev;
 + struct bgx *bgx;
 + interr;
 + uint8_t lmac 

Re: [PATCH] serial: add ADDI-DATA GmbH Communication cards in 8250_pci.c and pci_ids.h.

2007-11-28 Thread Andrey Panin
  0,
> + 0,
> + pbn_b0_4_115200 },
> +
> + {   PCI_VENDOR_ID_ADDIDATA,
> + PCI_DEVICE_ID_ADDIDATA_APCI7420_2,
> + PCI_ANY_ID,
> + PCI_ANY_ID,
> + 0,
> + 0,
> + pbn_b0_2_115200 },
> +
> + {   PCI_VENDOR_ID_ADDIDATA,
> + PCI_DEVICE_ID_ADDIDATA_APCI7300_2,
> + PCI_ANY_ID,
> + PCI_ANY_ID,
> + 0,
> + 0,
> + pbn_b0_1_115200 },
> +
> + {   PCI_VENDOR_ID_ADDIDATA,
> + PCI_DEVICE_ID_ADDIDATA_APCI7500_3,
> + PCI_ANY_ID,
> + PCI_ANY_ID,
> + 0,
> + 0,
> +     pbn_b0_4_115200 },
> +
> + {   PCI_VENDOR_ID_ADDIDATA,
> + PCI_DEVICE_ID_ADDIDATA_APCI7420_3,
> + PCI_ANY_ID,
> + PCI_ANY_ID,
> + 0,
> + 0,
> + pbn_b0_2_115200 },
> +
> + {   PCI_VENDOR_ID_ADDIDATA,
> + PCI_DEVICE_ID_ADDIDATA_APCI7300_3,
> + PCI_ANY_ID,
> + PCI_ANY_ID,
> + 0,
> + 0,
> + pbn_b0_1_115200 },
> +
> + {   PCI_VENDOR_ID_ADDIDATA,
> + PCI_DEVICE_ID_ADDIDATA_APCI7800_3,
> + PCI_ANY_ID,
> + PCI_ANY_ID,
> + 0,
> + 0,
> + pbn_b0_bt_8_115200 },
> +
> + /*
>* These entries match devices with class COMMUNICATION_SERIAL,
>* COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
>*/

Otherwise patch looks good.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] serial: add ADDI-DATA GmbH Communication cards in 8250_pci.c and pci_ids.h.

2007-11-28 Thread Andrey Panin
,
 + pbn_b0_1_115200 },
 +
 + {   PCI_VENDOR_ID_ADDIDATA,
 + PCI_DEVICE_ID_ADDIDATA_APCI7800_3,
 + PCI_ANY_ID,
 + PCI_ANY_ID,
 + 0,
 + 0,
 + pbn_b0_bt_8_115200 },
 +
 + /*
* These entries match devices with class COMMUNICATION_SERIAL,
* COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
*/

Otherwise patch looks good.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-28 Thread Andrey Panin
On 295, 10 22, 2007 at 01:14:14 -0400, Chris Bergeron wrote:
> Andrey Panin wrote:
>> On 291, 10 18, 2007 at 01:00:06 -0400, Chris Bergeron wrote:
>>   So the card probably generates screaming interrupt... that's bad.
>> I found some docs for IT887x chips, according to these docs  IT887x
>> have simple interrupt controller inside. Further investigation is needed.
>>
>> Can you post output of lspci -xxx ?
>>
>>   
> Full output at 
> http://pcburn.com/files/Syba_serial_controller/lspci_xxx.out.  The relevant 
> part for the Syba card is probably:
>
> 01:08.0 Serial controller: PLX Technology, Inc. Unknown device 9016 (rev 
> 01)
> 00: b5 10 16 90 07 00 80 02 01 02 00 07 00 00 00 00
> 10: 01 a4 00 00 01 a8 00 00 01 ac 00 00 00 00 00 f5
> 20: 00 10 00 f5 00 20 00 f5 00 00 00 00 4e 54 08 00
> 30: 00 00 00 00 00 00 00 00 00 00 00 00 05 01 00 00
> 40: 3f 3f 08 00 00 8c 20 8b 45 54 55 45 00 00 10 d2
> 50: 01 01 71 03 01 03 00 00 00 00 00 00 00 00 00 00
> 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 70: 00 00 00 00 00 00 00 00 00 03 00 06 f8 03 f8 02
> 80: 78 03 78 07 00 08 00 07 00 01 20 01 40 01 60 01
> 90: 00 00 00 00 00 00 00 00 00 00 00 00 70 43 25 64
> a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Can you test an attached patch against 2.6.24-rc1 ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
diff -urdpNX dontdiff linux-2.6.24.vanilla/drivers/serial/8250_pci.c 
linux-2.6.24/drivers/serial/8250_pci.c
--- linux-2.6.24.vanilla/drivers/serial/8250_pci.c  2007-10-28 
13:00:14.0 +0300
+++ linux-2.6.24/drivers/serial/8250_pci.c  2007-10-28 18:15:12.0 
+0300
@@ -610,45 +610,49 @@ static int pci_netmos_init(struct pci_de
 /* enable IO_Space bit */
 #define ITE_887x_POSIO_ENABLE  (1 << 31)
 
-static int pci_ite887x_init(struct pci_dev *dev)
+static int pci_ite_887x_allocate_io(struct pci_dev *dev)
 {
-   /* inta_addr are the configuration addresses of the ITE */
-   static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0,
-   0x200, 0x280, 0 };
-   int ret, i, type;
-   struct resource *iobase = NULL;
-   u32 miscr, uartbar, ioport;
+   static const short inta_addr[] = {
+   0x2a0, 0x2c0, 0x220, 0x240, 0x1e0, 0x200, 0x280, 0
+   };
+   int ret, i;
 
-   /* search for the base-ioport */
-   i = 0;
-   while (inta_addr[i] && iobase == NULL) {
-   iobase = request_region(inta_addr[i], ITE_887x_IOSIZE,
-   "ite887x");
-   if (iobase != NULL) {
+   for (i = 0; i < ARRAY_SIZE(inta_addr); i++) {
+   int iobase = inta_addr[i];
+
+   if (request_region(iobase, ITE_887x_IOSIZE, "ite887x")) {
/* write POSIO0R - speed | size | ioport */
pci_write_config_dword(dev, ITE_887x_POSIO0,
ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
-   ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]);
+   ITE_887x_POSIO_IOSIZE_32 | iobase);
+
/* write INTCBAR - ioport */
-   pci_write_config_dword(dev, ITE_887x_INTCBAR, 
inta_addr[i]);
-   ret = inb(inta_addr[i]);
+   pci_write_config_dword(dev, ITE_887x_INTCBAR, iobase);
+   ret = inb(iobase);
if (ret != 0xff) {
/* ioport connected */
-   break;
+   return iobase;
}
-   release_region(iobase->start, ITE_887x_IOSIZE);
-   iobase = NULL;
+   release_region(iobase, ITE_887x_IOSIZE);
}
-   i++;
}
 
-   if (!inta_addr[i]) {
+   return 0;
+}
+
+static int pci_ite887x_init(struct pci_dev *dev)
+{
+   int i, ret, type, iobase;
+   u32 miscr, uartbar, ioport;
+
+   iobase = pci_ite_887x_allocate_io(dev);
+   if (!iobase) {
printk(KERN_ERR "ite887x: could not find iobase\n");
return -ENODEV;
}
 
/* start of undocumented type checking (see parport_pc.c) */
-   type = inb(iobase->start + 0x18) & 0x0f;
+   type = inb(iobase + 0x18) & 0x0f;
 
switch (type) {
c

Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-28 Thread Andrey Panin
On 295, 10 22, 2007 at 01:14:14 -0400, Chris Bergeron wrote:
 Andrey Panin wrote:
 On 291, 10 18, 2007 at 01:00:06 -0400, Chris Bergeron wrote:
   So the card probably generates screaming interrupt... that's bad.
 I found some docs for IT887x chips, according to these docs  IT887x
 have simple interrupt controller inside. Further investigation is needed.

 Can you post output of lspci -xxx ?

   
 Full output at 
 http://pcburn.com/files/Syba_serial_controller/lspci_xxx.out.  The relevant 
 part for the Syba card is probably:

 01:08.0 Serial controller: PLX Technology, Inc. Unknown device 9016 (rev 
 01)
 00: b5 10 16 90 07 00 80 02 01 02 00 07 00 00 00 00
 10: 01 a4 00 00 01 a8 00 00 01 ac 00 00 00 00 00 f5
 20: 00 10 00 f5 00 20 00 f5 00 00 00 00 4e 54 08 00
 30: 00 00 00 00 00 00 00 00 00 00 00 00 05 01 00 00
 40: 3f 3f 08 00 00 8c 20 8b 45 54 55 45 00 00 10 d2
 50: 01 01 71 03 01 03 00 00 00 00 00 00 00 00 00 00
 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 70: 00 00 00 00 00 00 00 00 00 03 00 06 f8 03 f8 02
 80: 78 03 78 07 00 08 00 07 00 01 20 01 40 01 60 01
 90: 00 00 00 00 00 00 00 00 00 00 00 00 70 43 25 64
 a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Can you test an attached patch against 2.6.24-rc1 ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
diff -urdpNX dontdiff linux-2.6.24.vanilla/drivers/serial/8250_pci.c 
linux-2.6.24/drivers/serial/8250_pci.c
--- linux-2.6.24.vanilla/drivers/serial/8250_pci.c  2007-10-28 
13:00:14.0 +0300
+++ linux-2.6.24/drivers/serial/8250_pci.c  2007-10-28 18:15:12.0 
+0300
@@ -610,45 +610,49 @@ static int pci_netmos_init(struct pci_de
 /* enable IO_Space bit */
 #define ITE_887x_POSIO_ENABLE  (1  31)
 
-static int pci_ite887x_init(struct pci_dev *dev)
+static int pci_ite_887x_allocate_io(struct pci_dev *dev)
 {
-   /* inta_addr are the configuration addresses of the ITE */
-   static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0,
-   0x200, 0x280, 0 };
-   int ret, i, type;
-   struct resource *iobase = NULL;
-   u32 miscr, uartbar, ioport;
+   static const short inta_addr[] = {
+   0x2a0, 0x2c0, 0x220, 0x240, 0x1e0, 0x200, 0x280, 0
+   };
+   int ret, i;
 
-   /* search for the base-ioport */
-   i = 0;
-   while (inta_addr[i]  iobase == NULL) {
-   iobase = request_region(inta_addr[i], ITE_887x_IOSIZE,
-   ite887x);
-   if (iobase != NULL) {
+   for (i = 0; i  ARRAY_SIZE(inta_addr); i++) {
+   int iobase = inta_addr[i];
+
+   if (request_region(iobase, ITE_887x_IOSIZE, ite887x)) {
/* write POSIO0R - speed | size | ioport */
pci_write_config_dword(dev, ITE_887x_POSIO0,
ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
-   ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]);
+   ITE_887x_POSIO_IOSIZE_32 | iobase);
+
/* write INTCBAR - ioport */
-   pci_write_config_dword(dev, ITE_887x_INTCBAR, 
inta_addr[i]);
-   ret = inb(inta_addr[i]);
+   pci_write_config_dword(dev, ITE_887x_INTCBAR, iobase);
+   ret = inb(iobase);
if (ret != 0xff) {
/* ioport connected */
-   break;
+   return iobase;
}
-   release_region(iobase-start, ITE_887x_IOSIZE);
-   iobase = NULL;
+   release_region(iobase, ITE_887x_IOSIZE);
}
-   i++;
}
 
-   if (!inta_addr[i]) {
+   return 0;
+}
+
+static int pci_ite887x_init(struct pci_dev *dev)
+{
+   int i, ret, type, iobase;
+   u32 miscr, uartbar, ioport;
+
+   iobase = pci_ite_887x_allocate_io(dev);
+   if (!iobase) {
printk(KERN_ERR ite887x: could not find iobase\n);
return -ENODEV;
}
 
/* start of undocumented type checking (see parport_pc.c) */
-   type = inb(iobase-start + 0x18)  0x0f;
+   type = inb(iobase + 0x18)  0x0f;
 
switch (type) {
case 0x2:   /* ITE8871 (1P) */
@@ -697,7 +701,7 @@ static int pci_ite887x_init(struct pci_d
 
if (ret = 0) {
/* the device has no UARTs if we get here */
-   release_region(iobase-start, ITE_887x_IOSIZE

Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-26 Thread Andrey Panin
On 295, 10 22, 2007 at 12:18:08PM -0400, Lennart Sorensen wrote:
> On Mon, Oct 22, 2007 at 07:33:23PM +0400, Andrey Panin wrote:
> > So the card probably generates screaming interrupt... that's bad.
> > I found some docs for IT887x chips, according to these docs  IT887x
> > have simple interrupt controller inside. Further investigation is needed.
> > 
> > Can you post output of lspci -xxx ?
> 
> Is it possible they put a chip on to generate a PCI interrupt on perhaps
> PCIB on the slot from the serial chips directly, so that they didn't
> have to turn interrupts from the serial chips into a signal that forces
> the parallel port to generate an interrupt?  After all that would reduce
> latency, and if you use PCIA for the parallel port, PCIB for the first
> serial chip and PCIC for the second, you might get a much more efficient
> design, although the driver would have to register all those IRQs.

I dont think so. IT887x has builtin interrupt controller which multiplexes 
16 external IRQ pins with IRQs from builtin devices (parallel port, UARTs
and GPIO) into single INTA# line. IT887x also contains 8-bit ISA-like bus
and 16 chip select lines and it's all you need to glue UARTs to PCI bus.

I suspect that it's interrupt controller problem, probably edge/level
triggered settings.

> What IRQ is each PCI device in that system using right now?  perhaps we
> could figure out what irq 17 would be on that PCI slot.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-26 Thread Andrey Panin
On 295, 10 22, 2007 at 12:18:08PM -0400, Lennart Sorensen wrote:
 On Mon, Oct 22, 2007 at 07:33:23PM +0400, Andrey Panin wrote:
  So the card probably generates screaming interrupt... that's bad.
  I found some docs for IT887x chips, according to these docs  IT887x
  have simple interrupt controller inside. Further investigation is needed.
  
  Can you post output of lspci -xxx ?
 
 Is it possible they put a chip on to generate a PCI interrupt on perhaps
 PCIB on the slot from the serial chips directly, so that they didn't
 have to turn interrupts from the serial chips into a signal that forces
 the parallel port to generate an interrupt?  After all that would reduce
 latency, and if you use PCIA for the parallel port, PCIB for the first
 serial chip and PCIC for the second, you might get a much more efficient
 design, although the driver would have to register all those IRQs.

I dont think so. IT887x has builtin interrupt controller which multiplexes 
16 external IRQ pins with IRQs from builtin devices (parallel port, UARTs
and GPIO) into single INTA# line. IT887x also contains 8-bit ISA-like bus
and 16 chip select lines and it's all you need to glue UARTs to PCI bus.

I suspect that it's interrupt controller problem, probably edge/level
triggered settings.

 What IRQ is each PCI device in that system using right now?  perhaps we
 could figure out what irq 17 would be on that PCI slot.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-22 Thread Andrey Panin
On 291, 10 18, 2007 at 01:00:06 -0400, Chris Bergeron wrote:
> Andrey Panin wrote:
>> On 290, 10 17, 2007 at 06:16:58 -0400, Chris Bergeron wrote:
>>   
>>> Andrey Panin wrote:
>>> 
>>>> Is it possible to connect two ports and run getty on one port and 
>>>> minicom on
>>>> another ? We should check that UARTs are really working.
>>>>
>>>> 
>>> I used the on-board serial port as a known working control (after getting 
>>> it to work with the other onboard serial port) to try and connect over to 
>>> one of the Syba card ports (using Cutecom & getty).  The lines light up, 
>>> but there's nothing getting sent from the 8-port as far as I can see.
>>> 
>>
>> Oh crap... I missed this fscking "Disabling IRQ #17" line in your dmesg.
>> Can you try with firewire controller disabled somehow ?
>>
>>   
> Ah, I forgot to make note of that.  I did actually turn off Firewire in the 
> BIOS.  Assuming that worked (and it looks like it did) the following 
> section probably contains the relevant bits.  Still getting the IRQ 17 
> error.
>
> -- Chris
>
> PCI: Setting latency timer of device :00:05.0 to 64
> NET: Registered protocol family 17
> eth0: no IPv6 routers present
> irq 17: nobody cared (try booting with the "irqpoll" option)
> [] show_trace_log_lvl+0x1a/0x2f
> [] show_trace+0x12/0x14
> [] dump_stack+0x16/0x18
> [] __report_bad_irq+0x39/0x79
> [] note_interrupt+0x1df/0x218
> [] handle_fasteoi_irq+0x91/0xb6
> [] do_IRQ+0x7c/0x95
> [] common_interrupt+0x2e/0x34
> [] cpu_idle+0x1c/0xc2
> [] rest_init+0x4d/0x4f
> [] start_kernel+0x32a/0x332
> [<>] 0x0
> ===
> handlers:
> [] (serial8250_interrupt+0x0/0x115)
> Disabling IRQ #17
> hda: DMA timeout retry
>
>
> full dmesg output at 
> http://pcburn.com/files/Syba_serial_controller/dmesg_with_1394_disabled.txt

So the card probably generates screaming interrupt... that's bad.
I found some docs for IT887x chips, according to these docs  IT887x
have simple interrupt controller inside. Further investigation is needed.

Can you post output of lspci -xxx ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-22 Thread Andrey Panin
On 291, 10 18, 2007 at 01:00:06 -0400, Chris Bergeron wrote:
 Andrey Panin wrote:
 On 290, 10 17, 2007 at 06:16:58 -0400, Chris Bergeron wrote:
   
 Andrey Panin wrote:
 
 Is it possible to connect two ports and run getty on one port and 
 minicom on
 another ? We should check that UARTs are really working.

 
 I used the on-board serial port as a known working control (after getting 
 it to work with the other onboard serial port) to try and connect over to 
 one of the Syba card ports (using Cutecom  getty).  The lines light up, 
 but there's nothing getting sent from the 8-port as far as I can see.
 

 Oh crap... I missed this fscking Disabling IRQ #17 line in your dmesg.
 Can you try with firewire controller disabled somehow ?

   
 Ah, I forgot to make note of that.  I did actually turn off Firewire in the 
 BIOS.  Assuming that worked (and it looks like it did) the following 
 section probably contains the relevant bits.  Still getting the IRQ 17 
 error.

 -- Chris

 PCI: Setting latency timer of device :00:05.0 to 64
 NET: Registered protocol family 17
 eth0: no IPv6 routers present
 irq 17: nobody cared (try booting with the irqpoll option)
 [c0104f45] show_trace_log_lvl+0x1a/0x2f
 [c0105939] show_trace+0x12/0x14
 [c0105951] dump_stack+0x16/0x18
 [c0152f90] __report_bad_irq+0x39/0x79
 [c01531af] note_interrupt+0x1df/0x218
 [c0153754] handle_fasteoi_irq+0x91/0xb6
 [c0105fef] do_IRQ+0x7c/0x95
 [c0104946] common_interrupt+0x2e/0x34
 [c010233a] cpu_idle+0x1c/0xc2
 [c02deed9] rest_init+0x4d/0x4f
 [c03e7979] start_kernel+0x32a/0x332
 [] 0x0
 ===
 handlers:
 [c023ecae] (serial8250_interrupt+0x0/0x115)
 Disabling IRQ #17
 hda: DMA timeout retry


 full dmesg output at 
 http://pcburn.com/files/Syba_serial_controller/dmesg_with_1394_disabled.txt

So the card probably generates screaming interrupt... that's bad.
I found some docs for IT887x chips, according to these docs  IT887x
have simple interrupt controller inside. Further investigation is needed.

Can you post output of lspci -xxx ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-17 Thread Andrey Panin
On 290, 10 17, 2007 at 06:16:58 -0400, Chris Bergeron wrote:
> Andrey Panin wrote:
>>
>> Is it possible to connect two ports and run getty on one port and minicom 
>> on
>> another ? We should check that UARTs are really working.
>>
>>   
> I used the on-board serial port as a known working control (after getting 
> it to work with the other onboard serial port) to try and connect over to 
> one of the Syba card ports (using Cutecom & getty).  The lines light up, 
> but there's nothing getting sent from the 8-port as far as I can see.

Oh crap... I missed this fscking "Disabling IRQ #17" line in your dmesg.
Can you try with firewire controller disabled somehow ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-17 Thread Andrey Panin
On 289, 10 16, 2007 at 03:03:34PM -0400, Chris Bergeron wrote:
> Andrey Panin wrote:
>> On 284, 10 11, 2007 at 01:02:12PM -0400, Chris Bergeron wrote:
>>   
>>> Andrey Panin wrote:
>>> 
>>>> On 278, 10 05, 2007 at 05:31:05PM -0400, Chris Bergeron wrote:
>>>> 
>>>>> Hello all,
>>>>>
>>>>> I've just installed a multiport serial card released by an outfit 
>>>>> called Syba.  This is an 8 port serial-only card with an Octopus style 
>>>>> breakout cable.  The main chipset on it is an ITE IT8871F.
>>>>> 
>>>> Are you sure ? IIRC IT887x are PCI-ISA bridges with additional periphery
>>>> and your lspci shows PLX chip. Can you send complete lspci -vv output ?
>>>> Output of dmesg could be useful too.
>>>>
>>>>   
>>> I'm sure that's what it says on the largest chip on the PCI card.  It 
>>> could be that the other two chips are more relevant... the numbers from 
>>> them are included below.
>>>
>>> I've posted up a quick text only page with the diagnostic information 
>>> from the system (full dmesg, lspci, etc) plus links to pictures of the 
>>> board (since others might see something important that I'm not aware of). 
>>>  You can access that at 
>>> http://pcburn.com/files/Syba_serial_controller/index.html
>>> 
>>
>> Can you try an attached patch ? I hope it should at least detect UARTs on 
>> your board. Be ready that baudrate could be wrong, because we do not know
>> what frequency is used to clock these UARTs.
>>
>>   
> Alright,finally had another machine to try the attached patch.  I get an 
> odd error regarding IRQ 17:
>
> "irq 17: nobody cared (try booting with the "irqpoll" option)"

This message apearred after firewire driver initialization and firewire chip
shares IRQ with serial card. It's hard to say who is guilty here :)

> along with a long error message (but the kernel continues to load).  Aside 
> from that the ports now allow me to run a getty on them and the DTR line 
> lights up on my serial tester (as it does with a working port) but the 
> device on the other end doesn't function.

Is it possible to connect two ports and run getty on one port and minicom on
another ? We should check that UARTs are really working.

> I've updated the web page with lspci -vv and dmesg output.  I can also post 
> it here if that's desirable, just figured I'd save everyone the inbox 
> flooding :).
>
> -- Chris

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-17 Thread Andrey Panin
On 290, 10 17, 2007 at 06:16:58 -0400, Chris Bergeron wrote:
 Andrey Panin wrote:

 Is it possible to connect two ports and run getty on one port and minicom 
 on
 another ? We should check that UARTs are really working.

   
 I used the on-board serial port as a known working control (after getting 
 it to work with the other onboard serial port) to try and connect over to 
 one of the Syba card ports (using Cutecom  getty).  The lines light up, 
 but there's nothing getting sent from the 8-port as far as I can see.

Oh crap... I missed this fscking Disabling IRQ #17 line in your dmesg.
Can you try with firewire controller disabled somehow ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-17 Thread Andrey Panin
On 289, 10 16, 2007 at 03:03:34PM -0400, Chris Bergeron wrote:
 Andrey Panin wrote:
 On 284, 10 11, 2007 at 01:02:12PM -0400, Chris Bergeron wrote:
   
 Andrey Panin wrote:
 
 On 278, 10 05, 2007 at 05:31:05PM -0400, Chris Bergeron wrote:
 
 Hello all,

 I've just installed a multiport serial card released by an outfit 
 called Syba.  This is an 8 port serial-only card with an Octopus style 
 breakout cable.  The main chipset on it is an ITE IT8871F.
 
 Are you sure ? IIRC IT887x are PCI-ISA bridges with additional periphery
 and your lspci shows PLX chip. Can you send complete lspci -vv output ?
 Output of dmesg could be useful too.

   
 I'm sure that's what it says on the largest chip on the PCI card.  It 
 could be that the other two chips are more relevant... the numbers from 
 them are included below.

 I've posted up a quick text only page with the diagnostic information 
 from the system (full dmesg, lspci, etc) plus links to pictures of the 
 board (since others might see something important that I'm not aware of). 
  You can access that at 
 http://pcburn.com/files/Syba_serial_controller/index.html
 

 Can you try an attached patch ? I hope it should at least detect UARTs on 
 your board. Be ready that baudrate could be wrong, because we do not know
 what frequency is used to clock these UARTs.

   
 Alright,finally had another machine to try the attached patch.  I get an 
 odd error regarding IRQ 17:

 irq 17: nobody cared (try booting with the irqpoll option)

This message apearred after firewire driver initialization and firewire chip
shares IRQ with serial card. It's hard to say who is guilty here :)

 along with a long error message (but the kernel continues to load).  Aside 
 from that the ports now allow me to run a getty on them and the DTR line 
 lights up on my serial tester (as it does with a working port) but the 
 device on the other end doesn't function.

Is it possible to connect two ports and run getty on one port and minicom on
another ? We should check that UARTs are really working.

 I've updated the web page with lspci -vv and dmesg output.  I can also post 
 it here if that's desirable, just figured I'd save everyone the inbox 
 flooding :).

 -- Chris

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [HP ProLiant WatchDog driver] hpwdt HP WatchDog Patch

2007-10-15 Thread Andrey Panin
 return retval;
> +
> + p_mem_addr = ioremap((unsigned long)pci_resource_start(dev, 1), 0x80);
> + if (!p_mem_addr) {
> + retval = -ENOMEM;
> + goto error_out;
> + }
> + hpwdt_timer_reg = (p_mem_addr + 0x70);
> + hpwdt_timer_con = (p_mem_addr + 0x72);
> +
> +#ifndef CONFIG_X86_64
> + /*
> +  * Let's try to map in the ROM for 32 bit Operating Systems because
> +  * we need get the CRU Service through the 32 Bit BIOS SD.
> +  * This is not the case for 64 bit Operating Systems where we get
> +  * that service through SMBIOS.
> +  */
> + retval = find_32bit_bios_sd();
> + if (retval < 0) {
> + printk(KERN_WARNING
> +"hpwdt: No 32 Bit BIOS Service Directory found.\n");
> + goto error_out;
> + }
> +
> + retval = cru_detect();
> + if (retval < 0) {
> + printk(KERN_WARNING
> +"hpwdt: Unable to detect 32 Bit CRU Service.\n");
> + goto error_out;
> + }
> +#else
> + retval = smbios_detect();
> + if (retval < 0) {
> + printk(KERN_WARNING "hpwdt: No 64 Bit SMBIOS found.\n");
> + goto error_out;
> + }
> +
> + retval = smbios_get_64bit_cru_info();
> + if (retval < 0) {
> + printk(KERN_WARNING
> +"hpwdt: Unable to detect the 64 Bit CRU Service.\n");
> + goto error_out;
> + }
> +#endif
> + /*
> +  * We know this is the only CRU call we need to make so lets keep as
> +  * few instructions as possible once the NMI comes in.
> +  */
> + memset(_regs, 0, sizeof(CMN_REGISTERS));
> + cmn_regs.u1.s1.rah = 0x0D;
> + cmn_regs.u1.s1.ral = 0x02;
> +
> + retval = register_die_notifier(_notifier);
> + if (retval != 0) {
> + printk(KERN_WARNING
> +"hpwdt: Unable to register a die notifier.\n");
> + goto error_out;
> + }
> + die_reg = 1;
> +
> + new_margin = soft_margin;
> + printk("hp Watchdog Timer Driver: 1.00, timer margin: %d minutes\n",
> + new_margin);
> +
> + return 0;
> +error_out:
> + printk(KERN_WARNING "hpwdt: NMI support is not possible.\n");
> + misc_deregister(_miscdev);
> + if (pci_enable)
> + pci_disable_device(dev);
> + if (p_mem_addr)
> + iounmap(p_mem_addr);
> + if (gpVirtRomCRUAddr)
> + iounmap(gpVirtRomCRUAddr);
> + return retval;
> +}
> +
> +static void __devexit hpwdt_exit(struct pci_dev *dev)
> +{
> + if (die_reg)
> + unregister_die_notifier(_notifier);
> +
> + misc_deregister(_miscdev);
> + if (p_mem_addr)
> + iounmap(p_mem_addr);
> + if (gpVirtRomCRUAddr)
> + iounmap(gpVirtRomCRUAddr);
> +}
> +
> +static struct pci_driver hpwdt_driver = {
> + .name = "hpwdt",
> + .id_table = hpwdt_devices,
> + .probe = hpwdt_init_one,
> + .remove = __devexit_p(hpwdt_exit),
> +};
> +
> +static void __exit hpwdt_cleanup(void)
> +{
> + pci_unregister_driver(_driver);
> +}
> +
> +static int __init hpwdt_init(void)
> +{
> + return pci_register_driver(_driver);
> +}
> +
> +MODULE_AUTHOR("Tom Mingarelli");
> +MODULE_DESCRIPTION("hp watchdog driver");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
> +
> +module_param(soft_margin, int, 0);
> +MODULE_PARM_DESC(soft_margin, "Watchdog timeout in minutes");
> +
> +module_init(hpwdt_init);
> +module_exit(hpwdt_cleanup);
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [HP ProLiant WatchDog driver] hpwdt HP WatchDog Patch

2007-10-15 Thread Andrey Panin
 struct notifier_block die_notifier = {
 + .notifier_call = hpwdt_pretimeout,
 + .priority = 0x7FFF,
 +};
 +
 +static int __devinit hpwdt_init_one(struct pci_dev *dev,
 + const struct pci_device_id *ent)
 +{
 + int retval;
 +
 + if (pci_enable_device(dev)) {
 + printk(KERN_WARNING
 +hpwdt: Not possible to enable PCI Device\n);
 + return -ENODEV;
 + }
 + pci_enable = 1;
 +
 + /*
 +  * First let's find out if we are on an iLO2 server. We will
 +  * not run on a legacy ASM box.
 +  */
 + if (dev-subsystem_vendor != PCI_VENDOR_ID_HP) {
 + printk(KERN_WARNING
 +hpwdt: This server does not have an iLO2 ASIC.\n);
 + return -ENODEV;
 + }
 +
 + retval = misc_register(hpwdt_miscdev);
 + if (retval  0)
 + return retval;
 +
 + p_mem_addr = ioremap((unsigned long)pci_resource_start(dev, 1), 0x80);
 + if (!p_mem_addr) {
 + retval = -ENOMEM;
 + goto error_out;
 + }
 + hpwdt_timer_reg = (p_mem_addr + 0x70);
 + hpwdt_timer_con = (p_mem_addr + 0x72);
 +
 +#ifndef CONFIG_X86_64
 + /*
 +  * Let's try to map in the ROM for 32 bit Operating Systems because
 +  * we need get the CRU Service through the 32 Bit BIOS SD.
 +  * This is not the case for 64 bit Operating Systems where we get
 +  * that service through SMBIOS.
 +  */
 + retval = find_32bit_bios_sd();
 + if (retval  0) {
 + printk(KERN_WARNING
 +hpwdt: No 32 Bit BIOS Service Directory found.\n);
 + goto error_out;
 + }
 +
 + retval = cru_detect();
 + if (retval  0) {
 + printk(KERN_WARNING
 +hpwdt: Unable to detect 32 Bit CRU Service.\n);
 + goto error_out;
 + }
 +#else
 + retval = smbios_detect();
 + if (retval  0) {
 + printk(KERN_WARNING hpwdt: No 64 Bit SMBIOS found.\n);
 + goto error_out;
 + }
 +
 + retval = smbios_get_64bit_cru_info();
 + if (retval  0) {
 + printk(KERN_WARNING
 +hpwdt: Unable to detect the 64 Bit CRU Service.\n);
 + goto error_out;
 + }
 +#endif
 + /*
 +  * We know this is the only CRU call we need to make so lets keep as
 +  * few instructions as possible once the NMI comes in.
 +  */
 + memset(cmn_regs, 0, sizeof(CMN_REGISTERS));
 + cmn_regs.u1.s1.rah = 0x0D;
 + cmn_regs.u1.s1.ral = 0x02;
 +
 + retval = register_die_notifier(die_notifier);
 + if (retval != 0) {
 + printk(KERN_WARNING
 +hpwdt: Unable to register a die notifier.\n);
 + goto error_out;
 + }
 + die_reg = 1;
 +
 + new_margin = soft_margin;
 + printk(hp Watchdog Timer Driver: 1.00, timer margin: %d minutes\n,
 + new_margin);
 +
 + return 0;
 +error_out:
 + printk(KERN_WARNING hpwdt: NMI support is not possible.\n);
 + misc_deregister(hpwdt_miscdev);
 + if (pci_enable)
 + pci_disable_device(dev);
 + if (p_mem_addr)
 + iounmap(p_mem_addr);
 + if (gpVirtRomCRUAddr)
 + iounmap(gpVirtRomCRUAddr);
 + return retval;
 +}
 +
 +static void __devexit hpwdt_exit(struct pci_dev *dev)
 +{
 + if (die_reg)
 + unregister_die_notifier(die_notifier);
 +
 + misc_deregister(hpwdt_miscdev);
 + if (p_mem_addr)
 + iounmap(p_mem_addr);
 + if (gpVirtRomCRUAddr)
 + iounmap(gpVirtRomCRUAddr);
 +}
 +
 +static struct pci_driver hpwdt_driver = {
 + .name = hpwdt,
 + .id_table = hpwdt_devices,
 + .probe = hpwdt_init_one,
 + .remove = __devexit_p(hpwdt_exit),
 +};
 +
 +static void __exit hpwdt_cleanup(void)
 +{
 + pci_unregister_driver(hpwdt_driver);
 +}
 +
 +static int __init hpwdt_init(void)
 +{
 + return pci_register_driver(hpwdt_driver);
 +}
 +
 +MODULE_AUTHOR(Tom Mingarelli);
 +MODULE_DESCRIPTION(hp watchdog driver);
 +MODULE_LICENSE(GPL);
 +MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
 +
 +module_param(soft_margin, int, 0);
 +MODULE_PARM_DESC(soft_margin, Watchdog timeout in minutes);
 +
 +module_init(hpwdt_init);
 +module_exit(hpwdt_cleanup);
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH try #4] Blackfin BF54x Input Keypad controller driver

2007-10-13 Thread Andrey Panin
t; + input_free_device(input);
> +out3:
> + free_irq(bf54x_kpad->irq, pdev);
> +out2:
> + peripheral_free_list((u16 *)_cols[MAX_RC - pdata->cols]);
> +out1:
> + peripheral_free_list((u16 *)_rows[MAX_RC - pdata->rows]);
> +out0:
> + kfree(bf54x_kpad->keycode);
> +out:
> + kfree(bf54x_kpad);
> + platform_set_drvdata(pdev, NULL);
> +
> + return error;
> +}
> +
> +static int __devexit bfin_kpad_remove(struct platform_device *pdev)
> +{
> + struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data;
> + struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev);
> +
> +
> + del_timer_sync(_kpad->timer);
> + free_irq(bf54x_kpad->irq, pdev);
> +
> + peripheral_free_list((u16 *)_rows[MAX_RC - pdata->rows]);
> + peripheral_free_list((u16 *)_cols[MAX_RC - pdata->cols]);
> +
> + input_unregister_device(bf54x_kpad->input);
> +
> + kfree(bf54x_kpad->keycode);
> + kfree(bf54x_kpad);
> + platform_set_drvdata(pdev, NULL);
> +
> + return 0;
> +}
> +
> +struct platform_driver bfin_kpad_device_driver = {
> + .probe  = bfin_kpad_probe,
> + .remove = __devexit_p(bfin_kpad_remove),
> + .driver = {
> + .name   = DRV_NAME,
> + }
> +};
> +
> +static int __init bfin_kpad_init(void)
> +{
> + return platform_driver_register(_kpad_device_driver);
> +}
> +
> +static void __exit bfin_kpad_exit(void)
> +{
> + platform_driver_unregister(_kpad_device_driver);
> +}
> +
> +module_init(bfin_kpad_init);
> +module_exit(bfin_kpad_exit);
> +
> +MODULE_LICENSE("GPL");
> +MODULE_AUTHOR("Michael Hennerich <[EMAIL PROTECTED]>");
> +MODULE_DESCRIPTION("Keypad driver for BF54x Processors");
> diff --git a/include/asm-blackfin/mach-bf548/bf54x_keys.h 
> b/include/asm-blackfin/mach-bf548/bf54x_keys.h
> new file mode 100644
> index 000..8ab1f91
> --- /dev/null
> +++ b/include/asm-blackfin/mach-bf548/bf54x_keys.h
> @@ -0,0 +1,17 @@
> +#ifndef _BFIN_KPAD_H
> +#define _BFIN_KPAD_H
> +
> +struct bfin_kpad_platform_data {
> + int rows;
> + int cols;
> + unsigned int *keymap;
> + unsigned short keymapsize;
> + unsigned short repeat;
> + u32 debounce_time;  /* in ns */
> + u32 coldrive_time;  /* in ns */
> + u32 keyup_test_interval; /* in ms */
> +};
> +
> +#define KEYVAL(col, row, val) (((1 << col) << 24) | ((1 << row) << 16) | 
> (val))
> +
> +#endif
> -- 
> 1.5.3.4
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH try #4] Blackfin BF54x Input Keypad controller driver

2007-10-13 Thread Andrey Panin
 cols;
 + unsigned int *keymap;
 + unsigned short keymapsize;
 + unsigned short repeat;
 + u32 debounce_time;  /* in ns */
 + u32 coldrive_time;  /* in ns */
 + u32 keyup_test_interval; /* in ms */
 +};
 +
 +#define KEYVAL(col, row, val) (((1  col)  24) | ((1  row)  16) | 
 (val))
 +
 +#endif
 -- 
 1.5.3.4
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-12 Thread Andrey Panin
On 284, 10 11, 2007 at 01:02:12PM -0400, Chris Bergeron wrote:
> Andrey Panin wrote:
>> On 278, 10 05, 2007 at 05:31:05PM -0400, Chris Bergeron wrote:
>>   
>>> Hello all,
>>>
>>> I've just installed a multiport serial card released by an outfit called 
>>> Syba.  This is an 8 port serial-only card with an Octopus style breakout 
>>> cable.  The main chipset on it is an ITE IT8871F.
>>> 
>>
>> Are you sure ? IIRC IT887x are PCI-ISA bridges with additional periphery
>> and your lspci shows PLX chip. Can you send complete lspci -vv output ?
>> Output of dmesg could be useful too.
>>
>>
>>   
> I'm sure that's what it says on the largest chip on the PCI card.  It could 
> be that the other two chips are more relevant... the numbers from them are 
> included below.
>
> I've posted up a quick text only page with the diagnostic information from 
> the system (full dmesg, lspci, etc) plus links to pictures of the board 
> (since others might see something important that I'm not aware of).  You 
> can access that at 
> http://pcburn.com/files/Syba_serial_controller/index.html

Can you try an attached patch ? I hope it should at least detect UARTs on 
your board. Be ready that baudrate could be wrong, because we do not know
what frequency is used to clock these UARTs.

> One chip has "ITE IT8871F 0641-AYS ZF1M04L" written on it, and the other 
> two have  a stylized celtic knot looking "T" followed by "TG16C554CJG 
> FTA6M-001 0620-B".

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
diff -urdpNX /usr/share/dontdiff linux-2.6.23.vanilla/drivers/serial/8250_pci.c 
linux-2.6.23/drivers/serial/8250_pci.c
--- linux-2.6.23.vanilla/drivers/serial/8250_pci.c  2007-10-12 
14:20:44.0 +0400
+++ linux-2.6.23/drivers/serial/8250_pci.c  2007-10-12 14:07:08.0 
+0400
@@ -1036,6 +1036,7 @@ enum pci_board_num_t {
pbn_b0_2_115200,
pbn_b0_4_115200,
pbn_b0_5_115200,
+   pbn_b0_8_115200,
 
pbn_b0_1_921600,
pbn_b0_2_921600,
@@ -1172,6 +1173,12 @@ static struct pciserial_board pci_boards
.base_baud  = 115200,
.uart_offset= 8,
},
+   [pbn_b0_8_115200] = {
+   .flags  = FL_BASE0,
+   .num_ports  = 8,
+   .base_baud  = 115200,
+   .uart_offset= 8,
+   },
 
[pbn_b0_1_921600] = {
.flags  = FL_BASE0,
@@ -2520,6 +2527,11 @@ static struct pci_device_id serial_pci_t
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
pbn_b3_8_115200 },
 
+   /* Syba PCI8871-PR8 8-port serial card */
+   {   PCI_VENDOR_ID_PLX, 0x9016,
+   0x544e, 0x0008, 0, 0,
+   pbn_b0_8_115200 },
+
/*
 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
 */


signature.asc
Description: Digital signature


Re: [PATCH try #2] Input/Joystick Driver: add support AD7142 joystick driver

2007-10-12 Thread Andrey Panin
01);
> + break;
> + case 0x0002:
> + input_report_key(ad7142_dev, BTN_BASE3,
> + ((irqno_high & 0x0002) >> 1));
> + break;
> + case 0x0004:
> + input_report_key(ad7142_dev, KEY_DOWN,
> + ((irqno_high & 0x0004) >> 2));
> + break;
> + case 0x0008:
> + input_report_key(ad7142_dev, KEY_LEFT,
> + ((irqno_high & 0x0008) >> 3));
> + break;
> + }
> + old_status_high = irqno_high;
> +
> + input_sync(ad7142_dev);
> +}
> +
> +static int ad7142_thread(void *nothing)
> +{
> + do {
> + wait_event_interruptible(ad7142_wait,
> + kthread_should_stop() || (intr_flag != 0));
> + ad7142_decode();
> + intr_flag = 0;
> + enable_irq(CONFIG_BFIN_JOYSTICK_IRQ_PFX);
> + } while (!kthread_should_stop());
> +
> + pr_debug("ad7142: kthread exiting\n");
> +
> + return 0;
> +}
> +
> +static int ad7142_open(struct input_dev *dev)
> +{
> + unsigned short id, value;
> +
> + ad7142_i2c_read(ad7142_client, DEVID, , 1);
> + if (id != AD7142_I2C_ID) {
> + printk(KERN_ERR "Open AD7142 error\n");
> + return -ENODEV;
> + }
> +
> + ad7142_i2c_write(ad7142_client, STAGE0_CONNECTION, stage[0], 8);
> + ad7142_i2c_write(ad7142_client, STAGE1_CONNECTION, stage[1], 8);
> + ad7142_i2c_write(ad7142_client, STAGE2_CONNECTION, stage[2], 8);
> + ad7142_i2c_write(ad7142_client, STAGE3_CONNECTION, stage[3], 8);
> + ad7142_i2c_write(ad7142_client, STAGE4_CONNECTION, stage[4], 8);
> + ad7142_i2c_write(ad7142_client, STAGE5_CONNECTION, stage[4], 8);
> + ad7142_i2c_write(ad7142_client, STAGE6_CONNECTION, stage[4], 8);
> + ad7142_i2c_write(ad7142_client, STAGE7_CONNECTION, stage[4], 8);
> + ad7142_i2c_write(ad7142_client, STAGE8_CONNECTION, stage[4], 8);
> + ad7142_i2c_write(ad7142_client, STAGE9_CONNECTION, stage[4], 8);
> + ad7142_i2c_write(ad7142_client, STAGE10_CONNECTION, stage[4], 8);
> + ad7142_i2c_write(ad7142_client, STAGE11_CONNECTION, stage[4], 8);
> +
> + value = 0x00B0;
> + ad7142_i2c_write(ad7142_client, PWRCONVCTL, , 1);
> +
> + value = 0x0690;
> + ad7142_i2c_write(ad7142_client, AMBCOMPCTL_REG1, , 1);
> +
> + value = 0x0664;
> + ad7142_i2c_write(ad7142_client, AMBCOMPCTL_REG2, , 1);
> +
> + value = 0x290F;
> + ad7142_i2c_write(ad7142_client, AMBCOMPCTL_REG3, , 1);
> +
> + value = 0x000F;
> + ad7142_i2c_write(ad7142_client, INTEN_REG0, , 1);
> + ad7142_i2c_write(ad7142_client, INTEN_REG1, , 1);
> +
> + value = 0x;
> + ad7142_i2c_write(ad7142_client, INTEN_REG2, , 1);
> +
> + ad7142_i2c_read(ad7142_client, AMBCOMPCTL_REG1, , 1);
> +
> + value = 0x000F;
> + ad7142_i2c_write(ad7142_client, AMBCOMPCTL_REG0, , 1);
> +
> + ad7142_task = kthread_run(ad7142_thread, NULL, "ad7142_task");
> + if (IS_ERR(ad7142_task)) {
> + printk(KERN_ERR "serio: Failed to start kseriod\n");
> + return PTR_ERR(ad7142_task);
> + }
> + return 0;
> +}
> +
> +static void ad7142_close(struct input_dev *dev)
> +{
> + free_irq(CONFIG_BFIN_JOYSTICK_IRQ_PFX, ad7142_interrupt);
> + kthread_stop(ad7142_task);
> +}
> +
> +static int __init ad7142_init(void)
> +{
> + int ret;
> +
> + ad7142_dev = input_allocate_device();
> + if (!ad7142_dev)
> + return -ENOMEM;
> +
> + ad7142_dev->open = ad7142_open;
> + ad7142_dev->close = ad7142_close;
> + ad7142_dev->evbit[0] = BIT(EV_KEY);
> + ad7142_dev->keybit[LONG(BTN_BASE)] = BIT(BTN_BASE) | BIT(BTN_BASE2) |
> + BIT(BTN_BASE3) | BIT(BTN_BASE4);
> + ad7142_dev->keybit[LONG(KEY_UP)] |= BIT(KEY_UP) | BIT(KEY_DOWN) |
> + BIT(KEY_LEFT) | BIT(KEY_RIGHT);
> +
> + ad7142_dev->name = "ad7142 joystick";
> + ad7142_dev->phys = "ad7142/input0";
> + ad7142_dev->id.bustype = BUS_I2C;
> + ad7142_dev->id.vendor = 0x0001;
> + ad7142_dev->id.product = 0x0001;
> + ad7142_dev->id.version = 0x0100;
> +
> + ret = input_register_device(ad7142_dev);
> + if (ret) {
> + printk(KERN_ERR "Failed to register AD7142 input device!\n");
> + goto fail_register;
> + }
> +
> + ret = i2c_add_driver(_driver);
> + if (ret) {
> + printk(KERN_ERR "Failed to add AD7142 I2C driver!\n");
> + goto fail_add;
> + }
> + return 0;
> +
> +fail_add:
> + input_unregister_device(ad7142_dev);
> +fail_register:
> + input_free_device(ad7142_dev);
> + return ret;
> +}
> +
> +static void __exit ad7142_exit(void)
> +{
> + i2c_del_driver(_driver);
> + input_unregister_device(ad7142_dev);
> +}
> +
> +module_init(ad7142_init);
> +module_exit(ad7142_exit);
> -- 
> 1.5.3.4
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH try #2] Input/Joystick Driver: add support AD7142 joystick driver

2007-10-12 Thread Andrey Panin
);
 + ad7142_i2c_write(ad7142_client, STAGE9_CONNECTION, stage[4], 8);
 + ad7142_i2c_write(ad7142_client, STAGE10_CONNECTION, stage[4], 8);
 + ad7142_i2c_write(ad7142_client, STAGE11_CONNECTION, stage[4], 8);
 +
 + value = 0x00B0;
 + ad7142_i2c_write(ad7142_client, PWRCONVCTL, value, 1);
 +
 + value = 0x0690;
 + ad7142_i2c_write(ad7142_client, AMBCOMPCTL_REG1, value, 1);
 +
 + value = 0x0664;
 + ad7142_i2c_write(ad7142_client, AMBCOMPCTL_REG2, value, 1);
 +
 + value = 0x290F;
 + ad7142_i2c_write(ad7142_client, AMBCOMPCTL_REG3, value, 1);
 +
 + value = 0x000F;
 + ad7142_i2c_write(ad7142_client, INTEN_REG0, value, 1);
 + ad7142_i2c_write(ad7142_client, INTEN_REG1, value, 1);
 +
 + value = 0x;
 + ad7142_i2c_write(ad7142_client, INTEN_REG2, value, 1);
 +
 + ad7142_i2c_read(ad7142_client, AMBCOMPCTL_REG1, value, 1);
 +
 + value = 0x000F;
 + ad7142_i2c_write(ad7142_client, AMBCOMPCTL_REG0, value, 1);
 +
 + ad7142_task = kthread_run(ad7142_thread, NULL, ad7142_task);
 + if (IS_ERR(ad7142_task)) {
 + printk(KERN_ERR serio: Failed to start kseriod\n);
 + return PTR_ERR(ad7142_task);
 + }
 + return 0;
 +}
 +
 +static void ad7142_close(struct input_dev *dev)
 +{
 + free_irq(CONFIG_BFIN_JOYSTICK_IRQ_PFX, ad7142_interrupt);
 + kthread_stop(ad7142_task);
 +}
 +
 +static int __init ad7142_init(void)
 +{
 + int ret;
 +
 + ad7142_dev = input_allocate_device();
 + if (!ad7142_dev)
 + return -ENOMEM;
 +
 + ad7142_dev-open = ad7142_open;
 + ad7142_dev-close = ad7142_close;
 + ad7142_dev-evbit[0] = BIT(EV_KEY);
 + ad7142_dev-keybit[LONG(BTN_BASE)] = BIT(BTN_BASE) | BIT(BTN_BASE2) |
 + BIT(BTN_BASE3) | BIT(BTN_BASE4);
 + ad7142_dev-keybit[LONG(KEY_UP)] |= BIT(KEY_UP) | BIT(KEY_DOWN) |
 + BIT(KEY_LEFT) | BIT(KEY_RIGHT);
 +
 + ad7142_dev-name = ad7142 joystick;
 + ad7142_dev-phys = ad7142/input0;
 + ad7142_dev-id.bustype = BUS_I2C;
 + ad7142_dev-id.vendor = 0x0001;
 + ad7142_dev-id.product = 0x0001;
 + ad7142_dev-id.version = 0x0100;
 +
 + ret = input_register_device(ad7142_dev);
 + if (ret) {
 + printk(KERN_ERR Failed to register AD7142 input device!\n);
 + goto fail_register;
 + }
 +
 + ret = i2c_add_driver(ad7142_driver);
 + if (ret) {
 + printk(KERN_ERR Failed to add AD7142 I2C driver!\n);
 + goto fail_add;
 + }
 + return 0;
 +
 +fail_add:
 + input_unregister_device(ad7142_dev);
 +fail_register:
 + input_free_device(ad7142_dev);
 + return ret;
 +}
 +
 +static void __exit ad7142_exit(void)
 +{
 + i2c_del_driver(ad7142_driver);
 + input_unregister_device(ad7142_dev);
 +}
 +
 +module_init(ad7142_init);
 +module_exit(ad7142_exit);
 -- 
 1.5.3.4
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-12 Thread Andrey Panin
On 284, 10 11, 2007 at 01:02:12PM -0400, Chris Bergeron wrote:
 Andrey Panin wrote:
 On 278, 10 05, 2007 at 05:31:05PM -0400, Chris Bergeron wrote:
   
 Hello all,

 I've just installed a multiport serial card released by an outfit called 
 Syba.  This is an 8 port serial-only card with an Octopus style breakout 
 cable.  The main chipset on it is an ITE IT8871F.
 

 Are you sure ? IIRC IT887x are PCI-ISA bridges with additional periphery
 and your lspci shows PLX chip. Can you send complete lspci -vv output ?
 Output of dmesg could be useful too.


   
 I'm sure that's what it says on the largest chip on the PCI card.  It could 
 be that the other two chips are more relevant... the numbers from them are 
 included below.

 I've posted up a quick text only page with the diagnostic information from 
 the system (full dmesg, lspci, etc) plus links to pictures of the board 
 (since others might see something important that I'm not aware of).  You 
 can access that at 
 http://pcburn.com/files/Syba_serial_controller/index.html

Can you try an attached patch ? I hope it should at least detect UARTs on 
your board. Be ready that baudrate could be wrong, because we do not know
what frequency is used to clock these UARTs.

 One chip has ITE IT8871F 0641-AYS ZF1M04L written on it, and the other 
 two have  a stylized celtic knot looking T followed by TG16C554CJG 
 FTA6M-001 0620-B.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
diff -urdpNX /usr/share/dontdiff linux-2.6.23.vanilla/drivers/serial/8250_pci.c 
linux-2.6.23/drivers/serial/8250_pci.c
--- linux-2.6.23.vanilla/drivers/serial/8250_pci.c  2007-10-12 
14:20:44.0 +0400
+++ linux-2.6.23/drivers/serial/8250_pci.c  2007-10-12 14:07:08.0 
+0400
@@ -1036,6 +1036,7 @@ enum pci_board_num_t {
pbn_b0_2_115200,
pbn_b0_4_115200,
pbn_b0_5_115200,
+   pbn_b0_8_115200,
 
pbn_b0_1_921600,
pbn_b0_2_921600,
@@ -1172,6 +1173,12 @@ static struct pciserial_board pci_boards
.base_baud  = 115200,
.uart_offset= 8,
},
+   [pbn_b0_8_115200] = {
+   .flags  = FL_BASE0,
+   .num_ports  = 8,
+   .base_baud  = 115200,
+   .uart_offset= 8,
+   },
 
[pbn_b0_1_921600] = {
.flags  = FL_BASE0,
@@ -2520,6 +2527,11 @@ static struct pci_device_id serial_pci_t
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
pbn_b3_8_115200 },
 
+   /* Syba PCI8871-PR8 8-port serial card */
+   {   PCI_VENDOR_ID_PLX, 0x9016,
+   0x544e, 0x0008, 0, 0,
+   pbn_b0_8_115200 },
+
/*
 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
 */


signature.asc
Description: Digital signature


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-10 Thread Andrey Panin
On 278, 10 05, 2007 at 05:31:05PM -0400, Chris Bergeron wrote:
> Hello all,
>
> I've just installed a multiport serial card released by an outfit called 
> Syba.  This is an 8 port serial-only card with an Octopus style breakout 
> cable.  The main chipset on it is an ITE IT8871F.

Are you sure ? IIRC IT887x are PCI-ISA bridges with additional periphery
and your lspci shows PLX chip. Can you send complete lspci -vv output ?
Output of dmesg could be useful too.

> I've got two questions on this: Is there a driver I should try force 
> loading on it (and if so, what options to use)?  and is there any useful 
> testing I can do to report back to the LKML on this card?
>
> Thanks for your time, diagnostic output follows.
> -- Chris
>
> The following comes up from an "lspci -vv"
>
> 01:06.0 Serial controller: PLX Technology, Inc. Unknown device 9016 (rev 
> 01) (prog-if 02 [16550])
>Subsystem: Unknown device 544e:0008
>Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- 
> Stepping- SERR- FastB2B-
>Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
> SERR- Interrupt: pin A routed to IRQ 16
>Region 0: I/O ports at a000 [size=64]
>Region 1: I/O ports at a400 [size=16]
>Region 2: I/O ports at a800 [size=16]
>Region 3: Memory at f500 (32-bit, non-prefetchable) [size=4K]
>Region 4: Memory at f5001000 (32-bit, non-prefetchable) [size=4K]
>Region 5: Memory at f5002000 (32-bit, non-prefetchable) [size=4K]
>
> and "lshw" outputs:
>
>*-communication UNCLAIMED
> description: Serial controller
> product: PLX Technology, Inc.
> vendor: PLX Technology, Inc.
> physical id: 6
> bus info: [EMAIL PROTECTED]:01:06.0
> version: 01
> width: 32 bits
> clock: 33MHz
> capabilities: 16550
> configuration: latency=0
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Added support for Wacom WACF007 and WACF008 to serial pnp driver.

2007-10-10 Thread Andrey Panin
On 283, 10 10, 2007 at 09:55:58AM +0200, Maik Broemme wrote:
> Hi,
> 
> notebook manufacturer seems to built a newer Wacom pen enabled tablet to
> recent tablet pcs which are not recognized by the serial pnp driver.
> 
> Attached is a patch which makes the newer Wacom WACF007 and WACF008
> tablets useable with the serial driver. The device is fully compatible
> with it.
> 
> This is a resent of my mail two weeks ago to 'linux-serial' :)

Please resend with proper Signed-off-by: line.

> diff -Nur linux-2.6.23-rc8/drivers/serial/8250_pnp.c 
> linux-2.6.23-rc8-newer-wacom/drivers/serial/8250_pnp.c
> --- linux-2.6.23-rc8/drivers/serial/8250_pnp.c2007-09-28 
> 17:14:07.0 +0200
> +++ linux-2.6.23-rc8-newer-wacom/drivers/serial/8250_pnp.c2007-09-28 
> 17:09:45.0 +0200
> @@ -327,6 +327,8 @@
>   {   "WACF004",  0   },
>   {   "WACF005",  0   },
>   {   "WACF006",  0   },
> + {   "WACF007",  0   },
> + {   "WACF008",  0   },
>   /* Compaq touchscreen */
>   {   "FPI2002",  0 },
>   /* Fujitsu Stylistic touchscreens */


-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Added support for Wacom WACF007 and WACF008 to serial pnp driver.

2007-10-10 Thread Andrey Panin
On 283, 10 10, 2007 at 09:55:58AM +0200, Maik Broemme wrote:
 Hi,
 
 notebook manufacturer seems to built a newer Wacom pen enabled tablet to
 recent tablet pcs which are not recognized by the serial pnp driver.
 
 Attached is a patch which makes the newer Wacom WACF007 and WACF008
 tablets useable with the serial driver. The device is fully compatible
 with it.
 
 This is a resent of my mail two weeks ago to 'linux-serial' :)

Please resend with proper Signed-off-by: line.

 diff -Nur linux-2.6.23-rc8/drivers/serial/8250_pnp.c 
 linux-2.6.23-rc8-newer-wacom/drivers/serial/8250_pnp.c
 --- linux-2.6.23-rc8/drivers/serial/8250_pnp.c2007-09-28 
 17:14:07.0 +0200
 +++ linux-2.6.23-rc8-newer-wacom/drivers/serial/8250_pnp.c2007-09-28 
 17:09:45.0 +0200
 @@ -327,6 +327,8 @@
   {   WACF004,  0   },
   {   WACF005,  0   },
   {   WACF006,  0   },
 + {   WACF007,  0   },
 + {   WACF008,  0   },
   /* Compaq touchscreen */
   {   FPI2002,  0 },
   /* Fujitsu Stylistic touchscreens */


-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Syba 8-Port Serial Card Unidentified By Kernel

2007-10-10 Thread Andrey Panin
On 278, 10 05, 2007 at 05:31:05PM -0400, Chris Bergeron wrote:
 Hello all,

 I've just installed a multiport serial card released by an outfit called 
 Syba.  This is an 8 port serial-only card with an Octopus style breakout 
 cable.  The main chipset on it is an ITE IT8871F.

Are you sure ? IIRC IT887x are PCI-ISA bridges with additional periphery
and your lspci shows PLX chip. Can you send complete lspci -vv output ?
Output of dmesg could be useful too.

 I've got two questions on this: Is there a driver I should try force 
 loading on it (and if so, what options to use)?  and is there any useful 
 testing I can do to report back to the LKML on this card?

 Thanks for your time, diagnostic output follows.
 -- Chris

 The following comes up from an lspci -vv

 01:06.0 Serial controller: PLX Technology, Inc. Unknown device 9016 (rev 
 01) (prog-if 02 [16550])
Subsystem: Unknown device 544e:0008
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- 
 Stepping- SERR- FastB2B-
Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium TAbort- 
 TAbort- MAbort- SERR- PERR-
Interrupt: pin A routed to IRQ 16
Region 0: I/O ports at a000 [size=64]
Region 1: I/O ports at a400 [size=16]
Region 2: I/O ports at a800 [size=16]
Region 3: Memory at f500 (32-bit, non-prefetchable) [size=4K]
Region 4: Memory at f5001000 (32-bit, non-prefetchable) [size=4K]
Region 5: Memory at f5002000 (32-bit, non-prefetchable) [size=4K]

 and lshw outputs:

*-communication UNCLAIMED
 description: Serial controller
 product: PLX Technology, Inc.
 vendor: PLX Technology, Inc.
 physical id: 6
 bus info: [EMAIL PROTECTED]:01:06.0
 version: 01
 width: 32 bits
 clock: 33MHz
 capabilities: 16550
 configuration: latency=0

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


-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] watchdog: add Nano 7240 driver

2007-10-07 Thread Andrey Panin
= {
> + .owner = THIS_MODULE,
> + .llseek = no_llseek,
> + .write = fop_write,
> + .open = fop_open,
> + .release = fop_close,
> + .ioctl = fop_ioctl,
> +};
> +
> +static struct miscdevice wdt_miscdev = {
> + .minor = WATCHDOG_MINOR,
> + .name = "watchdog",
> + .fops = _fops,
> +};
> +
> +/*
> + *   Notifier for system down
> + */
> +
> +static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
> +   void *unused)
> +{
> + if (code == SYS_DOWN || code == SYS_HALT)
> + wdt_disable();
> + return NOTIFY_DONE;
> +}
> +
> +static struct notifier_block wdt_notifier = {
> + .notifier_call = wdt_notify_sys,
> +};
> +
> +static void __exit sbc7240_wdt_unload(void)
> +{
> + printk(KERN_INFO PREFIX "Removing watchdog\n");
> + misc_deregister(_miscdev);
> +
> + unregister_reboot_notifier(_notifier);
> + release_region(ENABLE_SBC7240_PORT, 1);
> +}
> +
> +static int __init sbc7240_wdt_init(void)
> +{
> + int rc = -EBUSY;
> +
> + if (!request_region(ENABLE_SBC7240_PORT, 1, "SBC7240 WDT")) {
> + printk(KERN_ERR PREFIX "I/O address 0x%04x already in use\n",
> +ENABLE_SBC7240_PORT);
> + rc = -EIO;
> + goto err_out;
> + }
> +
> + /* The IO port 0x043 used to disable the watchdog
> +  * is already claimed by the system timer, so we
> +  * cant request_region() it ...*/
> +
> + rc = misc_register(_miscdev);
> + if (rc) {
> + printk(KERN_ERR PREFIX
> +"cannot register miscdev on minor=%d (err=%d)\n",
> +wdt_miscdev.minor, rc);
> + goto err_out_region1;
> + }
> +
> + rc = register_reboot_notifier(_notifier);
> + if (rc) {
> + printk(KERN_ERR PREFIX
> +"cannot register reboot notifier (err=%d)\n", rc);
> + goto err_out_miscdev;
> + }
> +
> + if (timeout < 1 || timeout > WATCHDOG_MAX_TIMEOUT) {
> +     timeout = WATCHDOG_TIMEOUT;
> + printk(KERN_INFO PREFIX
> +"timeout value must be 1<=x<=%d, using %d\n",
> +WATCHDOG_MAX_TIMEOUT, timeout);
> + }
> + wdt_set_timeout(timeout);
> +
> + printk(KERN_INFO PREFIX
> +"Watchdog driver for SBC7240 initialised (nowayout=%d)\n",
> +nowayout);
> +
> + return 0;
> +
> +  err_out_miscdev:
> + misc_deregister(_miscdev);
> +  err_out_region1:
> + release_region(ENABLE_SBC7240_PORT, 1);
> +  err_out:
> + return rc;
> +}
> +
> +module_init(sbc7240_wdt_init);
> +module_exit(sbc7240_wdt_unload);
> +
> +MODULE_AUTHOR("Gilles Gigan");
> +MODULE_DESCRIPTION
> +("Watchdog device driver for single board computer EPIC Nano 7240 from 
> iEi");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
>
> --
> Free pop3 email with a spam filter.
> http://www.bluebottle.com/tag/5
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] watchdog: add Nano 7240 driver

2007-10-07 Thread Andrey Panin
 WDT)) {
 + printk(KERN_ERR PREFIX I/O address 0x%04x already in use\n,
 +ENABLE_SBC7240_PORT);
 + rc = -EIO;
 + goto err_out;
 + }
 +
 + /* The IO port 0x043 used to disable the watchdog
 +  * is already claimed by the system timer, so we
 +  * cant request_region() it ...*/
 +
 + rc = misc_register(wdt_miscdev);
 + if (rc) {
 + printk(KERN_ERR PREFIX
 +cannot register miscdev on minor=%d (err=%d)\n,
 +wdt_miscdev.minor, rc);
 + goto err_out_region1;
 + }
 +
 + rc = register_reboot_notifier(wdt_notifier);
 + if (rc) {
 + printk(KERN_ERR PREFIX
 +cannot register reboot notifier (err=%d)\n, rc);
 + goto err_out_miscdev;
 + }
 +
 + if (timeout  1 || timeout  WATCHDOG_MAX_TIMEOUT) {
 + timeout = WATCHDOG_TIMEOUT;
 + printk(KERN_INFO PREFIX
 +timeout value must be 1=x=%d, using %d\n,
 +WATCHDOG_MAX_TIMEOUT, timeout);
 + }
 + wdt_set_timeout(timeout);
 +
 + printk(KERN_INFO PREFIX
 +Watchdog driver for SBC7240 initialised (nowayout=%d)\n,
 +nowayout);
 +
 + return 0;
 +
 +  err_out_miscdev:
 + misc_deregister(wdt_miscdev);
 +  err_out_region1:
 + release_region(ENABLE_SBC7240_PORT, 1);
 +  err_out:
 + return rc;
 +}
 +
 +module_init(sbc7240_wdt_init);
 +module_exit(sbc7240_wdt_unload);
 +
 +MODULE_AUTHOR(Gilles Gigan);
 +MODULE_DESCRIPTION
 +(Watchdog device driver for single board computer EPIC Nano 7240 from 
 iEi);
 +MODULE_LICENSE(GPL);
 +MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);

 --
 Free pop3 email with a spam filter.
 http://www.bluebottle.com/tag/5

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


-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Patches for tiny 386 kernels, again. Linux kernel 2.6.22.7

2007-09-24 Thread Andrey Panin
On 267, 09 24, 2007 at 03:09:17PM -0400, Dave Jones wrote:
> On Mon, Sep 24, 2007 at 01:51:17AM -0700, Jonathan Campbell wrote:
> 
> 
>  > +#if defined(__i386__) && defined(CONFIG_DMI)
>  >dmi_check_system(acpi_dmi_table);
>  >  #endif
>  >  
>  > +#ifdef CONFIG_DMI
>  >dmi_scan_machine();
>  > +#endif
>  >  
>  > +#ifdef CONFIG_DMI
>  >/* Check and install the TSC clocksource */
>  >dmi_check_system(bad_tsc_dmi_table);
>  > +#endif
>  >  
>  > +#ifdef CONFIG_DMI
>  >dmi_check_system(acpi_osl_dmi_table);
>  > +#endif
>  
> Instead of adding all these ifdefs, we could just define
> add something along the lines of..
> 
> #ifndef CONFIG_DMI
> #define dmi_check_system do {} while (0)
> #endif
> 
> in some header, which hides the uglies away from the code
> whilst having the same net effect.

Let take a look at linux/dmi.h:

#ifdef CONFIG_DMI

extern int dmi_check_system(struct dmi_system_id *list);
extern char * dmi_get_system_info(int field);
extern struct dmi_device * dmi_find_device(int type, const char *name,
struct dmi_device *from);
extern void dmi_scan_machine(void);
extern int dmi_get_year(int field);
extern int dmi_name_in_vendors(char *str);

#else

static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
static inline char * dmi_get_system_info(int field) { return NULL; }
static inline struct dmi_device * dmi_find_device(int type, const char *name,
struct dmi_device *from) { return NULL; }
static inline int dmi_get_year(int year) { return 0; }
static inline int dmi_name_in_vendors(char *s) { return 0; }

#endif

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Patches for tiny 386 kernels, again. Linux kernel 2.6.22.7

2007-09-24 Thread Andrey Panin
On 267, 09 24, 2007 at 03:09:17PM -0400, Dave Jones wrote:
 On Mon, Sep 24, 2007 at 01:51:17AM -0700, Jonathan Campbell wrote:
 
 
   +#if defined(__i386__)  defined(CONFIG_DMI)
  dmi_check_system(acpi_dmi_table);
#endif

   +#ifdef CONFIG_DMI
  dmi_scan_machine();
   +#endif

   +#ifdef CONFIG_DMI
  /* Check and install the TSC clocksource */
  dmi_check_system(bad_tsc_dmi_table);
   +#endif

   +#ifdef CONFIG_DMI
  dmi_check_system(acpi_osl_dmi_table);
   +#endif
  
 Instead of adding all these ifdefs, we could just define
 add something along the lines of..
 
 #ifndef CONFIG_DMI
 #define dmi_check_system do {} while (0)
 #endif
 
 in some header, which hides the uglies away from the code
 whilst having the same net effect.

Let take a look at linux/dmi.h:

#ifdef CONFIG_DMI

extern int dmi_check_system(struct dmi_system_id *list);
extern char * dmi_get_system_info(int field);
extern struct dmi_device * dmi_find_device(int type, const char *name,
struct dmi_device *from);
extern void dmi_scan_machine(void);
extern int dmi_get_year(int field);
extern int dmi_name_in_vendors(char *str);

#else

static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
static inline char * dmi_get_system_info(int field) { return NULL; }
static inline struct dmi_device * dmi_find_device(int type, const char *name,
struct dmi_device *from) { return NULL; }
static inline int dmi_get_year(int year) { return 0; }
static inline int dmi_name_in_vendors(char *s) { return 0; }

#endif

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: ICH Intel PATA short cable override...

2007-09-05 Thread Andrey Panin
On 247, 09 04, 2007 at 01:37:22PM +0100, Daniel J Blueman wrote:
> We see that in ata_piix.c, there is a whitelist for (laptop) Intel ICH
> controllers with short cables, tied to specific vendor subsystem IDs.
> Since my mini-ITX Ibase MI910F has the subsystem IDs specified as
> Intel [1], this is unusable.
> 
> I can't find another existing mechanism to add short cable
> information, to allow UDMA/66 for my on-board CF socket.

If this board has useful DMI information, you can add DMI quirk for it.
You can look at pata_via.c or pata_ali.c for example.

> Do you suggest I cook a patch to pass a kernel argument eg 'ich=short'
> or 'pata=short', or can you think of a better mechanism?
> 
> Thanks,
>   Daniel
> 
> --- [1]
> 
> # lspci -vs 00:1f.2
> 00:1f.2 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E)
> SATA IDE Controller (rev 03) (prog-if 80 [Master])
> Subsystem: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA
> IDE Controller
> 
> # lspci -vns 00:1f.2
> 00:1f.2 0101: 8086:2828 (rev 03) (prog-if 80 [Master])
> Subsystem: 8086:2828
> -- 
> Daniel J Blueman
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: ICH Intel PATA short cable override...

2007-09-05 Thread Andrey Panin
On 247, 09 04, 2007 at 01:37:22PM +0100, Daniel J Blueman wrote:
 We see that in ata_piix.c, there is a whitelist for (laptop) Intel ICH
 controllers with short cables, tied to specific vendor subsystem IDs.
 Since my mini-ITX Ibase MI910F has the subsystem IDs specified as
 Intel [1], this is unusable.
 
 I can't find another existing mechanism to add short cable
 information, to allow UDMA/66 for my on-board CF socket.

If this board has useful DMI information, you can add DMI quirk for it.
You can look at pata_via.c or pata_ali.c for example.

 Do you suggest I cook a patch to pass a kernel argument eg 'ich=short'
 or 'pata=short', or can you think of a better mechanism?
 
 Thanks,
   Daniel
 
 --- [1]
 
 # lspci -vs 00:1f.2
 00:1f.2 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E)
 SATA IDE Controller (rev 03) (prog-if 80 [Master])
 Subsystem: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA
 IDE Controller
 
 # lspci -vns 00:1f.2
 00:1f.2 0101: 8086:2828 (rev 03) (prog-if 80 [Master])
 Subsystem: 8086:2828
 -- 
 Daniel J Blueman
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [2.6 patch] i386 visws: "extern inline" -> "static inline"

2007-08-28 Thread Andrey Panin
On 239, 08 27, 2007 at 11:28:19PM +0200, Adrian Bunk wrote:
> "extern inline" will have different semantics with gcc 4.3.
> 
> Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

Looks good.

Acked-by: Andrey Panin <[EMAIL PROTECTED]>


> ---
> 
> This patch has been sent on:
> - 14 Aug 2007
> 
>  include/asm-i386/mach-visws/cobalt.h  |8 
>  include/asm-i386/mach-visws/lithium.h |8 
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> e12d2e797af72524f53a0ef3a7dd3cf91f58c542 
> diff --git a/include/asm-i386/mach-visws/cobalt.h 
> b/include/asm-i386/mach-visws/cobalt.h
> index 33c3622..9952588 100644
> --- a/include/asm-i386/mach-visws/cobalt.h
> +++ b/include/asm-i386/mach-visws/cobalt.h
> @@ -94,22 +94,22 @@
>  #define  CO_IRQ_8259 CO_IRQ(CO_APIC_8259)
>  
>  #ifdef CONFIG_X86_VISWS_APIC
> -extern __inline void co_cpu_write(unsigned long reg, unsigned long v)
> +static inline void co_cpu_write(unsigned long reg, unsigned long v)
>  {
>   *((volatile unsigned long *)(CO_CPU_VADDR+reg))=v;
>  }
>  
> -extern __inline unsigned long co_cpu_read(unsigned long reg)
> +static inline unsigned long co_cpu_read(unsigned long reg)
>  {
>   return *((volatile unsigned long *)(CO_CPU_VADDR+reg));
>  }
>   
> -extern __inline void co_apic_write(unsigned long reg, unsigned long v)
> +static inline void co_apic_write(unsigned long reg, unsigned long v)
>  {
>   *((volatile unsigned long *)(CO_APIC_VADDR+reg))=v;
>  }
>   
> -extern __inline unsigned long co_apic_read(unsigned long reg)
> +static inline unsigned long co_apic_read(unsigned long reg)
>  {
>   return *((volatile unsigned long *)(CO_APIC_VADDR+reg));
>  }
> diff --git a/include/asm-i386/mach-visws/lithium.h 
> b/include/asm-i386/mach-visws/lithium.h
> index d443e68..dfcd4f0 100644
> --- a/include/asm-i386/mach-visws/lithium.h
> +++ b/include/asm-i386/mach-visws/lithium.h
> @@ -29,22 +29,22 @@
>  #define  LI_INTD 0x0080
>  
>  /* More special purpose macros... */
> -extern __inline void li_pcia_write16(unsigned long reg, unsigned short v)
> +static inline void li_pcia_write16(unsigned long reg, unsigned short v)
>  {
>   *((volatile unsigned short *)(LI_PCIA_VADDR+reg))=v;
>  }
>  
> -extern __inline unsigned short li_pcia_read16(unsigned long reg)
> +static inline unsigned short li_pcia_read16(unsigned long reg)
>  {
>return *((volatile unsigned short *)(LI_PCIA_VADDR+reg));
>  }
>  
> -extern __inline void li_pcib_write16(unsigned long reg, unsigned short v)
> +static inline void li_pcib_write16(unsigned long reg, unsigned short v)
>  {
>   *((volatile unsigned short *)(LI_PCIB_VADDR+reg))=v;
>  }
>  
> -extern __inline unsigned short li_pcib_read16(unsigned long reg)
> +static inline unsigned short li_pcib_read16(unsigned long reg)
>  {
>   return *((volatile unsigned short *)(LI_PCIB_VADDR+reg));
>  }
> 
> 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [2.6 patch] i386 visws: extern inline - static inline

2007-08-28 Thread Andrey Panin
On 239, 08 27, 2007 at 11:28:19PM +0200, Adrian Bunk wrote:
 extern inline will have different semantics with gcc 4.3.
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

Looks good.

Acked-by: Andrey Panin [EMAIL PROTECTED]


 ---
 
 This patch has been sent on:
 - 14 Aug 2007
 
  include/asm-i386/mach-visws/cobalt.h  |8 
  include/asm-i386/mach-visws/lithium.h |8 
  2 files changed, 8 insertions(+), 8 deletions(-)
 
 e12d2e797af72524f53a0ef3a7dd3cf91f58c542 
 diff --git a/include/asm-i386/mach-visws/cobalt.h 
 b/include/asm-i386/mach-visws/cobalt.h
 index 33c3622..9952588 100644
 --- a/include/asm-i386/mach-visws/cobalt.h
 +++ b/include/asm-i386/mach-visws/cobalt.h
 @@ -94,22 +94,22 @@
  #define  CO_IRQ_8259 CO_IRQ(CO_APIC_8259)
  
  #ifdef CONFIG_X86_VISWS_APIC
 -extern __inline void co_cpu_write(unsigned long reg, unsigned long v)
 +static inline void co_cpu_write(unsigned long reg, unsigned long v)
  {
   *((volatile unsigned long *)(CO_CPU_VADDR+reg))=v;
  }
  
 -extern __inline unsigned long co_cpu_read(unsigned long reg)
 +static inline unsigned long co_cpu_read(unsigned long reg)
  {
   return *((volatile unsigned long *)(CO_CPU_VADDR+reg));
  }
   
 -extern __inline void co_apic_write(unsigned long reg, unsigned long v)
 +static inline void co_apic_write(unsigned long reg, unsigned long v)
  {
   *((volatile unsigned long *)(CO_APIC_VADDR+reg))=v;
  }
   
 -extern __inline unsigned long co_apic_read(unsigned long reg)
 +static inline unsigned long co_apic_read(unsigned long reg)
  {
   return *((volatile unsigned long *)(CO_APIC_VADDR+reg));
  }
 diff --git a/include/asm-i386/mach-visws/lithium.h 
 b/include/asm-i386/mach-visws/lithium.h
 index d443e68..dfcd4f0 100644
 --- a/include/asm-i386/mach-visws/lithium.h
 +++ b/include/asm-i386/mach-visws/lithium.h
 @@ -29,22 +29,22 @@
  #define  LI_INTD 0x0080
  
  /* More special purpose macros... */
 -extern __inline void li_pcia_write16(unsigned long reg, unsigned short v)
 +static inline void li_pcia_write16(unsigned long reg, unsigned short v)
  {
   *((volatile unsigned short *)(LI_PCIA_VADDR+reg))=v;
  }
  
 -extern __inline unsigned short li_pcia_read16(unsigned long reg)
 +static inline unsigned short li_pcia_read16(unsigned long reg)
  {
return *((volatile unsigned short *)(LI_PCIA_VADDR+reg));
  }
  
 -extern __inline void li_pcib_write16(unsigned long reg, unsigned short v)
 +static inline void li_pcib_write16(unsigned long reg, unsigned short v)
  {
   *((volatile unsigned short *)(LI_PCIB_VADDR+reg))=v;
  }
  
 -extern __inline unsigned short li_pcib_read16(unsigned long reg)
 +static inline unsigned short li_pcib_read16(unsigned long reg)
  {
   return *((volatile unsigned short *)(LI_PCIB_VADDR+reg));
  }
 
 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH 4/7] I/OAT: Split PCI startup from DMA handling code

2007-07-20 Thread Andrey Panin
On 200, 07 19, 2007 at 05:45:07PM -0700, Shannon Nelson wrote:
> Split the general PCI startup from the DMA handling code in order to
> prepare for adding support for DCA services and future versions of the
> ioatdma device.
> 
> Signed-off-by: Shannon Nelson <[EMAIL PROTECTED]>
> ---
> 
>  drivers/dma/Makefile |2 
>  drivers/dma/ioat.c   |  186 
>  drivers/dma/ioat_dma.c   |  196 
> +++---
>  drivers/dma/ioatdma.h|   16 +++-
>  drivers/dma/ioatdma_hw.h |2 
>  5 files changed, 245 insertions(+), 157 deletions(-)
> 
> diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
> index 77bee99..cec0c9c 100644
> --- a/drivers/dma/Makefile
> +++ b/drivers/dma/Makefile
> @@ -1,5 +1,5 @@
>  obj-$(CONFIG_DMA_ENGINE) += dmaengine.o
>  obj-$(CONFIG_NET_DMA) += iovlock.o
>  obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o
> -ioatdma-objs := ioat_dma.o
> +ioatdma-objs := ioat.o ioat_dma.o
>  obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
> diff --git a/drivers/dma/ioat.c b/drivers/dma/ioat.c
> new file mode 100644
> index 000..9d9f672
> --- /dev/null
> +++ b/drivers/dma/ioat.c
> @@ -0,0 +1,186 @@
> +/*
> + * Intel I/OAT DMA Linux driver
> + * Copyright(c) 2004 - 2007 Intel Corporation.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but 
> WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.
> + *
> + * You should have received a copy of the GNU General Public License along 
> with
> + * this program; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> + *
> + * The full GNU General Public License is included in this distribution in
> + * the file called "COPYING".
> + *
> + */
> +
> +/*
> + * This driver supports an Intel I/OAT DMA engine, which does asynchronous
> + * copy operations.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "ioatdma.h"
> +#include "ioatdma_registers.h"
> +#include "ioatdma_hw.h"
> +
> +MODULE_VERSION("1.24");
> +MODULE_LICENSE("GPL");
> +MODULE_AUTHOR("Intel Corporation");
> +
> +static struct pci_device_id ioat_pci_tbl[] = {
> + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT) },
> + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB)  },
> + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_SCNB) },
> + { PCI_DEVICE(PCI_VENDOR_ID_UNISYS, PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR) },
> + { 0, }
> +};

Why this driver lacks MODULE_DEVICE_TABLE() ? Is it intentionaly omitted ?


-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH 4/7] I/OAT: Split PCI startup from DMA handling code

2007-07-20 Thread Andrey Panin
On 200, 07 19, 2007 at 05:45:07PM -0700, Shannon Nelson wrote:
 Split the general PCI startup from the DMA handling code in order to
 prepare for adding support for DCA services and future versions of the
 ioatdma device.
 
 Signed-off-by: Shannon Nelson [EMAIL PROTECTED]
 ---
 
  drivers/dma/Makefile |2 
  drivers/dma/ioat.c   |  186 
  drivers/dma/ioat_dma.c   |  196 
 +++---
  drivers/dma/ioatdma.h|   16 +++-
  drivers/dma/ioatdma_hw.h |2 
  5 files changed, 245 insertions(+), 157 deletions(-)
 
 diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
 index 77bee99..cec0c9c 100644
 --- a/drivers/dma/Makefile
 +++ b/drivers/dma/Makefile
 @@ -1,5 +1,5 @@
  obj-$(CONFIG_DMA_ENGINE) += dmaengine.o
  obj-$(CONFIG_NET_DMA) += iovlock.o
  obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o
 -ioatdma-objs := ioat_dma.o
 +ioatdma-objs := ioat.o ioat_dma.o
  obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
 diff --git a/drivers/dma/ioat.c b/drivers/dma/ioat.c
 new file mode 100644
 index 000..9d9f672
 --- /dev/null
 +++ b/drivers/dma/ioat.c
 @@ -0,0 +1,186 @@
 +/*
 + * Intel I/OAT DMA Linux driver
 + * Copyright(c) 2004 - 2007 Intel Corporation.
 + *
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms and conditions of the GNU General Public License,
 + * version 2, as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful, but 
 WITHOUT
 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 + * more details.
 + *
 + * You should have received a copy of the GNU General Public License along 
 with
 + * this program; if not, write to the Free Software Foundation, Inc.,
 + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 + *
 + * The full GNU General Public License is included in this distribution in
 + * the file called COPYING.
 + *
 + */
 +
 +/*
 + * This driver supports an Intel I/OAT DMA engine, which does asynchronous
 + * copy operations.
 + */
 +
 +#include linux/init.h
 +#include linux/module.h
 +#include linux/pci.h
 +#include linux/interrupt.h
 +#include ioatdma.h
 +#include ioatdma_registers.h
 +#include ioatdma_hw.h
 +
 +MODULE_VERSION(1.24);
 +MODULE_LICENSE(GPL);
 +MODULE_AUTHOR(Intel Corporation);
 +
 +static struct pci_device_id ioat_pci_tbl[] = {
 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT) },
 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB)  },
 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_SCNB) },
 + { PCI_DEVICE(PCI_VENDOR_ID_UNISYS, PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR) },
 + { 0, }
 +};

Why this driver lacks MODULE_DEVICE_TABLE() ? Is it intentionaly omitted ?


-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Andrey Panin
*ip++;
> + }
> + t = *ip++;
> + } while (1);
> + }
> +
> +eof_found:
> + *out_len = pd(op, out);
> + return (ip == ip_end ? 0 : -1);
> +}
> +
> +EXPORT_SYMBOL(lzo1x_decompress);
> diff --git a/lib/lzo1x/lzo1x_int.h b/lib/lzo1x/lzo1x_int.h
> new file mode 100755
> index 000..4dd993d
> --- /dev/null
> +++ b/lib/lzo1x/lzo1x_int.h
> @@ -0,0 +1,105 @@
> +/* lzo1x_int.h -- to be used internally by LZO de/compression algorithms
> +
> +   This file is part of the LZO real-time data compression library.
> +
> +   Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
> +   Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
> +   Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
> +   Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
> +   Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
> +   Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
> +   Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
> +   Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
> +   Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
> +   Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
> +   All Rights Reserved.
> +
> +   The LZO library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU General Public License,
> +   version 2, as published by the Free Software Foundation.
> +
> +   The LZO library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +   GNU General Public License for more details.
> +
> +   You should have received a copy of the GNU General Public License
> +   along with the LZO library; see the file COPYING.
> +   If not, write to the Free Software Foundation, Inc.,
> +   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> +
> +   Markus F.X.J. Oberhumer
> +   <[EMAIL PROTECTED]>
> +   http://www.oberhumer.com/opensource/lzo/
> +
> +
> +   This file was derived from several header files found in original
> +   LZO 2.02 code. Some additional changes have also been made to make
> +   it work in kernel space.
> +
> +   Nitin Gupta
> +   <[EMAIL PROTECTED]>
> + */
> +
> +#ifndef __LZO1X_INT_H
> +#define __LZO1X_INT_H
> +
> +#include 
> +
> +#define D_SIZE   (1u << D_BITS)
> +#define D_MASK   (D_SIZE - 1)
> +#define D_HIGH   ((D_MASK >> 1) + 1)
> +
> +#define DX2(p,s1,s2) \
> + (size_t)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0])
> +#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0])
> +#define DMUL(a,b)((size_t) ((a) * (b)))
> +#define DMS(v,s) ((size_t) (((v) & (D_MASK >> (s))) << (s)))
> +#define DM(v)DMS(v,0)
> +
> +#define D_BITS   14
> +#define DINDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5)
> +#define DINDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
> +#define DENTRY(p,in) (p)
> +
> +#define PTR(a)   ((unsigned long) (a))
> +#define PTR_LT(a,b)  (PTR(a) < PTR(b))
> +#define PTR_GE(a,b)  (PTR(a) >= PTR(b))
> +#define PTR_DIFF(a,b)(PTR(a) - PTR(b))
> +#define pd(a,b)  ((size_t) ((a)-(b)))
> +
> +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
> + ( m_pos = ip - (size_t) PTR_DIFF(ip,m_pos), \
> + PTR_LT(m_pos,in) || \
> + (m_off = (size_t) PTR_DIFF(ip,m_pos)) <= 0 || \
> + m_off > max_offset )
> +
> +#define COPY4(dst,src)   *(uint32_t *)(dst) = *(uint32_t *)(src)
> +
> +
> +/* LZO1X Specific constants */
> +
> +#define M1_MAX_OFFSET0x0400
> +#define M2_MAX_OFFSET0x0800
> +#define M3_MAX_OFFSET0x4000
> +#define M4_MAX_OFFSET0xbfff
> +
> +#define MX_MAX_OFFSET(M1_MAX_OFFSET + M2_MAX_OFFSET)
> +
> +#define M1_MIN_LEN   2
> +#define M1_MAX_LEN   2
> +#define M2_MIN_LEN   3
> +#define M2_MAX_LEN   8
> +#define M3_MIN_LEN   3
> +#define M3_MAX_LEN   33
> +#define M4_MIN_LEN   3
> +#define M4_MAX_LEN   9
> +
> +#define M1_MARKER0
> +#define M2_MARKER64
> +#define M3_MARKER32
> +#define M4_MARKER16
> +
> +#define MIN_LOOKAHEAD(M2_MAX_LEN + 1)
> +
> +#endif /* already included */



-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Andrey Panin
) (a))
 +#define PTR_LT(a,b)  (PTR(a)  PTR(b))
 +#define PTR_GE(a,b)  (PTR(a) = PTR(b))
 +#define PTR_DIFF(a,b)(PTR(a) - PTR(b))
 +#define pd(a,b)  ((size_t) ((a)-(b)))
 +
 +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
 + ( m_pos = ip - (size_t) PTR_DIFF(ip,m_pos), \
 + PTR_LT(m_pos,in) || \
 + (m_off = (size_t) PTR_DIFF(ip,m_pos)) = 0 || \
 + m_off  max_offset )
 +
 +#define COPY4(dst,src)   *(uint32_t *)(dst) = *(uint32_t *)(src)
 +
 +
 +/* LZO1X Specific constants */
 +
 +#define M1_MAX_OFFSET0x0400
 +#define M2_MAX_OFFSET0x0800
 +#define M3_MAX_OFFSET0x4000
 +#define M4_MAX_OFFSET0xbfff
 +
 +#define MX_MAX_OFFSET(M1_MAX_OFFSET + M2_MAX_OFFSET)
 +
 +#define M1_MIN_LEN   2
 +#define M1_MAX_LEN   2
 +#define M2_MIN_LEN   3
 +#define M2_MAX_LEN   8
 +#define M3_MIN_LEN   3
 +#define M3_MAX_LEN   33
 +#define M4_MIN_LEN   3
 +#define M4_MAX_LEN   9
 +
 +#define M1_MARKER0
 +#define M2_MARKER64
 +#define M3_MARKER32
 +#define M4_MARKER16
 +
 +#define MIN_LOOKAHEAD(M2_MAX_LEN + 1)
 +
 +#endif /* already included */



-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Add support for ITE887x serial chipsets

2007-03-26 Thread Andrey Panin
from the device */
> + ret = pci_read_config_dword(dev, PS1BAR + (0x4 * idx), );
> + if (ret) {

Checking return value of pci_read_config_XXX/pci_write_config_XXX is (almost ?)
useless and only complicates things.

> + printk(KERN_ERR "ite887x: read error PS%dBAR\n", idx + 1);
> + ret = -ENODEV;
> + goto release_inta;
> + }
> +
> + ioport &= 0xFF00;   /* the actual I/O space base address */
> + ret = pci_write_config_dword(dev, POSIO1 + (0x4 * idx),
> + POSIO_ENABLE | POSIO_SPEED | ioport);
> + if (ret) {
> + printk(KERN_ERR "ite887x: write error PSIO%d+\n", idx + 1);
> + ret = -ENODEV;
> + goto release_inta;
> + }
> +
> + /* write the ioport to the UARTBAR */
> + ret = pci_read_config_dword(dev, UARTBAR, );
> + if (ret) {
> + printk(KERN_ERR "ite887x: read error UARTBAR\n");
> + ret = -ENODEV;
> + goto release_inta;
> + }
> + uartbar &= ~(15 << (4 * idx));  /* clear half the reg */
> + uartbar |= ioport << (16 * idx);/* set the ioport */
> + ret = pci_write_config_dword(dev, UARTBAR, uartbar);
> + if (ret) {
> + printk(KERN_ERR "ite887x: write error UARTBAR\n");
> + ret = -ENODEV;
> + goto release_inta;
> + }
> +
> + /* get current config */
> + ret = pci_read_config_dword(dev, MISCR, );
> + if (ret) {
> + printk(KERN_ERR "ite887x: read error MISCR\n");
> + ret = -ENODEV;
> + goto release_inta;
> + }
> +
> + /* disable interrupts (UARTx_Routing[3:0]) */
> + miscr &= ~(0xf << (12 - 4 * idx));
> + /* activate the UART (UARTx_En) */
> + miscr |= 1 << (23 - idx);
> +
> + /* write new config with activated UART */
> + ret = pci_write_config_dword(dev, MISCR, miscr);
> + if (ret) {
> + printk(KERN_ERR "ite887x: write error MISCR\n");
> + ret = -ENODEV;
> + goto release_inta;
> + }
> +
> + /* idx + 1: using POSIO1 and up */
> + return setup_port(priv, port, idx + 1, board->first_offset, 0);
> +
> +release_inta:
> + /* release region again if we get here */
> + release_resource(iobase);
> + dev->dev.driver_data = NULL;
> + return ret;
> +}
> +
> +static void __devexit pci_ite887x_exit(struct pci_dev *dev)
> +{
> + /* free the private driver data */
> + release_resource(((struct resource*) dev->dev.driver_data));
> +}
> +
>  static int
>  pci_default_setup(struct serial_private *priv, struct pciserial_board *board,
> struct uart_port *port, int idx)
> @@ -654,6 +822,18 @@ static struct pci_serial_quirk pci_seria
>   .setup  = pci_default_setup,
>   },
>   /*
> +  * ITE
> +  */
> + {
> + .vendor = PCI_VENDOR_ID_ITE,
> + .device = PCI_DEVICE_ID_ITE_8872,
> + .subvendor  = PCI_ANY_ID,
> + .subdevice  = PCI_ANY_ID,
> + .init   = pci_ite887x_init,
> + .setup  = pci_ite887x_setup,
> + .exit   = __devexit_p(pci_ite887x_exit),
> + },
> + /*
>* Panacom
>*/
>   {
> @@ -968,6 +1148,7 @@ enum pci_board_num_t {
>   pbn_plx_romulus,
>   pbn_oxsemi,
>   pbn_intel_i960,
> + pbn_ite_887x,
>   pbn_sgi_ioc3,
>   pbn_nec_nile4,
>   pbn_computone_4,
> @@ -1430,6 +1611,15 @@ static struct pciserial_board pci_boards
>   },
>  
>   /*
> +  * ITE
> +  */
> + [pbn_ite_887x] = {
> +.flags  = FL_BASE0 | FL_BASE_BARS,
> +.base_baud  = 115200,
> +.uart_offset    = 8,
> +},

IMHO this is not needed. You can use pbn_b0_bt_2_115200 or pbn_b0_bt_1_115200,
since quirks will be used anyway.

> +
> + /*
>* NEC Vrc-5074 (Nile 4) builtin UART.
>*/
>   [pbn_nec_nile4] = {
> @@ -2370,6 +2560,13 @@ static struct pci_device_id serial_pci_t
>   {   PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
>   PCI_ANY_ID, PCI_ANY_ID, 0, 0,
>   pbn_b0_1_115200 },
> + /*
> +  * ITE
> +  */
> + {   PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
> + PCI_ANY_ID, PCI_ANY_ID,
> + 0, 0,
> + pbn_ite_887x }, 
>  
>   /*
>* IntaShield IS-200
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Add support for ITE887x serial chipsets

2007-03-26 Thread Andrey Panin
 = -ENODEV;
 + goto release_inta;
 + }
 +
 + /* write the ioport to the UARTBAR */
 + ret = pci_read_config_dword(dev, UARTBAR, uartbar);
 + if (ret) {
 + printk(KERN_ERR ite887x: read error UARTBAR\n);
 + ret = -ENODEV;
 + goto release_inta;
 + }
 + uartbar = ~(15  (4 * idx));  /* clear half the reg */
 + uartbar |= ioport  (16 * idx);/* set the ioport */
 + ret = pci_write_config_dword(dev, UARTBAR, uartbar);
 + if (ret) {
 + printk(KERN_ERR ite887x: write error UARTBAR\n);
 + ret = -ENODEV;
 + goto release_inta;
 + }
 +
 + /* get current config */
 + ret = pci_read_config_dword(dev, MISCR, miscr);
 + if (ret) {
 + printk(KERN_ERR ite887x: read error MISCR\n);
 + ret = -ENODEV;
 + goto release_inta;
 + }
 +
 + /* disable interrupts (UARTx_Routing[3:0]) */
 + miscr = ~(0xf  (12 - 4 * idx));
 + /* activate the UART (UARTx_En) */
 + miscr |= 1  (23 - idx);
 +
 + /* write new config with activated UART */
 + ret = pci_write_config_dword(dev, MISCR, miscr);
 + if (ret) {
 + printk(KERN_ERR ite887x: write error MISCR\n);
 + ret = -ENODEV;
 + goto release_inta;
 + }
 +
 + /* idx + 1: using POSIO1 and up */
 + return setup_port(priv, port, idx + 1, board-first_offset, 0);
 +
 +release_inta:
 + /* release region again if we get here */
 + release_resource(iobase);
 + dev-dev.driver_data = NULL;
 + return ret;
 +}
 +
 +static void __devexit pci_ite887x_exit(struct pci_dev *dev)
 +{
 + /* free the private driver data */
 + release_resource(((struct resource*) dev-dev.driver_data));
 +}
 +
  static int
  pci_default_setup(struct serial_private *priv, struct pciserial_board *board,
 struct uart_port *port, int idx)
 @@ -654,6 +822,18 @@ static struct pci_serial_quirk pci_seria
   .setup  = pci_default_setup,
   },
   /*
 +  * ITE
 +  */
 + {
 + .vendor = PCI_VENDOR_ID_ITE,
 + .device = PCI_DEVICE_ID_ITE_8872,
 + .subvendor  = PCI_ANY_ID,
 + .subdevice  = PCI_ANY_ID,
 + .init   = pci_ite887x_init,
 + .setup  = pci_ite887x_setup,
 + .exit   = __devexit_p(pci_ite887x_exit),
 + },
 + /*
* Panacom
*/
   {
 @@ -968,6 +1148,7 @@ enum pci_board_num_t {
   pbn_plx_romulus,
   pbn_oxsemi,
   pbn_intel_i960,
 + pbn_ite_887x,
   pbn_sgi_ioc3,
   pbn_nec_nile4,
   pbn_computone_4,
 @@ -1430,6 +1611,15 @@ static struct pciserial_board pci_boards
   },
  
   /*
 +  * ITE
 +  */
 + [pbn_ite_887x] = {
 +.flags  = FL_BASE0 | FL_BASE_BARS,
 +.base_baud  = 115200,
 +.uart_offset= 8,
 +},

IMHO this is not needed. You can use pbn_b0_bt_2_115200 or pbn_b0_bt_1_115200,
since quirks will be used anyway.

 +
 + /*
* NEC Vrc-5074 (Nile 4) builtin UART.
*/
   [pbn_nec_nile4] = {
 @@ -2370,6 +2560,13 @@ static struct pci_device_id serial_pci_t
   {   PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
   PCI_ANY_ID, PCI_ANY_ID, 0, 0,
   pbn_b0_1_115200 },
 + /*
 +  * ITE
 +  */
 + {   PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
 + PCI_ANY_ID, PCI_ANY_ID,
 + 0, 0,
 + pbn_ite_887x }, 
  
   /*
* IntaShield IS-200
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] drivers/media/video/videocodec.c: check kmalloc() return value.

2007-03-09 Thread Andrey Panin
On 067, 03 08, 2007 at 11:14:01PM -0800, Amit Choudhary wrote:
> Description: Check the return value of kmalloc() in function 
> videocodec_build_table(), in file drivers/media/video/videocodec.c.
> 
> Signed-off-by: Amit Choudhary <[EMAIL PROTECTED]>
> 
> diff --git a/drivers/media/video/videocodec.c 
> b/drivers/media/video/videocodec.c
> index 2ae3fb2..16fc1dd 100644
> --- a/drivers/media/video/videocodec.c
> +++ b/drivers/media/video/videocodec.c
> @@ -348,6 +348,8 @@ #define LINESIZE 100
>   kfree(videocodec_buf);
>   videocodec_buf = (char *) kmalloc(size, GFP_KERNEL);
>  
> + if (!videocodec_buf)
> + return 0;
>   i = 0;
>   i += scnprintf(videocodec_buf + i, size - 1,
> "lave or attached aster name  type flagsmagic   
>  ");

Can you also remove useless (char *) cast above ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Use more gcc extensions in the Linux headers

2007-03-09 Thread Andrey Panin
On 068, 03 09, 2007 at 07:53:08AM +, Christoph Hellwig wrote:
> On Fri, Mar 09, 2007 at 09:50:56AM +0300, Andrey Panin wrote:
> > On 068, 03 09, 2007 at 04:56:32PM +1100, Rusty Russell wrote:
> > > __builtin_types_compatible_p() has been around since gcc 2.95,
> > 
> > but it's not available in Intel C compiler IIRC :(
> 
> So what?

Kernel compilation with Intel compiler is (was ?) supported.
This patch will break it.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Use more gcc extensions in the Linux headers

2007-03-09 Thread Andrey Panin
On 068, 03 09, 2007 at 07:53:08AM +, Christoph Hellwig wrote:
 On Fri, Mar 09, 2007 at 09:50:56AM +0300, Andrey Panin wrote:
  On 068, 03 09, 2007 at 04:56:32PM +1100, Rusty Russell wrote:
   __builtin_types_compatible_p() has been around since gcc 2.95,
  
  but it's not available in Intel C compiler IIRC :(
 
 So what?

Kernel compilation with Intel compiler is (was ?) supported.
This patch will break it.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] drivers/media/video/videocodec.c: check kmalloc() return value.

2007-03-09 Thread Andrey Panin
On 067, 03 08, 2007 at 11:14:01PM -0800, Amit Choudhary wrote:
 Description: Check the return value of kmalloc() in function 
 videocodec_build_table(), in file drivers/media/video/videocodec.c.
 
 Signed-off-by: Amit Choudhary [EMAIL PROTECTED]
 
 diff --git a/drivers/media/video/videocodec.c 
 b/drivers/media/video/videocodec.c
 index 2ae3fb2..16fc1dd 100644
 --- a/drivers/media/video/videocodec.c
 +++ b/drivers/media/video/videocodec.c
 @@ -348,6 +348,8 @@ #define LINESIZE 100
   kfree(videocodec_buf);
   videocodec_buf = (char *) kmalloc(size, GFP_KERNEL);
  
 + if (!videocodec_buf)
 + return 0;
   i = 0;
   i += scnprintf(videocodec_buf + i, size - 1,
 Slave or attached Master name  type flagsmagic   
  );

Can you also remove useless (char *) cast above ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Use more gcc extensions in the Linux headers

2007-03-08 Thread Andrey Panin
On 068, 03 09, 2007 at 04:56:32PM +1100, Rusty Russell wrote:
> __builtin_types_compatible_p() has been around since gcc 2.95,

but it's not available in Intel C compiler IIRC :(

> and we don't use it anywhere.  This patch quietly fixes that.
>
> Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
> 
> diff -r f0ff8138f993 include/linux/kernel.h
> --- a/include/linux/kernel.h  Fri Mar 09 16:40:25 2007 +1100
> +++ b/include/linux/kernel.h  Fri Mar 09 16:44:04 2007 +1100
> @@ -35,7 +35,9 @@ extern const char linux_proc_banner[];
>  #define ALIGN(x,a)   __ALIGN_MASK(x,(typeof(x))(a)-1)
>  #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
>  
> -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
> +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])  
>   \
> + + sizeof(typeof(int[1 - 2*!!__builtin_types_compatible_p(typeof(arr), \
> +  typeof([0]))]))*0)
>  #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
>  #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
>  #define roundup(x, y) x) + ((y) - 1)) / (y)) * (y))
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Use more gcc extensions in the Linux headers

2007-03-08 Thread Andrey Panin
On 068, 03 09, 2007 at 04:56:32PM +1100, Rusty Russell wrote:
 __builtin_types_compatible_p() has been around since gcc 2.95,

but it's not available in Intel C compiler IIRC :(

 and we don't use it anywhere.  This patch quietly fixes that.

 Signed-off-by: Rusty Russell [EMAIL PROTECTED]
 
 diff -r f0ff8138f993 include/linux/kernel.h
 --- a/include/linux/kernel.h  Fri Mar 09 16:40:25 2007 +1100
 +++ b/include/linux/kernel.h  Fri Mar 09 16:44:04 2007 +1100
 @@ -35,7 +35,9 @@ extern const char linux_proc_banner[];
  #define ALIGN(x,a)   __ALIGN_MASK(x,(typeof(x))(a)-1)
  #define __ALIGN_MASK(x,mask) (((x)+(mask))~(mask))
  
 -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])  
   \
 + + sizeof(typeof(int[1 - 2*!!__builtin_types_compatible_p(typeof(arr), \
 +  typeof(arr[0]))]))*0)
  #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)-f))
  #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
  #define roundup(x, y) x) + ((y) - 1)) / (y)) * (y))
 
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] wistron button support for fujitsu-siemens Amilo D88x0

2007-02-07 Thread Andrey Panin
On 038, 02 07, 2007 at 11:43:46AM +0100, Michael Leun wrote:
> On Wed, 7 Feb 2007 09:58:07 +
> Matthew Garrett <[EMAIL PROTECTED]> wrote:
> 
> > On Wed, Feb 07, 2007 at 07:23:47AM +0100, Michael Leun wrote:
> > > Matthew Garrett <[EMAIL PROTECTED]> wrote:
> > > > Hm. Is there really no PNP id that tends to be associated with
> > > > this wistron hardware? Fujitsu (at least) seem to be quite good at
> > > > exposing a lot of their magic hardware that way.
> > > 
> > > Sorry, I do not know and I do not know how to find out. If there is
> > > any testing I should do on my machine I will happily do that, but
> > > you would have to tell me what to do.
> > 
> > cat /sys/bus/pnp/devices/*/id should give a list of the available IDs.
> 
> [EMAIL PROTECTED]:~> cat /sys/bus/pnp/devices/*/id

This list doesn't look promising.

PNP0a03 - PCI bus
PNP0200 - AT DMA controller
PNP0b00 - AT real-time clock
PNP0800 - AT-style speaker sound
PNP0c02 - Motherboard resources
PNP0c04 - Math coprocessor
PNP0303 - IBM enhanced keyboard (101/102-key, PS/2 mouse support)
PNP0f13 - PS/2 port for PS/2-style mice
PNP0700 - PC standard floppy disk controller
PNP0400 - Standard LPT printer port
PNP0501 - 16550A-compatible COM port

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] wistron button support for fujitsu-siemens Amilo D88x0

2007-02-07 Thread Andrey Panin
On 038, 02 07, 2007 at 11:43:46AM +0100, Michael Leun wrote:
 On Wed, 7 Feb 2007 09:58:07 +
 Matthew Garrett [EMAIL PROTECTED] wrote:
 
  On Wed, Feb 07, 2007 at 07:23:47AM +0100, Michael Leun wrote:
   Matthew Garrett [EMAIL PROTECTED] wrote:
Hm. Is there really no PNP id that tends to be associated with
this wistron hardware? Fujitsu (at least) seem to be quite good at
exposing a lot of their magic hardware that way.
   
   Sorry, I do not know and I do not know how to find out. If there is
   any testing I should do on my machine I will happily do that, but
   you would have to tell me what to do.
  
  cat /sys/bus/pnp/devices/*/id should give a list of the available IDs.
 
 [EMAIL PROTECTED]:~ cat /sys/bus/pnp/devices/*/id

This list doesn't look promising.

PNP0a03 - PCI bus
PNP0200 - AT DMA controller
PNP0b00 - AT real-time clock
PNP0800 - AT-style speaker sound
PNP0c02 - Motherboard resources
PNP0c04 - Math coprocessor
PNP0303 - IBM enhanced keyboard (101/102-key, PS/2 mouse support)
PNP0f13 - PS/2 port for PS/2-style mice
PNP0700 - PC standard floppy disk controller
PNP0400 - Standard LPT printer port
PNP0501 - 16550A-compatible COM port

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH] Add support for Korenix 16C950-based PCI cards

2006-12-20 Thread Andrey Panin
On 347, 12 13, 2006 at 02:45:46PM +, Russell King wrote:
> Linus, Andrew,
> 
> This patch adds initial support to 8250-pci for the Korenix Jetcard PCI
> serial cards.  The JC12xx cards are standard RS232-based serial cards
> utilising the Oxford 16C950 device.
> 
> The JC14xx are RS422/RS485-based cards, but in order for these to be
> supported natively, we will need additional tweaks to the 8250 layers
> so we can specify some values for the 950's registers.  Hence, these
> two entries are commented out.

IIRC 16c950 just need two bits in ACR set properly. Will attached patch 
do the trick ?

> Signed-off-by: Russell King <[EMAIL PROTECTED]>
> 
>  drivers/serial/8250_pci.c |   24 
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
> index 4d0ff8f..89c3f2c 100644
> --- a/drivers/serial/8250_pci.c
> +++ b/drivers/serial/8250_pci.c
> @@ -2239,6 +2239,30 @@ static struct pci_device_id serial_pci_t
>   pbn_b0_bt_1_460800 },
>  
>   /*
> +  * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
> +  * Cards are identified by their subsystem vendor IDs, which
> +  * (in hex) match the model number.
> +  *
> +  * Note that JC140x are RS422/485 cards which require ox950
> +  * ACR = 0x10, and as such are not currently fully supported.
> +  */
> + {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
> + 0x1204, 0x0004, 0, 0,
> + pbn_b0_4_921600 },
> + {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
> + 0x1208, 0x0004, 0, 0,
> + pbn_b0_4_921600 },
> +/*   {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
> + 0x1402, 0x0002, 0, 0,
> + pbn_b0_2_921600 }, */
> +/*   {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
> + 0x1404, 0x0004, 0, 0,
> + pbn_b0_4_921600 }, */
> + {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
> + 0x1208, 0x0004, 0, 0,
> + pbn_b0_4_921600 },
> +
> +     /*
>* Dell Remote Access Card 4 - [EMAIL PROTECTED]
>*/
>   {   PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
diff -urdpNX /usr/share/dontdiff -x Makefile 
linux-2.6.19.vanilla/drivers/serial/8250.c linux-2.6.19/drivers/serial/8250.c
--- linux-2.6.19.vanilla/drivers/serial/8250.c  2006-12-19 20:18:26.0 
+0300
+++ linux-2.6.19/drivers/serial/8250.c  2006-12-19 19:53:04.0 +0300
@@ -1548,7 +1548,7 @@ static int serial8250_startup(struct uar
 
if (up->port.type == PORT_16C950) {
/* Wake up and initialize UART */
-   up->acr = 0;
+   up->acr = port->initial_acr;
serial_outp(up, UART_LCR, 0xBF);
serial_outp(up, UART_EFR, UART_EFR_ECB);
serial_outp(up, UART_IER, 0);
@@ -2599,6 +2599,7 @@ int serial8250_register_port(struct uart
uart->port.iotype   = port->iotype;
uart->port.flags= port->flags | UPF_BOOT_AUTOCONF;
uart->port.mapbase  = port->mapbase;
+   uart->port.initial_acr = port->initial_acr;
if (port->dev)
uart->port.dev = port->dev;
 
diff -urdpNX /usr/share/dontdiff -x Makefile 
linux-2.6.19.vanilla/drivers/serial/8250.h linux-2.6.19/drivers/serial/8250.h
--- linux-2.6.19.vanilla/drivers/serial/8250.h  2006-12-19 20:44:12.0 
+0300
+++ linux-2.6.19/drivers/serial/8250.h  2006-12-19 20:28:29.0 +0300
@@ -29,6 +29,8 @@ struct old_serial_port {
unsigned short iomem_reg_shift;
 };
 
+#define initial_acr unused[0]
+
 /*
  * This replaces serial_uart_config in include/linux/serial.h
  */


Re: [PATCH] Add support for Korenix 16C950-based PCI cards

2006-12-20 Thread Andrey Panin
On 347, 12 13, 2006 at 02:45:46PM +, Russell King wrote:
 Linus, Andrew,
 
 This patch adds initial support to 8250-pci for the Korenix Jetcard PCI
 serial cards.  The JC12xx cards are standard RS232-based serial cards
 utilising the Oxford 16C950 device.
 
 The JC14xx are RS422/RS485-based cards, but in order for these to be
 supported natively, we will need additional tweaks to the 8250 layers
 so we can specify some values for the 950's registers.  Hence, these
 two entries are commented out.

IIRC 16c950 just need two bits in ACR set properly. Will attached patch 
do the trick ?

 Signed-off-by: Russell King [EMAIL PROTECTED]
 
  drivers/serial/8250_pci.c |   24 
  1 file changed, 24 insertions(+)
 
 diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
 index 4d0ff8f..89c3f2c 100644
 --- a/drivers/serial/8250_pci.c
 +++ b/drivers/serial/8250_pci.c
 @@ -2239,6 +2239,30 @@ static struct pci_device_id serial_pci_t
   pbn_b0_bt_1_460800 },
  
   /*
 +  * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
 +  * Cards are identified by their subsystem vendor IDs, which
 +  * (in hex) match the model number.
 +  *
 +  * Note that JC140x are RS422/485 cards which require ox950
 +  * ACR = 0x10, and as such are not currently fully supported.
 +  */
 + {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
 + 0x1204, 0x0004, 0, 0,
 + pbn_b0_4_921600 },
 + {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
 + 0x1208, 0x0004, 0, 0,
 + pbn_b0_4_921600 },
 +/*   {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
 + 0x1402, 0x0002, 0, 0,
 + pbn_b0_2_921600 }, */
 +/*   {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
 + 0x1404, 0x0004, 0, 0,
 + pbn_b0_4_921600 }, */
 + {   PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
 + 0x1208, 0x0004, 0, 0,
 + pbn_b0_4_921600 },
 +
 + /*
* Dell Remote Access Card 4 - [EMAIL PROTECTED]
*/
   {   PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
diff -urdpNX /usr/share/dontdiff -x Makefile 
linux-2.6.19.vanilla/drivers/serial/8250.c linux-2.6.19/drivers/serial/8250.c
--- linux-2.6.19.vanilla/drivers/serial/8250.c  2006-12-19 20:18:26.0 
+0300
+++ linux-2.6.19/drivers/serial/8250.c  2006-12-19 19:53:04.0 +0300
@@ -1548,7 +1548,7 @@ static int serial8250_startup(struct uar
 
if (up-port.type == PORT_16C950) {
/* Wake up and initialize UART */
-   up-acr = 0;
+   up-acr = port-initial_acr;
serial_outp(up, UART_LCR, 0xBF);
serial_outp(up, UART_EFR, UART_EFR_ECB);
serial_outp(up, UART_IER, 0);
@@ -2599,6 +2599,7 @@ int serial8250_register_port(struct uart
uart-port.iotype   = port-iotype;
uart-port.flags= port-flags | UPF_BOOT_AUTOCONF;
uart-port.mapbase  = port-mapbase;
+   uart-port.initial_acr = port-initial_acr;
if (port-dev)
uart-port.dev = port-dev;
 
diff -urdpNX /usr/share/dontdiff -x Makefile 
linux-2.6.19.vanilla/drivers/serial/8250.h linux-2.6.19/drivers/serial/8250.h
--- linux-2.6.19.vanilla/drivers/serial/8250.h  2006-12-19 20:44:12.0 
+0300
+++ linux-2.6.19/drivers/serial/8250.h  2006-12-19 20:28:29.0 +0300
@@ -29,6 +29,8 @@ struct old_serial_port {
unsigned short iomem_reg_shift;
 };
 
+#define initial_acr unused[0]
+
 /*
  * This replaces serial_uart_config in include/linux/serial.h
  */


Re: [PATCH 5/5] 2.6.13-rc5-mm1, driver for IBM Automatic Server Restart watchdog

2005-08-17 Thread Andrey Panin
On 229, 08 17, 2005 at 01:14:15PM -0700, Andrew Morton wrote:
> Andrey Panin <[EMAIL PROTECTED]> wrote:
> >
> > 
> > This patch adds driver for IBM Automatic Server Restart watchdog hardware
> > found in some IBM eServer xSeries machines. This driver is based on the ugly
> > driver provided by IBM. Driver was tested on IBM eServer 226.
> > 
> > ...
> > +
> > +   case ASMTYPE_JASPER:
> > +   type = "Jaspers ";
> > +
> > +   /* FIXME: need to use pci_config_lock here, but it's not 
> > exported */
> 
> That's gregkh material.
> 
> > +
> > +/* spin_lock_irqsave(_config_lock, flags);*/
> > +
> > +   /* Select the SuperIO chip in the PCI I/O port register */
> > +   outl(0x8000f858, 0xcf8);
> > +
> > +   /* 
> > +* Read the base address for the SuperIO chip.
> > +* Only the lower 16 bits are valid, but the address is word 
> > +* aligned so the last bit must be masked off.
> > +*/
> > +   asr_base = inl(0xcfc) & 0xfffe;
> > +
> > +/* spin_unlock_irqrestore(_config_lock, flags);*/
> >
> > ...
> >
> > +static int asr_ioctl(struct inode *inode, struct file *file,
> > +unsigned int cmd, unsigned long arg)
> > +{
> > +   static const struct watchdog_info ident = {
> > +   .options =  WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
> > +   WDIOF_MAGICCLOSE,
> > +   .identity = "IBM ASR"
> > +   };
> > +   void __user *argp = (void __user *)arg;
> > +   int __user *p = argp;
> > +   int heartbeat;
> > +
> > +   switch (cmd) {
> > +   case WDIOC_GETSUPPORT:
> > +   return copy_to_user(argp, , sizeof(ident)) ? 
> > +   -EFAULT : 0;
> > +
> > +   case WDIOC_GETSTATUS:
> > +   case WDIOC_GETBOOTSTATUS:
> > +   return put_user(0, p);
> > +
> > +   case WDIOC_KEEPALIVE:
> > +   asr_toggle();
> > +   return 0;
> > +
> > +
> > +   case WDIOC_SETTIMEOUT:
> > +   if (get_user(heartbeat, p))
> > +   return -EFAULT;
> > +   /* Fall */
> > +
> > +       case WDIOC_GETTIMEOUT:
> > +   heartbeat = 256;
> > +   return put_user(heartbeat, p);
> 
> Something very wrong is happening with WDIOC_SETTIMEOUT and
> WDIOC_GETTIMEOUT.  They're both no-ops and the effect of WDIOC_SETTIMEOUT
> is immidiately overwritten.

Hardware has fixed timeout value, so WDIOC_SETTIMEOUT is noop and 
WDIOC_GETTIMEOUT
always returns 256.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [PATCH 5/5] 2.6.13-rc5-mm1, driver for IBM Automatic Server Restart watchdog

2005-08-17 Thread Andrey Panin
On 229, 08 17, 2005 at 01:14:15PM -0700, Andrew Morton wrote:
 Andrey Panin [EMAIL PROTECTED] wrote:
 
  
  This patch adds driver for IBM Automatic Server Restart watchdog hardware
  found in some IBM eServer xSeries machines. This driver is based on the ugly
  driver provided by IBM. Driver was tested on IBM eServer 226.
  
  ...
  +
  +   case ASMTYPE_JASPER:
  +   type = Jaspers ;
  +
  +   /* FIXME: need to use pci_config_lock here, but it's not 
  exported */
 
 That's gregkh material.
 
  +
  +/* spin_lock_irqsave(pci_config_lock, flags);*/
  +
  +   /* Select the SuperIO chip in the PCI I/O port register */
  +   outl(0x8000f858, 0xcf8);
  +
  +   /* 
  +* Read the base address for the SuperIO chip.
  +* Only the lower 16 bits are valid, but the address is word 
  +* aligned so the last bit must be masked off.
  +*/
  +   asr_base = inl(0xcfc)  0xfffe;
  +
  +/* spin_unlock_irqrestore(pci_config_lock, flags);*/
 
  ...
 
  +static int asr_ioctl(struct inode *inode, struct file *file,
  +unsigned int cmd, unsigned long arg)
  +{
  +   static const struct watchdog_info ident = {
  +   .options =  WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
  +   WDIOF_MAGICCLOSE,
  +   .identity = IBM ASR
  +   };
  +   void __user *argp = (void __user *)arg;
  +   int __user *p = argp;
  +   int heartbeat;
  +
  +   switch (cmd) {
  +   case WDIOC_GETSUPPORT:
  +   return copy_to_user(argp, ident, sizeof(ident)) ? 
  +   -EFAULT : 0;
  +
  +   case WDIOC_GETSTATUS:
  +   case WDIOC_GETBOOTSTATUS:
  +   return put_user(0, p);
  +
  +   case WDIOC_KEEPALIVE:
  +   asr_toggle();
  +   return 0;
  +
  +
  +   case WDIOC_SETTIMEOUT:
  +   if (get_user(heartbeat, p))
  +   return -EFAULT;
  +   /* Fall */
  +
  +   case WDIOC_GETTIMEOUT:
  +   heartbeat = 256;
  +   return put_user(heartbeat, p);
 
 Something very wrong is happening with WDIOC_SETTIMEOUT and
 WDIOC_GETTIMEOUT.  They're both no-ops and the effect of WDIOC_SETTIMEOUT
 is immidiately overwritten.

Hardware has fixed timeout value, so WDIOC_SETTIMEOUT is noop and 
WDIOC_GETTIMEOUT
always returns 256.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [RFC][PATCH 2.6.13-rc6] add Dell Systems Management Base Driver (dcdbas) with sysfs support

2005-08-16 Thread Andrey Panin
On 228, 08 16, 2005 at 01:36:19AM -0400, [EMAIL PROTECTED] wrote:
> On Mon, 15 Aug 2005 23:58:43 CDT, Michael E Brown said:
> 
> > No, this is an _EXCELLENT_ reason why _LESS_ of this should be in the
> > kernel. Why should we have to duplicate a _TON_ of code inside the
> > kernel to figure out which platform we are on, and then look up in a
> > table which method to use for that platform? We have a _MUCH_ nicer
> > programming environment available to us in userspace where we can use
> > things like libsmbios to look up the platform type, then look in an
> > easily-updateable text file which smi type to use. In general, plugging
> > the wrong value here is a no-op.
> 
> You'll still need to do some *very* basic checking - there's fairly
> scary-looking 'outb' call in  callintf_smi()  and host_control_smi() that 
> seems to
> be totally too trusting that The Right Thing is located at address 
> CMOS_BASE_PORT:
> 
> + for (index = PE1300_CMOS_CMD_STRUCT_PTR;
> +  index < (PE1300_CMOS_CMD_STRUCT_PTR + 4);
> +  index++) {
> + outb(index,
> +  (CMOS_BASE_PORT + CMOS_PAGE2_INDEX_PORT_PIIX4));
> + outb(*data++,
> +  (CMOS_BASE_PORT + CMOS_PAGE2_DATA_PORT_PIIX4));
> + }
> 
> This Dell C840 has an 845, not a PIIX.  What just got toasted if this driver
> gets called?
> 
> Can we have a check that the machine is (a) a Dell and (b) has a PIIX and (c) 
> the
> PIIX has a functional SMI behind it, before we start doing outb() calls?

What about dmi_check_system() ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [RFC][PATCH 2.6.13-rc6] add Dell Systems Management Base Driver (dcdbas) with sysfs support

2005-08-16 Thread Andrey Panin
On 228, 08 16, 2005 at 01:36:19AM -0400, [EMAIL PROTECTED] wrote:
 On Mon, 15 Aug 2005 23:58:43 CDT, Michael E Brown said:
 
  No, this is an _EXCELLENT_ reason why _LESS_ of this should be in the
  kernel. Why should we have to duplicate a _TON_ of code inside the
  kernel to figure out which platform we are on, and then look up in a
  table which method to use for that platform? We have a _MUCH_ nicer
  programming environment available to us in userspace where we can use
  things like libsmbios to look up the platform type, then look in an
  easily-updateable text file which smi type to use. In general, plugging
  the wrong value here is a no-op.
 
 You'll still need to do some *very* basic checking - there's fairly
 scary-looking 'outb' call in  callintf_smi()  and host_control_smi() that 
 seems to
 be totally too trusting that The Right Thing is located at address 
 CMOS_BASE_PORT:
 
 + for (index = PE1300_CMOS_CMD_STRUCT_PTR;
 +  index  (PE1300_CMOS_CMD_STRUCT_PTR + 4);
 +  index++) {
 + outb(index,
 +  (CMOS_BASE_PORT + CMOS_PAGE2_INDEX_PORT_PIIX4));
 + outb(*data++,
 +  (CMOS_BASE_PORT + CMOS_PAGE2_DATA_PORT_PIIX4));
 + }
 
 This Dell C840 has an 845, not a PIIX.  What just got toasted if this driver
 gets called?
 
 Can we have a check that the machine is (a) a Dell and (b) has a PIIX and (c) 
 the
 PIIX has a functional SMI behind it, before we start doing outb() calls?

What about dmi_check_system() ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


[PATCH 5/5] 2.6.13-rc5-mm1, driver for IBM Automatic Server Restart watchdog

2005-08-10 Thread Andrey Panin

This patch adds driver for IBM Automatic Server Restart watchdog hardware
found in some IBM eServer xSeries machines. This driver is based on the ugly
driver provided by IBM. Driver was tested on IBM eServer 226.

Signed-off-by: Andrey Panin <[EMAIL PROTECTED]>

 drivers/char/watchdog/Kconfig  |   10 +
 drivers/char/watchdog/Makefile |1 
 drivers/char/watchdog/ibmasr.c |  407 +
 3 files changed, 418 insertions(+)

diff -urdpN linux-2.6.13-rc5-mm1.vanilla/drivers/char/watchdog/ibmasr.c 
linux-2.6.13-rc5-mm1/drivers/char/watchdog/ibmasr.c
--- linux-2.6.13-rc5-mm1.vanilla/drivers/char/watchdog/ibmasr.c 1970-01-01 
03:00:00.0 +0300
+++ linux-2.6.13-rc5-mm1/drivers/char/watchdog/ibmasr.c 2005-08-10 
11:43:45.0 +0400
@@ -0,0 +1,407 @@
+/*
+ * IBM Automatic Server Restart driver.
+ *
+ * Copyright (c) 2005 Andrey Panin <[EMAIL PROTECTED]>
+ *
+ * Based on driver written by Pete Reynolds.
+ * Copyright (c) IBM Corporation, 1998-2004.
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU Public License, incorporated herein by reference.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+
+enum {
+   ASMTYPE_UNKNOWN,
+   ASMTYPE_TOPAZ,
+   ASMTYPE_JASPER,
+   ASMTYPE_PEARL,
+   ASMTYPE_JUNIPER,
+   ASMTYPE_SPRUCE,
+};
+
+#define PFX "ibmasr: "
+
+#define TOPAZ_ASR_REG_OFFSET   4
+#define TOPAZ_ASR_TOGGLE   0x40
+#define TOPAZ_ASR_DISABLE  0x80
+
+/* PEARL ASR S/W REGISTER SUPERIO PORT ADDRESSES */
+#define PEARL_BASE 0xe04
+#define PEARL_WRITE0xe06
+#define PEARL_READ 0xe07
+
+#define PEARL_ASR_DISABLE_MASK 0x80/* bit 7: disable = 1, enable = 0 */
+#define PEARL_ASR_TOGGLE_MASK  0x40/* bit 6: 0, then 1, then 0 */
+
+/* JASPER OFFSET FROM SIO BASE ADDR TO ASR S/W REGISTERS. */
+#define JASPER_ASR_REG_OFFSET  0x38
+
+#define JASPER_ASR_DISABLE_MASK0x01/* bit 0: disable = 1, enable = 
0 */
+#define JASPER_ASR_TOGGLE_MASK 0x02/* bit 1: 0, then 1, then 0 */
+
+#define JUNIPER_BASE_ADDRESS   0x54b   /* Base address of Juniper ASR */
+#define JUNIPER_ASR_DISABLE_MASK 0x01  /* bit 0: disable = 1 enable = 0 */
+#define JUNIPER_ASR_TOGGLE_MASK0x02/* bit 1: 0, then 1, then 0 */
+
+#define SPRUCE_BASE_ADDRESS0x118e  /* Base address of Spruce ASR */
+#define SPRUCE_ASR_DISABLE_MASK0x01/* bit 1: disable = 1 enable = 
0 */
+#define SPRUCE_ASR_TOGGLE_MASK 0x02/* bit 0: 0, then 1, then 0 */
+
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+static unsigned long asr_is_open;
+static char asr_expect_close;
+
+static unsigned int asr_type, asr_base, asr_length;
+static unsigned int asr_read_addr, asr_write_addr;
+static unsigned char asr_toggle_mask, asr_disable_mask;
+
+static void asr_toggle(void)
+{
+   unsigned char reg = inb(asr_read_addr);
+
+   outb(reg & ~asr_toggle_mask, asr_write_addr);
+   reg = inb(asr_read_addr);
+
+   outb(reg | asr_toggle_mask, asr_write_addr);
+   reg = inb(asr_read_addr);
+
+   outb(reg & ~asr_toggle_mask, asr_write_addr);
+   reg = inb(asr_read_addr);
+}
+
+static void asr_enable(void)
+{
+   unsigned char reg;
+
+   if (asr_type == ASMTYPE_TOPAZ) {
+   /* asr_write_addr == asr_read_addr */
+   reg = inb(asr_read_addr);
+   outb(reg & ~(TOPAZ_ASR_TOGGLE | TOPAZ_ASR_DISABLE),
+asr_read_addr);
+   } else {
+   /*
+* First make sure the hardware timer is reset by toggling
+* ASR hardware timer line.
+*/
+   asr_toggle();
+
+   reg = inb(asr_read_addr);
+   outb(reg & ~asr_disable_mask, asr_write_addr);
+   }
+   reg = inb(asr_read_addr);
+}
+
+static void asr_disable(void)
+{
+   unsigned char reg = inb(asr_read_addr);
+
+   if (asr_type == ASMTYPE_TOPAZ)
+   /* asr_write_addr == asr_read_addr */
+   outb(reg | TOPAZ_ASR_TOGGLE | TOPAZ_ASR_DISABLE,
+asr_read_addr);
+   else {
+   outb(reg | asr_toggle_mask, asr_write_addr);
+   reg = inb(asr_read_addr);
+
+   outb(reg | asr_disable_mask, asr_write_addr);
+   }
+   reg = inb(asr_read_addr);
+}
+
+static int __init asr_get_base_address(void)
+{
+   unsigned char low, high;
+   const char *type = "";
+
+   asr_length = 1;
+
+   switch (asr_type) {
+   case ASMTYPE_TOPAZ:
+   /* SELECT SuperIO CHIP FOR QUERYING (WRITE 0x07 TO BOTH 0x2E 
and 0x2F) */
+   outb(0x07, 0x2e);
+   outb(0x07, 0x2f);
+
+   /* SELECT AND READ THE HIGH-NIBBLE OF THE GPIO BASE ADDRESS */
+   outb(0x60, 0x2e);
+   high = inb(0x2f);
+
+   /* SELECT 

[PATCH 1/5] 2.6.13-rc5-mm1, remove old debugging code

2005-08-10 Thread Andrey Panin

DMI debugging code is unused for ages. This patch removes it.

Signed-off-by: Andrey Panin <[EMAIL PROTECTED]>

 arch/i386/kernel/dmi_scan.c |   21 -
 1 files changed, 21 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c2005-06-14 
23:24:54.0 +0400
+++ linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c2005-06-14 
23:25:07.0 +0400
@@ -12,13 +12,6 @@ struct dmi_header {
u16 handle;
 };
 
-#undef DMI_DEBUG
-
-#ifdef DMI_DEBUG
-#define dmi_printk(x) printk x
-#else
-#define dmi_printk(x)
-#endif
 
 static char * __init dmi_string(struct dmi_header *dm, u8 s)
 {
@@ -117,29 +110,19 @@ static void __init dmi_decode(struct dmi

switch(dm->type) {
case  0:
-   dmi_printk(("BIOS Vendor: %s\n", dmi_string(dm, data[4])));
dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
-   dmi_printk(("BIOS Version: %s\n", dmi_string(dm, data[5])));
dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
-   dmi_printk(("BIOS Release: %s\n", dmi_string(dm, data[8])));
dmi_save_ident(dm, DMI_BIOS_DATE, 8);
break;
case 1:
-   dmi_printk(("System Vendor: %s\n", dmi_string(dm, data[4])));
dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
-   dmi_printk(("Product Name: %s\n", dmi_string(dm, data[5])));
dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
-   dmi_printk(("Version: %s\n", dmi_string(dm, data[6])));
dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
-   dmi_printk(("Serial Number: %s\n", dmi_string(dm, data[7])));
dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
break;
case 2:
-   dmi_printk(("Board Vendor: %s\n", dmi_string(dm, data[4])));
dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
-   dmi_printk(("Board Name: %s\n", dmi_string(dm, data[5])));
dmi_save_ident(dm, DMI_BOARD_NAME, 5);
-   dmi_printk(("Board Version: %s\n", dmi_string(dm, data[6])));
dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
break;
}
@@ -177,10 +160,6 @@ void __init dmi_scan_machine(void)
else
printk(KERN_INFO "DMI present.\n");
 
-   dmi_printk((KERN_INFO "%d structures occupying %d 
bytes.\n",
-   num, len));
-   dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", base));
-
if (dmi_table(base,len, num, dmi_decode) == 0)
return;
}

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


[PATCH 3/5] 2.6.13-rc5-mm1, add onboard devices discovery

2005-08-10 Thread Andrey Panin

This patch adds onboard devices and IPMI BMC discovery into DMI scan code.
Drivers can use dmi_find_device() function to search for devices by type
and name.

Signed-off-by: Andrey Panin <[EMAIL PROTECTED]>

 arch/i386/kernel/dmi_scan.c |  102 ++--
 include/linux/dmi.h |   34 +-
 2 files changed, 121 insertions(+), 15 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c2005-08-09 
14:39:13.0 +0400
+++ linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c2005-08-09 
15:07:57.0 +0400
@@ -6,13 +6,6 @@
 #include 
 
 
-struct dmi_header {
-   u8 type;
-   u8 length;
-   u16 handle;
-};
-
-
 static char * __init dmi_string(struct dmi_header *dm, u8 s)
 {
u8 *bp = ((u8 *) dm) + dm->length;
@@ -88,6 +81,7 @@ static int __init dmi_checksum(u8 *buf)
 }
 
 static char *dmi_ident[DMI_STRING_MAX];
+static LIST_HEAD(dmi_devices);
 
 /*
  * Save a DMI string
@@ -106,6 +100,58 @@ static void __init dmi_save_ident(struct
dmi_ident[slot] = p;
 }
 
+static void __init dmi_save_devices(struct dmi_header *dm)
+{
+   int i, count = (dm->length - sizeof(struct dmi_header)) / 2;
+   struct dmi_device *dev;
+
+   for (i = 0; i < count; i++) {
+   char *d = ((char *) dm) + (i * 2);
+
+   /* Skip disabled device */
+   if ((*d & 0x80) == 0)
+   continue;
+
+   dev = alloc_bootmem(sizeof(*dev));
+   if (!dev) {
+   printk(KERN_ERR "dmi_save_devices: out of memory.\n");
+   break;
+   }
+
+   dev->type = *d++ & 0x7f;
+   dev->name = dmi_string(dm, *d);
+   dev->device_data = NULL;
+
+   list_add(>list, _devices);
+   }
+}
+
+static void __init dmi_save_ipmi_device(struct dmi_header *dm)
+{
+   struct dmi_device *dev;
+   void * data;
+
+   data = alloc_bootmem(dm->length);
+   if (data == NULL) {
+   printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
+   return;
+   }
+
+   memcpy(data, dm, dm->length);
+
+   dev = alloc_bootmem(sizeof(*dev));
+   if (!dev) {
+   printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
+   return;
+   }
+
+   dev->type = DMI_DEV_TYPE_IPMI;
+   dev->name = "IPMI controller";
+   dev->device_data = data;
+
+   list_add(>list, _devices);
+}
+
 /*
  * Process a DMI table entry. Right now all we care about are the BIOS
  * and machine entries. For 2.5 we should pull the smbus controller info
@@ -113,25 +159,28 @@ static void __init dmi_save_ident(struct
  */
 static void __init dmi_decode(struct dmi_header *dm)
 {
-   u8 *data __attribute__((__unused__)) = (u8 *)dm;
-   
switch(dm->type) {
-   case  0:
+   case 0: /* BIOS Information */
dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
dmi_save_ident(dm, DMI_BIOS_DATE, 8);
break;
-   case 1:
+   case 1: /* System Information */
dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
break;
-   case 2:
+   case 2: /* Base Board Information */
dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
dmi_save_ident(dm, DMI_BOARD_NAME, 5);
dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
break;
+   case 10:/* Onboard Devices Information */
+   dmi_save_devices(dm);
+   break;
+   case 38:/* IPMI Device Information */
+   dmi_save_ipmi_device(dm);
}
 }
 
@@ -221,3 +270,32 @@ char *dmi_get_system_info(int field)
return dmi_ident[field];
 }
 EXPORT_SYMBOL(dmi_get_system_info);
+
+/**
+ * dmi_find_device - find onboard device by type/name
+ * @type: device type or %DMI_DEV_TYPE_ANY to match all device types
+ * @desc: device name string or %NULL to match all
+ * @from: previous device found in search, or %NULL for new search.
+ *
+ * Iterates through the list of known onboard devices. If a device is
+ * found with a matching @vendor and @device, a pointer to its device
+ * structure is returned.  Otherwise, %NULL is returned.
+ * A new search is initiated by passing %NULL to the @from argument.
+ * If @from is not %NULL, searches continue from next device.
+ */
+struct dmi_device * dmi_fin

[PATCH 4/5] 2.6.13-rc5-mm1, IPMI, use dmi_find_device()

2005-08-10 Thread Andrey Panin

This patch replaces homebrew DMI scanning code in IPMI System Interface driver
with dmi_find_device() call.

Signed-off-by: Andrey Panin <[EMAIL PROTECTED]>

 drivers/char/ipmi/ipmi_si_intf.c |  105 ++-
 1 files changed, 17 insertions(+), 88 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/drivers/char/ipmi/ipmi_si_intf.c 
linux-2.6.13-rc5-mm1/drivers/char/ipmi/ipmi_si_intf.c
--- linux-2.6.13-rc5-mm1.vanilla/drivers/char/ipmi/ipmi_si_intf.c   
2005-08-08 14:32:07.0 +0400
+++ linux-2.6.13-rc5-mm1/drivers/char/ipmi/ipmi_si_intf.c   2005-08-08 
11:39:00.0 +0400
@@ -75,6 +75,7 @@ static inline void add_usec_to_timer(str
 #include 
 #include "ipmi_si_sm.h"
 #include 
+#include 
 
 /* Measure times between events in the driver. */
 #undef DEBUG_TIMING
@@ -1642,22 +1643,15 @@ typedef struct dmi_ipmi_data
 static dmi_ipmi_data_t dmi_data[SI_MAX_DRIVERS];
 static int dmi_data_entries;
 
-typedef struct dmi_header
-{
-   u8  type;
-   u8  length;
-   u16 handle;
-} dmi_header_t;
-
-static int decode_dmi(dmi_header_t __iomem *dm, int intf_num)
+static int __init decode_dmi(struct dmi_header *dm, int intf_num)
 {
-   u8  __iomem *data = (u8 __iomem *)dm;
+   u8 *data = (u8 *)dm;
unsigned long   base_addr;
u8  reg_spacing;
-   u8  len = readb(>length);
+   u8  len = dm->length;
dmi_ipmi_data_t *ipmi_data = dmi_data+intf_num;
 
-   ipmi_data->type = readb([4]);
+   ipmi_data->type = data[4];
 
memcpy(_addr, data+8, sizeof(unsigned long));
if (len >= 0x11) {
@@ -1672,12 +1666,12 @@ static int decode_dmi(dmi_header_t __iom
}
/* If bit 4 of byte 0x10 is set, then the lsb for the address
   is odd. */
-   ipmi_data->base_addr = base_addr | ((readb([0x10]) & 0x10) 
>> 4);
+   ipmi_data->base_addr = base_addr | ((data[0x10] & 0x10) >> 4);
 
-   ipmi_data->irq = readb([0x11]);
+   ipmi_data->irq = data[0x11];
 
/* The top two bits of byte 0x10 hold the register spacing. */
-   reg_spacing = (readb([0x10]) & 0xC0) >> 6;
+   reg_spacing = (data[0x10] & 0xC0) >> 6;
switch(reg_spacing){
case 0x00: /* Byte boundaries */
ipmi_data->offset = 1;
@@ -1705,7 +1699,7 @@ static int decode_dmi(dmi_header_t __iom
ipmi_data->offset = 1;
}
 
-   ipmi_data->slave_addr = readb([6]);
+   ipmi_data->slave_addr = data[6];
 
if (is_new_interface(-1, ipmi_data->addr_space,ipmi_data->base_addr)) {
dmi_data_entries++;
@@ -1717,82 +1711,17 @@ static int decode_dmi(dmi_header_t __iom
return -1;
 }
 
-static int dmi_table(u32 base, int len, int num)
-{
-   u8__iomem *buf;
-   struct dmi_header __iomem *dm;
-   u8__iomem *data;
-   int   i=1;
-   int   status=-1;
-   int   intf_num = 0;
-
-   buf = ioremap(base, len);
-   if(buf==NULL)
-   return -1;
-
-   data = buf;
-
-   while(ilength)) >= len)
-   break;
-
-   if (readb(>type) == 38) {
-   if (decode_dmi(dm, intf_num) == 0) {
-   intf_num++;
-   if (intf_num >= SI_MAX_DRIVERS)
-   break;
-   }
-   }
-
-   data+=readb(>length);
-   while((data-buf) < len && (readb(data)||readb(data+1)))
-   data++;
-   data+=2;
-   i++;
-   }
-   iounmap(buf);
-
-   return status;
-}
-
-static inline int dmi_checksum(u8 *buf)
-{
-   u8   sum=0;
-   int  a;
-
-   for(a=0; a<15; a++)
-   sum+=buf[a];
-   return (sum==0);
-}
-
-static int dmi_decode(void)
+static void __init dmi_find_bmc(void)
 {
-   u8   buf[15];
-   u32  fp=0xF;
-
-#ifdef CONFIG_SIMNOW
-   return -1;
-#endif
+   struct dmi_device *dev = NULL;
+   int intf_num = 0;
 
-   while(fp < 0xF)
-   {
-   isa_memcpy_fromio(buf, fp, 15);
-   if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf))
-   {
-   u16 num=buf[13]<<8|buf[12];
-   u16 len=buf[7]<<8|buf[6];
-   u32 base=buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8];
+   while ((dev = dmi_find_device(DMI_DEV_TYPE_IPMI, NULL, dev))) {
+   if (intf_num >= SI_MAX_DRIVERS)
+   break;
 
-   if(

[PATCH 2/5] 2.6.13-rc5-mm1, make dmi_string() behave like strdup()

2005-08-10 Thread Andrey Panin

This patch changes dmi_string() function to allocate string copy by itself,
to avoid code duplication in the next patch.

Signed-off-by: Andrey Panin <[EMAIL PROTECTED]>

 arch/i386/kernel/dmi_scan.c |   39 +++
 1 files changed, 23 insertions(+), 16 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c2005-06-14 
23:31:39.0 +0400
+++ linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c2005-06-14 
23:31:51.0 +0400
@@ -16,15 +16,25 @@ struct dmi_header {
 static char * __init dmi_string(struct dmi_header *dm, u8 s)
 {
u8 *bp = ((u8 *) dm) + dm->length;
+   char *str = "";
 
-   if (!s)
-   return "";
-   s--;
-   while (s > 0 && *bp) {
-   bp += strlen(bp) + 1;
+   if (s) {
s--;
-   }
-   return bp;
+   while (s > 0 && *bp) {
+   bp += strlen(bp) + 1;
+   s--;
+   }
+
+   if (*bp != 0) {
+   str = alloc_bootmem(strlen(bp) + 1);
+   if (str != NULL)
+   strcpy(str, bp);
+   else
+   printk(KERN_ERR "dmi_string: out of memory.\n");
+   }
+   }
+
+   return str;
 }
 
 /*
@@ -84,19 +94,16 @@ static char *dmi_ident[DMI_STRING_MAX];
  */
 static void __init dmi_save_ident(struct dmi_header *dm, int slot, int string)
 {
-   char *d = (char*)dm;
-   char *p = dmi_string(dm, d[string]);
+   char *p, *d = (char*) dm;
 
-   if (p == NULL || *p == 0)
-   return;
if (dmi_ident[slot])
return;
 
-   dmi_ident[slot] = alloc_bootmem(strlen(p) + 1);
-   if(dmi_ident[slot])
-   strcpy(dmi_ident[slot], p);
-   else
-   printk(KERN_ERR "dmi_save_ident: out of memory.\n");
+   p = dmi_string(dm, d[string]);
+   if (p == NULL)
+   return;
+
+   dmi_ident[slot] = p;
 }
 
 /*

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


[PATCH 0/5] 2.6.13-rc5-mm1, remove uneeded function

2005-08-10 Thread Andrey Panin

After elimination of central DMI blacklist dmi_scan_machine() function
became a wrapper for dmi_iterate(). This patch moves some code around to
kill unneeded function.

Signed-off-by: Andrey Panin <[EMAIL PROTECTED]>

 arch/i386/kernel/dmi_scan.c |   85 
 1 files changed, 40 insertions(+), 45 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c2005-06-12 
23:07:37.0 +0400
+++ linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c2005-06-14 
23:18:18.0 +0400
@@ -84,49 +84,6 @@ static int __init dmi_checksum(u8 *buf)
return sum == 0;
 }
 
-static int __init dmi_iterate(void (*decode)(struct dmi_header *))
-{
-   u8 buf[15];
-   char __iomem *p, *q;
-
-   /*
-* no iounmap() for that ioremap(); it would be a no-op, but it's
-* so early in setup that sucker gets confused into doing what
-* it shouldn't if we actually call it.
-*/
-   p = ioremap(0xF, 0x1);
-   if (p == NULL)
-   return -1;
-
-   for (q = p; q < p + 0x1; q += 16) {
-   memcpy_fromio(buf, q, 15);
-   if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
-   u16 num = (buf[13] << 8) | buf[12];
-   u16 len = (buf[7] << 8) | buf[6];
-   u32 base = (buf[11] << 24) | (buf[10] << 16) |
-  (buf[9] << 8) | buf[8];
-
-   /*
-* DMI version 0.0 means that the real version is taken 
from
-* the SMBIOS version, which we don't know at this 
point.
-*/
-   if (buf[14] != 0)
-   printk(KERN_INFO "DMI %d.%d present.\n",
-   buf[14] >> 4, buf[14] & 0xF);
-   else
-   printk(KERN_INFO "DMI present.\n");
-
-   dmi_printk((KERN_INFO "%d structures occupying %d 
bytes.\n",
-   num, len));
-   dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", base));
-
-   if (dmi_table(base,len, num, decode) == 0)
-   return 0;
-   }
-   }
-   return -1;
-}
-
 static char *dmi_ident[DMI_STRING_MAX];
 
 /*
@@ -190,8 +147,46 @@ static void __init dmi_decode(struct dmi
 
 void __init dmi_scan_machine(void)
 {
-   if (dmi_iterate(dmi_decode))
-   printk(KERN_INFO "DMI not present.\n");
+   u8 buf[15];
+   char __iomem *p, *q;
+
+   /*
+* no iounmap() for that ioremap(); it would be a no-op, but it's
+* so early in setup that sucker gets confused into doing what
+* it shouldn't if we actually call it.
+*/
+   p = ioremap(0xF, 0x1);
+   if (p == NULL)
+   goto out;
+
+   for (q = p; q < p + 0x1; q += 16) {
+   memcpy_fromio(buf, q, 15);
+   if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
+   u16 num = (buf[13] << 8) | buf[12];
+   u16 len = (buf[7] << 8) | buf[6];
+   u32 base = (buf[11] << 24) | (buf[10] << 16) |
+  (buf[9] << 8) | buf[8];
+
+   /*
+* DMI version 0.0 means that the real version is taken 
from
+* the SMBIOS version, which we don't know at this 
point.
+*/
+   if (buf[14] != 0)
+   printk(KERN_INFO "DMI %d.%d present.\n",
+   buf[14] >> 4, buf[14] & 0xF);
+   else
+   printk(KERN_INFO "DMI present.\n");
+
+   dmi_printk((KERN_INFO "%d structures occupying %d 
bytes.\n",
+   num, len));
+   dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", base));
+
+   if (dmi_table(base,len, num, dmi_decode) == 0)
+   return;
+   }
+   }
+
+out:   printk(KERN_INFO "DMI not present.\n");
 }
 
 

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


[PATCH 2/5] 2.6.13-rc5-mm1, make dmi_string() behave like strdup()

2005-08-10 Thread Andrey Panin

This patch changes dmi_string() function to allocate string copy by itself,
to avoid code duplication in the next patch.

Signed-off-by: Andrey Panin [EMAIL PROTECTED]

 arch/i386/kernel/dmi_scan.c |   39 +++
 1 files changed, 23 insertions(+), 16 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c2005-06-14 
23:31:39.0 +0400
+++ linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c2005-06-14 
23:31:51.0 +0400
@@ -16,15 +16,25 @@ struct dmi_header {
 static char * __init dmi_string(struct dmi_header *dm, u8 s)
 {
u8 *bp = ((u8 *) dm) + dm-length;
+   char *str = ;
 
-   if (!s)
-   return ;
-   s--;
-   while (s  0  *bp) {
-   bp += strlen(bp) + 1;
+   if (s) {
s--;
-   }
-   return bp;
+   while (s  0  *bp) {
+   bp += strlen(bp) + 1;
+   s--;
+   }
+
+   if (*bp != 0) {
+   str = alloc_bootmem(strlen(bp) + 1);
+   if (str != NULL)
+   strcpy(str, bp);
+   else
+   printk(KERN_ERR dmi_string: out of memory.\n);
+   }
+   }
+
+   return str;
 }
 
 /*
@@ -84,19 +94,16 @@ static char *dmi_ident[DMI_STRING_MAX];
  */
 static void __init dmi_save_ident(struct dmi_header *dm, int slot, int string)
 {
-   char *d = (char*)dm;
-   char *p = dmi_string(dm, d[string]);
+   char *p, *d = (char*) dm;
 
-   if (p == NULL || *p == 0)
-   return;
if (dmi_ident[slot])
return;
 
-   dmi_ident[slot] = alloc_bootmem(strlen(p) + 1);
-   if(dmi_ident[slot])
-   strcpy(dmi_ident[slot], p);
-   else
-   printk(KERN_ERR dmi_save_ident: out of memory.\n);
+   p = dmi_string(dm, d[string]);
+   if (p == NULL)
+   return;
+
+   dmi_ident[slot] = p;
 }
 
 /*

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


[PATCH 0/5] 2.6.13-rc5-mm1, remove uneeded function

2005-08-10 Thread Andrey Panin

After elimination of central DMI blacklist dmi_scan_machine() function
became a wrapper for dmi_iterate(). This patch moves some code around to
kill unneeded function.

Signed-off-by: Andrey Panin [EMAIL PROTECTED]

 arch/i386/kernel/dmi_scan.c |   85 
 1 files changed, 40 insertions(+), 45 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c2005-06-12 
23:07:37.0 +0400
+++ linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c2005-06-14 
23:18:18.0 +0400
@@ -84,49 +84,6 @@ static int __init dmi_checksum(u8 *buf)
return sum == 0;
 }
 
-static int __init dmi_iterate(void (*decode)(struct dmi_header *))
-{
-   u8 buf[15];
-   char __iomem *p, *q;
-
-   /*
-* no iounmap() for that ioremap(); it would be a no-op, but it's
-* so early in setup that sucker gets confused into doing what
-* it shouldn't if we actually call it.
-*/
-   p = ioremap(0xF, 0x1);
-   if (p == NULL)
-   return -1;
-
-   for (q = p; q  p + 0x1; q += 16) {
-   memcpy_fromio(buf, q, 15);
-   if ((memcmp(buf, _DMI_, 5) == 0)  dmi_checksum(buf)) {
-   u16 num = (buf[13]  8) | buf[12];
-   u16 len = (buf[7]  8) | buf[6];
-   u32 base = (buf[11]  24) | (buf[10]  16) |
-  (buf[9]  8) | buf[8];
-
-   /*
-* DMI version 0.0 means that the real version is taken 
from
-* the SMBIOS version, which we don't know at this 
point.
-*/
-   if (buf[14] != 0)
-   printk(KERN_INFO DMI %d.%d present.\n,
-   buf[14]  4, buf[14]  0xF);
-   else
-   printk(KERN_INFO DMI present.\n);
-
-   dmi_printk((KERN_INFO %d structures occupying %d 
bytes.\n,
-   num, len));
-   dmi_printk((KERN_INFO DMI table at 0x%08X.\n, base));
-
-   if (dmi_table(base,len, num, decode) == 0)
-   return 0;
-   }
-   }
-   return -1;
-}
-
 static char *dmi_ident[DMI_STRING_MAX];
 
 /*
@@ -190,8 +147,46 @@ static void __init dmi_decode(struct dmi
 
 void __init dmi_scan_machine(void)
 {
-   if (dmi_iterate(dmi_decode))
-   printk(KERN_INFO DMI not present.\n);
+   u8 buf[15];
+   char __iomem *p, *q;
+
+   /*
+* no iounmap() for that ioremap(); it would be a no-op, but it's
+* so early in setup that sucker gets confused into doing what
+* it shouldn't if we actually call it.
+*/
+   p = ioremap(0xF, 0x1);
+   if (p == NULL)
+   goto out;
+
+   for (q = p; q  p + 0x1; q += 16) {
+   memcpy_fromio(buf, q, 15);
+   if ((memcmp(buf, _DMI_, 5) == 0)  dmi_checksum(buf)) {
+   u16 num = (buf[13]  8) | buf[12];
+   u16 len = (buf[7]  8) | buf[6];
+   u32 base = (buf[11]  24) | (buf[10]  16) |
+  (buf[9]  8) | buf[8];
+
+   /*
+* DMI version 0.0 means that the real version is taken 
from
+* the SMBIOS version, which we don't know at this 
point.
+*/
+   if (buf[14] != 0)
+   printk(KERN_INFO DMI %d.%d present.\n,
+   buf[14]  4, buf[14]  0xF);
+   else
+   printk(KERN_INFO DMI present.\n);
+
+   dmi_printk((KERN_INFO %d structures occupying %d 
bytes.\n,
+   num, len));
+   dmi_printk((KERN_INFO DMI table at 0x%08X.\n, base));
+
+   if (dmi_table(base,len, num, dmi_decode) == 0)
+   return;
+   }
+   }
+
+out:   printk(KERN_INFO DMI not present.\n);
 }
 
 

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


[PATCH 1/5] 2.6.13-rc5-mm1, remove old debugging code

2005-08-10 Thread Andrey Panin

DMI debugging code is unused for ages. This patch removes it.

Signed-off-by: Andrey Panin [EMAIL PROTECTED]

 arch/i386/kernel/dmi_scan.c |   21 -
 1 files changed, 21 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c2005-06-14 
23:24:54.0 +0400
+++ linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c2005-06-14 
23:25:07.0 +0400
@@ -12,13 +12,6 @@ struct dmi_header {
u16 handle;
 };
 
-#undef DMI_DEBUG
-
-#ifdef DMI_DEBUG
-#define dmi_printk(x) printk x
-#else
-#define dmi_printk(x)
-#endif
 
 static char * __init dmi_string(struct dmi_header *dm, u8 s)
 {
@@ -117,29 +110,19 @@ static void __init dmi_decode(struct dmi

switch(dm-type) {
case  0:
-   dmi_printk((BIOS Vendor: %s\n, dmi_string(dm, data[4])));
dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
-   dmi_printk((BIOS Version: %s\n, dmi_string(dm, data[5])));
dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
-   dmi_printk((BIOS Release: %s\n, dmi_string(dm, data[8])));
dmi_save_ident(dm, DMI_BIOS_DATE, 8);
break;
case 1:
-   dmi_printk((System Vendor: %s\n, dmi_string(dm, data[4])));
dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
-   dmi_printk((Product Name: %s\n, dmi_string(dm, data[5])));
dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
-   dmi_printk((Version: %s\n, dmi_string(dm, data[6])));
dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
-   dmi_printk((Serial Number: %s\n, dmi_string(dm, data[7])));
dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
break;
case 2:
-   dmi_printk((Board Vendor: %s\n, dmi_string(dm, data[4])));
dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
-   dmi_printk((Board Name: %s\n, dmi_string(dm, data[5])));
dmi_save_ident(dm, DMI_BOARD_NAME, 5);
-   dmi_printk((Board Version: %s\n, dmi_string(dm, data[6])));
dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
break;
}
@@ -177,10 +160,6 @@ void __init dmi_scan_machine(void)
else
printk(KERN_INFO DMI present.\n);
 
-   dmi_printk((KERN_INFO %d structures occupying %d 
bytes.\n,
-   num, len));
-   dmi_printk((KERN_INFO DMI table at 0x%08X.\n, base));
-
if (dmi_table(base,len, num, dmi_decode) == 0)
return;
}

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


[PATCH 3/5] 2.6.13-rc5-mm1, add onboard devices discovery

2005-08-10 Thread Andrey Panin

This patch adds onboard devices and IPMI BMC discovery into DMI scan code.
Drivers can use dmi_find_device() function to search for devices by type
and name.

Signed-off-by: Andrey Panin [EMAIL PROTECTED]

 arch/i386/kernel/dmi_scan.c |  102 ++--
 include/linux/dmi.h |   34 +-
 2 files changed, 121 insertions(+), 15 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.13-rc5-mm1.vanilla/arch/i386/kernel/dmi_scan.c2005-08-09 
14:39:13.0 +0400
+++ linux-2.6.13-rc5-mm1/arch/i386/kernel/dmi_scan.c2005-08-09 
15:07:57.0 +0400
@@ -6,13 +6,6 @@
 #include linux/bootmem.h
 
 
-struct dmi_header {
-   u8 type;
-   u8 length;
-   u16 handle;
-};
-
-
 static char * __init dmi_string(struct dmi_header *dm, u8 s)
 {
u8 *bp = ((u8 *) dm) + dm-length;
@@ -88,6 +81,7 @@ static int __init dmi_checksum(u8 *buf)
 }
 
 static char *dmi_ident[DMI_STRING_MAX];
+static LIST_HEAD(dmi_devices);
 
 /*
  * Save a DMI string
@@ -106,6 +100,58 @@ static void __init dmi_save_ident(struct
dmi_ident[slot] = p;
 }
 
+static void __init dmi_save_devices(struct dmi_header *dm)
+{
+   int i, count = (dm-length - sizeof(struct dmi_header)) / 2;
+   struct dmi_device *dev;
+
+   for (i = 0; i  count; i++) {
+   char *d = ((char *) dm) + (i * 2);
+
+   /* Skip disabled device */
+   if ((*d  0x80) == 0)
+   continue;
+
+   dev = alloc_bootmem(sizeof(*dev));
+   if (!dev) {
+   printk(KERN_ERR dmi_save_devices: out of memory.\n);
+   break;
+   }
+
+   dev-type = *d++  0x7f;
+   dev-name = dmi_string(dm, *d);
+   dev-device_data = NULL;
+
+   list_add(dev-list, dmi_devices);
+   }
+}
+
+static void __init dmi_save_ipmi_device(struct dmi_header *dm)
+{
+   struct dmi_device *dev;
+   void * data;
+
+   data = alloc_bootmem(dm-length);
+   if (data == NULL) {
+   printk(KERN_ERR dmi_save_ipmi_device: out of memory.\n);
+   return;
+   }
+
+   memcpy(data, dm, dm-length);
+
+   dev = alloc_bootmem(sizeof(*dev));
+   if (!dev) {
+   printk(KERN_ERR dmi_save_ipmi_device: out of memory.\n);
+   return;
+   }
+
+   dev-type = DMI_DEV_TYPE_IPMI;
+   dev-name = IPMI controller;
+   dev-device_data = data;
+
+   list_add(dev-list, dmi_devices);
+}
+
 /*
  * Process a DMI table entry. Right now all we care about are the BIOS
  * and machine entries. For 2.5 we should pull the smbus controller info
@@ -113,25 +159,28 @@ static void __init dmi_save_ident(struct
  */
 static void __init dmi_decode(struct dmi_header *dm)
 {
-   u8 *data __attribute__((__unused__)) = (u8 *)dm;
-   
switch(dm-type) {
-   case  0:
+   case 0: /* BIOS Information */
dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
dmi_save_ident(dm, DMI_BIOS_DATE, 8);
break;
-   case 1:
+   case 1: /* System Information */
dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
break;
-   case 2:
+   case 2: /* Base Board Information */
dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
dmi_save_ident(dm, DMI_BOARD_NAME, 5);
dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
break;
+   case 10:/* Onboard Devices Information */
+   dmi_save_devices(dm);
+   break;
+   case 38:/* IPMI Device Information */
+   dmi_save_ipmi_device(dm);
}
 }
 
@@ -221,3 +270,32 @@ char *dmi_get_system_info(int field)
return dmi_ident[field];
 }
 EXPORT_SYMBOL(dmi_get_system_info);
+
+/**
+ * dmi_find_device - find onboard device by type/name
+ * @type: device type or %DMI_DEV_TYPE_ANY to match all device types
+ * @desc: device name string or %NULL to match all
+ * @from: previous device found in search, or %NULL for new search.
+ *
+ * Iterates through the list of known onboard devices. If a device is
+ * found with a matching @vendor and @device, a pointer to its device
+ * structure is returned.  Otherwise, %NULL is returned.
+ * A new search is initiated by passing %NULL to the @from argument.
+ * If @from is not %NULL, searches continue from next device.
+ */
+struct dmi_device * dmi_find_device(int type, const char *name,
+   struct dmi_device *from

[PATCH 4/5] 2.6.13-rc5-mm1, IPMI, use dmi_find_device()

2005-08-10 Thread Andrey Panin

This patch replaces homebrew DMI scanning code in IPMI System Interface driver
with dmi_find_device() call.

Signed-off-by: Andrey Panin [EMAIL PROTECTED]

 drivers/char/ipmi/ipmi_si_intf.c |  105 ++-
 1 files changed, 17 insertions(+), 88 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.13-rc5-mm1.vanilla/drivers/char/ipmi/ipmi_si_intf.c 
linux-2.6.13-rc5-mm1/drivers/char/ipmi/ipmi_si_intf.c
--- linux-2.6.13-rc5-mm1.vanilla/drivers/char/ipmi/ipmi_si_intf.c   
2005-08-08 14:32:07.0 +0400
+++ linux-2.6.13-rc5-mm1/drivers/char/ipmi/ipmi_si_intf.c   2005-08-08 
11:39:00.0 +0400
@@ -75,6 +75,7 @@ static inline void add_usec_to_timer(str
 #include asm/io.h
 #include ipmi_si_sm.h
 #include linux/init.h
+#include linux/dmi.h
 
 /* Measure times between events in the driver. */
 #undef DEBUG_TIMING
@@ -1642,22 +1643,15 @@ typedef struct dmi_ipmi_data
 static dmi_ipmi_data_t dmi_data[SI_MAX_DRIVERS];
 static int dmi_data_entries;
 
-typedef struct dmi_header
-{
-   u8  type;
-   u8  length;
-   u16 handle;
-} dmi_header_t;
-
-static int decode_dmi(dmi_header_t __iomem *dm, int intf_num)
+static int __init decode_dmi(struct dmi_header *dm, int intf_num)
 {
-   u8  __iomem *data = (u8 __iomem *)dm;
+   u8 *data = (u8 *)dm;
unsigned long   base_addr;
u8  reg_spacing;
-   u8  len = readb(dm-length);
+   u8  len = dm-length;
dmi_ipmi_data_t *ipmi_data = dmi_data+intf_num;
 
-   ipmi_data-type = readb(data[4]);
+   ipmi_data-type = data[4];
 
memcpy(base_addr, data+8, sizeof(unsigned long));
if (len = 0x11) {
@@ -1672,12 +1666,12 @@ static int decode_dmi(dmi_header_t __iom
}
/* If bit 4 of byte 0x10 is set, then the lsb for the address
   is odd. */
-   ipmi_data-base_addr = base_addr | ((readb(data[0x10])  0x10) 
 4);
+   ipmi_data-base_addr = base_addr | ((data[0x10]  0x10)  4);
 
-   ipmi_data-irq = readb(data[0x11]);
+   ipmi_data-irq = data[0x11];
 
/* The top two bits of byte 0x10 hold the register spacing. */
-   reg_spacing = (readb(data[0x10])  0xC0)  6;
+   reg_spacing = (data[0x10]  0xC0)  6;
switch(reg_spacing){
case 0x00: /* Byte boundaries */
ipmi_data-offset = 1;
@@ -1705,7 +1699,7 @@ static int decode_dmi(dmi_header_t __iom
ipmi_data-offset = 1;
}
 
-   ipmi_data-slave_addr = readb(data[6]);
+   ipmi_data-slave_addr = data[6];
 
if (is_new_interface(-1, ipmi_data-addr_space,ipmi_data-base_addr)) {
dmi_data_entries++;
@@ -1717,82 +1711,17 @@ static int decode_dmi(dmi_header_t __iom
return -1;
 }
 
-static int dmi_table(u32 base, int len, int num)
-{
-   u8__iomem *buf;
-   struct dmi_header __iomem *dm;
-   u8__iomem *data;
-   int   i=1;
-   int   status=-1;
-   int   intf_num = 0;
-
-   buf = ioremap(base, len);
-   if(buf==NULL)
-   return -1;
-
-   data = buf;
-
-   while(inum  (data - buf)  len)
-   {
-   dm=(dmi_header_t __iomem *)data;
-
-   if((data-buf+readb(dm-length)) = len)
-   break;
-
-   if (readb(dm-type) == 38) {
-   if (decode_dmi(dm, intf_num) == 0) {
-   intf_num++;
-   if (intf_num = SI_MAX_DRIVERS)
-   break;
-   }
-   }
-
-   data+=readb(dm-length);
-   while((data-buf)  len  (readb(data)||readb(data+1)))
-   data++;
-   data+=2;
-   i++;
-   }
-   iounmap(buf);
-
-   return status;
-}
-
-static inline int dmi_checksum(u8 *buf)
-{
-   u8   sum=0;
-   int  a;
-
-   for(a=0; a15; a++)
-   sum+=buf[a];
-   return (sum==0);
-}
-
-static int dmi_decode(void)
+static void __init dmi_find_bmc(void)
 {
-   u8   buf[15];
-   u32  fp=0xF;
-
-#ifdef CONFIG_SIMNOW
-   return -1;
-#endif
+   struct dmi_device *dev = NULL;
+   int intf_num = 0;
 
-   while(fp  0xF)
-   {
-   isa_memcpy_fromio(buf, fp, 15);
-   if(memcmp(buf, _DMI_, 5)==0  dmi_checksum(buf))
-   {
-   u16 num=buf[13]8|buf[12];
-   u16 len=buf[7]8|buf[6];
-   u32 base=buf[11]24|buf[10]16|buf[9]8|buf[8];
+   while ((dev = dmi_find_device(DMI_DEV_TYPE_IPMI, NULL, dev))) {
+   if (intf_num = SI_MAX_DRIVERS)
+   break;
 
-   if(dmi_table(base, len, num) == 0

[PATCH 5/5] 2.6.13-rc5-mm1, driver for IBM Automatic Server Restart watchdog

2005-08-10 Thread Andrey Panin

This patch adds driver for IBM Automatic Server Restart watchdog hardware
found in some IBM eServer xSeries machines. This driver is based on the ugly
driver provided by IBM. Driver was tested on IBM eServer 226.

Signed-off-by: Andrey Panin [EMAIL PROTECTED]

 drivers/char/watchdog/Kconfig  |   10 +
 drivers/char/watchdog/Makefile |1 
 drivers/char/watchdog/ibmasr.c |  407 +
 3 files changed, 418 insertions(+)

diff -urdpN linux-2.6.13-rc5-mm1.vanilla/drivers/char/watchdog/ibmasr.c 
linux-2.6.13-rc5-mm1/drivers/char/watchdog/ibmasr.c
--- linux-2.6.13-rc5-mm1.vanilla/drivers/char/watchdog/ibmasr.c 1970-01-01 
03:00:00.0 +0300
+++ linux-2.6.13-rc5-mm1/drivers/char/watchdog/ibmasr.c 2005-08-10 
11:43:45.0 +0400
@@ -0,0 +1,407 @@
+/*
+ * IBM Automatic Server Restart driver.
+ *
+ * Copyright (c) 2005 Andrey Panin [EMAIL PROTECTED]
+ *
+ * Based on driver written by Pete Reynolds.
+ * Copyright (c) IBM Corporation, 1998-2004.
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU Public License, incorporated herein by reference.
+ */
+
+#include linux/config.h
+#include linux/fs.h
+#include linux/kernel.h
+#include linux/slab.h
+#include linux/module.h
+#include linux/pci.h
+#include linux/timer.h
+#include linux/miscdevice.h
+#include linux/watchdog.h
+#include linux/dmi.h
+
+#include asm/io.h
+#include asm/uaccess.h
+
+
+enum {
+   ASMTYPE_UNKNOWN,
+   ASMTYPE_TOPAZ,
+   ASMTYPE_JASPER,
+   ASMTYPE_PEARL,
+   ASMTYPE_JUNIPER,
+   ASMTYPE_SPRUCE,
+};
+
+#define PFX ibmasr: 
+
+#define TOPAZ_ASR_REG_OFFSET   4
+#define TOPAZ_ASR_TOGGLE   0x40
+#define TOPAZ_ASR_DISABLE  0x80
+
+/* PEARL ASR S/W REGISTER SUPERIO PORT ADDRESSES */
+#define PEARL_BASE 0xe04
+#define PEARL_WRITE0xe06
+#define PEARL_READ 0xe07
+
+#define PEARL_ASR_DISABLE_MASK 0x80/* bit 7: disable = 1, enable = 0 */
+#define PEARL_ASR_TOGGLE_MASK  0x40/* bit 6: 0, then 1, then 0 */
+
+/* JASPER OFFSET FROM SIO BASE ADDR TO ASR S/W REGISTERS. */
+#define JASPER_ASR_REG_OFFSET  0x38
+
+#define JASPER_ASR_DISABLE_MASK0x01/* bit 0: disable = 1, enable = 
0 */
+#define JASPER_ASR_TOGGLE_MASK 0x02/* bit 1: 0, then 1, then 0 */
+
+#define JUNIPER_BASE_ADDRESS   0x54b   /* Base address of Juniper ASR */
+#define JUNIPER_ASR_DISABLE_MASK 0x01  /* bit 0: disable = 1 enable = 0 */
+#define JUNIPER_ASR_TOGGLE_MASK0x02/* bit 1: 0, then 1, then 0 */
+
+#define SPRUCE_BASE_ADDRESS0x118e  /* Base address of Spruce ASR */
+#define SPRUCE_ASR_DISABLE_MASK0x01/* bit 1: disable = 1 enable = 
0 */
+#define SPRUCE_ASR_TOGGLE_MASK 0x02/* bit 0: 0, then 1, then 0 */
+
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+static unsigned long asr_is_open;
+static char asr_expect_close;
+
+static unsigned int asr_type, asr_base, asr_length;
+static unsigned int asr_read_addr, asr_write_addr;
+static unsigned char asr_toggle_mask, asr_disable_mask;
+
+static void asr_toggle(void)
+{
+   unsigned char reg = inb(asr_read_addr);
+
+   outb(reg  ~asr_toggle_mask, asr_write_addr);
+   reg = inb(asr_read_addr);
+
+   outb(reg | asr_toggle_mask, asr_write_addr);
+   reg = inb(asr_read_addr);
+
+   outb(reg  ~asr_toggle_mask, asr_write_addr);
+   reg = inb(asr_read_addr);
+}
+
+static void asr_enable(void)
+{
+   unsigned char reg;
+
+   if (asr_type == ASMTYPE_TOPAZ) {
+   /* asr_write_addr == asr_read_addr */
+   reg = inb(asr_read_addr);
+   outb(reg  ~(TOPAZ_ASR_TOGGLE | TOPAZ_ASR_DISABLE),
+asr_read_addr);
+   } else {
+   /*
+* First make sure the hardware timer is reset by toggling
+* ASR hardware timer line.
+*/
+   asr_toggle();
+
+   reg = inb(asr_read_addr);
+   outb(reg  ~asr_disable_mask, asr_write_addr);
+   }
+   reg = inb(asr_read_addr);
+}
+
+static void asr_disable(void)
+{
+   unsigned char reg = inb(asr_read_addr);
+
+   if (asr_type == ASMTYPE_TOPAZ)
+   /* asr_write_addr == asr_read_addr */
+   outb(reg | TOPAZ_ASR_TOGGLE | TOPAZ_ASR_DISABLE,
+asr_read_addr);
+   else {
+   outb(reg | asr_toggle_mask, asr_write_addr);
+   reg = inb(asr_read_addr);
+
+   outb(reg | asr_disable_mask, asr_write_addr);
+   }
+   reg = inb(asr_read_addr);
+}
+
+static int __init asr_get_base_address(void)
+{
+   unsigned char low, high;
+   const char *type = ;
+
+   asr_length = 1;
+
+   switch (asr_type) {
+   case ASMTYPE_TOPAZ:
+   /* SELECT SuperIO CHIP FOR QUERYING (WRITE 0x07 TO BOTH 0x2E 
and 0x2F) */
+   outb(0x07, 0x2e);
+   outb(0x07, 0x2f);
+
+   /* SELECT AND READ THE HIGH-NIBBLE OF THE GPIO BASE ADDRESS

Re: Synaptics probe problem on Acer Travelmate 3004WTMi

2005-07-18 Thread Andrey Panin
On 199, 07 18, 2005 at 07:54:16AM +0200, Thomas Sailer wrote:
> On Wed, 2005-07-13 at 20:38 +0200, Vojtech Pavlik wrote:
> 
> > Also try the usual options ("i8042.nomux=1" and "usb-handoff"). One or
> > both may make the problem disappear.
> 
> usb-handoff did it, thanks a lot!

IIRC there was a patch which used DMI to automatically enable USB handoff
on machines that need it. Was it rejected ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Synaptics probe problem on Acer Travelmate 3004WTMi

2005-07-18 Thread Andrey Panin
On 199, 07 18, 2005 at 07:54:16AM +0200, Thomas Sailer wrote:
 On Wed, 2005-07-13 at 20:38 +0200, Vojtech Pavlik wrote:
 
  Also try the usual options (i8042.nomux=1 and usb-handoff). One or
  both may make the problem disappear.
 
 usb-handoff did it, thanks a lot!

IIRC there was a patch which used DMI to automatically enable USB handoff
on machines that need it. Was it rejected ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: IBM HDAPS things are looking up (was: Re: [Hdaps-devel] Re: [ltp] IBM HDAPS Someone interested? (Accelerometer))

2005-07-04 Thread Andrey Panin
meter */
> -#define HDAPS_NR_PORTS   0x30/* nr of ports total - 0x1600 through 
> 0x162f */
> -
> -#define STATE_STALE  0x00/* accelerometer data is stale */
> -#define STATE_FRESH  0x50/* accelerometer data fresh fresh */
> -
> -#define REFRESH_ASYNC0x00/* do asynchronous refresh */
> -#define REFRESH_SYNC 0x01/* do synchronous refresh */
> -
> -/* 
> - * where to find the various accelerometer data
> - * these map to the members of struct hdaps_accel_data
> - */
> -#define HDAPS_PORT_STATE 0x1611
> -#define  HDAPS_PORT_XACCEL   0x1612
> -#define HDAPS_PORT_YACCEL0x1614
> -#define HDAPS_PORT_TEMP  0x1616
> -#define HDAPS_PORT_XVAR  0x1617
> -#define HDAPS_PORT_YVAR  0x1619
> -#define HDAPS_PORT_TEMP2 0x161b
> -#define HDAPS_PORT_UNKNOWN   0x161c
> -#define HDAPS_PORT_KMACCT0x161d
> +MODULE_LICENSE("GPL");
> +MODULE_AUTHOR(DRV_COPYRIGHT);
> +MODULE_DESCRIPTION(DRV_DESCRIPTION);
> +MODULE_VERSION(DRV_VERSION);
>  
>  static short debug = 0;
>   
> @@ -345,6 +332,9 @@
>   int retval;
>   struct hdaps_accel_data data;
>  
> + printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n");
> + printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n");
> +
>   printk(KERN_WARNING "init 1 %08ld\n", jiffies);
>   if (!request_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS, "ibm_hdaps"))
>   return -ENXIO;
> @@ -367,7 +357,6 @@
>   }
>   
>   if (0) for (i = 0; i < 50; i++) {
> - int j;
>   unsigned long tmp;
>   accelerometer_read();
>   printk(KERN_WARNING "state = %d\n", data.state);
> @@ -405,8 +394,3 @@
>  module_init(ibm_hdaps_init);
>  module_exit(ibm_hdaps_exit);
>  
> -MODULE_LICENSE("GPL");
> -MODULE_AUTHOR("Jesper Juhl");
> -
> -MODULE_DESCRIPTION("IBM ThinkPad Accelerometer driver");
> -MODULE_VERSION("0.2");

> /*
>  * Driver for IBM HDAPS (HardDisk Active Protection system)
>  *
>  * Based on the document by Mark A. Smith available at
>  * http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html
>  *
>  * Copyright (c) 2005  Jesper Juhl <[EMAIL PROTECTED]>
>  *
>  * This program is free software; you can redistribute it and/or modify
>  * it under the terms of the GNU General Public License as published by
>  * the Free Software Foundation; either version 2 of the License, or
>  * (at your option) any later version.
>  *
>  * This program is distributed in the hope that it will be useful,
>  * but WITHOUT ANY WARRANTY; without even the implied warranty of
>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>  * GNU General Public License for more details.
>  *
>  * You should have received a copy of the GNU General Public License
>  * along with this program; if not, write to the Free Software
>  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
>  */
> 
> #ifndef __IBM_HDAPS_H__
> #define __IBM_HDAPS_H__
> 
> #define HDAPS_LOW_PORT0x1600  /* first port used by accelerometer */
> #define HDAPS_NR_PORTS0x30/* nr of ports total - 0x1600 through 
> 0x162f */
> 
> #define STATE_STALE   0x00/* accelerometer data is stale */
> #define STATE_FRESH   0x50/* accelerometer data fresh fresh */
> 
> #define REFRESH_ASYNC 0x00/* do asynchronous refresh */
> #define REFRESH_SYNC  0x01/* do synchronous refresh */
> 
> /* 
>  * where to find the various accelerometer data
>  * these map to the members of struct hdaps_accel_data
>  */
> #define HDAPS_PORT_STATE  0x1611
> #define   HDAPS_PORT_XACCEL   0x1612
> #define HDAPS_PORT_YACCEL 0x1614
> #define HDAPS_PORT_TEMP   0x1616
> #define HDAPS_PORT_XVAR   0x1617
> #define HDAPS_PORT_YVAR   0x1619
> #define HDAPS_PORT_TEMP2  0x161b
> #define HDAPS_PORT_UNKNOWN0x161c
> #define HDAPS_PORT_KMACCT 0x161d
> 
> #endif /*  __IBM_HDAPS_H__  */

> --- Makefile.org  2005-07-04 07:58:53.0 +0200
> +++ Makefile  2005-07-04 07:57:50.0 +0200
> @@ -26,3 +26,7 @@
>   install -d $(KMISC)
>   install -m 644 -c $(addsuffix .ko,$(list-m)) $(KMISC)
>   /sbin/depmod -a
> +
> +uninstall:
> + rm -f $(KMISC)/$(addsuffix .ko,$(list-m))
> + /sbin/depmod -a


-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [CFT:PATCH] Serial + Serial PCI card cleanup

2005-07-04 Thread Andrey Panin
  kfree(priv);
> + priv = pciserial_init_ports(dev, board);
> + if (!IS_ERR(priv)) {
> + pci_set_drvdata(dev, priv);
> + return 0;
>   }
> +
> + rc = PTR_ERR(priv);
> +
> + disable:
> + pci_disable_device(dev);
> + return rc;
> +}
> +
> +static void __devexit pciserial_remove_one(struct pci_dev *dev)
> +{
> + struct serial_private *priv = pci_get_drvdata(dev);
> +
> + pci_set_drvdata(dev, NULL);
> +
> + if (priv)
> + pciserial_remove_ports(priv);
> +
> + pci_disable_device(dev);
>  }
>  
>  static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
>  {
>   struct serial_private *priv = pci_get_drvdata(dev);
>  
> - if (priv) {
> - int i;
> + if (priv)
> + pciserial_suspend_ports(priv);
>  
> - for (i = 0; i < priv->nr; i++)
> - serial8250_suspend_port(priv->line[i]);
> - }
>   pci_save_state(dev);
>   pci_set_power_state(dev, pci_choose_state(dev, state));
>   return 0;
> @@ -1807,21 +1693,12 @@
>   pci_restore_state(dev);
>  
>   if (priv) {
> - int i;
> -
>   /*
>    * The device may have been disabled.  Re-enable it.
>*/
>   pci_enable_device(dev);
>  
> - /

Re: IBM HDAPS things are looking up (was: Re: [Hdaps-devel] Re: [ltp] IBM HDAPS Someone interested? (Accelerometer))

2005-07-04 Thread Andrey Panin
 HDAPS_PORT_XVAR  0x1617
 -#define HDAPS_PORT_YVAR  0x1619
 -#define HDAPS_PORT_TEMP2 0x161b
 -#define HDAPS_PORT_UNKNOWN   0x161c
 -#define HDAPS_PORT_KMACCT0x161d
 +MODULE_LICENSE(GPL);
 +MODULE_AUTHOR(DRV_COPYRIGHT);
 +MODULE_DESCRIPTION(DRV_DESCRIPTION);
 +MODULE_VERSION(DRV_VERSION);
  
  static short debug = 0;
   
 @@ -345,6 +332,9 @@
   int retval;
   struct hdaps_accel_data data;
  
 + printk(KERN_INFO DRV_NAME :  DRV_DESCRIPTION ,  DRV_VERSION \n);
 + printk(KERN_INFO DRV_NAME :  DRV_COPYRIGHT \n);
 +
   printk(KERN_WARNING init 1 %08ld\n, jiffies);
   if (!request_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS, ibm_hdaps))
   return -ENXIO;
 @@ -367,7 +357,6 @@
   }
   
   if (0) for (i = 0; i  50; i++) {
 - int j;
   unsigned long tmp;
   accelerometer_read(data);
   printk(KERN_WARNING state = %d\n, data.state);
 @@ -405,8 +394,3 @@
  module_init(ibm_hdaps_init);
  module_exit(ibm_hdaps_exit);
  
 -MODULE_LICENSE(GPL);
 -MODULE_AUTHOR(Jesper Juhl);
 -
 -MODULE_DESCRIPTION(IBM ThinkPad Accelerometer driver);
 -MODULE_VERSION(0.2);

 /*
  * Driver for IBM HDAPS (HardDisk Active Protection system)
  *
  * Based on the document by Mark A. Smith available at
  * http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html
  *
  * Copyright (c) 2005  Jesper Juhl [EMAIL PROTECTED]
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
 #ifndef __IBM_HDAPS_H__
 #define __IBM_HDAPS_H__
 
 #define HDAPS_LOW_PORT0x1600  /* first port used by accelerometer */
 #define HDAPS_NR_PORTS0x30/* nr of ports total - 0x1600 through 
 0x162f */
 
 #define STATE_STALE   0x00/* accelerometer data is stale */
 #define STATE_FRESH   0x50/* accelerometer data fresh fresh */
 
 #define REFRESH_ASYNC 0x00/* do asynchronous refresh */
 #define REFRESH_SYNC  0x01/* do synchronous refresh */
 
 /* 
  * where to find the various accelerometer data
  * these map to the members of struct hdaps_accel_data
  */
 #define HDAPS_PORT_STATE  0x1611
 #define   HDAPS_PORT_XACCEL   0x1612
 #define HDAPS_PORT_YACCEL 0x1614
 #define HDAPS_PORT_TEMP   0x1616
 #define HDAPS_PORT_XVAR   0x1617
 #define HDAPS_PORT_YVAR   0x1619
 #define HDAPS_PORT_TEMP2  0x161b
 #define HDAPS_PORT_UNKNOWN0x161c
 #define HDAPS_PORT_KMACCT 0x161d
 
 #endif /*  __IBM_HDAPS_H__  */

 --- Makefile.org  2005-07-04 07:58:53.0 +0200
 +++ Makefile  2005-07-04 07:57:50.0 +0200
 @@ -26,3 +26,7 @@
   install -d $(KMISC)
   install -m 644 -c $(addsuffix .ko,$(list-m)) $(KMISC)
   /sbin/depmod -a
 +
 +uninstall:
 + rm -f $(KMISC)/$(addsuffix .ko,$(list-m))
 + /sbin/depmod -a


-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [CFT:PATCH] Serial + SerialParallel PCI card cleanup

2005-07-04 Thread Andrey Panin
/
 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [2.6 patch] i386: cleanup boot_cpu_logical_apicid variables

2005-04-19 Thread Andrey Panin
On 105, 04 15, 2005 at 04:35:29PM +0200, Adrian Bunk wrote:
> There are currently two different boot_cpu_logical_apicid variables:
> - a global one in mpparse.c
> - a static one in smpboot.c
> 
> Of these two, only the one in smpboot.c might be used (through 
> boot_cpu_apicid).
> 
> This patch therefore removes the one in mpparse.c .
> 
> Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

Looks good. For the visws part:

Signed-off-by: Andrey Panin <[EMAIL PROTECTED]>

> ---
> 
>  arch/i386/kernel/mpparse.c |2 --
>  arch/i386/mach-visws/mpparse.c |5 +
>  2 files changed, 1 insertion(+), 6 deletions(-)
> 
> --- linux-2.6.12-rc2-mm3-full/arch/i386/kernel/mpparse.c.old  2005-04-15 
> 14:21:41.0 +0200
> +++ linux-2.6.12-rc2-mm3-full/arch/i386/kernel/mpparse.c  2005-04-15 
> 14:22:00.0 +0200
> @@ -67,7 +67,6 @@
>  
>  /* Processor that is doing the boot up */
>  unsigned int boot_cpu_physical_apicid = -1U;
> -unsigned int boot_cpu_logical_apicid = -1U;
>  /* Internal processor count */
>  static unsigned int __initdata num_processors;
>  
> @@ -180,7 +179,6 @@
>   if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
>   Dprintk("Bootup CPU\n");
>   boot_cpu_physical_apicid = m->mpc_apicid;
> - boot_cpu_logical_apicid = apicid;
>   }
>  
>   if (num_processors >= NR_CPUS) {
> --- linux-2.6.12-rc2-mm3-full/arch/i386/mach-visws/mpparse.c.old  
> 2005-04-15 14:22:10.0 +0200
> +++ linux-2.6.12-rc2-mm3-full/arch/i386/mach-visws/mpparse.c  2005-04-15 
> 14:22:27.0 +0200
> @@ -23,7 +23,6 @@
>  
>  /* Processor that is doing the boot up */
>  unsigned int boot_cpu_physical_apicid = -1U;
> -unsigned int boot_cpu_logical_apicid = -1U;
>  
>  /* Bitmask of physically existing CPUs */
>  physid_mask_t phys_cpu_present_map;
> @@ -52,10 +51,8 @@
>   (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
>   m->mpc_apicver);
>  
> - if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
> + if (m->mpc_cpuflag & CPU_BOOTPROCESSOR)
>   boot_cpu_physical_apicid = m->mpc_apicid;
> - boot_cpu_logical_apicid = logical_apicid;
> - }
>  
>   ver = m->mpc_apicver;
>   if ((ver >= 0x14 && m->mpc_apicid >= 0xff) || m->mpc_apicid >= 0xf) {
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [2.6 patch] i386: cleanup boot_cpu_logical_apicid variables

2005-04-19 Thread Andrey Panin
On 105, 04 15, 2005 at 04:35:29PM +0200, Adrian Bunk wrote:
 There are currently two different boot_cpu_logical_apicid variables:
 - a global one in mpparse.c
 - a static one in smpboot.c
 
 Of these two, only the one in smpboot.c might be used (through 
 boot_cpu_apicid).
 
 This patch therefore removes the one in mpparse.c .
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

Looks good. For the visws part:

Signed-off-by: Andrey Panin [EMAIL PROTECTED]

 ---
 
  arch/i386/kernel/mpparse.c |2 --
  arch/i386/mach-visws/mpparse.c |5 +
  2 files changed, 1 insertion(+), 6 deletions(-)
 
 --- linux-2.6.12-rc2-mm3-full/arch/i386/kernel/mpparse.c.old  2005-04-15 
 14:21:41.0 +0200
 +++ linux-2.6.12-rc2-mm3-full/arch/i386/kernel/mpparse.c  2005-04-15 
 14:22:00.0 +0200
 @@ -67,7 +67,6 @@
  
  /* Processor that is doing the boot up */
  unsigned int boot_cpu_physical_apicid = -1U;
 -unsigned int boot_cpu_logical_apicid = -1U;
  /* Internal processor count */
  static unsigned int __initdata num_processors;
  
 @@ -180,7 +179,6 @@
   if (m-mpc_cpuflag  CPU_BOOTPROCESSOR) {
   Dprintk(Bootup CPU\n);
   boot_cpu_physical_apicid = m-mpc_apicid;
 - boot_cpu_logical_apicid = apicid;
   }
  
   if (num_processors = NR_CPUS) {
 --- linux-2.6.12-rc2-mm3-full/arch/i386/mach-visws/mpparse.c.old  
 2005-04-15 14:22:10.0 +0200
 +++ linux-2.6.12-rc2-mm3-full/arch/i386/mach-visws/mpparse.c  2005-04-15 
 14:22:27.0 +0200
 @@ -23,7 +23,6 @@
  
  /* Processor that is doing the boot up */
  unsigned int boot_cpu_physical_apicid = -1U;
 -unsigned int boot_cpu_logical_apicid = -1U;
  
  /* Bitmask of physically existing CPUs */
  physid_mask_t phys_cpu_present_map;
 @@ -52,10 +51,8 @@
   (m-mpc_cpufeature  CPU_MODEL_MASK)  4,
   m-mpc_apicver);
  
 - if (m-mpc_cpuflag  CPU_BOOTPROCESSOR) {
 + if (m-mpc_cpuflag  CPU_BOOTPROCESSOR)
   boot_cpu_physical_apicid = m-mpc_apicid;
 - boot_cpu_logical_apicid = logical_apicid;
 - }
  
   ver = m-mpc_apicver;
   if ((ver = 0x14  m-mpc_apicid = 0xff) || m-mpc_apicid = 0xf) {
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.12-rc2-mm1

2005-04-05 Thread Andrey Panin
On 095, 04 05, 2005 at 12:05:24AM -0700, Andrew Morton wrote:

what useful this part of the patch is supposed to do ?
Looks like the result of whitespace damage.


--- linux-2.6.12-rc2/drivers/acpi/sleep/main.c  2005-03-02 01:09:19.0 
-0800
+++ 25/drivers/acpi/sleep/main.c2005-04-04 22:33:10.0 -0700



@@ -190,16 +180,16 @@ static int __init init_ints_after_s1(str
 
 static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
{
-   .callback = init_ints_after_s1,
-   .ident = "Toshiba Satellite 4030cdt",
-   .matches = { DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), },
-   },
-   { },
+.callback = init_ints_after_s1,
+.ident = "Toshiba Satellite 4030cdt",
+.matches = {DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),},
+},
+   {},
 };

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


Re: 2.6.12-rc2-mm1

2005-04-05 Thread Andrey Panin
On 095, 04 05, 2005 at 12:05:24AM -0700, Andrew Morton wrote:

what useful this part of the patch is supposed to do ?
Looks like the result of whitespace damage.


--- linux-2.6.12-rc2/drivers/acpi/sleep/main.c  2005-03-02 01:09:19.0 
-0800
+++ 25/drivers/acpi/sleep/main.c2005-04-04 22:33:10.0 -0700

snip

@@ -190,16 +180,16 @@ static int __init init_ints_after_s1(str
 
 static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
{
-   .callback = init_ints_after_s1,
-   .ident = Toshiba Satellite 4030cdt,
-   .matches = { DMI_MATCH(DMI_PRODUCT_NAME, S4030CDT/4.3), },
-   },
-   { },
+.callback = init_ints_after_s1,
+.ident = Toshiba Satellite 4030cdt,
+.matches = {DMI_MATCH(DMI_PRODUCT_NAME, S4030CDT/4.3),},
+},
+   {},
 };

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


Re: PROBLEM: v2.4.29 won't compile with PCI support disabled

2005-04-04 Thread Andrey Panin
On 094, 04 04, 2005 at 02:14:47 +0200, Mikael Pettersson wrote:
> Don Guy writes:
>  > PROBLEM:
>  > 
>  > Attempts to compile v2.4.29 with PCI support disabled result in the
>  > following errors:
>  > 
>  > drivers/char/char.o: In function `siig10x_init_fn':
>  > drivers/char/char.o(.text.init+0x12cd): undefined reference to
>  > `pci_siig10x_fn'
>  > drivers/char/char.o: In function `siig20x_init_fn':
>  > drivers/char/char.o(.text.init+0x12ed): undefined reference to
>  > `pci_siig20x_fn'
>  > 
>  > It has been suggested that enabling PCI support in the kernel will make 
> this
>  > go away however a) enabling PCI support on a 486 which only has ISA & VLB 
> is
>  > downright silly, and b) a test run with CONFIG_PCI=y resulted in a plethora
>  > of other errors.
> 
> Presumably this is because of other CONFIG options which are still
> enabled but don't work w/o CONFIG_PCI. So please post your .config.
> 
d> Both 2.4 and 2.6 kernels with CONFIG_PCI=n work Ok(*) on my 486.

Disable CONFIG_PARPORT_SERIAL in your config.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: PROBLEM: v2.4.29 won't compile with PCI support disabled

2005-04-04 Thread Andrey Panin
On 094, 04 04, 2005 at 02:14:47 +0200, Mikael Pettersson wrote:
 Don Guy writes:
   PROBLEM:
   
   Attempts to compile v2.4.29 with PCI support disabled result in the
   following errors:
   
   drivers/char/char.o: In function `siig10x_init_fn':
   drivers/char/char.o(.text.init+0x12cd): undefined reference to
   `pci_siig10x_fn'
   drivers/char/char.o: In function `siig20x_init_fn':
   drivers/char/char.o(.text.init+0x12ed): undefined reference to
   `pci_siig20x_fn'
   
   It has been suggested that enabling PCI support in the kernel will make 
 this
   go away however a) enabling PCI support on a 486 which only has ISA  VLB 
 is
   downright silly, and b) a test run with CONFIG_PCI=y resulted in a plethora
   of other errors.
 
 Presumably this is because of other CONFIG options which are still
 enabled but don't work w/o CONFIG_PCI. So please post your .config.
 
d Both 2.4 and 2.6 kernels with CONFIG_PCI=n work Ok(*) on my 486.

Disable CONFIG_PARPORT_SERIAL in your config.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [rfc/rft] Fujitsu B-Series Lifebook PS/2 TouchScreen driver

2005-03-22 Thread Andrey Panin
On 081, 03 22, 2005 at 02:13:45AM -0500, Dmitry Torokhov wrote:
> On Monday 21 March 2005 10:31, Kenan Esau wrote:
> > Am Montag, den 21.03.2005, 09:52 -0500 schrieb Dmitry Torokhov:
> > > 
> > > There are couple of things that I an concerned with:
> > > 
> > > 1. I don't like that it overrides meaning of max_proto parameter to be
> > > exactly the protocol specified. 
> > 
> > Yeah -- I agree. I also don't like that double-meaning. That was the
> > reason why I originally proposed the use of a new parameter...
> > 
> 
> Ok, I have some patches to lifebook that I would like to included (if
> they work):
> 
> 1. lifebook-dmi-x86-only - do not compile in DMI detection on anything
>but x86.

On !x86 machines DMI functions will be optimized away and so you'll save only
few bytes in .init.data section. IMHO it's not worth additional ugly #ifdef's.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: [rfc/rft] Fujitsu B-Series Lifebook PS/2 TouchScreen driver

2005-03-22 Thread Andrey Panin
On 081, 03 22, 2005 at 02:13:45AM -0500, Dmitry Torokhov wrote:
 On Monday 21 March 2005 10:31, Kenan Esau wrote:
  Am Montag, den 21.03.2005, 09:52 -0500 schrieb Dmitry Torokhov:
   
   There are couple of things that I an concerned with:
   
   1. I don't like that it overrides meaning of max_proto parameter to be
   exactly the protocol specified. 
  
  Yeah -- I agree. I also don't like that double-meaning. That was the
  reason why I originally proposed the use of a new parameter...
  
 
 Ok, I have some patches to lifebook that I would like to included (if
 they work):
 
 1. lifebook-dmi-x86-only - do not compile in DMI detection on anything
but x86.

On !x86 machines DMI functions will be optimized away and so you'll save only
few bytes in .init.data section. IMHO it's not worth additional ugly #ifdef's.

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Need break driver<-->pci-device automatic association

2005-03-21 Thread Andrey Panin
On 080, 03 21, 2005 at 08:22:28AM +, Russell King wrote:
> On Mon, Mar 21, 2005 at 11:16:38AM +0300, Andrey Panin wrote:
> > On 078, 03 19, 2005 at 08:33:14PM +0200, Jacques Goldberg wrote:
> > >That's really what is needed (mainline).
> > >I attach the file which Sasha, author or the lmodem driver, has
> > > modified and then it works for the chips hard-wired in the routine.
> > >To locate the patched area, look for 5457
> > 
> > We can use PCI quirk here. Patch attached.
> 
> I haven't seen any mail in this thread which provides the complete
> PCI ID information for these cards.

I took them from the patched 8250_pci.c file in Jacques' previous mail:

/*
 * pci devices with appropriate class declared, but known as
 * non modems or serial
 */
static struct pci_device_id __devinitdata non_serial_pci_tbl[] = {
{   PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{   PCI_VENDOR_ID_AL, 0x5457,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{   PCI_VENDOR_ID_AL, 0x5459,
    PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, }
};

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Need break driver<-->pci-device automatic association

2005-03-21 Thread Andrey Panin
On 078, 03 19, 2005 at 08:33:14PM +0200, Jacques Goldberg wrote:
> 
>Good news!
>That's really what is needed (mainline).
>I attach the file which Sasha, author or the lmodem driver, has
> modified and then it works for the chips hard-wired in the routine.
>To locate the patched area, look for 5457

We can use PCI quirk here. Patch attached.

>I am an experimental physicist, not a computer expert. If this kind of
> algorithm could be implemented in the mainlin 8250_pci.c , then I would
> dream of looking for an /etc/config file containing such a list, whose
> objects would be skipped by the serial driver.
>Sorry to repeat myself, but avoiding the need for the users to
> recompile a kernel should be the first worry when implementing a solution.

It's not a reason to fill kernel code with ugly kludges :)

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
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.0 
+0300
+++ linux-2.6.11/drivers/pci/quirks.c   2005-03-21 11:02:53.0 +0300
@@ -1241,6 +1241,18 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_E7320_MCH,  
quirk_pcie_mch );
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_E7525_MCH,  
quirk_pcie_mch );
 
+/*
+ * Some stupid winmodems try to look as real modems. Fix them.
+ */
+static void __devinit quirk_winmodems(struct pci_dev *dev)
+{
+   dev->class = PCI_CLASS_COMMUNICATION_OTHER;
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451, 
quirk_winmodems);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5457, quirk_winmodems);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5459, quirk_winmodems);
+
+
 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct 
pci_fixup *end)
 {
while (f < end) {


Re: Need break driver--pci-device automatic association

2005-03-21 Thread Andrey Panin
On 078, 03 19, 2005 at 08:33:14PM +0200, Jacques Goldberg wrote:
 
Good news!
That's really what is needed (mainline).
I attach the file which Sasha, author or the lmodem driver, has
 modified and then it works for the chips hard-wired in the routine.
To locate the patched area, look for 5457

We can use PCI quirk here. Patch attached.

I am an experimental physicist, not a computer expert. If this kind of
 algorithm could be implemented in the mainlin 8250_pci.c , then I would
 dream of looking for an /etc/config file containing such a list, whose
 objects would be skipped by the serial driver.
Sorry to repeat myself, but avoiding the need for the users to
 recompile a kernel should be the first worry when implementing a solution.

It's not a reason to fill kernel code with ugly kludges :)

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
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.0 
+0300
+++ linux-2.6.11/drivers/pci/quirks.c   2005-03-21 11:02:53.0 +0300
@@ -1241,6 +1241,18 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_E7320_MCH,  
quirk_pcie_mch );
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_E7525_MCH,  
quirk_pcie_mch );
 
+/*
+ * Some stupid winmodems try to look as real modems. Fix them.
+ */
+static void __devinit quirk_winmodems(struct pci_dev *dev)
+{
+   dev-class = PCI_CLASS_COMMUNICATION_OTHER;
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451, 
quirk_winmodems);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5457, quirk_winmodems);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5459, quirk_winmodems);
+
+
 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct 
pci_fixup *end)
 {
while (f  end) {


Re: Need break driver--pci-device automatic association

2005-03-21 Thread Andrey Panin
On 080, 03 21, 2005 at 08:22:28AM +, Russell King wrote:
 On Mon, Mar 21, 2005 at 11:16:38AM +0300, Andrey Panin wrote:
  On 078, 03 19, 2005 at 08:33:14PM +0200, Jacques Goldberg wrote:
  That's really what is needed (mainline).
  I attach the file which Sasha, author or the lmodem driver, has
   modified and then it works for the chips hard-wired in the routine.
  To locate the patched area, look for 5457
  
  We can use PCI quirk here. Patch attached.
 
 I haven't seen any mail in this thread which provides the complete
 PCI ID information for these cards.

I took them from the patched 8250_pci.c file in Jacques' previous mail:

/*
 * pci devices with appropriate class declared, but known as
 * non modems or serial
 */
static struct pci_device_id __devinitdata non_serial_pci_tbl[] = {
{   PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{   PCI_VENDOR_ID_AL, 0x5457,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{   PCI_VENDOR_ID_AL, 0x5459,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, }
};

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ES7000 Legacy Mappings Update

2005-03-14 Thread Andrey Panin
On 073, 03 14, 2005 at 06:05:54PM -0800, Andrew Morton wrote:
> 
> You triggered my trivia twitch.
> 
> Jason Davis <[EMAIL PROTECTED]> wrote:
> >
> >  -   * ES7000 has no legacy identity mappings
> >  +   * Older generations of ES7000 have no legacy identity mappings
> >  */
> >  -  if (es7000_plat)
> >  +  if (es7000_plat && es7000_plat < 2) 
> > return;
> 
> Why not
> 
>   if (es7000_plat == 1)
> 
> ?
> 
> > /* 
> >  diff -Naurp linux-2.6.11.3/arch/i386/mach-es7000/es7000plat.c 
> > linux-2.6.11.3-legacy/arch/i386/mach-es7000/es7000plat.c
> >  --- linux-2.6.11.3/arch/i386/mach-es7000/es7000plat.c  2005-03-13 
> > 01:44:41.0 -0500
> >  +++ linux-2.6.11.3-legacy/arch/i386/mach-es7000/es7000plat.c   
> > 2005-03-14 11:52:44.0 -0500
> >  @@ -138,7 +138,14 @@ parse_unisys_oem (char *oemptr, int oem_
> > es7000_plat = 0;
> > } else {
> > printk("\nEnabling ES7000 specific features...\n");
> >  -  es7000_plat = 1;
> >  +  /*
> >  +   * Check to see if this is a x86_64 ES7000 machine.
> >  +   */
> >  +  if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
> >  +  es7000_plat = 2;
> >  +  else
> >  +  es7000_plat = 1;
> >  +
> 
> Perhaps some nice enumerated identifiers here, rather than magic numbers?

While you are looking at this code can you take a look at the attached
trivial patch ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net

This patch moves es7000_plat global variable out of DMI code.

Signed-off-by: Andrey Panin <[EMAIL PROTECTED]>

 arch/i386/kernel/dmi_scan.c |2 --
 arch/i386/kernel/mpparse.c  |1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.11.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.11/arch/i386/kernel/dmi_scan.c
--- linux-2.6.11.vanilla/arch/i386/kernel/dmi_scan.c2005-03-08 
18:02:00.0 +0300
+++ linux-2.6.11/arch/i386/kernel/dmi_scan.c2005-03-08 18:04:38.0 
+0300
@@ -12,8 +12,6 @@
 #include 
 
 
-int es7000_plat = 0;
-
 struct dmi_header
 {
u8  type;
diff -urdpNX /usr/share/dontdiff 
linux-2.6.11.vanilla/arch/i386/kernel/mpparse.c 
linux-2.6.11/arch/i386/kernel/mpparse.c
--- linux-2.6.11.vanilla/arch/i386/kernel/mpparse.c 2005-03-02 
10:37:53.0 +0300
+++ linux-2.6.11/arch/i386/kernel/mpparse.c 2005-03-08 18:05:28.0 
+0300
@@ -982,6 +982,7 @@ void __init mp_override_legacy_irq (
return;
 }
 
+int es7000_plat;
 
 void __init mp_config_acpi_legacy_irqs (void)
 {


Re: [PATCH] ES7000 Legacy Mappings Update

2005-03-14 Thread Andrey Panin
On 073, 03 14, 2005 at 06:05:54PM -0800, Andrew Morton wrote:
 
 You triggered my trivia twitch.
 
 Jason Davis [EMAIL PROTECTED] wrote:
 
   -   * ES7000 has no legacy identity mappings
   +   * Older generations of ES7000 have no legacy identity mappings
   */
   -  if (es7000_plat)
   +  if (es7000_plat  es7000_plat  2) 
  return;
 
 Why not
 
   if (es7000_plat == 1)
 
 ?
 
  /* 
   diff -Naurp linux-2.6.11.3/arch/i386/mach-es7000/es7000plat.c 
  linux-2.6.11.3-legacy/arch/i386/mach-es7000/es7000plat.c
   --- linux-2.6.11.3/arch/i386/mach-es7000/es7000plat.c  2005-03-13 
  01:44:41.0 -0500
   +++ linux-2.6.11.3-legacy/arch/i386/mach-es7000/es7000plat.c   
  2005-03-14 11:52:44.0 -0500
   @@ -138,7 +138,14 @@ parse_unisys_oem (char *oemptr, int oem_
  es7000_plat = 0;
  } else {
  printk(\nEnabling ES7000 specific features...\n);
   -  es7000_plat = 1;
   +  /*
   +   * Check to see if this is a x86_64 ES7000 machine.
   +   */
   +  if (!(boot_cpu_data.x86 = 15  boot_cpu_data.x86_model = 2))
   +  es7000_plat = 2;
   +  else
   +  es7000_plat = 1;
   +
 
 Perhaps some nice enumerated identifiers here, rather than magic numbers?

While you are looking at this code can you take a look at the attached
trivial patch ?

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net

This patch moves es7000_plat global variable out of DMI code.

Signed-off-by: Andrey Panin [EMAIL PROTECTED]

 arch/i386/kernel/dmi_scan.c |2 --
 arch/i386/kernel/mpparse.c  |1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff -urdpNX /usr/share/dontdiff 
linux-2.6.11.vanilla/arch/i386/kernel/dmi_scan.c 
linux-2.6.11/arch/i386/kernel/dmi_scan.c
--- linux-2.6.11.vanilla/arch/i386/kernel/dmi_scan.c2005-03-08 
18:02:00.0 +0300
+++ linux-2.6.11/arch/i386/kernel/dmi_scan.c2005-03-08 18:04:38.0 
+0300
@@ -12,8 +12,6 @@
 #include linux/bootmem.h
 
 
-int es7000_plat = 0;
-
 struct dmi_header
 {
u8  type;
diff -urdpNX /usr/share/dontdiff 
linux-2.6.11.vanilla/arch/i386/kernel/mpparse.c 
linux-2.6.11/arch/i386/kernel/mpparse.c
--- linux-2.6.11.vanilla/arch/i386/kernel/mpparse.c 2005-03-02 
10:37:53.0 +0300
+++ linux-2.6.11/arch/i386/kernel/mpparse.c 2005-03-08 18:05:28.0 
+0300
@@ -982,6 +982,7 @@ void __init mp_override_legacy_irq (
return;
 }
 
+int es7000_plat;
 
 void __init mp_config_acpi_legacy_irqs (void)
 {


Re: Patch to enable the USB handoff on Dell 650

2005-03-10 Thread Andrey Panin
On 063, 03 04, 2005 at 12:17:40 -0800, Pete Zaitcev wrote:
> On Wed, 2 Feb 2005 10:18:47 +0300 Andrey Panin <[EMAIL PROTECTED]> 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.0 
+0300
+++ linux-2.6.11/drivers/pci/quirks.c   2005-03-10 10:45:19.0 +0300
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #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
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Patch to enable the USB handoff on Dell 650

2005-03-10 Thread Andrey Panin
On 063, 03 04, 2005 at 12:17:40 -0800, Pete Zaitcev wrote:
 On Wed, 2 Feb 2005 10:18:47 +0300 Andrey Panin [EMAIL PROTECTED] 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.0 
+0300
+++ linux-2.6.11/drivers/pci/quirks.c   2005-03-10 10:45:19.0 +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
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Patch to enable the USB handoff on Dell 650

2005-02-01 Thread Andrey Panin
On 032, 02 01, 2005 at 10:02:41AM -0800, Pete Zaitcev wrote:
> Hi, guys,
> 
> I was looking at this:
>   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=138892
> 
>   I have added usb-handoff as a kernel option in grub.conf for
>   2.4.21-20.EL (smp) and re-enabled USB Emulation and Controller in the
>   BIOS, and the machine now seems to boot normally.  I only had time to
>   try booting it twice, but previously it would fail almost every time,
>   so two successive successful boots seems very good.  Thanks for your
>   quick responses and working solution!
> 
> Can someone with the Dell PW650 (which, I think, should be same as PE600)
> test this patch for me? I do not want to send this for inclusion into
> Linus' kernel before it's tested.
> 
> In theory we probably will want USB handoff to be enabled by default, but
> I am not sure this time is now, so let us use DMI lists until then.
> 
> Thanks,
> -- Pete
> 
> --- linux-2.6.11-rc2/arch/i386/kernel/dmi_scan.c  2005-01-22 
> 14:53:59.0 -0800
> +++ linux-2.6.11-rc2-lem/arch/i386/kernel/dmi_scan.c  2005-01-31 
> 20:42:16.163592792 -0800
> @@ -243,6 +243,19 @@
>  }  
>  #endif
>  
> +static __init int enable_usb_handoff(struct dmi_blacklist *d)
> +{
> + extern int usb_early_handoff;
> +
> + /*
> +  * 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;
> +}
> +

Please don't add new quirks into dmi_scan.c. Use dmi_check_system()
where possible.

>  /*
>   *   Process the DMI blacklists
>   */
> @@ -376,6 +389,14 @@
>  
>  #endif
>  
> + /*
> +  *  Boxes which need USB taken over from BIOS explicitly.
> +  */
> + { enable_usb_handoff, "Dell PW650", {
> + MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
> + MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 650"),
> + NO_MATCH, NO_MATCH }},
> +
>   { NULL, }

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


Re: Patch to enable the USB handoff on Dell 650

2005-02-01 Thread Andrey Panin
On 032, 02 01, 2005 at 10:02:41AM -0800, Pete Zaitcev wrote:
 Hi, guys,
 
 I was looking at this:
   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=138892
 
   I have added usb-handoff as a kernel option in grub.conf for
   2.4.21-20.EL (smp) and re-enabled USB Emulation and Controller in the
   BIOS, and the machine now seems to boot normally.  I only had time to
   try booting it twice, but previously it would fail almost every time,
   so two successive successful boots seems very good.  Thanks for your
   quick responses and working solution!
 
 Can someone with the Dell PW650 (which, I think, should be same as PE600)
 test this patch for me? I do not want to send this for inclusion into
 Linus' kernel before it's tested.
 
 In theory we probably will want USB handoff to be enabled by default, but
 I am not sure this time is now, so let us use DMI lists until then.
 
 Thanks,
 -- Pete
 
 --- linux-2.6.11-rc2/arch/i386/kernel/dmi_scan.c  2005-01-22 
 14:53:59.0 -0800
 +++ linux-2.6.11-rc2-lem/arch/i386/kernel/dmi_scan.c  2005-01-31 
 20:42:16.163592792 -0800
 @@ -243,6 +243,19 @@
  }  
  #endif
  
 +static __init int enable_usb_handoff(struct dmi_blacklist *d)
 +{
 + extern int usb_early_handoff;
 +
 + /*
 +  * 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;
 +}
 +

Please don't add new quirks into dmi_scan.c. Use dmi_check_system()
where possible.

  /*
   *   Process the DMI blacklists
   */
 @@ -376,6 +389,14 @@
  
  #endif
  
 + /*
 +  *  Boxes which need USB taken over from BIOS explicitly.
 +  */
 + { enable_usb_handoff, Dell PW650, {
 + MATCH(DMI_SYS_VENDOR, Dell Computer Corporation),
 + MATCH(DMI_PRODUCT_NAME, Precision WorkStation 650),
 + NO_MATCH, NO_MATCH }},
 +
   { NULL, }

-- 
Andrey Panin| Linux and UNIX system administrator
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net


signature.asc
Description: Digital signature


[Linux-usb-users] USB harddrive not working (2.4, 2.5)

2003-03-19 Thread Andrey Panin
Hi,

ISD200 based hard drive bay doesn't work with 2.4 & 2.5, 
can someone assist me with it?

Kernel message log appended.

Best regards.

-- 
Andrey Panin| Embedded systems software developer
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
drivers/usb/core/usb.c: registered new driver hub
drivers/usb/host/uhci-hcd.c: USB Universal Host Controller Interface driver v2.0
PCI: Found IRQ 11 for device 00:1f.2
PCI: Setting latency timer of device 00:1f.2 to 64
uhci-hcd 00:1f.2: Intel Corp. 82801AA USB
uhci-hcd 00:1f.2: irq 11, io base d000
uhci-hcd 00:1f.2: new USB bus registered, assigned bus number 1
hub 1-0:0: USB hub found
hub 1-0:0: 2 ports detected
hub 1-0:0: debounce: port 2: delay 100ms stable 4 status 0x101
hub 1-0:0: new USB device on port 2, assigned address 2
Initializing USB Mass Storage driver...
usb-storage: act_altsetting is 0
usb-storage: id_index calculated to be: 32
usb-storage: Array length appears to be: 81
usb-storage: Vendor: In-System
usb-storage: Product: USB/IDE Bridge (ATA/ATAPI)
usb-storage: USB Mass Storage device detected
usb-storage: Endpoints: In: 0xc336b934 Out: 0xc336b920 Int: 0xc336b948 (Period 32)
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: Transport: Bulk
usb-storage: Protocol: ISD200 ATA/ATAPI
usb-storage: Allocating usb_ctrlrequest
usb-storage: Allocating URB
usb-storage: Allocating scatter-gather request block
usb-storage: ISD200 Initialization...
usb-storage: Entering isd200_get_inquiry_data
usb-storage: Entering isd200_manual_enum
usb-storage: Entering isd200_read_config
usb-storage: usb_stor_ctrl_transfer(): rq=02 rqtype=c0 value= index=02 len=8
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage:Retrieved the following ISD200 Config Data:
usb-storage:   Event Notification: 0x0
usb-storage:   External Clock: 0x0
usb-storage:   ATA Init Timeout: 0x19
usb-storage:   ATAPI Command Block Size: 0x0
usb-storage:   Master/Slave Selection: 0x0
usb-storage:   ATAPI Reset: 0x0
usb-storage:   ATA Timing: 0x1
usb-storage:   ATA Major Command: 0x24
usb-storage:   ATA Minor Command: 0x24
usb-storage:   Init Status: 0x0
usb-storage:   Config Descriptor 2: 0x0
usb-storage:   Skip Device Boot: 0x0
usb-storage:   ATA 3 State Supsend: 0x0
usb-storage:   Descriptor Override: 0x8
usb-storage:   Last LUN Identifier: 0x0
usb-storage:   SRST Enable: 0x0
usb-storage: Leaving isd200_read_config 
usb-storage:isd200_action(ENUM,0xa0)
usb-storage: Bulk command S 0x43425355 T 0x0 Trg 0 LUN 1 L 0 F 0 CL 0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code -32; transferred 0/13
usb-storage: clearing endpoint halt for pipe 0xc0010280
usb-storage: usb_stor_clear_halt: result=0
usb-storage: Attempting to get CSW (2nd try)...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code -32; transferred 0/13
usb-storage: clearing endpoint halt for pipe 0xc0010280
usb-storage: usb_stor_clear_halt: result=0
usb-storage: Bulk status result = 2
usb-storage:isd200_action(0x04) error: 2
usb-storage:Setting Master/Slave selection to 0
usb-storage: Entering isd200_write_config
usb-storage:Writing the following ISD200 Config Data:
usb-storage:   Event Notification: 0x0
usb-storage:   External Clock: 0x0
usb-storage:   ATA Init Timeout: 0x19
usb-storage:   ATAPI Command Block Size: 0x0
usb-storage:   Master/Slave Selection: 0x0
usb-storage:   ATAPI Reset: 0x0
usb-storage:   ATA Timing: 0x1
usb-storage:   ATA Major Command: 0x24
usb-storage:   ATA Minor Command: 0x24
usb-storage:   Init Status: 0x0
usb-storage:   Config Descriptor 2: 0x0
usb-storage:   Skip Device Boot: 0x0
usb-storage:   ATA 3 State Supsend: 0x0
usb-storage:   Descriptor Override: 0x8
usb-storage:   Last LUN Identifier: 0x0
usb-storage:   SRST Enable: 0x0
usb-storage: usb_stor_ctrl_transfer(): rq=01 rqtype=40 value= index=02 len=8
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage:ISD200 Config Data was written successfully
usb-storage: Leaving isd200_write_config 
usb-storage: Leaving isd200_manual_enum 
usb-storage: Protocol changed to: Transparent SCSI
usb-storage: Leaving isd200_get_inquiry_data 
usb-storage: ISD200 Initialization complete
usb-storage: *** thread sleeping.
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage:  12 00 00 00 24 00
usb-storage: Bulk command S 0x43425355 T 0x1 Trg 0 LUN 0 L 36 F 128 CL 6
usb-storage: usb_stor_bulk_transfer

[Linux-usb-users] USB harddrive not working (2.4, 2.5)

2003-03-19 Thread Andrey Panin
Hi,

ISD200 based hard drive bay doesn't work with 2.4  2.5, 
can someone assist me with it?

Kernel message log appended.

Best regards.

-- 
Andrey Panin| Embedded systems software developer
[EMAIL PROTECTED]   | PGP key: wwwkeys.pgp.net
drivers/usb/core/usb.c: registered new driver hub
drivers/usb/host/uhci-hcd.c: USB Universal Host Controller Interface driver v2.0
PCI: Found IRQ 11 for device 00:1f.2
PCI: Setting latency timer of device 00:1f.2 to 64
uhci-hcd 00:1f.2: Intel Corp. 82801AA USB
uhci-hcd 00:1f.2: irq 11, io base d000
uhci-hcd 00:1f.2: new USB bus registered, assigned bus number 1
hub 1-0:0: USB hub found
hub 1-0:0: 2 ports detected
hub 1-0:0: debounce: port 2: delay 100ms stable 4 status 0x101
hub 1-0:0: new USB device on port 2, assigned address 2
Initializing USB Mass Storage driver...
usb-storage: act_altsetting is 0
usb-storage: id_index calculated to be: 32
usb-storage: Array length appears to be: 81
usb-storage: Vendor: In-System
usb-storage: Product: USB/IDE Bridge (ATA/ATAPI)
usb-storage: USB Mass Storage device detected
usb-storage: Endpoints: In: 0xc336b934 Out: 0xc336b920 Int: 0xc336b948 (Period 32)
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: Transport: Bulk
usb-storage: Protocol: ISD200 ATA/ATAPI
usb-storage: Allocating usb_ctrlrequest
usb-storage: Allocating URB
usb-storage: Allocating scatter-gather request block
usb-storage: ISD200 Initialization...
usb-storage: Entering isd200_get_inquiry_data
usb-storage: Entering isd200_manual_enum
usb-storage: Entering isd200_read_config
usb-storage: usb_stor_ctrl_transfer(): rq=02 rqtype=c0 value= index=02 len=8
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage:Retrieved the following ISD200 Config Data:
usb-storage:   Event Notification: 0x0
usb-storage:   External Clock: 0x0
usb-storage:   ATA Init Timeout: 0x19
usb-storage:   ATAPI Command Block Size: 0x0
usb-storage:   Master/Slave Selection: 0x0
usb-storage:   ATAPI Reset: 0x0
usb-storage:   ATA Timing: 0x1
usb-storage:   ATA Major Command: 0x24
usb-storage:   ATA Minor Command: 0x24
usb-storage:   Init Status: 0x0
usb-storage:   Config Descriptor 2: 0x0
usb-storage:   Skip Device Boot: 0x0
usb-storage:   ATA 3 State Supsend: 0x0
usb-storage:   Descriptor Override: 0x8
usb-storage:   Last LUN Identifier: 0x0
usb-storage:   SRST Enable: 0x0
usb-storage: Leaving isd200_read_config 
usb-storage:isd200_action(ENUM,0xa0)
usb-storage: Bulk command S 0x43425355 T 0x0 Trg 0 LUN 1 L 0 F 0 CL 0
usb-storage: usb_stor_bulk_transfer_buf(): xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code -32; transferred 0/13
usb-storage: clearing endpoint halt for pipe 0xc0010280
usb-storage: usb_stor_clear_halt: result=0
usb-storage: Attempting to get CSW (2nd try)...
usb-storage: usb_stor_bulk_transfer_buf(): xfer 13 bytes
usb-storage: Status code -32; transferred 0/13
usb-storage: clearing endpoint halt for pipe 0xc0010280
usb-storage: usb_stor_clear_halt: result=0
usb-storage: Bulk status result = 2
usb-storage:isd200_action(0x04) error: 2
usb-storage:Setting Master/Slave selection to 0
usb-storage: Entering isd200_write_config
usb-storage:Writing the following ISD200 Config Data:
usb-storage:   Event Notification: 0x0
usb-storage:   External Clock: 0x0
usb-storage:   ATA Init Timeout: 0x19
usb-storage:   ATAPI Command Block Size: 0x0
usb-storage:   Master/Slave Selection: 0x0
usb-storage:   ATAPI Reset: 0x0
usb-storage:   ATA Timing: 0x1
usb-storage:   ATA Major Command: 0x24
usb-storage:   ATA Minor Command: 0x24
usb-storage:   Init Status: 0x0
usb-storage:   Config Descriptor 2: 0x0
usb-storage:   Skip Device Boot: 0x0
usb-storage:   ATA 3 State Supsend: 0x0
usb-storage:   Descriptor Override: 0x8
usb-storage:   Last LUN Identifier: 0x0
usb-storage:   SRST Enable: 0x0
usb-storage: usb_stor_ctrl_transfer(): rq=01 rqtype=40 value= index=02 len=8
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage:ISD200 Config Data was written successfully
usb-storage: Leaving isd200_write_config 
usb-storage: Leaving isd200_manual_enum 
usb-storage: Protocol changed to: Transparent SCSI
usb-storage: Leaving isd200_get_inquiry_data 
usb-storage: ISD200 Initialization complete
usb-storage: *** thread sleeping.
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage:  12 00 00 00 24 00
usb-storage: Bulk command S 0x43425355 T 0x1 Trg 0 LUN 0 L 36 F 128 CL 6
usb-storage: usb_stor_bulk_transfer_buf

[PATCH] PnP BIOS: io range length bugfix

2001-07-19 Thread Andrey Panin

Hi all,

this patch fixes bug in pnpbios_rawdata_2_pci_dev() - miscalculated length of
ioport range. This function uses word at offset 6 in I/O Port Descriptor, 
but according to ISA PnP specification ioport range length is a byte at offset 7
and byte 6 is base alignment.

BTW will it usefull to implement PnP device naming function ?

Best regards.

-- 
Andrey Panin| Embedded systems software engineer
[EMAIL PROTECTED]| PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc

diff -urN -X /usr/dontdiff /linux.vanilla/drivers/pnp/pnp_bios.c 
/linux/drivers/pnp/pnp_bios.c
--- /linux.vanilla/drivers/pnp/pnp_bios.c   Tue Jul 17 23:11:14 2001
+++ /linux/drivers/pnp/pnp_bios.c   Sat Jul 21 00:08:38 2001
@@ -669,7 +669,7 @@
 break;
 case 0x08: // io
io= p[2] + p[3] *256;
-   len= p[6] + p[7] *256;
+   len = p[7];
i=0;
 while(pci_dev->resource[i].start && i
 PGP signature


[PATCH] PnP BIOS: io range length bugfix

2001-07-19 Thread Andrey Panin

Hi all,

this patch fixes bug in pnpbios_rawdata_2_pci_dev() - miscalculated length of
ioport range. This function uses word at offset 6 in I/O Port Descriptor, 
but according to ISA PnP specification ioport range length is a byte at offset 7
and byte 6 is base alignment.

BTW will it usefull to implement PnP device naming function ?

Best regards.

-- 
Andrey Panin| Embedded systems software engineer
[EMAIL PROTECTED]| PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc

diff -urN -X /usr/dontdiff /linux.vanilla/drivers/pnp/pnp_bios.c 
/linux/drivers/pnp/pnp_bios.c
--- /linux.vanilla/drivers/pnp/pnp_bios.c   Tue Jul 17 23:11:14 2001
+++ /linux/drivers/pnp/pnp_bios.c   Sat Jul 21 00:08:38 2001
@@ -669,7 +669,7 @@
 break;
 case 0x08: // io
io= p[2] + p[3] *256;
-   len= p[6] + p[7] *256;
+   len = p[7];
i=0;
 while(pci_dev-resource[i].start  iDEVICE_COUNT_RESOURCE)
 i++;

 PGP signature


[PATCH] drivers/net/at1700.c: missing __init and __initdata

2001-04-17 Thread Andrey Panin

Hi all,

this patch (2.4.3-ac7) adds some missing __init and __initdata 
into at1700.c NIC driver.

Best regards.

-- 
Andrey Panin| Embedded systems software engineer
[EMAIL PROTECTED]| PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc

diff -ur linux.vanilla/drivers/net/at1700.c linux/drivers/net/at1700.c
--- linux.vanilla/drivers/net/at1700.c  Tue Apr 17 10:54:07 2001
+++ linux/drivers/net/at1700.c  Tue Apr 17 11:17:37 2001
@@ -70,7 +70,7 @@
 
 /* These unusual address orders are used to verify the CONFIG register. */
 
-static int fmv18x_probe_list[] = {
+static int fmv18x_probe_list[] __initdata = {
0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x300, 0x340, 0
 };
 
@@ -78,7 +78,7 @@
  * ISA
  */
 
-static int at1700_probe_list[] = {
+static int at1700_probe_list[] __initdata = {
0x260, 0x280, 0x2a0, 0x240, 0x340, 0x320, 0x380, 0x300, 0
 };
 
@@ -86,15 +86,15 @@
  * MCA
  */
 #ifdef CONFIG_MCA  
-static int at1700_ioaddr_pattern[] = {
+static int at1700_ioaddr_pattern[] __initdata = {
0x00, 0x04, 0x01, 0x05, 0x02, 0x06, 0x03, 0x07
 };
 
-static int at1700_mca_probe_list[] = {
+static int at1700_mca_probe_list[] __initdata = {
0x400, 0x1400, 0x2400, 0x3400, 0x4400, 0x5400, 0x6400, 0x7400, 0
 };
 
-static int at1700_irq_pattern[] = {
+static int at1700_irq_pattern[] __initdata = {
0x00, 0x00, 0x00, 0x30, 0x70, 0xb0, 0x00, 0x00,
0x00, 0xf0, 0x34, 0x74, 0xb4, 0x00, 0x00, 0xf4, 0x00
 };
@@ -175,10 +175,10 @@
 };
 /* rEnE : maybe there are others I don't know off... */
 
-static struct at1720_mca_adapters_struct at1720_mca_adapters[] = {
+static struct at1720_mca_adapters_struct at1720_mca_adapters[] __initdata = {
{ "Allied Telesys AT1720AT",0x6410 },
{ "Allied Telesys AT1720BT",0x6413 },
-   { "Allied Telesys AT1720T", 0x6416 },
+   { "Allied Telesys AT1720T", 0x6416 },
{ NULL, 0 },
 };
 #endif
@@ -470,7 +470,7 @@
 #define EE_READ_CMD(6 << 6)
 #define EE_ERASE_CMD   (7 << 6)
 
-static int read_eeprom(int ioaddr, int location)
+static int __init read_eeprom(int ioaddr, int location)
 {
int i;
unsigned short retval = 0;

 PGP signature


[PATCH] drivers/net/at1700.c: missing __init and __initdata

2001-04-17 Thread Andrey Panin

Hi all,

this patch (2.4.3-ac7) adds some missing __init and __initdata 
into at1700.c NIC driver.

Best regards.

-- 
Andrey Panin| Embedded systems software engineer
[EMAIL PROTECTED]| PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc

diff -ur linux.vanilla/drivers/net/at1700.c linux/drivers/net/at1700.c
--- linux.vanilla/drivers/net/at1700.c  Tue Apr 17 10:54:07 2001
+++ linux/drivers/net/at1700.c  Tue Apr 17 11:17:37 2001
@@ -70,7 +70,7 @@
 
 /* These unusual address orders are used to verify the CONFIG register. */
 
-static int fmv18x_probe_list[] = {
+static int fmv18x_probe_list[] __initdata = {
0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x300, 0x340, 0
 };
 
@@ -78,7 +78,7 @@
  * ISA
  */
 
-static int at1700_probe_list[] = {
+static int at1700_probe_list[] __initdata = {
0x260, 0x280, 0x2a0, 0x240, 0x340, 0x320, 0x380, 0x300, 0
 };
 
@@ -86,15 +86,15 @@
  * MCA
  */
 #ifdef CONFIG_MCA  
-static int at1700_ioaddr_pattern[] = {
+static int at1700_ioaddr_pattern[] __initdata = {
0x00, 0x04, 0x01, 0x05, 0x02, 0x06, 0x03, 0x07
 };
 
-static int at1700_mca_probe_list[] = {
+static int at1700_mca_probe_list[] __initdata = {
0x400, 0x1400, 0x2400, 0x3400, 0x4400, 0x5400, 0x6400, 0x7400, 0
 };
 
-static int at1700_irq_pattern[] = {
+static int at1700_irq_pattern[] __initdata = {
0x00, 0x00, 0x00, 0x30, 0x70, 0xb0, 0x00, 0x00,
0x00, 0xf0, 0x34, 0x74, 0xb4, 0x00, 0x00, 0xf4, 0x00
 };
@@ -175,10 +175,10 @@
 };
 /* rEnE : maybe there are others I don't know off... */
 
-static struct at1720_mca_adapters_struct at1720_mca_adapters[] = {
+static struct at1720_mca_adapters_struct at1720_mca_adapters[] __initdata = {
{ "Allied Telesys AT1720AT",0x6410 },
{ "Allied Telesys AT1720BT",0x6413 },
-   { "Allied Telesys AT1720T", 0x6416 },
+   { "Allied Telesys AT1720T", 0x6416 },
{ NULL, 0 },
 };
 #endif
@@ -470,7 +470,7 @@
 #define EE_READ_CMD(6  6)
 #define EE_ERASE_CMD   (7  6)
 
-static int read_eeprom(int ioaddr, int location)
+static int __init read_eeprom(int ioaddr, int location)
 {
int i;
unsigned short retval = 0;

 PGP signature


Re: [RFC] FW: proposal for systems that do not require security

2001-04-10 Thread Andrey Panin


Do you think it worth an effort ?

-- 
Andrey Panin| Embedded systems software engineer
[EMAIL PROTECTED]| PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc
 PGP signature


Re: [RFC] FW: proposal for systems that do not require security

2001-04-10 Thread Andrey Panin


Do you think it worth an effort ?

-- 
Andrey Panin| Embedded systems software engineer
[EMAIL PROTECTED]| PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc
 PGP signature


[PATCH] net drivers: missing __init's

2001-04-09 Thread Andrey Panin

Hi all,

attached patches add missing __init and (__devinit) to some network drivers:
at1700.c, eepro.c, epic100.c, hamachi.c, sis900.c, 
tokenring/abyss.c, tokenring/tmsisa.c, tokenring/tmspci.c.

Best regards.

-- 
Andrey Panin| Embedded systems software engineer
[EMAIL PROTECTED]| PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc

diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/at1700.c 
/linux/drivers/net/at1700.c
--- /linux.vanilla/drivers/net/at1700.c Mon Apr  2 15:45:18 2001
+++ /linux/drivers/net/at1700.c Sat Apr  7 21:22:27 2001
@@ -470,7 +470,7 @@
 #define EE_READ_CMD(6 << 6)
 #define EE_ERASE_CMD   (7 << 6)
 
-static int read_eeprom(int ioaddr, int location)
+static int __init read_eeprom(int ioaddr, int location)
 {
int i;
unsigned short retval = 0;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/eepro.c 
/linux/drivers/net/eepro.c
--- /linux.vanilla/drivers/net/eepro.c  Mon Apr  2 15:45:19 2001
+++ /linux/drivers/net/eepro.c  Sun Apr  8 23:51:12 2001
@@ -588,7 +588,7 @@
return -ENODEV;
 }
 
-static void printEEPROMInfo(short ioaddr, struct net_device *dev)
+static void __init printEEPROMInfo(short ioaddr, struct net_device *dev)
 {
unsigned short Word;
int i,j;
@@ -647,7 +647,7 @@
probes on the ISA bus.  A good device probe avoids doing writes, and
verifies that the correct device exists and functions.  */
 
-static int eepro_probe1(struct net_device *dev, short ioaddr)
+static int __init eepro_probe1(struct net_device *dev, short ioaddr)
 {
unsigned short station_addr[6], id, counter;
int i,j, irqMask;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/epic100.c 
/linux/drivers/net/epic100.c
--- /linux.vanilla/drivers/net/epic100.cMon Apr  2 15:45:27 2001
+++ /linux/drivers/net/epic100.cSun Apr  8 23:46:03 2001
@@ -545,7 +545,7 @@
 #define EE_READ256_CMD (6 << 8)
 #define EE_ERASE_CMD   (7 << 6)
 
-static int read_eeprom(long ioaddr, int location)
+static int __devinit read_eeprom(long ioaddr, int location)
 {
int i;
int retval = 0;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/hamachi.c 
/linux/drivers/net/hamachi.c
--- /linux.vanilla/drivers/net/hamachi.cMon Apr  2 15:45:33 2001
+++ /linux/drivers/net/hamachi.cSun Apr  8 23:48:24 2001
@@ -545,7 +544,7 @@
 static void set_rx_mode(struct net_device *dev);
 
 
-static int __init hamachi_init_one (struct pci_dev *pdev,
+static int __devinit hamachi_init_one (struct pci_dev *pdev,
const struct pci_device_id *ent)
 {
static int did_version = 0; /* Already printed version 
info. */
@@ -728,7 +727,7 @@
return 0;
 }
 
-static int read_eeprom(long ioaddr, int location)
+static int __devinit read_eeprom(long ioaddr, int location)
 {
int bogus_cnt = 1000;
 
@@ -1858,7 +1857,7 @@
 }
 
 
-static void __exit hamachi_remove_one (struct pci_dev *pdev)
+static void __devexit hamachi_remove_one (struct pci_dev *pdev)
 {
struct net_device *dev = pci_get_drvdata(pdev);
 


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/sis900.c 
/linux/drivers/net/sis900.c
--- /linux.vanilla/drivers/net/sis900.c Mon Apr  2 15:45:26 2001
+++ /linux/drivers/net/sis900.c Sun Apr  8 18:15:42 2001
@@ -60,7 +60,7 @@
 
 #include "sis900.h"
 
-static const char *version =
+static const char *version __initdata =
 "sis900.c: v1.07.09  2/9/2001\n";
 
 static int max_interrupt_work = 20;
@@ -443,7 +443,7 @@
  * Note that location is in word (16 bits) unit
  */
 
-static u16 read_eeprom(long ioaddr, int location)
+static u16 __devinit read_eeprom(long ioaddr, int location)
 {
int i;
u16 retval = 0;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/tokenring/abyss.c 
/linux/drivers/net/tokenring/abyss.c
--- /linux.vanilla/drivers/net/tokenring/abyss.cMon Apr  2 15:45:22 2001
+++ /linux/drivers/net/tokenring/abyss.cSat Apr  7 21:58:20 2001
@@ -390,7 +390,7 @@
  * Read configuration data from the AT24 SEEPROM on Madge cards.
  *
  */
-static void abyss_read_eeprom(struct net_device *dev)
+static void __init abyss_read_eeprom(struct net_device *dev)
 {
struct net_local *tp;
unsigned long ioaddr;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/tokenring/tmsisa.c 
/linux/drivers/net/tokenring/tmsisa.c
--- /linux.vanilla/drivers/net/tokenring/tmsisa.c   Mon Apr  2 15:45:22 2001
+++ /linux/drivers/net/tokenring/tmsisa.c   Sun Apr  8 18:18:51 2001
@@ -19,7 +19,7 @@
  *  TODO:
  * 1. Add support for Proteon TR ISA adapters (1392, 1392+)
  */
-static const char *version = "tmsisa.c: v1.00 14/01/2001 by Jochen Friedrich\n";
+static const char version[] __initdata = "tmsisa.c: v1.00 14/01/2001 by Jochen 
+Friedrich\n";
 
 #include 
 #include 
@@ -297,7 +297,7 @@
  * machine har

[PATCH] net drivers: missing __init's

2001-04-09 Thread Andrey Panin

Hi all,

attached patches add missing __init and (__devinit) to some network drivers:
at1700.c, eepro.c, epic100.c, hamachi.c, sis900.c, 
tokenring/abyss.c, tokenring/tmsisa.c, tokenring/tmspci.c.

Best regards.

-- 
Andrey Panin| Embedded systems software engineer
[EMAIL PROTECTED]| PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc

diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/at1700.c 
/linux/drivers/net/at1700.c
--- /linux.vanilla/drivers/net/at1700.c Mon Apr  2 15:45:18 2001
+++ /linux/drivers/net/at1700.c Sat Apr  7 21:22:27 2001
@@ -470,7 +470,7 @@
 #define EE_READ_CMD(6  6)
 #define EE_ERASE_CMD   (7  6)
 
-static int read_eeprom(int ioaddr, int location)
+static int __init read_eeprom(int ioaddr, int location)
 {
int i;
unsigned short retval = 0;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/eepro.c 
/linux/drivers/net/eepro.c
--- /linux.vanilla/drivers/net/eepro.c  Mon Apr  2 15:45:19 2001
+++ /linux/drivers/net/eepro.c  Sun Apr  8 23:51:12 2001
@@ -588,7 +588,7 @@
return -ENODEV;
 }
 
-static void printEEPROMInfo(short ioaddr, struct net_device *dev)
+static void __init printEEPROMInfo(short ioaddr, struct net_device *dev)
 {
unsigned short Word;
int i,j;
@@ -647,7 +647,7 @@
probes on the ISA bus.  A good device probe avoids doing writes, and
verifies that the correct device exists and functions.  */
 
-static int eepro_probe1(struct net_device *dev, short ioaddr)
+static int __init eepro_probe1(struct net_device *dev, short ioaddr)
 {
unsigned short station_addr[6], id, counter;
int i,j, irqMask;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/epic100.c 
/linux/drivers/net/epic100.c
--- /linux.vanilla/drivers/net/epic100.cMon Apr  2 15:45:27 2001
+++ /linux/drivers/net/epic100.cSun Apr  8 23:46:03 2001
@@ -545,7 +545,7 @@
 #define EE_READ256_CMD (6  8)
 #define EE_ERASE_CMD   (7  6)
 
-static int read_eeprom(long ioaddr, int location)
+static int __devinit read_eeprom(long ioaddr, int location)
 {
int i;
int retval = 0;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/hamachi.c 
/linux/drivers/net/hamachi.c
--- /linux.vanilla/drivers/net/hamachi.cMon Apr  2 15:45:33 2001
+++ /linux/drivers/net/hamachi.cSun Apr  8 23:48:24 2001
@@ -545,7 +544,7 @@
 static void set_rx_mode(struct net_device *dev);
 
 
-static int __init hamachi_init_one (struct pci_dev *pdev,
+static int __devinit hamachi_init_one (struct pci_dev *pdev,
const struct pci_device_id *ent)
 {
static int did_version = 0; /* Already printed version 
info. */
@@ -728,7 +727,7 @@
return 0;
 }
 
-static int read_eeprom(long ioaddr, int location)
+static int __devinit read_eeprom(long ioaddr, int location)
 {
int bogus_cnt = 1000;
 
@@ -1858,7 +1857,7 @@
 }
 
 
-static void __exit hamachi_remove_one (struct pci_dev *pdev)
+static void __devexit hamachi_remove_one (struct pci_dev *pdev)
 {
struct net_device *dev = pci_get_drvdata(pdev);
 


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/sis900.c 
/linux/drivers/net/sis900.c
--- /linux.vanilla/drivers/net/sis900.c Mon Apr  2 15:45:26 2001
+++ /linux/drivers/net/sis900.c Sun Apr  8 18:15:42 2001
@@ -60,7 +60,7 @@
 
 #include "sis900.h"
 
-static const char *version =
+static const char *version __initdata =
 "sis900.c: v1.07.09  2/9/2001\n";
 
 static int max_interrupt_work = 20;
@@ -443,7 +443,7 @@
  * Note that location is in word (16 bits) unit
  */
 
-static u16 read_eeprom(long ioaddr, int location)
+static u16 __devinit read_eeprom(long ioaddr, int location)
 {
int i;
u16 retval = 0;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/tokenring/abyss.c 
/linux/drivers/net/tokenring/abyss.c
--- /linux.vanilla/drivers/net/tokenring/abyss.cMon Apr  2 15:45:22 2001
+++ /linux/drivers/net/tokenring/abyss.cSat Apr  7 21:58:20 2001
@@ -390,7 +390,7 @@
  * Read configuration data from the AT24 SEEPROM on Madge cards.
  *
  */
-static void abyss_read_eeprom(struct net_device *dev)
+static void __init abyss_read_eeprom(struct net_device *dev)
 {
struct net_local *tp;
unsigned long ioaddr;


diff -ur -x *.o -x *.flags /linux.vanilla/drivers/net/tokenring/tmsisa.c 
/linux/drivers/net/tokenring/tmsisa.c
--- /linux.vanilla/drivers/net/tokenring/tmsisa.c   Mon Apr  2 15:45:22 2001
+++ /linux/drivers/net/tokenring/tmsisa.c   Sun Apr  8 18:18:51 2001
@@ -19,7 +19,7 @@
  *  TODO:
  * 1. Add support for Proteon TR ISA adapters (1392, 1392+)
  */
-static const char *version = "tmsisa.c: v1.00 14/01/2001 by Jochen Friedrich\n";
+static const char version[] __initdata = "tmsisa.c: v1.00 14/01/2001 by Jochen 
+Friedrich\n";
 
 #include linux/module.h
 #include linux/kernel.h
@@ -297,7 +297,7 @@
  * machine

  1   2   >