Deleted Added
full compact
firewire.c (124251) firewire.c (125238)
1/*
2 * Copyright (c) 2003 Hidetoshi Shimokawa
3 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
1/*
2 * Copyright (c) 2003 Hidetoshi Shimokawa
3 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 * $FreeBSD: head/sys/dev/firewire/firewire.c 124251 2004-01-08 14:58:09Z simokawa $
34 * $FreeBSD: head/sys/dev/firewire/firewire.c 125238 2004-01-30 14:28:11Z simokawa $
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/types.h>
41
42#include <sys/kernel.h>

--- 32 unchanged lines hidden (view full) ---

75
76MALLOC_DEFINE(M_FW, "firewire", "FireWire");
77MALLOC_DEFINE(M_FWXFER, "fw_xfer", "XFER/FireWire");
78
79#define FW_MAXASYRTY 4
80
81devclass_t firewire_devclass;
82
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/types.h>
41
42#include <sys/kernel.h>

--- 32 unchanged lines hidden (view full) ---

75
76MALLOC_DEFINE(M_FW, "firewire", "FireWire");
77MALLOC_DEFINE(M_FWXFER, "fw_xfer", "XFER/FireWire");
78
79#define FW_MAXASYRTY 4
80
81devclass_t firewire_devclass;
82
83static int firewire_match (device_t);
83static void firewire_identify (driver_t *, device_t);
84static int firewire_probe (device_t);
84static int firewire_attach (device_t);
85static int firewire_detach (device_t);
86static int firewire_resume (device_t);
87#if 0
88static int firewire_shutdown (device_t);
89#endif
90static device_t firewire_add_child (device_t, int, const char *, int);
91static void fw_try_bmr (void *);

--- 8 unchanged lines hidden (view full) ---

100static void fw_vmaccess (struct fw_xfer *);
101#endif
102struct fw_xfer *asyreqq (struct firewire_comm *, u_int8_t, u_int8_t, u_int8_t,
103 u_int32_t, u_int32_t, void (*)(struct fw_xfer *));
104static int fw_bmr (struct firewire_comm *);
105
106static device_method_t firewire_methods[] = {
107 /* Device interface */
85static int firewire_attach (device_t);
86static int firewire_detach (device_t);
87static int firewire_resume (device_t);
88#if 0
89static int firewire_shutdown (device_t);
90#endif
91static device_t firewire_add_child (device_t, int, const char *, int);
92static void fw_try_bmr (void *);

--- 8 unchanged lines hidden (view full) ---

101static void fw_vmaccess (struct fw_xfer *);
102#endif
103struct fw_xfer *asyreqq (struct firewire_comm *, u_int8_t, u_int8_t, u_int8_t,
104 u_int32_t, u_int32_t, void (*)(struct fw_xfer *));
105static int fw_bmr (struct firewire_comm *);
106
107static device_method_t firewire_methods[] = {
108 /* Device interface */
108 DEVMETHOD(device_probe, firewire_match),
109 DEVMETHOD(device_identify, firewire_identify),
110 DEVMETHOD(device_probe, firewire_probe),
109 DEVMETHOD(device_attach, firewire_attach),
110 DEVMETHOD(device_detach, firewire_detach),
111 DEVMETHOD(device_suspend, bus_generic_suspend),
112 DEVMETHOD(device_resume, firewire_resume),
113 DEVMETHOD(device_shutdown, bus_generic_shutdown),
114
115 /* Bus interface */
116 DEVMETHOD(bus_add_child, firewire_add_child),

--- 188 unchanged lines hidden (view full) ---

305 xfer->q->queued ++;
306 splx(s);
307 /* XXX just queue for mbuf */
308 if (xfer->mbuf == NULL)
309 xfer->q->start(fc);
310 return;
311}
312
111 DEVMETHOD(device_attach, firewire_attach),
112 DEVMETHOD(device_detach, firewire_detach),
113 DEVMETHOD(device_suspend, bus_generic_suspend),
114 DEVMETHOD(device_resume, firewire_resume),
115 DEVMETHOD(device_shutdown, bus_generic_shutdown),
116
117 /* Bus interface */
118 DEVMETHOD(bus_add_child, firewire_add_child),

--- 188 unchanged lines hidden (view full) ---

307 xfer->q->queued ++;
308 splx(s);
309 /* XXX just queue for mbuf */
310 if (xfer->mbuf == NULL)
311 xfer->q->start(fc);
312 return;
313}
314
315static void
316firewire_identify(driver_t *driver, device_t parent)
317{
318 BUS_ADD_CHILD(parent, 0, "firewire", -1);
319}
320
313static int
321static int
314firewire_match( device_t dev )
322firewire_probe(device_t dev)
315{
316 device_set_desc(dev, "IEEE1394(FireWire) bus");
323{
324 device_set_desc(dev, "IEEE1394(FireWire) bus");
317 return -140;
325 return (0);
318}
319
320static void
321firewire_xfer_timeout(struct firewire_comm *fc)
322{
323 struct fw_xfer *xfer;
324 struct tlabel *tl;
325 struct timeval tv;

--- 81 unchanged lines hidden (view full) ---

407
408 /* Locate our children */
409 bus_generic_probe(dev);
410
411 /* launch attachement of the added children */
412 bus_generic_attach(dev);
413
414 /* bus_reset */
326}
327
328static void
329firewire_xfer_timeout(struct firewire_comm *fc)
330{
331 struct fw_xfer *xfer;
332 struct tlabel *tl;
333 struct timeval tv;

--- 81 unchanged lines hidden (view full) ---

415
416 /* Locate our children */
417 bus_generic_probe(dev);
418
419 /* launch attachement of the added children */
420 bus_generic_attach(dev);
421
422 /* bus_reset */
423 fw_busreset(fc);
415 fc->ibr(fc);
416
417 return 0;
418}
419
420/*
421 * Attach it as child.
422 */

--- 1808 unchanged lines hidden ---
424 fc->ibr(fc);
425
426 return 0;
427}
428
429/*
430 * Attach it as child.
431 */

--- 1808 unchanged lines hidden ---