[Linux-parport] Inconsistency between write control and frob control in parport_pc.h

Per Zetterlund per.zetterlund at 27m.se
Thu Jan 27 07:47:35 EST 2005


Hi all,

Is there a reason why parport_pc_write_control only calls parport_pc_data_reverse
(when needed) while parport_pc_frob_control calls both parport_pc_data_reverse
*and* parport_pc_data_forward? It really fooled me.

See code:

---8<---
 static __inline__ void parport_pc_write_control (struct parport *p,
                                                  unsigned char d)
 {
         const unsigned char wm = (PARPORT_CONTROL_STROBE |
                                   PARPORT_CONTROL_AUTOFD |
                                   PARPORT_CONTROL_INIT |
                                   PARPORT_CONTROL_SELECT);
 
         /* Take this out when drivers have adapted to newer interface. */
         if (d & 0x20) {
                 printk (KERN_DEBUG "%s (%s): use data_reverse for this!\n",
                         p->name, p->cad->name);
                 parport_pc_data_reverse (p);
         }
 
         __parport_pc_frob_control (p, wm, d & wm);
 }
--->8---

---8<---
 static __inline__ unsigned char parport_pc_frob_control (struct parport *p,
                                                          unsigned char mask,
                                                          unsigned char val)
 {
         const unsigned char wm = (PARPORT_CONTROL_STROBE |
                                   PARPORT_CONTROL_AUTOFD |
                                   PARPORT_CONTROL_INIT |
                                   PARPORT_CONTROL_SELECT);
 
         /* Take this out when drivers have adapted to newer interface. */
         if (mask & 0x20) {
                 printk (KERN_DEBUG "%s (%s): use data_%s for this!\n",
                         p->name, p->cad->name,
                         (val & 0x20) ? "reverse" : "forward");
                 if (val & 0x20)
                         parport_pc_data_reverse (p);
                 else
                         parport_pc_data_forward (p);
         }
 
         /* Restrict mask and val to control lines. */
         mask &= wm;
         val &= wm;
 
         return __parport_pc_frob_control (p, mask, val);
 }
--->8---

If this has been discussed before on the list, I'm sorry. I tried to search the list,
but couldn't find any search engine.

Thanks,

  Per




More information about the Linux-parport mailing list