PnP Changes for 2.5.72

PnP Changes for 2.5.72

Post by Adam Bela » Fri, 20 Jun 2003 06:20:09



# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1416  -> 1.1417
#       drivers/pnp/resource.c  1.15    -> 1.16  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------

# [PNP] Module Compilation Fix
#
# Fixes a trivial typo in an export symbol macro.
# --------------------------------------------
#
diff -Nru a/drivers/pnp/resource.c b/drivers/pnp/resource.c
--- a/drivers/pnp/resource.c    Wed Jun 18 23:02:03 2003

 }

-EXPORT_SYMBOL(pnp_register_dependent_resource);
-EXPORT_SYMBOL(pnp_register_independent_resource);
+EXPORT_SYMBOL(pnp_register_dependent_option);
+EXPORT_SYMBOL(pnp_register_independent_option);
 EXPORT_SYMBOL(pnp_register_irq_resource);
 EXPORT_SYMBOL(pnp_register_dma_resource);
 EXPORT_SYMBOL(pnp_register_port_resource);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

PnP Changes for 2.5.72

Post by Adam Bela » Fri, 20 Jun 2003 06:20:13


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1415  -> 1.1416
#       drivers/pnp/resource.c  1.14    -> 1.15  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------

# [PNP] /drivers/pnp/resource.c check_region warning fix
#
# This patch resolves the compiler warning caused by the depreciated check_region
# function.  It may not be the best solution but check_region really is what is
# needed here because we never actually have to call "request_region".  If prefered,
# I could alternatively request and release but doing so would be less efficient.
# --------------------------------------------
#
diff -Nru a/drivers/pnp/resource.c b/drivers/pnp/resource.c
--- a/drivers/pnp/resource.c    Wed Jun 18 23:02:14 2003

        /* check if the resource is already in use, skip if the
         * device is active because it itself may be in use */
        if(!dev->active) {
-               if (check_region(*port, length(port,end)))
+               if (__check_region(&ioport_resource, *port, length(port,end)))
                        return 0;
        }

        /* check if the resource is already in use, skip if the
         * device is active because it itself may be in use */
        if(!dev->active) {
-               if (__check_region(&iomem_resource, *addr, length(addr,end)))
+               if (check_mem_region(*addr, length(addr,end)))
                        return 0;
        }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

PnP Changes for 2.5.72

Post by Adam Bela » Fri, 20 Jun 2003 06:20:16


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1420  -> 1.1421
#       drivers/pnp/isapnp/core.c       1.37    -> 1.38  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------

# [PNP] Remove some leftover resource config options in isapnp
#
# Must have missed it earlier, but the pci module parameter is not needed.
# --------------------------------------------
#
diff -Nru a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
--- a/drivers/pnp/isapnp/core.c Wed Jun 18 23:01:25 2003

 int isapnp_disable;                    /* Disable ISA PnP */
 int isapnp_rdp;                                /* Read Data Port */
 int isapnp_reset = 1;                  /* reset all PnP cards (deactivate) */
-int isapnp_skip_pci_scan;              /* skip PCI resource scanning */
 int isapnp_verbose = 1;                        /* verbose mode */


 MODULE_PARM(isapnp_reset, "i");
 MODULE_PARM_DESC(isapnp_reset, "ISA Plug & Play reset all cards");
 MODULE_PARM(isapnp_allow_dma0, "i");
-MODULE_PARM(isapnp_skip_pci_scan, "i");
-MODULE_PARM_DESC(isapnp_skip_pci_scan, "ISA Plug & Play skip PCI resource scanning");
 MODULE_PARM(isapnp_verbose, "i");
 MODULE_PARM_DESC(isapnp_verbose, "ISA Plug & Play verbose mode");

 {
        (void)((get_option(&str,&isapnp_rdp) == 2) &&
               (get_option(&str,&isapnp_reset) == 2) &&
-              (get_option(&str,&isapnp_skip_pci_scan) == 2) &&
               (get_option(&str,&isapnp_verbose) == 2));
        return 1;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

PnP Changes for 2.5.72

Post by Adam Bela » Fri, 20 Jun 2003 06:20:11


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1414  -> 1.1415
#       drivers/serial/8250_pnp.c       1.11    -> 1.12  
#       drivers/pnp/interface.c 1.14    -> 1.15  
#         drivers/pnp/base.h    1.4     -> 1.5    
#         drivers/pnp/core.c    1.9     -> 1.10  
#       drivers/pnp/support.c   1.2     -> 1.3    
#       drivers/pnp/isapnp/core.c       1.36    -> 1.37  
#       drivers/pnp/resource.c  1.13    -> 1.14  
#       drivers/pnp/quirks.c    1.10    -> 1.11  
#       drivers/pnp/manager.c   1.6     -> 1.7    
#        include/linux/pnp.h    1.20    -> 1.21  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/18      am...@neo.rr.com       1.1415
# [PNP] Resource Management Cleanups and Updates
#
# This patch does the following...
# 1.) changes struct pnp_resources to pnp_option for clarity
# 2.) greatly cleans up resource option registration
# 3.) removes some of the current conflict prevention code in
# order to increase flexibility, (users will have more control)
# 4.) various manager cleanups, resulting code is more efficient
# 5.) fixes the locking bugs many have reported (now uses a mutex)
# 6.) removes the conflict displaying interface
#  - it is better to handle such things in user space
# 7.) also many misc. cleanups
# --------------------------------------------
#
diff -Nru a/drivers/pnp/base.h b/drivers/pnp/base.h
--- a/drivers/pnp/base.h        Wed Jun 18 23:02:24 2003
+++ b/drivers/pnp/base.h        Wed Jun 18 23:02:24 2003
@@ -4,29 +4,11 @@
 int pnp_interface_attach_device(struct pnp_dev *dev);
 void pnp_name_device(struct pnp_dev *dev);
 void pnp_fixup_device(struct pnp_dev *dev);
-void pnp_free_resources(struct pnp_resources *resources);
+void pnp_free_option(struct pnp_option *option);
 int __pnp_add_device(struct pnp_dev *dev);
 void __pnp_remove_device(struct pnp_dev *dev);

-/* resource conflict types */
-#define CONFLICT_TYPE_NONE     0x0000  /* there are no conflicts, other than those in the link */
-#define CONFLICT_TYPE_RESERVED 0x0001  /* the resource requested was reserved */
-#define CONFLICT_TYPE_IN_USE   0x0002  /* there is a conflict because the resource is in use */
-#define CONFLICT_TYPE_PCI      0x0004  /* there is a conflict with a pci device */
-#define CONFLICT_TYPE_INVALID  0x0008  /* the resource requested is invalid */
-#define CONFLICT_TYPE_INTERNAL 0x0010  /* resources within the device conflict with each ohter */
-#define CONFLICT_TYPE_PNP_WARM 0x0020  /* there is a conflict with a pnp device that is active */
-#define CONFLICT_TYPE_PNP_COLD 0x0040  /* there is a conflict with a pnp device that is disabled */
-
-/* conflict search modes */
-#define SEARCH_WARM 1  /* check for conflicts with active devices */
-#define SEARCH_COLD 0  /* check for conflicts with disabled devices */
-
-struct pnp_dev * pnp_check_port_conflicts(struct pnp_dev * dev, int idx, int mode);
 int pnp_check_port(struct pnp_dev * dev, int idx);
-struct pnp_dev * pnp_check_mem_conflicts(struct pnp_dev * dev, int idx, int mode);
 int pnp_check_mem(struct pnp_dev * dev, int idx);
-struct pnp_dev * pnp_check_irq_conflicts(struct pnp_dev * dev, int idx, int mode);
 int pnp_check_irq(struct pnp_dev * dev, int idx);
-struct pnp_dev * pnp_check_dma_conflicts(struct pnp_dev * dev, int idx, int mode);
 int pnp_check_dma(struct pnp_dev * dev, int idx);
diff -Nru a/drivers/pnp/core.c b/drivers/pnp/core.c
--- a/drivers/pnp/core.c        Wed Jun 18 23:02:24 2003
+++ b/drivers/pnp/core.c        Wed Jun 18 23:02:24 2003
@@ -104,8 +104,8 @@
 static void pnp_release_device(struct device *dmdev)
 {
        struct pnp_dev * dev = to_pnp_dev(dmdev);
-       if (dev->possible)
-               pnp_free_resources(dev->possible);
+       pnp_free_option(dev->independent);
+       pnp_free_option(dev->dependent);
        pnp_free_ids(dev);
        kfree(dev);
 }
@@ -122,7 +122,7 @@
        list_add_tail(&dev->global_list, &pnp_global);
        list_add_tail(&dev->protocol_list, &dev->protocol->devices);
        spin_unlock(&pnp_lock);
-       pnp_auto_config_dev(dev);
+
        ret = device_register(&dev->dev);
        if (ret == 0)
                pnp_interface_attach_device(dev);
diff -Nru a/drivers/pnp/interface.c b/drivers/pnp/interface.c
--- a/drivers/pnp/interface.c   Wed Jun 18 23:02:24 2003
+++ b/drivers/pnp/interface.c   Wed Jun 18 23:02:24 2003
@@ -168,7 +168,8 @@
        pnp_printf(buffer, ", %s\n", s);
 }

-static void pnp_print_resources(pnp_info_buffer_t *buffer, char *space, struct pnp_resources *res, int dep)
+static void pnp_print_option(pnp_info_buffer_t *buffer, char *space,
+                            struct pnp_option *option, int dep)
 {
        char *s;
        struct pnp_port *port;
@@ -176,49 +177,55 @@
        struct pnp_dma *dma;
        struct pnp_mem *mem;

-       switch (res->priority) {
-       case PNP_RES_PRIORITY_PREFERRED:
-               s = "preferred";
-               break;
-       case PNP_RES_PRIORITY_ACCEPTABLE:
-               s = "acceptable";
-               break;
-       case PNP_RES_PRIORITY_FUNCTIONAL:
-               s = "functional";
-               break;
-       default:
-               s = "invalid";
-       }
-       if (dep > 0)
+       if (dep) {
+               switch (option->priority) {
+                       case PNP_RES_PRIORITY_PREFERRED:
+                       s = "preferred";
+                       break;
+                       case PNP_RES_PRIORITY_ACCEPTABLE:
+                       s = "acceptable";
+                       break;
+                       case PNP_RES_PRIORITY_FUNCTIONAL:
+                       s = "functional";
+                       break;
+                       default:
+                       s = "invalid";
+               }
                pnp_printf(buffer, "Dependent: %02i - Priority %s\n",dep, s);
-       for (port = res->port; port; port = port->next)
+       }
+
+       for (port = option->port; port; port = port->next)
                pnp_print_port(buffer, space, port);
-       for (irq = res->irq; irq; irq = irq->next)
+       for (irq = option->irq; irq; irq = irq->next)
                pnp_print_irq(buffer, space, irq);
-       for (dma = res->dma; dma; dma = dma->next)
+       for (dma = option->dma; dma; dma = dma->next)
                pnp_print_dma(buffer, space, dma);
-       for (mem = res->mem; mem; mem = mem->next)
+       for (mem = option->mem; mem; mem = mem->next)
                pnp_print_mem(buffer, space, mem);
 }

-static ssize_t pnp_show_possible_resources(struct device *dmdev, char *buf)
+
+static ssize_t pnp_show_options(struct device *dmdev, char *buf)
 {
        struct pnp_dev *dev = to_pnp_dev(dmdev);
-       struct pnp_resources * res = dev->possible;
-       int ret, dep = 0;
+       struct pnp_option * independent = dev->independent;
+       struct pnp_option * dependent = dev->dependent;
+       int ret, dep = 1;
+
        pnp_info_buffer_t *buffer = (pnp_info_buffer_t *)
                                 pnp_alloc(sizeof(pnp_info_buffer_t));
        if (!buffer)
                return -ENOMEM;
+
        buffer->len = PAGE_SIZE;
        buffer->buffer = buf;
        buffer->curr = buffer->buffer;
-       while (res){
-               if (dep == 0)
-                       pnp_print_resources(buffer, "", res, dep);
-               else
-                       pnp_print_resources(buffer, "   ", res, dep);
-               res = res->dep;
+       if (independent)
+               pnp_print_option(buffer, "", independent, 0);
+
+       while (dependent){
+               pnp_print_option(buffer, "   ", dependent, dep);
+               dependent = dependent->next;
                dep++;
        }
        ret = (buffer->curr - buf);
@@ -226,97 +233,8 @@
        return ret;
 }

-static DEVICE_ATTR(possible,S_IRUGO,pnp_show_possible_resources,NULL);
-
-static void pnp_print_conflict_node(pnp_info_buffer_t *buffer, struct pnp_dev * dev)
-{
-       if (!dev)
-               return;
-       pnp_printf(buffer, "'%s'.\n", dev->dev.bus_id);
-}
-
-static void pnp_print_conflict_desc(pnp_info_buffer_t *buffer, int conflict)
-{
-       if (!conflict)
-               return;
-       pnp_printf(buffer, "  Conflict Detected: %2x - ", conflict);
-       switch (conflict) {
-       case CONFLICT_TYPE_RESERVED:
-               pnp_printf(buffer, "manually reserved.\n");
-               break;
-
-       case CONFLICT_TYPE_IN_USE:
-               pnp_printf(buffer, "currently in use.\n");
-               break;
-
-       case CONFLICT_TYPE_PCI:
-               pnp_printf(buffer, "PCI device.\n");
-               break;
-
-       case CONFLICT_TYPE_INVALID:
-               pnp_printf(buffer, "invalid.\n");
-               break;
-
-       case CONFLICT_TYPE_INTERNAL:
-               pnp_printf(buffer, "another resource on this device.\n");
-               break;
-
-       case CONFLICT_TYPE_PNP_WARM:
-               pnp_printf(buffer, "active PnP device ");
-               break;
-
-       case CONFLICT_TYPE_PNP_COLD:
-               pnp_printf(buffer, "disabled PnP device ");
-               break;
-       default:
-               pnp_printf(buffer, "Unknown conflict.\n");
-               break;
-       }
-}
+static DEVICE_ATTR(options,S_IRUGO,pnp_show_options,NULL);

-static void pnp_print_conflict(pnp_info_buffer_t *buffer, struct pnp_dev * dev, int idx, int type)
-{
-       struct pnp_dev * cdev, * wdev = NULL;
-       int conflict;
-       switch (type) {
-       case IORESOURCE_IO:
-               conflict = pnp_check_port(dev, idx);
-               if (conflict == CONFLICT_TYPE_PNP_WARM)
-                       wdev = pnp_check_port_conflicts(dev, idx, SEARCH_WARM);
-               cdev = pnp_check_port_conflicts(dev, idx, SEARCH_COLD);
-               break;
-       case IORESOURCE_MEM:
-               conflict = pnp_check_mem(dev, idx);
-               if (conflict == CONFLICT_TYPE_PNP_WARM)
-                       wdev = pnp_check_mem_conflicts(dev, idx, SEARCH_WARM);
-               cdev = pnp_check_mem_conflicts(dev, idx, SEARCH_COLD);
-               break;
-       case IORESOURCE_IRQ:
-               conflict = pnp_check_irq(dev, idx);
-               if (conflict == CONFLICT_TYPE_PNP_WARM)
-                       wdev = pnp_check_irq_conflicts(dev, idx, SEARCH_WARM);
-               cdev = pnp_check_irq_conflicts(dev, idx, SEARCH_COLD);
-               break;
-       case IORESOURCE_DMA:
-               conflict = pnp_check_dma(dev, idx);
-               if (conflict == CONFLICT_TYPE_PNP_WARM)
-                       wdev = pnp_check_dma_conflicts(dev, idx, SEARCH_WARM);
-               cdev = pnp_check_dma_conflicts(dev, idx, SEARCH_COLD);
-               break;
-       default:
-               return;
-       }
-
-       pnp_print_conflict_desc(buffer, conflict);
-
-       if (wdev)
-               pnp_print_conflict_node(buffer, wdev);
-
-       if (cdev) {
-               pnp_print_conflict_desc(buffer, CONFLICT_TYPE_PNP_COLD);
-               pnp_print_conflict_node(buffer, cdev);
-       }
-}

 static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf)
 {
@@ -332,12 +250,6 @@
        buffer->buffer = buf;
        buffer->curr = buffer->buffer;

-       pnp_printf(buffer,"mode = ");
-       if (dev->config_mode & PNP_CONFIG_MANUAL)
-               pnp_printf(buffer,"manual\n");
-       else
-               pnp_printf(buffer,"auto\n");
-
        pnp_printf(buffer,"state = ");
        if (dev->active)
                pnp_printf(buffer,"active\n");
@@ -350,7 +262,6 @@
                        pnp_printf(buffer," 0x%lx-0x%lx \n",
                                                pnp_port_start(dev, i),
                                                pnp_port_end(dev, i));
-              
...

read more »

 
 
 

PnP Changes for 2.5.72

Post by Adam Bela » Fri, 20 Jun 2003 06:20:17


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1419  -> 1.1420
#       drivers/pnp/support.c   1.3     -> 1.4    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------

# [PNP] Trivial Typo fix regarding DMAs
#
# The irq index is used instead of the dma index when parsing dmas.
# --------------------------------------------
#
diff -Nru a/drivers/pnp/support.c b/drivers/pnp/support.c
--- a/drivers/pnp/support.c     Wed Jun 18 23:01:34 2003

                {
                        if (len != 2)
                                goto sm_err;
-                       write_dma(p, &res->dma_resource[irq]);
+                       write_dma(p, &res->dma_resource[dma]);
                        dma++;
                        break;
                }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

PnP Changes for 2.5.72

Post by Adam Bela » Fri, 20 Jun 2003 06:30:11


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1421  -> 1.1422
#       drivers/pnp/support.c   1.4     -> 1.5    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------

# [PNP] Important Resource Parsing Fixes
#
# In some cases, we're reading the wrong bits for large tags.  This patch corrects
# the issue by setting the affected bits forward by an offset of 2 (skipping over
# the size portion of the tag).
# --------------------------------------------
#
diff -Nru a/drivers/pnp/support.c b/drivers/pnp/support.c
--- a/drivers/pnp/support.c     Wed Jun 18 23:01:17 2003

        mem = pnp_alloc(sizeof(struct pnp_mem));
        if (!mem)
                return;
-       mem->min = ((p[3] << 8) | p[2]) << 8;
-       mem->max = ((p[5] << 8) | p[4]) << 8;
-       mem->align = (p[7] << 8) | p[6];
-       mem->size = ((p[9] << 8) | p[8]) << 8;
-       mem->flags = p[1];
+       mem->min = ((p[5] << 8) | p[4]) << 8;
+       mem->max = ((p[7] << 8) | p[6]) << 8;
+       mem->align = (p[9] << 8) | p[8];
+       mem->size = ((p[11] << 8) | p[10]) << 8;
+       mem->flags = p[3];
        pnp_register_mem_resource(option,mem);
        return;

        mem = pnp_alloc(sizeof(struct pnp_mem));
        if (!mem)
                return;
-       mem->min = (p[5] << 24) | (p[4] << 16) | (p[3] << 8) | p[2];
-       mem->max = (p[9] << 24) | (p[8] << 16) | (p[7] << 8) | p[6];
-       mem->align = (p[13] << 24) | (p[12] << 16) | (p[11] << 8) | p[10];
-       mem->size = (p[17] << 24) | (p[16] << 16) | (p[15] << 8) | p[14];
-       mem->flags = p[1];
+       mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4];
+       mem->max = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8];
+       mem->align = (p[15] << 24) | (p[14] << 16) | (p[13] << 8) | p[12];
+       mem->size = (p[19] << 24) | (p[18] << 16) | (p[17] << 8) | p[16];
+       mem->flags = p[3];
        pnp_register_mem_resource(option,mem);
        return;

        mem = pnp_alloc(sizeof(struct pnp_mem));
        if (!mem)
                return;
-       mem->min = mem->max = (p[5] << 24) | (p[4] << 16) | (p[3] << 8) | p[2];
-       mem->size = (p[9] << 24) | (p[8] << 16) | (p[7] << 8) | p[6];
+       mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4];
+       mem->size = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8];
        mem->align = 0;
-       mem->flags = p[1];
+       mem->flags = p[3];
        pnp_register_mem_resource(option,mem);
        return;

 {
        unsigned long base = res->start;
        unsigned long len = res->end - res->start + 1;
-       p[2] = (base >> 8) & 0xff;
-       p[3] = ((base >> 8) >> 8) & 0xff;
        p[4] = (base >> 8) & 0xff;
        p[5] = ((base >> 8) >> 8) & 0xff;
-       p[8] = (len >> 8) & 0xff;
-       p[9] = ((len >> 8) >> 8) & 0xff;
+       p[6] = (base >> 8) & 0xff;
+       p[7] = ((base >> 8) >> 8) & 0xff;
+       p[10] = (len >> 8) & 0xff;
+       p[11] = ((len >> 8) >> 8) & 0xff;
        return;
 }

 {
        unsigned long base = res->start;
        unsigned long len = res->end - res->start + 1;
-       p[2] = base & 0xff;
-       p[3] = (base >> 8) & 0xff;
-       p[4] = (base >> 16) & 0xff;
-       p[5] = (base >> 24) & 0xff;
-       p[6] = base & 0xff;
-       p[7] = (base >> 8) & 0xff;
-       p[8] = (base >> 16) & 0xff;
-       p[9] = (base >> 24) & 0xff;
-       p[14] = len & 0xff;
-       p[15] = (len >> 8) & 0xff;
-       p[16] = (len >> 16) & 0xff;
-       p[17] = (len >> 24) & 0xff;
+       p[4] = base & 0xff;
+       p[5] = (base >> 8) & 0xff;
+       p[6] = (base >> 16) & 0xff;
+       p[7] = (base >> 24) & 0xff;
+       p[8] = base & 0xff;
+       p[9] = (base >> 8) & 0xff;
+       p[10] = (base >> 16) & 0xff;
+       p[11] = (base >> 24) & 0xff;
+       p[16] = len & 0xff;
+       p[17] = (len >> 8) & 0xff;
+       p[18] = (len >> 16) & 0xff;
+       p[19] = (len >> 24) & 0xff;
        return;
 }

 static void write_fixed_mem32(unsigned char *p, struct resource * res)
 {      unsigned long base = res->start;
        unsigned long len = res->end - res->start + 1;
-       p[2] = base & 0xff;
-       p[3] = (base >> 8) & 0xff;
-       p[4] = (base >> 16) & 0xff;
-       p[5] = (base >> 24) & 0xff;
-       p[6] = len & 0xff;
-       p[7] = (len >> 8) & 0xff;
-       p[8] = (len >> 16) & 0xff;
-       p[9] = (len >> 24) & 0xff;
+       p[4] = base & 0xff;
+       p[5] = (base >> 8) & 0xff;
+       p[6] = (base >> 16) & 0xff;
+       p[7] = (base >> 24) & 0xff;
+       p[8] = len & 0xff;
+       p[9] = (len >> 8) & 0xff;
+       p[10] = (len >> 16) & 0xff;
+       p[11] = (len >> 24) & 0xff;
        return;
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

PnP Changes for 2.5.72

Post by Adam Bela » Fri, 20 Jun 2003 06:30:31


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1418  -> 1.1419
#       drivers/pnp/interface.c 1.15    -> 1.16  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------

# [PNP] re-add the previously removed "get" command in interface.c.
#
# This patch adds the "get" command because at this point it is needed
# for debugging.
# --------------------------------------------
#
diff -Nru a/drivers/pnp/interface.c b/drivers/pnp/interface.c
--- a/drivers/pnp/interface.c   Wed Jun 18 23:01:42 2003

                pnp_init_resources(&dev->res);
                goto done;
        }
+       if (!strnicmp(buf,"get",3)) {
+               down(&pnp_res_mutex);
+               if (pnp_can_read(dev))
+                       dev->protocol->get(dev, &dev->res);
+               up(&pnp_res_mutex);
+               goto done;
+       }
        if (!strnicmp(buf,"set",3)) {
                int nport = 0, nmem = 0, nirq = 0, ndma = 0;
                if (dev->active)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

PnP Changes for 2.5.72

Post by Adam Bela » Fri, 20 Jun 2003 06:30:31


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1417  -> 1.1418
#       drivers/pnp/pnpbios/core.c      1.31    -> 1.32  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------

# [PNP] PnPBIOS resource setting fix
#
# If a device is disabled when initially read, its blank resource data will not
# be cleared and the pnp layer will assume incorrectly that the device has
# already been configured.  This patch resolves the issue by initializing the
# resource table if the device is found to be disabled.
# --------------------------------------------
#
diff -Nru a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
--- a/drivers/pnp/pnpbios/core.c        Wed Jun 18 23:01:51 2003

                dev->capabilities |= PNP_REMOVABLE;
        dev->protocol = &pnpbios_protocol;

+       /* clear out the damaged flags */
+       if (!dev->active)
+               pnp_init_resources(&dev->res);
+
        pnp_add_device(dev);
        pnpbios_interface_attach_device(node);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

PnP Changes for 2.5.72

Post by Russell Kin » Fri, 20 Jun 2003 10:40:10



> diff -Nru a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
> --- a/drivers/serial/8250_pnp.c    Wed Jun 18 23:02:24 2003
> +++ b/drivers/serial/8250_pnp.c    Wed Jun 18 23:02:24 2003

>  MODULE_DEVICE_TABLE(pnp, pnp_dev_table);

> -static inline void avoid_irq_share(struct pnp_dev *dev)
> -{
> -  unsigned int map = 0x1FF8;
> -  struct pnp_irq *irq;
> -  struct pnp_resources *res = dev->possible;
> -
> -  serial8250_get_irq_map(&map);
> -
> -  for ( ; res; res = res->dep)
> -          for (irq = res->irq; irq; irq = irq->next)
> -                  irq->map = map;
> -}
> -
>  static char *modem_names[] __devinitdata = {
>    "MODEM", "Modem", "modem", "FAX", "Fax", "fax",
>    "56K", "56k", "K56", "33.6", "28.8", "14.4",

>            if (ret < 0)
>                    return ret;
>    }
> -  if (flags & SPCI_FL_NO_SHIRQ)
> -          avoid_irq_share(dev);
>    memset(&serial_req, 0, sizeof(serial_req));
>    serial_req.irq = pnp_irq(dev,0);
>    serial_req.port = pnp_port_start(dev, 0);

Why did you remove this?  I'd like this to go to Linus as a separate cset
so it can easily be backed out again if needed.

It's purpose is trying to ensure that we don't use an interrupt which
another serial port is using.  Presumably this is because the card does
not work, for whatever reason, when it shares interrupts with other serial
ports.

--

             http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

PnP Changes for 2.5.72

Post by Adam Bela » Sat, 21 Jun 2003 06:10:08



> It's purpose is trying to ensure that we don't use an interrupt which
> another serial port is using.  Presumably this is because the card does

PnP automatically does this without modification to the rule structure.

Quote:> not work, for whatever reason, when it shares interrupts with other serial
> ports.

I removed avoid_irq_share because the current pnp code, like the previous, does
not allow irq sharing.  Also it corrupts the device rule structure by replacing
it with modified values that may not apply after devices are disabled etc.
Is there a set of conditions I could follow to determine if a serial pnp device
is capable of irq sharing, and also with which other devices can a capable
device share an irq?  If so, I could have the resource manager handle this type
of situation when few irqs are available.

Thanks,
Adam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

PnP Changes for 2.5.72

Post by Russell Kin » Sat, 21 Jun 2003 08:00:13



> I removed avoid_irq_share because the current pnp code, like the previous, does
> not allow irq sharing.  Also it corrupts the device rule structure by replacing
> it with modified values that may not apply after devices are disabled etc.
> Is there a set of conditions I could follow to determine if a serial pnp device
> is capable of irq sharing, and also with which other devices can a capable
> device share an irq?  If so, I could have the resource manager handle this type
> of situation when few irqs are available.

The problem is one of a lack of historical information on why it was
added.  The driver itself allows serial ports to share interrupts between
themselves.  Maybe tytso knows why the "Rockwell 56K ACF II Fax+Data+Voice
Modem" is unable to share IRQs?

--

             http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

PnP Changes for 2.5.72

Post by Andrey Pani » Sat, 21 Jun 2003 08:20:04




> > I removed avoid_irq_share because the current pnp code, like the previous, does
> > not allow irq sharing.  Also it corrupts the device rule structure by replacing
> > it with modified values that may not apply after devices are disabled etc.
> > Is there a set of conditions I could follow to determine if a serial pnp device
> > is capable of irq sharing, and also with which other devices can a capable
> > device share an irq?  If so, I could have the resource manager handle this type
> > of situation when few irqs are available.

> The problem is one of a lack of historical information on why it was
> added.  The driver itself allows serial ports to share interrupts between
> themselves.  Maybe tytso knows why the "Rockwell 56K ACF II Fax+Data+Voice
> Modem" is unable to share IRQs?

It was me who added this crappy quirk.

My ELine modem which identified itself "Rockwell 56K ACF II Fax+Data+Voice Modem"
was going mad when its IRQ was shared with any device. So I decided to add this
quirk.

Personally I think that ISA IRQ sharing should be absolutely last resort technic,
because ISA bus was never designed to support IRQ sharing sanely. If you have to
enable ISA PnP device and do not have enough IRQ, you must print BIG FAT WARNING
before doing this. May be kernel config options must be added for brave guys
wanting to use ISA IRQ sharing.

--
Andrey Panin            | Linux and UNIX system administrator

  application_pgp-signature_part
< 1K Download
 
 
 

PnP Changes for 2.5.72

Post by Russell Kin » Sat, 21 Jun 2003 09:20:12



> It was me who added this crappy quirk.

It helps when the people with the problems are reading the list. 8)

Quote:> My ELine modem which identified itself "Rockwell 56K ACF II Fax+Data+Voice
> Modem" was going mad when its IRQ was shared with any device. So I decided
> to add this quirk.

Can you remember any further details?  Eg, was it when sharing with other
serial ports (and were these serial ports in use), or any thing else?

Thanks.

--

             http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

PnP Changes for 2.5.72

Post by Andrey Pani » Sat, 21 Jun 2003 12:10:08




> > It was me who added this crappy quirk.

> It helps when the people with the problems are reading the list. 8)

> > My ELine modem which identified itself "Rockwell 56K ACF II Fax+Data+Voice
> > Modem" was going mad when its IRQ was shared with any device. So I decided
> > to add this quirk.

> Can you remember any further details?  Eg, was it when sharing with other
> serial ports (and were these serial ports in use), or any thing else?

Modem IRQ4 (IIRC) wash shared with onboard serial port and in this configuration
there were massive receive data losses on the modem.

--
Andrey Panin            | Linux and UNIX system administrator

  application_pgp-signature_part
< 1K Download
 
 
 

PnP Changes for 2.5.72

Post by Bill Davidse » Sat, 21 Jun 2003 20:10:12





> > > I removed avoid_irq_share because the current pnp code, like the previous, does
> > > not allow irq sharing.  Also it corrupts the device rule structure by replacing
> > > it with modified values that may not apply after devices are disabled etc.
> > > Is there a set of conditions I could follow to determine if a serial pnp device
> > > is capable of irq sharing, and also with which other devices can a capable
> > > device share an irq?  If so, I could have the resource manager handle this type
> > > of situation when few irqs are available.

> > The problem is one of a lack of historical information on why it was
> > added.  The driver itself allows serial ports to share interrupts between
> > themselves.  Maybe tytso knows why the "Rockwell 56K ACF II Fax+Data+Voice
> > Modem" is unable to share IRQs?

> It was me who added this crappy quirk.

> My ELine modem which identified itself "Rockwell 56K ACF II Fax+Data+Voice Modem"
> was going mad when its IRQ was shared with any device. So I decided to add this
> quirk.

> Personally I think that ISA IRQ sharing should be absolutely last resort technic,
> because ISA bus was never designed to support IRQ sharing sanely. If you have to
> enable ISA PnP device and do not have enough IRQ, you must print BIG FAT WARNING
> before doing this. May be kernel config options must be added for brave guys
> wanting to use ISA IRQ sharing.

But dumb multiport boards support sharing just fine:

0: uart:16550A port:3F8 irq:4 baud:1200 tx:6 rx:9587 RTS|CTS|DTR|DSR
1: uart:16550A port:2F8 irq:3 baud:9600 tx:9 rx:2 brk:2
2: uart:unknown port:3E8 irq:4
3: uart:unknown port:2E8 irq:3
4: uart:16550A port:1A0 irq:5 baud:9600 tx:0 rx:0 CTS
5: uart:16550A port:1A8 irq:5 baud:9600 tx:0 rx:0
6: uart:16550A port:1B0 irq:5 baud:9600 tx:0 rx:0
7: uart:16550A port:1B8 irq:5 baud:9600 tx:0 rx:0

There's more to it than just "it doesn't work." I note that 2.5.70 still
sets the NIC and AHA1540 to the same irq, while 2.4.18 doesn't. I gave up
on that, I can't change the hardware (specialty hardware) so I run 2.4
kernels. Someday I'll fight with it.

--

  CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

  application_pgp-signature_part
< 1K Download