diff options
author | imp <imp@FreeBSD.org> | 2006-09-06 23:49:36 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2006-09-06 23:49:36 +0000 |
commit | fb77a38eda0f5fdd90d8c7321017465e50859e84 (patch) | |
tree | d3425bcc0a8b2ff85b0da3e868090ff7b1e43372 | |
parent | 443562c9361136ebb76d499cdf93484e86af89c1 (diff) | |
download | FreeBSD-src-fb77a38eda0f5fdd90d8c7321017465e50859e84.zip FreeBSD-src-fb77a38eda0f5fdd90d8c7321017465e50859e84.tar.gz |
Only include FreeBSD defines. This file is slated to go to the happy
hunting ground in the sky.
Also, remove the #defines OBE.
-rw-r--r-- | sys/dev/usb/usb_port.h | 294 |
1 files changed, 0 insertions, 294 deletions
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index e5f6961..8eadc68 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -51,295 +51,6 @@ * Macro's to cope with the differences between operating systems. */ -#if defined(__NetBSD__) -/* - * NetBSD - */ - -#include "opt_usbverbose.h" - -#if defined(_KERNEL) -#include <sys/mallocvar.h> - -MALLOC_DECLARE(M_USB); -MALLOC_DECLARE(M_USBDEV); -MALLOC_DECLARE(M_USBHC); - -#endif - -#define USB_USE_SOFTINTR - -#ifdef USB_DEBUG -#define static -#else -#define static static -#endif - -#define SCSI_MODE_SENSE MODE_SENSE - -typedef struct proc *usb_proc_ptr; - -typedef struct device *device_ptr_t; -#define USBBASEDEVICE struct device -#define USBDEV(bdev) (&(bdev)) -#define USBDEVNAME(bdev) ((bdev).dv_xname) -#define USBDEVUNIT(bdev) ((bdev).dv_unit) -#define USBDEVPTRNAME(bdevptr) ((bdevptr)->dv_xname) -#define USBGETSOFTC(d) ((void *)(d)) - -#define DECLARE_USB_DMA_T \ - struct usb_dma_block; \ - typedef struct { \ - struct usb_dma_block *block; \ - u_int offs; \ - } usb_dma_t - -typedef struct callout usb_callout_t; -#define usb_callout_init(h) callout_init(&(h)) -#define usb_callout(h, t, f, d) callout_reset(&(h), (t), (f), (d)) -#define usb_uncallout(h, f, d) callout_stop(&(h)) - -#define usb_kthread_create1 kthread_create1 -#define usb_kthread_create kthread_create - -typedef struct malloc_type *usb_malloc_type; - -#define Ether_ifattach ether_ifattach -#define IF_INPUT(ifp, m) (*(ifp)->if_input)((ifp), (m)) - -#define logprintf printf - -#define USB_DNAME(dname) dname -#define USB_DECLARE_DRIVER(dname) \ -int __CONCAT(dname,_match)(struct device *, struct cfdata *, void *); \ -void __CONCAT(dname,_attach)(struct device *, struct device *, void *); \ -int __CONCAT(dname,_detach)(struct device *, int); \ -int __CONCAT(dname,_activate)(struct device *, enum devact); \ -\ -extern struct cfdriver __CONCAT(dname,_cd); \ -\ -CFATTACH_DECL(USB_DNAME(dname), \ - sizeof(struct ___CONCAT(dname,_softc)), \ - ___CONCAT(dname,_match), \ - ___CONCAT(dname,_attach), \ - ___CONCAT(dname,_detach), \ - ___CONCAT(dname,_activate)) - -#define USB_MATCH(dname) \ -int __CONCAT(dname,_match)(struct device *parent, struct cfdata *match, void *aux) - -#define USB_MATCH_START(dname, uaa) \ - struct usb_attach_arg *uaa = aux - -#define USB_ATTACH(dname) \ -void __CONCAT(dname,_attach)(struct device *parent, struct device *self, void *aux) - -#define USB_ATTACH_START(dname, sc, uaa) \ - struct __CONCAT(dname,_softc) *sc = \ - (struct __CONCAT(dname,_softc) *)self; \ - struct usb_attach_arg *uaa = aux - -/* Returns from attach */ -#define USB_ATTACH_ERROR_RETURN return -#define USB_ATTACH_SUCCESS_RETURN return - -#define USB_ATTACH_SETUP - printf("\n%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); - -#define USB_DETACH(dname) \ -int __CONCAT(dname,_detach)(struct device *self, int flags) - -#define USB_DETACH_START(dname, sc) \ - struct __CONCAT(dname,_softc) *sc = \ - (struct __CONCAT(dname,_softc) *)self - -#define USB_GET_SC_OPEN(dname, unit, sc) \ - if (unit >= __CONCAT(dname,_cd).cd_ndevs) \ - return (ENXIO); \ - sc = __CONCAT(dname,_cd).cd_devs[unit]; \ - if (sc == NULL) \ - return (ENXIO) - -#define USB_GET_SC(dname, unit, sc) \ - sc = __CONCAT(dname,_cd).cd_devs[unit] - -#define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \ - (config_found_sm_loc(parent, (args)->port == 0 ? "usb" : "uhub", \ - NULL, args, print, sub)) - -#elif defined(__OpenBSD__) -/* - * OpenBSD - */ -#define static - -typedef struct proc *usb_proc_ptr; - -#define UCOMBUSCF_PORTNO -1 -#define UCOMBUSCF_PORTNO_DEFAULT -1 - -#define SCSI_MODE_SENSE MODE_SENSE -#define XS_STS_DONE ITSDONE -#define XS_CTL_POLL SCSI_POLL -#define XS_CTL_DATA_IN SCSI_DATA_IN -#define XS_CTL_DATA_OUT SCSI_DATA_OUT -#define scsipi_adapter scsi_adapter -#define scsipi_cmd scsi_cmd -#define scsipi_device scsi_device -#define scsipi_done scsi_done -#define scsipi_link scsi_link -#define scsipi_minphys scsi_minphys -#define scsipi_sense scsi_sense -#define scsipi_xfer scsi_xfer -#define xs_control flags -#define xs_status status - -#define memcpy(d, s, l) bcopy((s),(d),(l)) -#define memset(d, v, l) bzero((d),(l)) -#define bswap32(x) swap32(x) -#define bswap16(x) swap16(x) - -/* - * The UHCI/OHCI controllers are little endian, so on big endian machines - * the data strored in memory needs to be swapped. - */ - -#if defined(letoh32) -#define le32toh(x) letoh32(x) -#define le16toh(x) letoh16(x) -#endif - -#define usb_kthread_create1 kthread_create -#define usb_kthread_create kthread_create_deferred - -#define usb_lockmgr(lk, mode, ptr) lockmgr(lk, mode, ptr, curproc) - -#define config_pending_incr() -#define config_pending_decr() - -typedef int usb_malloc_type; - -#define Ether_ifattach(ifp, eaddr) ether_ifattach(ifp) -#define if_deactivate(x) -#define IF_INPUT(ifp, m) do { \ - struct ether_header *eh; \ - \ - eh = mtod(m, struct ether_header *); \ - m_adj(m, sizeof(struct ether_header)); \ - ether_input((ifp), (eh), (m)); \ -} while (0) - -#define usbpoll usbselect -#define uhidpoll uhidselect -#define ugenpoll ugenselect -#define uscannerpoll uscannerselect - -#define powerhook_establish(fn, sc) (fn) -#define powerhook_disestablish(hdl) -#define PWR_RESUME 0 - -#define logprintf printf - -#define swap_bytes_change_sign16_le swap_bytes_change_sign16 -#define change_sign16_swap_bytes_le change_sign16_swap_bytes -#define change_sign16_le change_sign16 - -#define realloc usb_realloc -void *usb_realloc(void *, u_int, int, int); - -extern int cold; - -typedef struct device *device_ptr_t; -#define USBBASEDEVICE struct device -#define USBDEV(bdev) (&(bdev)) -#define USBDEVNAME(bdev) ((bdev).dv_xname) -#define USBDEVUNIT(bdev) ((bdev).dv_unit) -#define USBDEVPTRNAME(bdevptr) ((bdevptr)->dv_xname) -#define USBGETSOFTC(d) ((void *)(d)) - -#define DECLARE_USB_DMA_T \ - struct usb_dma_block; \ - typedef struct { \ - struct usb_dma_block *block; \ - u_int offs; \ - } usb_dma_t - -typedef char usb_callout_t; -#define usb_callout_init(h) -#define usb_callout(h, t, f, d) timeout((f), (d), (t)) -#define usb_uncallout(h, f, d) untimeout((f), (d)) - -#define USB_DECLARE_DRIVER(dname) \ -int __CONCAT(dname,_match)(struct device *, void *, void *); \ -void __CONCAT(dname,_attach)(struct device *, struct device *, void *); \ -int __CONCAT(dname,_detach)(struct device *, int); \ -int __CONCAT(dname,_activate)(struct device *, enum devact); \ -\ -struct cfdriver __CONCAT(dname,_cd) = { \ - NULL, #dname, DV_DULL \ -}; \ -\ -const struct cfattach __CONCAT(dname,_ca) = { \ - sizeof(struct __CONCAT(dname,_softc)), \ - __CONCAT(dname,_match), \ - __CONCAT(dname,_attach), \ - __CONCAT(dname,_detach), \ - __CONCAT(dname,_activate), \ -} - -#define USB_MATCH(dname) \ -int \ -__CONCAT(dname,_match)(parent, match, aux) \ - struct device *parent; \ - void *match; \ - void *aux; - -#define USB_MATCH_START(dname, uaa) \ - struct usb_attach_arg *uaa = aux - -#define USB_ATTACH(dname) \ -void \ -__CONCAT(dname,_attach)(parent, self, aux) \ - struct device *parent; \ - struct device *self; \ - void *aux; - -#define USB_ATTACH_START(dname, sc, uaa) \ - struct __CONCAT(dname,_softc) *sc = \ - (struct __CONCAT(dname,_softc) *)self; \ - struct usb_attach_arg *uaa = aux - -/* Returns from attach */ -#define USB_ATTACH_ERROR_RETURN return -#define USB_ATTACH_SUCCESS_RETURN return - -#define USB_ATTACH_SETUP - printf("\n%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); - -#define USB_DETACH(dname) \ -int \ -__CONCAT(dname,_detach)(self, flags) \ - struct device *self; \ - int flags; - -#define USB_DETACH_START(dname, sc) \ - struct __CONCAT(dname,_softc) *sc = \ - (struct __CONCAT(dname,_softc) *)self - -#define USB_GET_SC_OPEN(dname, unit, sc) \ - if (unit >= __CONCAT(dname,_cd).cd_ndevs) \ - return (ENXIO); \ - sc = __CONCAT(dname,_cd).cd_devs[unit]; \ - if (sc == NULL) \ - return (ENXIO) - -#define USB_GET_SC(dname, unit, sc) \ - sc = __CONCAT(dname,_cd).cd_devs[unit] - -#define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \ - (config_found_sm(parent, args, print, sub)) - -#elif defined(__FreeBSD__) /* * FreeBSD */ @@ -360,9 +71,6 @@ MALLOC_DECLARE(M_USBHC); #define USB_USE_SOFTINTR #endif -#define static static - -#define device_ptr_t device_t #define USBBASEDEVICE device_t #define USBDEV(bdev) (bdev) #define USBDEVNAME(bdev) device_get_nameunit(bdev) @@ -536,6 +244,4 @@ __CONCAT(dname,_detach)(device_t self) SYSCTL_DECL(_hw_usb); #endif -#endif /* __FreeBSD__ */ - #endif /* _USB_PORT_H */ |