~ubuntu-branches/ubuntu/saucy/hplip/saucy-proposed

« back to all changes in this revision

Viewing changes to io/hpmud/musb.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell, Till Kamppeter, Mark Purcell
  • Date: 2008-09-01 19:59:40 UTC
  • mfrom: (1.1.2 upstream) (2.1.60 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080901195940-saiiank2mbdrxsim
Tags: 2.8.6.b-1
[ Till Kamppeter ]
* New upstream release
   o HPLIP 2.8.6b, used 2.8.6.b as upstream version number so that this
     is considered newer than 2.8.6 and older than 2.8.7 for all binary
     packages.
   o Removal of prematurely introduced code (exact problems
     caused by that were not specified by HPLIP developers at HP).
* debian/patches/hp-makeuri-uri-only-output.dpatch: Fix URI-only output
  of hp-makeuri. This is required for system-config-printer to assign
  HPLIP CUPS backends to print queues (Fixes LP: #245199).
* debian/rules, debian/hpijs.version, debian/autogen.sh: Drop extra version
  number from HPIJS, now HPIJS and HPLIP have always the same version
  number.

[ Mark Purcell ]
* Upstream version 2.8.6 not to be distributed (use 2.8.6b or 2.8.7
  instead) (Closes: #494659)
  - Discussed on debian-release
* spurious version numbering for hpijs packages (Closes: #452574)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************\
 
2
 
 
3
  musb.h - USB support for multi-point transport driver
 
4
 
 
5
  (c) 2004-2007 Copyright Hewlett-Packard Development Company, LP
 
6
 
 
7
  Permission is hereby granted, free of charge, to any person obtaining a copy 
 
8
  of this software and associated documentation files (the "Software"), to deal 
 
9
  in the Software without restriction, including without limitation the rights 
 
10
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
 
11
  of the Software, and to permit persons to whom the Software is furnished to do 
 
12
  so, subject to the following conditions:
 
13
 
 
14
  The above copyright notice and this permission notice shall be included in all
 
15
  copies or substantial portions of the Software.
 
16
 
 
17
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
 
18
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
 
19
  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
 
20
  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
 
21
  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
 
22
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
23
 
 
24
\*****************************************************************************/
 
25
 
 
26
#ifndef _MUSB_H
 
27
#define _MUSB_H
 
28
 
 
29
#include <usb.h>
 
30
#include "hpmud.h"
 
31
#include "hpmudi.h"
 
32
 
 
33
#define LIBUSB_TIMEOUT 30000              /* milliseconds */
 
34
#define LIBUSB_CONTROL_REQ_TIMEOUT 5000
 
35
 
 
36
enum FD_ID
 
37
{
 
38
   FD_NA=0,
 
39
   FD_7_1_2,         /* bi-di interface */
 
40
   FD_7_1_3,         /* 1284.4 interface */
 
41
   FD_ff_1_1,        /* HP EWS interface */
 
42
   FD_ff_2_1,        /* HP Soap Scan interface */
 
43
   FD_ff_3_1,        /* HP Soap Fax interface */
 
44
   FD_ff_ff_ff,        /* HP dot4 interface */
 
45
   FD_ff_d4_0,        /* HP dot4 interface */
 
46
   MAX_FD
 
47
};
 
48
 
 
49
enum BRIGE_REG_ID
 
50
{
 
51
   ECRR=2,
 
52
   CCTR=3,
 
53
   ATAA=8
 
54
};
 
55
 
 
56
/* USB file descriptor, one for each USB protocol. */
 
57
typedef struct
 
58
{
 
59
   usb_dev_handle *hd;
 
60
   enum FD_ID fd;
 
61
   int config;
 
62
   int interface;
 
63
   int alt_setting;
 
64
 
 
65
   /* Write thread definitions. */
 
66
   int write_active;             /* 0=no, 1=yes */
 
67
   const void *write_buf;
 
68
   int write_size;
 
69
   int write_return;             /* return value, normally number bytes written */
 
70
   pthread_t tid;
 
71
   pthread_mutex_t mutex;
 
72
   pthread_cond_t write_done_cond;
 
73
 
 
74
   unsigned char ubuf[HPMUD_BUFFER_SIZE];           /* usb read packet buffer */     
 
75
   int uindex;
 
76
   int ucnt;             
 
77
} file_descriptor;
 
78
 
 
79
struct _mud_device;
 
80
struct _mud_channel;
 
81
 
 
82
extern struct _mud_device_vf __attribute__ ((visibility ("hidden"))) musb_mud_device_vf;
 
83
 
 
84
int __attribute__ ((visibility ("hidden"))) musb_write(int fd, const void *buf, int size, int usec_timout);    
 
85
int __attribute__ ((visibility ("hidden"))) musb_read(int fd, void *buf, int size, int usec_timout); 
 
86
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_open(struct _mud_device *pd);                 
 
87
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_close(struct _mud_device *pd);                 
 
88
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_get_device_id(struct _mud_device *pd, char *buf, int size, int *len);
 
89
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_get_device_status(struct _mud_device *pd, unsigned int *status);
 
90
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_channel_open(struct _mud_device *pd, const char *sn, HPMUD_CHANNEL *cd);
 
91
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_channel_close(struct _mud_device *pd, struct _mud_channel *pc);
 
92
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_channel_write(struct _mud_device *pd, struct _mud_channel *pc, const void *buf, int length, int timeout, int *bytes_wrote);
 
93
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_channel_read(struct _mud_device *pd, struct _mud_channel *pc, void *buf, int length, int timeout, int *bytes_read);
 
94
 
 
95
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_raw_channel_open(struct _mud_channel *pc);
 
96
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_raw_channel_close(struct _mud_channel *pc);
 
97
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_raw_channel_write(struct _mud_channel *pc, const void *buf, int length, int timeout, int *bytes_wrote);
 
98
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_raw_channel_read(struct _mud_channel *pc, void *buf, int length, int timeout, int *bytes_wrote);
 
99
 
 
100
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_comp_channel_open(struct _mud_channel *pc);
 
101
 
 
102
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_mlc_channel_open(struct _mud_channel *pc);
 
103
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_mlc_channel_close(struct _mud_channel *pc);
 
104
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_mlc_channel_write(struct _mud_channel *pc, const void *buf, int length, int timeout, int *bytes_wrote);
 
105
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_mlc_channel_read(struct _mud_channel *pc, void *buf, int length, int timeout, int *bytes_wrote);
 
106
 
 
107
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_dot4_channel_open(struct _mud_channel *pc);
 
108
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_dot4_channel_close(struct _mud_channel *pc);
 
109
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_dot4_channel_write(struct _mud_channel *pc, const void *buf, int length, int sec_timeout, int *bytes_wrote);
 
110
enum HPMUD_RESULT __attribute__ ((visibility ("hidden"))) musb_dot4_channel_read(struct _mud_channel *pc, void *buf, int length, int sec_timeout, int *bytes_read);
 
111
 
 
112
int __attribute__ ((visibility ("hidden"))) musb_probe_devices(char *lst, int lst_size, int *cnt);
 
113
int __attribute__ ((visibility ("hidden"))) power_up(struct _mud_device *pd, int fd);
 
114
 
 
115
#endif // _MUSB_H
 
116