• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/drivers/media/video/pvrusb2/

Lines Matching refs:mp

43 static void pvr2_context_set_notify(struct pvr2_context *mp, int fl)
48 if (!mp->notify_flag) {
50 mp->notify_prev = pvr2_context_notify_last;
51 mp->notify_next = NULL;
52 pvr2_context_notify_last = mp;
53 if (mp->notify_prev) {
54 mp->notify_prev->notify_next = mp;
56 pvr2_context_notify_first = mp;
58 mp->notify_flag = !0;
61 if (mp->notify_flag) {
62 mp->notify_flag = 0;
63 if (mp->notify_next) {
64 mp->notify_next->notify_prev = mp->notify_prev;
66 pvr2_context_notify_last = mp->notify_prev;
68 if (mp->notify_prev) {
69 mp->notify_prev->notify_next = mp->notify_next;
71 pvr2_context_notify_first = mp->notify_next;
80 static void pvr2_context_destroy(struct pvr2_context *mp)
82 pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context %p (destroy)",mp);
83 if (mp->hdw) pvr2_hdw_destroy(mp->hdw);
84 pvr2_context_set_notify(mp, 0);
86 if (mp->exist_next) {
87 mp->exist_next->exist_prev = mp->exist_prev;
89 pvr2_context_exist_last = mp->exist_prev;
91 if (mp->exist_prev) {
92 mp->exist_prev->exist_next = mp->exist_next;
94 pvr2_context_exist_first = mp->exist_next;
102 kfree(mp);
106 static void pvr2_context_notify(struct pvr2_context *mp)
108 pvr2_context_set_notify(mp,!0);
112 static void pvr2_context_check(struct pvr2_context *mp)
116 "pvr2_context %p (notify)", mp);
117 if (!mp->initialized_flag && !mp->disconnect_flag) {
118 mp->initialized_flag = !0;
120 "pvr2_context %p (initialize)", mp);
122 if (pvr2_hdw_initialize(mp->hdw,
124 mp)) {
125 mp->video_stream.stream =
126 pvr2_hdw_get_video_stream(mp->hdw);
130 if (mp->setup_func) mp->setup_func(mp);
134 mp);
143 for (ch1 = mp->mc_first; ch1; ch1 = ch2) {
148 if (mp->disconnect_flag && !mp->mc_first) {
150 pvr2_context_destroy(mp);
164 struct pvr2_context *mp;
169 while ((mp = pvr2_context_notify_first) != NULL) {
170 pvr2_context_set_notify(mp, 0);
171 pvr2_context_check(mp);
219 struct pvr2_context *mp = NULL;
220 mp = kzalloc(sizeof(*mp),GFP_KERNEL);
221 if (!mp) goto done;
222 pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context %p (create)",mp);
223 mp->setup_func = setup_func;
224 mutex_init(&mp->mutex);
226 mp->exist_prev = pvr2_context_exist_last;
227 mp->exist_next = NULL;
228 pvr2_context_exist_last = mp;
229 if (mp->exist_prev) {
230 mp->exist_prev->exist_next = mp;
232 pvr2_context_exist_first = mp;
235 mp->hdw = pvr2_hdw_create(intf,devid);
236 if (!mp->hdw) {
237 pvr2_context_destroy(mp);
238 mp = NULL;
241 pvr2_context_set_notify(mp, !0);
243 return mp;
247 static void pvr2_context_reset_input_limits(struct pvr2_context *mp)
251 struct pvr2_hdw *hdw = mp->hdw;
254 for (cp = mp->mc_first; cp; cp = cp->mc_next) {
263 static void pvr2_context_enter(struct pvr2_context *mp)
265 mutex_lock(&mp->mutex);
269 static void pvr2_context_exit(struct pvr2_context *mp)
272 if (!(mp->mc_first || !mp->disconnect_flag)) {
275 mutex_unlock(&mp->mutex);
276 if (destroy_flag) pvr2_context_notify(mp);
280 void pvr2_context_disconnect(struct pvr2_context *mp)
282 pvr2_hdw_disconnect(mp->hdw);
283 mp->disconnect_flag = !0;
284 pvr2_context_notify(mp);
288 void pvr2_channel_init(struct pvr2_channel *cp,struct pvr2_context *mp)
290 pvr2_context_enter(mp);
291 cp->hdw = mp->hdw;
292 cp->mc_head = mp;
294 cp->mc_prev = mp->mc_last;
295 if (mp->mc_last) {
296 mp->mc_last->mc_next = cp;
298 mp->mc_first = cp;
300 mp->mc_last = cp;
301 pvr2_context_exit(mp);
316 struct pvr2_context *mp = cp->mc_head;
317 pvr2_context_enter(mp);
320 pvr2_context_reset_input_limits(mp);
324 mp->mc_last = cp->mc_prev;
329 mp->mc_first = cp->mc_next;
332 pvr2_context_exit(mp);