Deleted Added
full compact
lpt.c (184164) lpt.c (185003)
1/*-
2 * Copyright (c) 1990 William F. Jolitz, TeleMuse
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 37 unchanged lines hidden (view full) ---

46 * SUCH DAMAGE.
47 *
48 * from: unknown origin, 386BSD 0.1
49 * From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
50 * From Id: nlpt.c,v 1.14 1999/02/08 13:55:43 des Exp
51 */
52
53#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990 William F. Jolitz, TeleMuse
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 37 unchanged lines hidden (view full) ---

46 * SUCH DAMAGE.
47 *
48 * from: unknown origin, 386BSD 0.1
49 * From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
50 * From Id: nlpt.c,v 1.14 1999/02/08 13:55:43 des Exp
51 */
52
53#include <sys/cdefs.h>
54__FBSDID("$FreeBSD: head/sys/dev/ppbus/lpt.c 184164 2008-10-22 15:00:22Z jhb $");
54__FBSDID("$FreeBSD: head/sys/dev/ppbus/lpt.c 185003 2008-11-16 17:42:02Z jhb $");
55
56/*
57 * Device Driver for AT parallel printer port
58 * Written by William Jolitz 12/18/90
59 */
60
61/*
62 * Updated for ppbus by Nicolas Souchu

--- 19 unchanged lines hidden (view full) ---

82#include <dev/ppbus/lptio.h>
83#include <dev/ppbus/ppbconf.h>
84#include <dev/ppbus/ppb_1284.h>
85#include <dev/ppbus/lpt.h>
86#include "ppbus_if.h"
87#include <dev/ppbus/ppbio.h>
88
89#ifndef LPT_DEBUG
55
56/*
57 * Device Driver for AT parallel printer port
58 * Written by William Jolitz 12/18/90
59 */
60
61/*
62 * Updated for ppbus by Nicolas Souchu

--- 19 unchanged lines hidden (view full) ---

82#include <dev/ppbus/lptio.h>
83#include <dev/ppbus/ppbconf.h>
84#include <dev/ppbus/ppb_1284.h>
85#include <dev/ppbus/lpt.h>
86#include "ppbus_if.h"
87#include <dev/ppbus/ppbio.h>
88
89#ifndef LPT_DEBUG
90#define lprintf(args)
90#define lprintf(args)
91#else
91#else
92#define lprintf(args) \
92#define lprintf(args) \
93 do { \
94 if (lptflag) \
95 printf args; \
96 } while (0)
97static int volatile lptflag = 1;
98#endif
99
100#define LPINITRDY 4 /* wait up to 4 seconds for a ready */

--- 7 unchanged lines hidden (view full) ---

108 device_t dev;
109 struct cdev *cdev;
110 struct cdev *cdev_bypass;
111 short sc_state;
112 /* default case: negative prime, negative ack, handshake strobe,
113 prime once */
114 u_char sc_control;
115 char sc_flags;
93 do { \
94 if (lptflag) \
95 printf args; \
96 } while (0)
97static int volatile lptflag = 1;
98#endif
99
100#define LPINITRDY 4 /* wait up to 4 seconds for a ready */

--- 7 unchanged lines hidden (view full) ---

108 device_t dev;
109 struct cdev *cdev;
110 struct cdev *cdev_bypass;
111 short sc_state;
112 /* default case: negative prime, negative ack, handshake strobe,
113 prime once */
114 u_char sc_control;
115 char sc_flags;
116#define LP_POS_INIT 0x04 /* if we are a postive init signal */
117#define LP_POS_ACK 0x08 /* if we are a positive going ack */
118#define LP_NO_PRIME 0x10 /* don't prime the printer at all */
119#define LP_PRIMEOPEN 0x20 /* prime on every open */
120#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */
121#define LP_BYPASS 0x80 /* bypass printer ready checks */
116#define LP_POS_INIT 0x04 /* if we are a postive init signal */
117#define LP_POS_ACK 0x08 /* if we are a positive going ack */
118#define LP_NO_PRIME 0x10 /* don't prime the printer at all */
119#define LP_PRIMEOPEN 0x20 /* prime on every open */
120#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */
121#define LP_BYPASS 0x80 /* bypass printer ready checks */
122 void *sc_inbuf;
123 void *sc_statbuf;
124 short sc_xfercnt ;
125 char sc_primed;
126 char *sc_cp ;
127 u_short sc_irq ; /* IRQ status of port */
122 void *sc_inbuf;
123 void *sc_statbuf;
124 short sc_xfercnt ;
125 char sc_primed;
126 char *sc_cp ;
127 u_short sc_irq ; /* IRQ status of port */
128#define LP_HAS_IRQ 0x01 /* we have an irq available */
129#define LP_USE_IRQ 0x02 /* we are using our irq */
130#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */
131#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */
128#define LP_HAS_IRQ 0x01 /* we have an irq available */
129#define LP_USE_IRQ 0x02 /* we are using our irq */
130#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */
131#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */
132 u_char sc_backoff ; /* time to call lptout() again */
133
134 struct resource *intr_resource; /* interrupt resource */
135 void *intr_cookie; /* interrupt registration cookie */
132 u_char sc_backoff ; /* time to call lptout() again */
133
134 struct resource *intr_resource; /* interrupt resource */
135 void *intr_cookie; /* interrupt registration cookie */
136
137};
138
136};
137
139#define LPT_NAME "lpt" /* our official name */
138#define LPT_NAME "lpt" /* our official name */
140
141static timeout_t lptout;
142static int lpt_port_test(device_t dev, u_char data, u_char mask);
143static int lpt_detect(device_t dev);
144
139
140static timeout_t lptout;
141static int lpt_port_test(device_t dev, u_char data, u_char mask);
142static int lpt_detect(device_t dev);
143
145#define DEVTOSOFTC(dev) \
144#define DEVTOSOFTC(dev) \
146 ((struct lpt_data *)device_get_softc(dev))
147
148static void lptintr(device_t dev);
149static void lpt_intr(void *arg); /* without spls */
150
151static devclass_t lpt_devclass;
152
153
154/* bits for state */
155#define OPEN (1<<0) /* device is open */
156#define ASLP (1<<1) /* awaiting draining of printer */
157#define EERROR (1<<2) /* error was received from printer */
158#define OBUSY (1<<3) /* printer is busy doing output */
145 ((struct lpt_data *)device_get_softc(dev))
146
147static void lptintr(device_t dev);
148static void lpt_intr(void *arg); /* without spls */
149
150static devclass_t lpt_devclass;
151
152
153/* bits for state */
154#define OPEN (1<<0) /* device is open */
155#define ASLP (1<<1) /* awaiting draining of printer */
156#define EERROR (1<<2) /* error was received from printer */
157#define OBUSY (1<<3) /* printer is busy doing output */
159#define LPTOUT (1<<4) /* timeout while not selected */
160#define TOUT (1<<5) /* timeout while not selected */
161#define LPTINIT (1<<6) /* waiting to initialize for open */
162#define INTERRUPTED (1<<7) /* write call was interrupted */
158#define LPTOUT (1<<4) /* timeout while not selected */
159#define TOUT (1<<5) /* timeout while not selected */
160#define LPTINIT (1<<6) /* waiting to initialize for open */
161#define INTERRUPTED (1<<7) /* write call was interrupted */
162#define HAVEBUS (1<<8) /* the driver owns the bus */
163
163
164#define HAVEBUS (1<<8) /* the driver owns the bus */
165
166
167/* status masks to interrogate printer status */
164/* status masks to interrogate printer status */
168#define RDY_MASK (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR) /* ready ? */
169#define LP_READY (LPS_SEL|LPS_NBSY|LPS_NERR)
165#define RDY_MASK (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR) /* ready ? */
166#define LP_READY (LPS_SEL|LPS_NBSY|LPS_NERR)
170
171/* Printer Ready condition - from lpa.c */
172/* Only used in polling code */
173#define LPS_INVERT (LPS_NBSY | LPS_NACK | LPS_SEL | LPS_NERR)
174#define LPS_MASK (LPS_NBSY | LPS_NACK | LPS_OUT | LPS_SEL | LPS_NERR)
175#define NOT_READY(ppbus) ((ppb_rstr(ppbus)^LPS_INVERT)&LPS_MASK)
176
177#define MAX_SLEEP (hz*5) /* Timeout while waiting for device ready */

--- 320 unchanged lines hidden (view full) ---

498 */
499 if (sc->sc_irq & LP_ENABLE_IRQ)
500 sc->sc_irq |= LP_USE_IRQ;
501 else
502 sc->sc_irq &= ~LP_USE_IRQ;
503
504 /* init printer */
505 if ((sc->sc_flags & LP_NO_PRIME) == 0) {
167
168/* Printer Ready condition - from lpa.c */
169/* Only used in polling code */
170#define LPS_INVERT (LPS_NBSY | LPS_NACK | LPS_SEL | LPS_NERR)
171#define LPS_MASK (LPS_NBSY | LPS_NACK | LPS_OUT | LPS_SEL | LPS_NERR)
172#define NOT_READY(ppbus) ((ppb_rstr(ppbus)^LPS_INVERT)&LPS_MASK)
173
174#define MAX_SLEEP (hz*5) /* Timeout while waiting for device ready */

--- 320 unchanged lines hidden (view full) ---

495 */
496 if (sc->sc_irq & LP_ENABLE_IRQ)
497 sc->sc_irq |= LP_USE_IRQ;
498 else
499 sc->sc_irq &= ~LP_USE_IRQ;
500
501 /* init printer */
502 if ((sc->sc_flags & LP_NO_PRIME) == 0) {
506 if((sc->sc_flags & LP_PRIMEOPEN) || sc->sc_primed == 0) {
503 if ((sc->sc_flags & LP_PRIMEOPEN) || sc->sc_primed == 0) {
507 ppb_wctr(ppbus, 0);
508 sc->sc_primed++;
509 DELAY(500);
510 }
511 }
512
513 ppb_wctr(ppbus, LPC_SEL|LPC_NINIT);
514

--- 62 unchanged lines hidden (view full) ---

577 * Check for interrupted write call added.
578 */
579
580static int
581lptclose(struct cdev *dev, int flags, int fmt, struct thread *td)
582{
583 struct lpt_data *sc = dev->si_drv1;
584 device_t lptdev = sc->dev;
504 ppb_wctr(ppbus, 0);
505 sc->sc_primed++;
506 DELAY(500);
507 }
508 }
509
510 ppb_wctr(ppbus, LPC_SEL|LPC_NINIT);
511

--- 62 unchanged lines hidden (view full) ---

574 * Check for interrupted write call added.
575 */
576
577static int
578lptclose(struct cdev *dev, int flags, int fmt, struct thread *td)
579{
580 struct lpt_data *sc = dev->si_drv1;
581 device_t lptdev = sc->dev;
585 device_t ppbus = device_get_parent(lptdev);
582 device_t ppbus = device_get_parent(lptdev);
586 int err;
587
588 if (sc->sc_flags & LP_BYPASS)
589 goto end_close;
590
591 if ((err = lpt_request_ppbus(lptdev, PPB_WAIT|PPB_INTR)) != 0)
592 return (err);
593
594 sc->sc_state &= ~OPEN;
595
596 /* if the last write was interrupted, don't complete it */
583 int err;
584
585 if (sc->sc_flags & LP_BYPASS)
586 goto end_close;
587
588 if ((err = lpt_request_ppbus(lptdev, PPB_WAIT|PPB_INTR)) != 0)
589 return (err);
590
591 sc->sc_state &= ~OPEN;
592
593 /* if the last write was interrupted, don't complete it */
597 if((!(sc->sc_state & INTERRUPTED)) && (sc->sc_irq & LP_USE_IRQ))
594 if ((!(sc->sc_state & INTERRUPTED)) && (sc->sc_irq & LP_USE_IRQ))
598 while ((ppb_rstr(ppbus) &
599 (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) !=
600 (LPS_SEL|LPS_NBSY|LPS_NERR) || sc->sc_xfercnt)
601 /* wait 1/4 second, give up if we get a signal */
602 if (tsleep(lptdev, LPPRI|PCATCH,
603 "lpclose", hz) != EWOULDBLOCK)
604 break;
605

--- 79 unchanged lines hidden (view full) ---

685 * lptread --retrieve printer status in IEEE1284 NIBBLE mode
686 */
687
688static int
689lptread(struct cdev *dev, struct uio *uio, int ioflag)
690{
691 struct lpt_data *sc = dev->si_drv1;
692 device_t lptdev = sc->dev;
595 while ((ppb_rstr(ppbus) &
596 (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) !=
597 (LPS_SEL|LPS_NBSY|LPS_NERR) || sc->sc_xfercnt)
598 /* wait 1/4 second, give up if we get a signal */
599 if (tsleep(lptdev, LPPRI|PCATCH,
600 "lpclose", hz) != EWOULDBLOCK)
601 break;
602

--- 79 unchanged lines hidden (view full) ---

682 * lptread --retrieve printer status in IEEE1284 NIBBLE mode
683 */
684
685static int
686lptread(struct cdev *dev, struct uio *uio, int ioflag)
687{
688 struct lpt_data *sc = dev->si_drv1;
689 device_t lptdev = sc->dev;
693 device_t ppbus = device_get_parent(lptdev);
690 device_t ppbus = device_get_parent(lptdev);
694 int error = 0, len;
695
696 if (sc->sc_flags & LP_BYPASS) {
697 /* we can't do reads in bypass mode */
698 return (EPERM);
699 }
700
701 if ((error = ppb_1284_negociate(ppbus, PPB_NIBBLE, 0)))

--- 29 unchanged lines hidden (view full) ---

731
732static int
733lptwrite(struct cdev *dev, struct uio *uio, int ioflag)
734{
735 register unsigned n;
736 int err;
737 struct lpt_data *sc = dev->si_drv1;
738 device_t lptdev = sc->dev;
691 int error = 0, len;
692
693 if (sc->sc_flags & LP_BYPASS) {
694 /* we can't do reads in bypass mode */
695 return (EPERM);
696 }
697
698 if ((error = ppb_1284_negociate(ppbus, PPB_NIBBLE, 0)))

--- 29 unchanged lines hidden (view full) ---

728
729static int
730lptwrite(struct cdev *dev, struct uio *uio, int ioflag)
731{
732 register unsigned n;
733 int err;
734 struct lpt_data *sc = dev->si_drv1;
735 device_t lptdev = sc->dev;
739 device_t ppbus = device_get_parent(lptdev);
736 device_t ppbus = device_get_parent(lptdev);
740
737
741 if(sc->sc_flags & LP_BYPASS) {
738 if (sc->sc_flags & LP_BYPASS) {
742 /* we can't do writes in bypass mode */
743 return(EPERM);
744 }
745
746 /* request the ppbus only if we don't have it already */
747 /* XXX interrupt registration?! */
748 if ((err = lpt_request_ppbus(lptdev, PPB_WAIT|PPB_INTR)) != 0)
749 return (err);

--- 22 unchanged lines hidden (view full) ---

772 sc->sc_xfercnt, 0);
773 switch (err) {
774 case 0:
775 /* if not all data was sent, we could rely
776 * on polling for the last bytes */
777 sc->sc_xfercnt = 0;
778 break;
779 case EINTR:
739 /* we can't do writes in bypass mode */
740 return(EPERM);
741 }
742
743 /* request the ppbus only if we don't have it already */
744 /* XXX interrupt registration?! */
745 if ((err = lpt_request_ppbus(lptdev, PPB_WAIT|PPB_INTR)) != 0)
746 return (err);

--- 22 unchanged lines hidden (view full) ---

769 sc->sc_xfercnt, 0);
770 switch (err) {
771 case 0:
772 /* if not all data was sent, we could rely
773 * on polling for the last bytes */
774 sc->sc_xfercnt = 0;
775 break;
776 case EINTR:
780 sc->sc_state |= INTERRUPTED;
777 sc->sc_state |= INTERRUPTED;
781 return(err);
782 case EINVAL:
783 /* advanced mode not avail */
784 log(LOG_NOTICE,
785 "%s: advanced mode not avail, polling\n",
786 device_get_nameunit(sc->dev));
787 break;
788 default:

--- 12 unchanged lines hidden (view full) ---

801 if ((err = tsleep(lptdev,
802 LPPRI|PCATCH, LPT_NAME "write", 0))) {
803 sc->sc_state |= INTERRUPTED;
804 return(err);
805 }
806 }
807
808 /* check to see if we must do a polled write */
778 return(err);
779 case EINVAL:
780 /* advanced mode not avail */
781 log(LOG_NOTICE,
782 "%s: advanced mode not avail, polling\n",
783 device_get_nameunit(sc->dev));
784 break;
785 default:

--- 12 unchanged lines hidden (view full) ---

798 if ((err = tsleep(lptdev,
799 LPPRI|PCATCH, LPT_NAME "write", 0))) {
800 sc->sc_state |= INTERRUPTED;
801 return(err);
802 }
803 }
804
805 /* check to see if we must do a polled write */
809 if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) {
806 if (!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) {
810 lprintf(("p"));
811
812 err = lpt_pushbytes(lptdev);
813
814 if (err)
815 return(err);
816 }
817 }

--- 5 unchanged lines hidden (view full) ---

823}
824
825/*
826 * lpt_intr -- handle printer interrupts which occur when the printer is
827 * ready to accept another char.
828 *
829 * do checking for interrupted write call.
830 */
807 lprintf(("p"));
808
809 err = lpt_pushbytes(lptdev);
810
811 if (err)
812 return(err);
813 }
814 }

--- 5 unchanged lines hidden (view full) ---

820}
821
822/*
823 * lpt_intr -- handle printer interrupts which occur when the printer is
824 * ready to accept another char.
825 *
826 * do checking for interrupted write call.
827 */
831
832static void
833lpt_intr(void *arg)
834{
835 device_t lptdev = (device_t)arg;
828static void
829lpt_intr(void *arg)
830{
831 device_t lptdev = (device_t)arg;
836 device_t ppbus = device_get_parent(lptdev);
832 device_t ppbus = device_get_parent(lptdev);
837 struct lpt_data *sc = DEVTOSOFTC(lptdev);
838 int sts = 0;
839 int i;
833 struct lpt_data *sc = DEVTOSOFTC(lptdev);
834 int sts = 0;
835 int i;
840
836
841 /* we must own the bus to use it */
842 if ((sc->sc_state & HAVEBUS) == 0)
843 return;
844
845 /*
846 * Is printer online and ready for output?
847 *
848 * Avoid falling back to lptout() too quickly. First spin-loop
849 * to see if the printer will become ready ``really soon now''.
850 */
851 for (i = 0; i < 100 &&
852 ((sts=ppb_rstr(ppbus)) & RDY_MASK) != LP_READY; i++) ;
853
854 if ((sts & RDY_MASK) == LP_READY) {
855 sc->sc_state = (sc->sc_state | OBUSY) & ~EERROR;
837 /* we must own the bus to use it */
838 if ((sc->sc_state & HAVEBUS) == 0)
839 return;
840
841 /*
842 * Is printer online and ready for output?
843 *
844 * Avoid falling back to lptout() too quickly. First spin-loop
845 * to see if the printer will become ready ``really soon now''.
846 */
847 for (i = 0; i < 100 &&
848 ((sts=ppb_rstr(ppbus)) & RDY_MASK) != LP_READY; i++) ;
849
850 if ((sts & RDY_MASK) == LP_READY) {
851 sc->sc_state = (sc->sc_state | OBUSY) & ~EERROR;
856 sc->sc_backoff = hz/LPTOUTINITIAL;
852 sc->sc_backoff = hz / LPTOUTINITIAL;
857
858 if (sc->sc_xfercnt) {
859 /* send char */
860 /*lprintf(("%x ", *sc->sc_cp)); */
861 ppb_wdtr(ppbus, *sc->sc_cp++) ;
862 ppb_wctr(ppbus, sc->sc_control|LPC_STB);
863 /* DELAY(X) */
864 ppb_wctr(ppbus, sc->sc_control);
865
866 /* any more data for printer */
853
854 if (sc->sc_xfercnt) {
855 /* send char */
856 /*lprintf(("%x ", *sc->sc_cp)); */
857 ppb_wdtr(ppbus, *sc->sc_cp++) ;
858 ppb_wctr(ppbus, sc->sc_control|LPC_STB);
859 /* DELAY(X) */
860 ppb_wctr(ppbus, sc->sc_control);
861
862 /* any more data for printer */
867 if(--(sc->sc_xfercnt) > 0) return;
863 if (--(sc->sc_xfercnt) > 0)
864 return;
868 }
869
870 /*
871 * No more data waiting for printer.
872 * Wakeup is not done if write call was not interrupted.
873 */
874 sc->sc_state &= ~OBUSY;
875
865 }
866
867 /*
868 * No more data waiting for printer.
869 * Wakeup is not done if write call was not interrupted.
870 */
871 sc->sc_state &= ~OBUSY;
872
876 if(!(sc->sc_state & INTERRUPTED))
873 if (!(sc->sc_state & INTERRUPTED))
877 wakeup(lptdev);
878 lprintf(("w "));
879 return;
880 } else { /* check for error */
874 wakeup(lptdev);
875 lprintf(("w "));
876 return;
877 } else { /* check for error */
881 if(((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) &&
878 if (((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) &&
882 (sc->sc_state & OPEN))
883 sc->sc_state |= EERROR;
884 /* lptout() will jump in and try to restart. */
885 }
886 lprintf(("sts %x ", sts));
887}
888
889static void

--- 12 unchanged lines hidden (view full) ---

902lptioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
903{
904 int error = 0;
905 struct lpt_data *sc = dev->si_drv1;
906 u_char old_sc_irq; /* old printer IRQ status */
907
908 switch (cmd) {
909 case LPT_IRQ :
879 (sc->sc_state & OPEN))
880 sc->sc_state |= EERROR;
881 /* lptout() will jump in and try to restart. */
882 }
883 lprintf(("sts %x ", sts));
884}
885
886static void

--- 12 unchanged lines hidden (view full) ---

899lptioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
900{
901 int error = 0;
902 struct lpt_data *sc = dev->si_drv1;
903 u_char old_sc_irq; /* old printer IRQ status */
904
905 switch (cmd) {
906 case LPT_IRQ :
910 if(sc->sc_irq & LP_HAS_IRQ) {
907 if (sc->sc_irq & LP_HAS_IRQ) {
911 /*
912 * NOTE:
913 * If the IRQ status is changed,
914 * this will only be visible on the
915 * next open.
916 *
917 * If interrupt status changes,
918 * this gets syslog'd.

--- 15 unchanged lines hidden (view full) ---

934 sc->sc_irq |= LP_ENABLE_EXT;
935 break;
936 case 3:
937 sc->sc_irq &= (~LP_ENABLE_EXT);
938 break;
939 default:
940 break;
941 }
908 /*
909 * NOTE:
910 * If the IRQ status is changed,
911 * this will only be visible on the
912 * next open.
913 *
914 * If interrupt status changes,
915 * this gets syslog'd.

--- 15 unchanged lines hidden (view full) ---

931 sc->sc_irq |= LP_ENABLE_EXT;
932 break;
933 case 3:
934 sc->sc_irq &= (~LP_ENABLE_EXT);
935 break;
936 default:
937 break;
938 }
942
939
943 if (old_sc_irq != sc->sc_irq )
944 log(LOG_NOTICE, "%s: switched to %s %s mode\n",
945 device_get_nameunit(sc->dev),
946 (sc->sc_irq & LP_ENABLE_IRQ)?
947 "interrupt-driven":"polled",
948 (sc->sc_irq & LP_ENABLE_EXT)?
949 "extended":"standard");
950 } else /* polled port */

--- 27 unchanged lines hidden ---
940 if (old_sc_irq != sc->sc_irq )
941 log(LOG_NOTICE, "%s: switched to %s %s mode\n",
942 device_get_nameunit(sc->dev),
943 (sc->sc_irq & LP_ENABLE_IRQ)?
944 "interrupt-driven":"polled",
945 (sc->sc_irq & LP_ENABLE_EXT)?
946 "extended":"standard");
947 } else /* polled port */

--- 27 unchanged lines hidden ---