~ubuntu-branches/ubuntu/utopic/oss4/utopic

« back to all changes in this revision

Viewing changes to kernel/framework/include/udi.h

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis, Samuel Thibault, Romain Beauxis, Sebastien NOEL
  • Date: 2011-06-14 10:06:56 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110614100656-cx4oc7u426zn812z
Tags: 4.2-build2004-1
[ Samuel Thibault ]
* debian/control: Add liboss4-salsa2, liboss4-salsa-dev and
  liboss4-salsa-asound2 packages, equivalent to (and will replace) those from
  the oss-libsalsa package (Closes: #589127).
* debian/patches/liboss4-salsa.patch: New patch to rename libsalsa into
  liboss4-salsa to avoid conflicts in the archive for no good reason.
* debian/rules: Make in libOSSlib and libsalsa.
* debian/liboss4-salsa-dev.install, debian/liboss4-salsa2.install,
  debian/liboss4-salsa-asound2.links, debian/liboss4-salsa-dev.links:
  Install liboss4-salsa libraries like was done in the oss-libsalsa package.
* include-alsa: Add a copy of ALSA 1.0.5 headers: Cf ALSA_1.0.* symbols in
  libsalsa, this is the roughly supported version.
* debian/copyright: Update for new include-alsa files.
* alsa.pc: New file for compatibility with libasound-dev.
* debian/control:
  - Add Vcs-Browser and Vcs-Svn fields.
  - Use linux-any instead of the list of Linux archs (Closes: #604679).
  - Make dkms dependency linux-any only.
* debian/patches/hurd_iot.patch: New patch to fix soundcard.h usage in
  libsalsa on hurd-i386.
* debian/patches/libsalsa_fixes.patch: New patch to fix some printf usages
  and ioctl declaration in libsalsa.
* debian/patches/no_EBADE.patch: New patch to cope with hurd-i386 not having
  EBADE.
* debian/patches/CFLAGS.patch: New patch to make oss4 take debian/rules
  CFLAGS into account.
* debian/patches/snd_asoundlib_version.patch: New patch to add
  snd_asoundlib_version().
* debian/patches/generic_srccconf.patch: New patch to fix source
  configuration on unknown archs.

[ Romain Beauxis ]
* Fixed README.Debian to only mention dkms' modules.
* Switch to dpkg-source 3.0 (quilt) format
* Added DM-Upload-Allowed: yes

[ Sebastien NOEL ]
* New upstream release (Closes: #595298, #619272).
* Fix typo in initscript (Closes: #627149).
* debian/control: adjust linux-headers dependencies (Closes: #628879).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Purpose: USB abstraction structures and functions used by OSS
 
3
 *
 
4
 * OS dependent wrappers for various USB related kernel interfaces. Each
 
5
 * operating system will have it's private udi.c file which implements
 
6
 * the services defined here.
 
7
 */
 
8
/*
 
9
 *
 
10
 * This file is part of Open Sound System.
 
11
 *
 
12
 * Copyright (C) 4Front Technologies 1996-2008.
 
13
 *
 
14
 * This this source file is released under GPL v2 license (no other versions).
 
15
 * See the COPYING file included in the main directory of this source
 
16
 * distribution for the license terms and conditions.
 
17
 *
 
18
 */
 
19
 
 
20
/* typedef struct udi_usb_devc udi_usb_devc; // Moved to os.h */
 
21
 
 
22
typedef struct
 
23
{
 
24
  char *altsetting_labels;
 
25
  int default_altsetting;
 
26
  unsigned int altsetting_mask;
 
27
} ossusb_altsetting_def_t;
 
28
 
 
29
#define MAX_ALTSETTINGS 20
 
30
 
 
31
typedef struct udi_usb_devinfo
 
32
{
 
33
  int vendor, product;
 
34
  char *name;
 
35
  const ossusb_altsetting_def_t altsettings[MAX_ALTSETTINGS];
 
36
}
 
37
udi_usb_devinfo;
 
38
 
 
39
typedef struct
 
40
{
 
41
  void *(*attach) (udi_usb_devc * devc, oss_device_t * osdev);
 
42
  void (*disconnect) (void *devc);
 
43
} udi_usb_driver;
 
44
 
 
45
extern int udi_attach_usbdriver (oss_device_t * osdev,
 
46
                                 const udi_usb_devinfo * devlist,
 
47
                                 udi_usb_driver * driver);
 
48
extern void udi_unload_usbdriver (oss_device_t * osdev);
 
49
 
 
50
extern int udi_usb_trace;
 
51
extern int udi_usbdev_get_class (udi_usb_devc * usbdev);
 
52
extern int udi_usbdev_get_subclass (udi_usb_devc * usbdev);
 
53
extern int udi_usbdev_get_vendor (udi_usb_devc * usbdev);
 
54
extern int udi_usbdev_get_product (udi_usb_devc * usbdev);
 
55
extern int udi_usbdev_get_inum (udi_usb_devc * usbdev);
 
56
extern unsigned char *udi_usbdev_get_endpoint (udi_usb_devc * usbdev,
 
57
                                               int altsetting, int n,
 
58
                                               int *len);
 
59
#define EP_IN   0
 
60
#define EP_OUT  1
 
61
extern char *udi_usbdev_get_name (udi_usb_devc * usbdev);
 
62
extern char *udi_usbdev_get_altsetting_labels (udi_usb_devc * usbdev, int if_num, int *default_alt, unsigned int *mask);
 
63
extern char *udi_usbdev_get_string (udi_usb_devc * usbdev, int ix);
 
64
extern char *udi_usbdev_get_devpath (udi_usb_devc * usbdev);
 
65
extern int udi_usbdev_get_num_altsettings (udi_usb_devc * usbdev);
 
66
extern int udi_usbdev_get_usb_version (udi_usb_devc * usbdev);
 
67
extern unsigned char *udi_usbdev_get_altsetting (udi_usb_devc * usbdev, int n,
 
68
                                                 int *size);
 
69
extern int udi_usbdev_set_interface (udi_usb_devc * usbdev, int inum,
 
70
                                     int altset);
 
71
extern int udi_usb_snd_control_msg (udi_usb_devc * usbdev,
 
72
                                    unsigned int endpoint, unsigned char rq,
 
73
                                    unsigned char rqtype,
 
74
                                    unsigned short value,
 
75
                                    unsigned short index, void *buf, int len,
 
76
                                    int timeout);
 
77
extern int udi_usb_rcv_control_msg (udi_usb_devc * usbdev,
 
78
                                    unsigned int endpoint, unsigned char rq,
 
79
                                    unsigned char rqtype,
 
80
                                    unsigned short value,
 
81
                                    unsigned short index, void *buf, int len,
 
82
                                    int timeout);
 
83
 
 
84
typedef struct udi_usb_request udi_usb_request_t;       /* Opaque type */
 
85
typedef struct _udi_endpoint_handle_t udi_endpoint_handle_t;
 
86
 
 
87
extern udi_endpoint_handle_t *udi_open_endpoint (udi_usb_devc * usbdev,
 
88
                                                 void *ep_descr);
 
89
extern void udi_close_endpoint (udi_endpoint_handle_t * eph);
 
90
extern int udi_endpoint_get_num (udi_endpoint_handle_t * eph);
 
91
 
 
92
#define UDI_USBXFER_ISO_WRITE           1
 
93
#define UDI_USBXFER_ISO_READ            2
 
94
#define UDI_USBXFER_BULK_READ           3
 
95
#define UDI_USBXFER_BULK_WRITE          4
 
96
#define UDI_USBXFER_INTR_READ           5
 
97
typedef void (*udi_usb_complete_func_t) (udi_usb_request_t * request,
 
98
                                         void *arg);
 
99
 
 
100
extern udi_usb_request_t *udi_usb_alloc_request (udi_usb_devc * usbdev,
 
101
                                                 udi_endpoint_handle_t * eph,
 
102
                                                 int nframes, int xfer_type);
 
103
extern void udi_usb_free_request (udi_usb_request_t * request);
 
104
extern int udi_usb_submit_request (udi_usb_request_t * request,
 
105
                                   udi_usb_complete_func_t callback,
 
106
                                   void *callback_arg,
 
107
                                   udi_endpoint_handle_t * eph, int xfer_type,
 
108
                                   void *data, int data_len);
 
109
extern void udi_usb_cancel_request (udi_usb_request_t * request);
 
110
extern int udi_usb_request_actlen (udi_usb_request_t * request);
 
111
extern unsigned char *udi_usb_request_actdata (udi_usb_request_t * request);