Print this page
8634 epoll fails to wake on certain edge-triggered conditions
8635 epoll should not emit POLLNVAL
8636 recursive epoll should emit EPOLLRDNORM
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/1394/targets/dcam1394/dcam.h
+++ new/usr/src/uts/common/sys/1394/targets/dcam1394/dcam.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
|
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 + * Copyright 2017 Joyent, Inc.
25 26 */
26 27
27 28 #ifndef _SYS_1394_TARGETS_DCAM1394_DCAM_H
28 29 #define _SYS_1394_TARGETS_DCAM1394_DCAM_H
29 30
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 31 #include <sys/modctl.h>
33 32 #include <sys/ksynch.h>
34 33 #include <sys/types.h>
35 34 #include <sys/dditypes.h>
36 35 #include <sys/1394/t1394.h>
37 36 #include <sys/dcam/dcam1394_io.h>
38 37
39 38 #ifdef __cplusplus
40 39 extern "C" {
41 40 #endif
42 41
43 42 #define ILP32_PTR_SIZE 4 /* caller's data model type */
44 43 #define LP64_PTR_SIZE 8
45 44
46 45 #define DCAM_POWER_OFF 0 /* power management state */
47 46 #define DCAM_POWER_ON 1
48 47
49 48 #define DCAM1394_MINOR_CTRL 0x80 /* this is the control device */
50 49
51 50 #define DCAM1394_FLAG_ATTACH_COMPLETE 0x1 /* dcam_attach() is complete */
52 51 #define DCAM1394_FLAG_OPEN 0x2 /* driver is open */
53 52 #define DCAM1394_FLAG_OPEN_CAPTURE 0x4 /* device is open for capture */
54 53 #define DCAM1394_FLAG_OPEN_CONTROL 0x8 /* device is open for control */
55 54 #define DCAM1394_FLAG_FRAME_RCV_INIT 0x10
56 55 #define DCAM1394_FLAG_FRAME_RCVING 0x20
57 56 #define DCAM1394_FLAG_READ_REQ_PROC 0x40
58 57 #define DCAM1394_FLAG_READ_REQ_INVALID 0x80
59 58
60 59 #define IS_VALID 0x1
61 60 #define IS_PRESENT 0x2
62 61 #define CAP_GET 0x4
63 62 #define CAP_SET 0x8
64 63 #define CAP_CTRL_SET 0x10
65 64
66 65 #define MAX_STR_LEN 50
67 66
68 67 #define DEV_TO_INSTANCE(d) (getminor(d) & 0x7f)
69 68
70 69 typedef uint_t
71 70 dcam1394_param_attr_t[DCAM1394_NUM_PARAM][DCAM1394_NUM_SUBPARAM];
72 71
73 72 typedef struct buff_info_s {
74 73 uint_t vid_mode;
75 74 unsigned int seq_num;
76 75 hrtime_t timestamp;
77 76 caddr_t kaddr_p; /* kernel data buffer */
78 77 ddi_dma_handle_t dma_handle; /* bind handle */
79 78 ddi_acc_handle_t data_acc_handle; /* acc handle */
80 79 ddi_dma_cookie_t dma_cookie; /* cookie */
81 80 size_t real_len; /* mem len */
82 81 uint_t dma_cookie_count; /* cookie count */
83 82 } buff_info_t;
84 83
85 84 #define MAX_NUM_READ_PTRS 1
86 85
87 86 typedef struct ring_buff_s {
88 87 size_t num_buffs;
89 88 size_t buff_num_bytes;
90 89 buff_info_t *buff_info_array_p;
91 90 int num_read_ptrs;
92 91 int read_ptr_incr_val;
93 92 size_t read_ptr_pos[MAX_NUM_READ_PTRS];
94 93 uint_t status[MAX_NUM_READ_PTRS];
95 94 size_t write_ptr_pos;
96 95 } ring_buff_t;
97 96
98 97 typedef struct dcam_state_s {
99 98 dev_info_t *dip;
100 99 int instance;
101 100 int usr_model;
102 101 t1394_handle_t sl_handle;
103 102 t1394_attachinfo_t attachinfo;
104 103 t1394_targetinfo_t targetinfo;
105 104 t1394_isoch_singleinfo_t sii;
106 105 t1394_isoch_single_out_t sii_output_args;
107 106 t1394_isoch_single_handle_t sii_hdl;
108 107 t1394_isoch_dma_handle_t isoch_handle;
109 108 kmutex_t softc_mutex;
110 109 kmutex_t dcam_frame_is_done_mutex;
111 110 dcam1394_param_attr_t param_attr;
112 111
|
↓ open down ↓ |
71 lines elided |
↑ open up ↑ |
113 112 ixl1394_command_t *ixlp;
114 113
115 114 ring_buff_t *ring_buff_p;
116 115 unsigned int seq_count;
117 116 uint_t reader_flags[MAX_NUM_READ_PTRS];
118 117 uint_t flags;
119 118 int cur_vid_mode;
120 119 int cur_frame_rate;
121 120 int cur_ring_buff_capacity;
122 121 int param_status;
123 - struct pollhead dcam_pollhead;
124 122 int camera_online;
125 123 int pm_open_count;
126 124 int pm_cable_power;
127 125 int suspended;
128 126 ddi_callback_id_t event_id;
129 127 } dcam_state_t;
130 128
131 129 int _init(void);
132 130 int _info(struct modinfo *modinfop);
133 131 int _fini(void);
134 132
135 133 int dcam_attach(dev_info_t *dip, ddi_attach_cmd_t cmd);
136 134 int dcam_power(dev_info_t *dip, int component, int level);
137 135 int dcam_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **result);
138 136 int dcam_identify(dev_info_t *dip);
139 137 int dcam_detach(dev_info_t *dip, ddi_detach_cmd_t cmd);
140 138 int dcam_open(dev_t *devp, int flag, int otyp, cred_t *credp);
141 139 int dcam_close(dev_t dev, int flags, int otyp, cred_t *credp);
142 140 int dcam_read(dev_t dev, struct uio *uio, cred_t *credp);
143 141 int dcam_write(dev_t dev, struct uio *uio, cred_t *credp);
144 142 int dcam_mmap(dev_t dev, off_t off, int prot);
145 143 int dcam_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len,
146 144 size_t *maplen, uint_t model);
147 145 int dcam_ioctl(dev_t dev, int cmd, intptr_t arg, int mode,
148 146 cred_t *credp, int *rvalp);
149 147 int dcam_chpoll(dev_t dev, short events, int anyyet, short *reventsp,
150 148 struct pollhead **phpp);
151 149 int dcam_intr(caddr_t dcam_softc_p);
152 150 void dcam_bus_reset_notify(dev_info_t *dip, ddi_eventcookie_t ev_cookie,
153 151 void *arg, void *impl_data);
154 152
155 153
156 154 ring_buff_t *ring_buff_create(dcam_state_t *softc_p, size_t num_buffs,
157 155 size_t buff_num_bytes);
158 156 void ring_buff_free(dcam_state_t *softc_p, ring_buff_t *ring_buff_p);
159 157 int ring_buff_reader_add(ring_buff_t *ring_buff_p);
160 158 int ring_buff_reader_remove(ring_buff_t *ring_buff_p, int reader_id);
161 159 buff_info_t *ring_buff_read_ptr_buff_get(ring_buff_t *ring_buff_p, int
162 160 reader_id);
163 161 size_t ring_buff_read_ptr_pos_get(ring_buff_t *ring_buff_p, int read_ptr_id);
164 162 void ring_buff_read_ptr_incr(ring_buff_t *ring_buff_p, int read_ptr_id);
165 163 size_t ring_buff_write_ptr_pos_get(ring_buff_t *ring_buff_p);
166 164 void ring_buff_write_ptr_incr(ring_buff_t *ring_buff_p);
167 165 int dcam_frame_rcv_stop(dcam_state_t *softc_p);
168 166 int dcam1394_ioctl_frame_rcv_start(dcam_state_t *softc_p);
169 167
170 168 #ifdef __cplusplus
171 169 }
172 170 #endif
173 171
174 172 #endif /* _SYS_1394_TARGETS_DCAM1394_DCAM_H */
|
↓ open down ↓ |
41 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX