]> git.karo-electronics.de Git - mv-sheeva.git/blob - drivers/usb/renesas_usbhs/pipe.c
usb: gadget: renesas_usbhs: move usbhsp_type() to usbhs_pipe_type()
[mv-sheeva.git] / drivers / usb / renesas_usbhs / pipe.c
1 /*
2  * Renesas USB driver
3  *
4  * Copyright (C) 2011 Renesas Solutions Corp.
5  * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
15  *
16  */
17 #include <linux/delay.h>
18 #include <linux/slab.h>
19 #include "./common.h"
20 #include "./pipe.h"
21
22 /*
23  *              macros
24  */
25 #define usbhsp_addr_offset(p)   ((usbhs_pipe_number(p) - 1) * 2)
26
27 #define usbhsp_flags_set(p, f)  ((p)->flags |=  USBHS_PIPE_FLAGS_##f)
28 #define usbhsp_flags_clr(p, f)  ((p)->flags &= ~USBHS_PIPE_FLAGS_##f)
29 #define usbhsp_flags_has(p, f)  ((p)->flags &   USBHS_PIPE_FLAGS_##f)
30 #define usbhsp_flags_init(p)    do {(p)->flags = 0; } while (0)
31
32 /*
33  * for debug
34  */
35 static char *usbhsp_pipe_name[] = {
36         [USB_ENDPOINT_XFER_CONTROL]     = "DCP",
37         [USB_ENDPOINT_XFER_BULK]        = "BULK",
38         [USB_ENDPOINT_XFER_INT]         = "INT",
39         [USB_ENDPOINT_XFER_ISOC]        = "ISO",
40 };
41
42 /*
43  *              usb request functions
44  */
45 void usbhs_usbreq_get_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req)
46 {
47         u16 val;
48
49         val = usbhs_read(priv, USBREQ);
50         req->bRequest           = (val >> 8) & 0xFF;
51         req->bRequestType       = (val >> 0) & 0xFF;
52
53         req->wValue     = usbhs_read(priv, USBVAL);
54         req->wIndex     = usbhs_read(priv, USBINDX);
55         req->wLength    = usbhs_read(priv, USBLENG);
56 }
57
58 void usbhs_usbreq_set_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req)
59 {
60         usbhs_write(priv, USBREQ,  (req->bRequest << 8) | req->bRequestType);
61         usbhs_write(priv, USBVAL,  req->wValue);
62         usbhs_write(priv, USBINDX, req->wIndex);
63         usbhs_write(priv, USBLENG, req->wLength);
64 }
65
66 /*
67  *              DCPCTR/PIPEnCTR functions
68  */
69 static void usbhsp_pipectrl_set(struct usbhs_pipe *pipe, u16 mask, u16 val)
70 {
71         struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
72         int offset = usbhsp_addr_offset(pipe);
73
74         if (usbhs_pipe_is_dcp(pipe))
75                 usbhs_bset(priv, DCPCTR, mask, val);
76         else
77                 usbhs_bset(priv, PIPEnCTR + offset, mask, val);
78 }
79
80 static u16 usbhsp_pipectrl_get(struct usbhs_pipe *pipe)
81 {
82         struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
83         int offset = usbhsp_addr_offset(pipe);
84
85         if (usbhs_pipe_is_dcp(pipe))
86                 return usbhs_read(priv, DCPCTR);
87         else
88                 return usbhs_read(priv, PIPEnCTR + offset);
89 }
90
91 /*
92  *              DCP/PIPE functions
93  */
94 static void __usbhsp_pipe_xxx_set(struct usbhs_pipe *pipe,
95                                   u16 dcp_reg, u16 pipe_reg,
96                                   u16 mask, u16 val)
97 {
98         struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
99
100         if (usbhs_pipe_is_dcp(pipe))
101                 usbhs_bset(priv, dcp_reg, mask, val);
102         else
103                 usbhs_bset(priv, pipe_reg, mask, val);
104 }
105
106 /*
107  *              DCPCFG/PIPECFG functions
108  */
109 static void usbhsp_pipe_cfg_set(struct usbhs_pipe *pipe, u16 mask, u16 val)
110 {
111         __usbhsp_pipe_xxx_set(pipe, DCPCFG, PIPECFG, mask, val);
112 }
113
114 /*
115  *              PIPEBUF
116  */
117 static void usbhsp_pipe_buf_set(struct usbhs_pipe *pipe, u16 mask, u16 val)
118 {
119         if (usbhs_pipe_is_dcp(pipe))
120                 return;
121
122         __usbhsp_pipe_xxx_set(pipe, 0, PIPEBUF, mask, val);
123 }
124
125 /*
126  *              DCPMAXP/PIPEMAXP
127  */
128 static void usbhsp_pipe_maxp_set(struct usbhs_pipe *pipe, u16 mask, u16 val)
129 {
130         __usbhsp_pipe_xxx_set(pipe, DCPMAXP, PIPEMAXP, mask, val);
131 }
132
133 /*
134  *              pipe control functions
135  */
136 static void usbhsp_pipe_select(struct usbhs_pipe *pipe)
137 {
138         struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
139
140         /*
141          * On pipe, this is necessary before
142          * accesses to below registers.
143          *
144          * PIPESEL      : usbhsp_pipe_select
145          * PIPECFG      : usbhsp_pipe_cfg_xxx
146          * PIPEBUF      : usbhsp_pipe_buf_xxx
147          * PIPEMAXP     : usbhsp_pipe_maxp_xxx
148          * PIPEPERI
149          */
150
151         /*
152          * if pipe is dcp, no pipe is selected.
153          * it is no problem, because dcp have its register
154          */
155         usbhs_write(priv, PIPESEL, 0xF & usbhs_pipe_number(pipe));
156 }
157
158 static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe)
159 {
160         struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
161         int timeout = 1024;
162         u16 val;
163
164         /*
165          * make sure....
166          *
167          * Modify these bits when CSSTS = 0, PID = NAK, and no pipe number is
168          * specified by the CURPIPE bits.
169          * When changing the setting of this bit after changing
170          * the PID bits for the selected pipe from BUF to NAK,
171          * check that CSSTS = 0 and PBUSY = 0.
172          */
173
174         /*
175          * CURPIPE bit = 0
176          *
177          * see also
178          *  "Operation"
179          *  - "Pipe Control"
180          *   - "Pipe Control Registers Switching Procedure"
181          */
182         usbhs_write(priv, CFIFOSEL, 0);
183         usbhs_pipe_disable(pipe);
184
185         do {
186                 val  = usbhsp_pipectrl_get(pipe);
187                 val &= CSSTS | PID_MASK;
188                 if (!val)
189                         return 0;
190
191                 udelay(10);
192
193         } while (timeout--);
194
195         return -EBUSY;
196 }
197
198 int usbhs_pipe_is_accessible(struct usbhs_pipe *pipe)
199 {
200         u16 val;
201
202         val = usbhsp_pipectrl_get(pipe);
203         if (val & BSTS)
204                 return 0;
205
206         return -EBUSY;
207 }
208
209 /*
210  *              PID ctrl
211  */
212 static void __usbhsp_pid_try_nak_if_stall(struct usbhs_pipe *pipe)
213 {
214         u16 pid = usbhsp_pipectrl_get(pipe);
215
216         pid &= PID_MASK;
217
218         /*
219          * see
220          * "Pipe n Control Register" - "PID"
221          */
222         switch (pid) {
223         case PID_STALL11:
224                 usbhsp_pipectrl_set(pipe, PID_MASK, PID_STALL10);
225                 /* fall-through */
226         case PID_STALL10:
227                 usbhsp_pipectrl_set(pipe, PID_MASK, PID_NAK);
228         }
229 }
230
231 void usbhs_pipe_disable(struct usbhs_pipe *pipe)
232 {
233         int timeout = 1024;
234         u16 val;
235
236         /* see "Pipe n Control Register" - "PID" */
237         __usbhsp_pid_try_nak_if_stall(pipe);
238
239         usbhsp_pipectrl_set(pipe, PID_MASK, PID_NAK);
240
241         do {
242                 val  = usbhsp_pipectrl_get(pipe);
243                 val &= PBUSY;
244                 if (!val)
245                         break;
246
247                 udelay(10);
248         } while (timeout--);
249 }
250
251 void usbhs_pipe_enable(struct usbhs_pipe *pipe)
252 {
253         /* see "Pipe n Control Register" - "PID" */
254         __usbhsp_pid_try_nak_if_stall(pipe);
255
256         usbhsp_pipectrl_set(pipe, PID_MASK, PID_BUF);
257 }
258
259 void usbhs_pipe_stall(struct usbhs_pipe *pipe)
260 {
261         u16 pid = usbhsp_pipectrl_get(pipe);
262
263         pid &= PID_MASK;
264
265         /*
266          * see
267          * "Pipe n Control Register" - "PID"
268          */
269         switch (pid) {
270         case PID_NAK:
271                 usbhsp_pipectrl_set(pipe, PID_MASK, PID_STALL10);
272                 break;
273         case PID_BUF:
274                 usbhsp_pipectrl_set(pipe, PID_MASK, PID_STALL11);
275                 break;
276         }
277 }
278
279 /*
280  *              pipe setup
281  */
282 static int usbhsp_possible_double_buffer(struct usbhs_pipe *pipe)
283 {
284         /*
285          * only ISO / BULK pipe can use double buffer
286          */
287         if (usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_BULK) ||
288             usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_ISOC))
289                 return 1;
290
291         return 0;
292 }
293
294 static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe,
295                                 int is_host,
296                                 int dir_in)
297 {
298         u16 type = 0;
299         u16 bfre = 0;
300         u16 dblb = 0;
301         u16 cntmd = 0;
302         u16 dir = 0;
303         u16 epnum = 0;
304         u16 shtnak = 0;
305         u16 type_array[] = {
306                 [USB_ENDPOINT_XFER_BULK] = TYPE_BULK,
307                 [USB_ENDPOINT_XFER_INT]  = TYPE_INT,
308                 [USB_ENDPOINT_XFER_ISOC] = TYPE_ISO,
309         };
310         int is_double = usbhsp_possible_double_buffer(pipe);
311
312         if (usbhs_pipe_is_dcp(pipe))
313                 return -EINVAL;
314
315         /*
316          * PIPECFG
317          *
318          * see
319          *  - "Register Descriptions" - "PIPECFG" register
320          *  - "Features"  - "Pipe configuration"
321          *  - "Operation" - "Pipe Control"
322          */
323
324         /* TYPE */
325         type = type_array[usbhs_pipe_type(pipe)];
326
327         /* BFRE */
328         if (usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_ISOC) ||
329             usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_BULK))
330                 bfre = 0; /* FIXME */
331
332         /* DBLB */
333         if (usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_ISOC) ||
334             usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_BULK))
335                 dblb = (is_double) ? DBLB : 0;
336
337         /* CNTMD */
338         if (usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_BULK))
339                 cntmd = 0; /* FIXME */
340
341         /* DIR */
342         if (dir_in)
343                 usbhsp_flags_set(pipe, IS_DIR_HOST);
344
345         if ((is_host  && !dir_in) ||
346             (!is_host && dir_in))
347                 dir |= DIR_OUT;
348
349         if (!dir)
350                 usbhsp_flags_set(pipe, IS_DIR_IN);
351
352         /* SHTNAK */
353         if (usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_BULK) &&
354             !dir)
355                 shtnak = SHTNAK;
356
357         /* EPNUM */
358         epnum = 0; /* see usbhs_pipe_config_update() */
359
360         return  type    |
361                 bfre    |
362                 dblb    |
363                 cntmd   |
364                 dir     |
365                 shtnak  |
366                 epnum;
367 }
368
369 static u16 usbhsp_setup_pipebuff(struct usbhs_pipe *pipe)
370 {
371         struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
372         struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
373         struct device *dev = usbhs_priv_to_dev(priv);
374         int pipe_num = usbhs_pipe_number(pipe);
375         int is_double = usbhsp_possible_double_buffer(pipe);
376         u16 buff_size;
377         u16 bufnmb;
378         u16 bufnmb_cnt;
379
380         /*
381          * PIPEBUF
382          *
383          * see
384          *  - "Register Descriptions" - "PIPEBUF" register
385          *  - "Features"  - "Pipe configuration"
386          *  - "Operation" - "FIFO Buffer Memory"
387          *  - "Operation" - "Pipe Control"
388          *
389          * ex) if pipe6 - pipe9 are USB_ENDPOINT_XFER_INT (SH7724)
390          *
391          * BUFNMB:      PIPE
392          * 0:           pipe0 (DCP 256byte)
393          * 1:           -
394          * 2:           -
395          * 3:           -
396          * 4:           pipe6 (INT 64byte)
397          * 5:           pipe7 (INT 64byte)
398          * 6:           pipe8 (INT 64byte)
399          * 7:           pipe9 (INT 64byte)
400          * 8 - xx:      free (for BULK, ISOC)
401          */
402
403         /*
404          * FIXME
405          *
406          * it doesn't have good buffer allocator
407          *
408          * DCP : 256 byte
409          * BULK: 512 byte
410          * INT :  64 byte
411          * ISOC: 512 byte
412          */
413         if (usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_CONTROL))
414                 buff_size = 256;
415         else if (usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_INT))
416                 buff_size = 64;
417         else
418                 buff_size = 512;
419
420         /* change buff_size to register value */
421         bufnmb_cnt = (buff_size / 64) - 1;
422
423         /* BUFNMB has been reserved for INT pipe
424          * see above */
425         if (usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_INT)) {
426                 bufnmb = pipe_num - 2;
427         } else {
428                 bufnmb = info->bufnmb_last;
429                 info->bufnmb_last += bufnmb_cnt + 1;
430
431                 /*
432                  * double buffer
433                  */
434                 if (is_double)
435                         info->bufnmb_last += bufnmb_cnt + 1;
436         }
437
438         dev_dbg(dev, "pipe : %d : buff_size 0x%x: bufnmb 0x%x\n",
439                 pipe_num, buff_size, bufnmb);
440
441         return  (0x1f & bufnmb_cnt)     << 10 |
442                 (0xff & bufnmb)         <<  0;
443 }
444
445 void usbhs_pipe_config_update(struct usbhs_pipe *pipe, u16 epnum, u16 maxp)
446 {
447         usbhsp_pipe_barrier(pipe);
448
449         pipe->maxp = maxp;
450
451         usbhsp_pipe_select(pipe);
452         usbhsp_pipe_maxp_set(pipe, 0xFFFF, maxp);
453
454         if (!usbhs_pipe_is_dcp(pipe))
455                 usbhsp_pipe_cfg_set(pipe,  0x000F, epnum);
456 }
457
458 /*
459  *              pipe control
460  */
461 int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe)
462 {
463         /*
464          * see
465          *      usbhs_pipe_config_update()
466          *      usbhs_dcp_malloc()
467          */
468         return pipe->maxp;
469 }
470
471 int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe)
472 {
473         return usbhsp_flags_has(pipe, IS_DIR_IN);
474 }
475
476 int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe)
477 {
478         return usbhsp_flags_has(pipe, IS_DIR_HOST);
479 }
480
481 void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe)
482 {
483         usbhsp_pipectrl_set(pipe, SQCLR, SQCLR);
484 }
485
486 void usbhs_pipe_clear(struct usbhs_pipe *pipe)
487 {
488         usbhsp_pipectrl_set(pipe, ACLRM, ACLRM);
489         usbhsp_pipectrl_set(pipe, ACLRM, 0);
490 }
491
492 static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type)
493 {
494         struct usbhs_pipe *pos, *pipe;
495         int i;
496
497         /*
498          * find target pipe
499          */
500         pipe = NULL;
501         usbhs_for_each_pipe_with_dcp(pos, priv, i) {
502                 if (!usbhs_pipe_type_is(pos, type))
503                         continue;
504                 if (usbhsp_flags_has(pos, IS_USED))
505                         continue;
506
507                 pipe = pos;
508                 break;
509         }
510
511         if (!pipe)
512                 return NULL;
513
514         /*
515          * initialize pipe flags
516          */
517         usbhsp_flags_init(pipe);
518         usbhsp_flags_set(pipe, IS_USED);
519
520         return pipe;
521 }
522
523 void usbhs_pipe_init(struct usbhs_priv *priv,
524                      void (*done)(struct usbhs_pkt *pkt),
525                      int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map))
526 {
527         struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
528         struct device *dev = usbhs_priv_to_dev(priv);
529         struct usbhs_pipe *pipe;
530         int i;
531
532         if (!done) {
533                 dev_err(dev, "no done function\n");
534                 return;
535         }
536
537         /*
538          * FIXME
539          *
540          * driver needs good allocator.
541          *
542          * find first free buffer area (BULK, ISOC)
543          * (DCP, INT area is fixed)
544          *
545          * buffer number 0 - 3 have been reserved for DCP
546          * see
547          *      usbhsp_to_bufnmb
548          */
549         info->bufnmb_last = 4;
550         usbhs_for_each_pipe_with_dcp(pipe, priv, i) {
551                 if (usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_INT))
552                         info->bufnmb_last++;
553
554                 usbhsp_flags_init(pipe);
555                 pipe->fifo = NULL;
556                 pipe->mod_private = NULL;
557                 INIT_LIST_HEAD(&pipe->list);
558
559                 /* pipe force init */
560                 usbhs_pipe_clear(pipe);
561         }
562
563         info->done = done;
564         info->dma_map_ctrl = dma_map_ctrl;
565 }
566
567 struct usbhs_pipe *usbhs_pipe_malloc(struct usbhs_priv *priv,
568                                      int endpoint_type,
569                                      int dir_in)
570 {
571         struct device *dev = usbhs_priv_to_dev(priv);
572         struct usbhs_mod *mod = usbhs_mod_get_current(priv);
573         struct usbhs_pipe *pipe;
574         int is_host = usbhs_mod_is_host(priv, mod);
575         int ret;
576         u16 pipecfg, pipebuf;
577
578         pipe = usbhsp_get_pipe(priv, endpoint_type);
579         if (!pipe) {
580                 dev_err(dev, "can't get pipe (%s)\n",
581                         usbhsp_pipe_name[endpoint_type]);
582                 return NULL;
583         }
584
585         INIT_LIST_HEAD(&pipe->list);
586
587         usbhs_pipe_disable(pipe);
588
589         /* make sure pipe is not busy */
590         ret = usbhsp_pipe_barrier(pipe);
591         if (ret < 0) {
592                 dev_err(dev, "pipe setup failed %d\n", usbhs_pipe_number(pipe));
593                 return NULL;
594         }
595
596         pipecfg  = usbhsp_setup_pipecfg(pipe, is_host, dir_in);
597         pipebuf  = usbhsp_setup_pipebuff(pipe);
598
599         usbhsp_pipe_select(pipe);
600         usbhsp_pipe_cfg_set(pipe, 0xFFFF, pipecfg);
601         usbhsp_pipe_buf_set(pipe, 0xFFFF, pipebuf);
602
603         usbhs_pipe_clear_sequence(pipe);
604
605         dev_dbg(dev, "enable pipe %d : %s (%s)\n",
606                 usbhs_pipe_number(pipe),
607                 usbhsp_pipe_name[endpoint_type],
608                 usbhs_pipe_is_dir_in(pipe) ? "in" : "out");
609
610         /*
611          * epnum / maxp are still not set to this pipe.
612          * call usbhs_pipe_config_update() after this function !!
613          */
614
615         return pipe;
616 }
617
618 void usbhs_pipe_select_fifo(struct usbhs_pipe *pipe, struct usbhs_fifo *fifo)
619 {
620         if (pipe->fifo)
621                 pipe->fifo->pipe = NULL;
622
623         pipe->fifo = fifo;
624
625         if (fifo)
626                 fifo->pipe = pipe;
627 }
628
629
630 /*
631  *              dcp control
632  */
633 struct usbhs_pipe *usbhs_dcp_malloc(struct usbhs_priv *priv)
634 {
635         struct usbhs_pipe *pipe;
636
637         pipe = usbhsp_get_pipe(priv, USB_ENDPOINT_XFER_CONTROL);
638         if (!pipe)
639                 return NULL;
640
641         INIT_LIST_HEAD(&pipe->list);
642
643         /*
644          * call usbhs_pipe_config_update() after this function !!
645          */
646
647         return pipe;
648 }
649
650 void usbhs_dcp_control_transfer_done(struct usbhs_pipe *pipe)
651 {
652         WARN_ON(!usbhs_pipe_is_dcp(pipe));
653
654         usbhs_pipe_enable(pipe);
655         usbhsp_pipectrl_set(pipe, CCPL, CCPL);
656 }
657
658 /*
659  *              pipe module function
660  */
661 int usbhs_pipe_probe(struct usbhs_priv *priv)
662 {
663         struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
664         struct usbhs_pipe *pipe;
665         struct device *dev = usbhs_priv_to_dev(priv);
666         u32 *pipe_type = usbhs_get_dparam(priv, pipe_type);
667         int pipe_size = usbhs_get_dparam(priv, pipe_size);
668         int i;
669
670         /* This driver expects 1st pipe is DCP */
671         if (pipe_type[0] != USB_ENDPOINT_XFER_CONTROL) {
672                 dev_err(dev, "1st PIPE is not DCP\n");
673                 return -EINVAL;
674         }
675
676         info->pipe = kzalloc(sizeof(struct usbhs_pipe) * pipe_size, GFP_KERNEL);
677         if (!info->pipe) {
678                 dev_err(dev, "Could not allocate pipe\n");
679                 return -ENOMEM;
680         }
681
682         info->size = pipe_size;
683
684         /*
685          * init pipe
686          */
687         usbhs_for_each_pipe_with_dcp(pipe, priv, i) {
688                 pipe->priv = priv;
689
690                 usbhs_pipe_type(pipe) =
691                         pipe_type[i] & USB_ENDPOINT_XFERTYPE_MASK;
692
693                 dev_dbg(dev, "pipe %x\t: %s\n",
694                         i, usbhsp_pipe_name[pipe_type[i]]);
695         }
696
697         return 0;
698 }
699
700 void usbhs_pipe_remove(struct usbhs_priv *priv)
701 {
702         struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
703
704         kfree(info->pipe);
705 }