Diff for /src/sys/dev/usbmisc/ubsa/ubsa.c between versions 1.4 and 1.5

version 1.4, 2003/12/29 06:42:13 version 1.5, 2003/12/30 01:01:46
Line 23 Line 23
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.   * SUCH DAMAGE.
  */   */
   
 /*  /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.   * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.   * All rights reserved.
Line 58 Line 59
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.   * POSSIBILITY OF SUCH DAMAGE.
  *   *
 * $FreeBSD: src/sys/dev/usb/ubsa.c,v 1.2.2.2 2003/11/30 12:53:40 akiyama Exp $ * $FreeBSD: src/sys/dev/usb/ubsa.c,v 1.11 2003/11/16 12:13:39 akiyama Exp $
  * $DragonFly$   * $DragonFly$
  */   */
   
Line 69 Line 70
 #include <sys/bus.h>  #include <sys/bus.h>
 #include <sys/ioccom.h>  #include <sys/ioccom.h>
 #include <sys/fcntl.h>  #include <sys/fcntl.h>
   #include <sys/interrupt.h>
 #include <sys/conf.h>  #include <sys/conf.h>
 #include <sys/tty.h>  #include <sys/tty.h>
 #include <sys/file.h>  #include <sys/file.h>
Line 92 Line 94
   
 #include "../ucom/ucomvar.h"  #include "../ucom/ucomvar.h"
   
#ifdef UBSA_DEBUG#ifdef USB_DEBUG
 Static int      ubsadebug = 0;  Static int      ubsadebug = 0;
 SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa");  SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa");
 SYSCTL_INT(_hw_usb_ubsa, OID_AUTO, debug, CTLFLAG_RW,  SYSCTL_INT(_hw_usb_ubsa, OID_AUTO, debug, CTLFLAG_RW,
Line 177  struct ubsa_softc { Line 179  struct ubsa_softc {
   
         u_char                  sc_lsr;         /* Local status register */          u_char                  sc_lsr;         /* Local status register */
         u_char                  sc_msr;         /* ubsa status register */          u_char                  sc_msr;         /* ubsa status register */
   #if __FreeBSD_version >= 500000
           void                    *sc_swicookie;
   #endif
 };  };
   
 Static  void ubsa_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);  Static  void ubsa_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
   Static  void ubsa_notify(void *);
   
 Static  void ubsa_get_status(void *, int, u_char *, u_char *);  Static  void ubsa_get_status(void *, int, u_char *, u_char *);
 Static  void ubsa_set(void *, int, int, int);  Static  void ubsa_set(void *, int, int, int);
Line 247  MODULE_DEPEND(ubsa, usb, 1, 1, 1); Line 253  MODULE_DEPEND(ubsa, usb, 1, 1, 1);
 MODULE_DEPEND(ubsa, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER);  MODULE_DEPEND(ubsa, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER);
 MODULE_VERSION(ubsa, UBSA_MODVER);  MODULE_VERSION(ubsa, UBSA_MODVER);
   
   #if __FreeBSD_version >= 500000
   static struct ithd *ucom_ithd;
   #endif
   
 USB_MATCH(ubsa)  USB_MATCH(ubsa)
 {  {
         USB_MATCH_START(ubsa, uaa);          USB_MATCH_START(ubsa, uaa);
Line 401  USB_ATTACH(ubsa) Line 411  USB_ATTACH(ubsa)
         DPRINTF(("ubsa: in = 0x%x, out = 0x%x, intr = 0x%x\n",          DPRINTF(("ubsa: in = 0x%x, out = 0x%x, intr = 0x%x\n",
             ucom->sc_bulkin_no, ucom->sc_bulkout_no, sc->sc_intr_number));              ucom->sc_bulkin_no, ucom->sc_bulkout_no, sc->sc_intr_number));
   
   #if __FreeBSD_version >= 500000
           swi_add(&ucom_ithd, "ucom", ubsa_notify, sc, SWI_TTY, 0,
               &sc->sc_swicookie);
   #endif
    
         ucom_attach(ucom);          ucom_attach(ucom);
   
         free(devinfo, M_USBDEV);          free(devinfo, M_USBDEV);
Line 430  USB_DETACH(ubsa) Line 445  USB_DETACH(ubsa)
   
         rv = ucom_detach(&sc->sc_ucom);          rv = ucom_detach(&sc->sc_ucom);
   
   #if __FreeBSD_version >= 500000
           ithread_remove_handler(sc->sc_swicookie);
   #endif
   
         return (rv);          return (rv);
 }  }
   
Line 617  ubsa_param(void *addr, int portno, struc Line 636  ubsa_param(void *addr, int portno, struc
 {  {
         struct ubsa_softc *sc;          struct ubsa_softc *sc;
   
           sc = addr;
   
         DPRINTF(("ubsa_param: sc = %p\n", sc));          DPRINTF(("ubsa_param: sc = %p\n", sc));
   
         sc = addr;  
         ubsa_baudrate(sc, ti->c_ospeed);          ubsa_baudrate(sc, ti->c_ospeed);
         ubsa_parity(sc, ti->c_cflag);          ubsa_parity(sc, ti->c_cflag);
         ubsa_databits(sc, ti->c_cflag);          ubsa_databits(sc, ti->c_cflag);
Line 720  ubsa_intr(usbd_xfer_handle xfer, usbd_pr Line 740  ubsa_intr(usbd_xfer_handle xfer, usbd_pr
         DPRINTF(("%s: ubsa lsr = 0x%02x, msr = 0x%02x\n",          DPRINTF(("%s: ubsa lsr = 0x%02x, msr = 0x%02x\n",
             USBDEVNAME(sc->sc_ucom.sc_dev), sc->sc_lsr, sc->sc_msr));              USBDEVNAME(sc->sc_ucom.sc_dev), sc->sc_lsr, sc->sc_msr));
   
   #if __FreeBSD_version >= 500000
           swi_sched(sc->sc_swicookie, 0);
   #else
           ubsa_notify(sc);
   #endif
   }
   
   /* Handle delayed events. */
   Static void
   ubsa_notify(void *arg)
   {
           struct ubsa_softc *sc;
   
           sc = arg;
         ucom_status_change(&sc->sc_ucom);          ucom_status_change(&sc->sc_ucom);
 }  }
   

Removed from v.1.4  
changed lines
  Added in v.1.5