Deleted Added
full compact
sbp.c (124145) sbp.c (124169)
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/sbp.c 124145 2004-01-05 14:21:18Z simokawa $
34 * $FreeBSD: head/sys/dev/firewire/sbp.c 124169 2004-01-06 14:30:47Z simokawa $
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/module.h>
41#include <sys/bus.h>
42#include <sys/sysctl.h>

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

215 struct sbp_target targets[SBP_NUM_TARGETS];
216 struct fw_bind fwb;
217 bus_dma_tag_t dmat;
218 struct timeval last_busreset;
219#define SIMQ_FREEZED 1
220 int flags;
221};
222
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/module.h>
41#include <sys/bus.h>
42#include <sys/sysctl.h>

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

215 struct sbp_target targets[SBP_NUM_TARGETS];
216 struct fw_bind fwb;
217 bus_dma_tag_t dmat;
218 struct timeval last_busreset;
219#define SIMQ_FREEZED 1
220 int flags;
221};
222
223static void sbp_post_explore __P((void *));
224static void sbp_recv __P((struct fw_xfer *));
225static void sbp_mgm_callback __P((struct fw_xfer *));
223static void sbp_post_explore (void *);
224static void sbp_recv (struct fw_xfer *);
225static void sbp_mgm_callback (struct fw_xfer *);
226#if 0
226#if 0
227static void sbp_cmd_callback __P((struct fw_xfer *));
227static void sbp_cmd_callback (struct fw_xfer *);
228#endif
228#endif
229static void sbp_orb_pointer __P((struct sbp_dev *, struct sbp_ocb *));
230static void sbp_execute_ocb __P((void *, bus_dma_segment_t *, int, int));
231static void sbp_free_ocb __P((struct sbp_dev *, struct sbp_ocb *));
232static void sbp_abort_ocb __P((struct sbp_ocb *, int));
233static void sbp_abort_all_ocbs __P((struct sbp_dev *, int));
234static struct fw_xfer * sbp_write_cmd __P((struct sbp_dev *, int, int));
235static struct sbp_ocb * sbp_get_ocb __P((struct sbp_dev *));
236static struct sbp_ocb * sbp_enqueue_ocb __P((struct sbp_dev *, struct sbp_ocb *));
237static struct sbp_ocb * sbp_dequeue_ocb __P((struct sbp_dev *, struct sbp_status *));
229static void sbp_orb_pointer (struct sbp_dev *, struct sbp_ocb *);
230static void sbp_execute_ocb (void *, bus_dma_segment_t *, int, int);
231static void sbp_free_ocb (struct sbp_dev *, struct sbp_ocb *);
232static void sbp_abort_ocb (struct sbp_ocb *, int);
233static void sbp_abort_all_ocbs (struct sbp_dev *, int);
234static struct fw_xfer * sbp_write_cmd (struct sbp_dev *, int, int);
235static struct sbp_ocb * sbp_get_ocb (struct sbp_dev *);
236static struct sbp_ocb * sbp_enqueue_ocb (struct sbp_dev *, struct sbp_ocb *);
237static struct sbp_ocb * sbp_dequeue_ocb (struct sbp_dev *, struct sbp_status *);
238static void sbp_cam_detach_sdev(struct sbp_dev *);
239static void sbp_free_sdev(struct sbp_dev *);
238static void sbp_cam_detach_sdev(struct sbp_dev *);
239static void sbp_free_sdev(struct sbp_dev *);
240static void sbp_cam_detach_target __P((struct sbp_target *));
241static void sbp_free_target __P((struct sbp_target *));
242static void sbp_mgm_timeout __P((void *arg));
243static void sbp_timeout __P((void *arg));
244static void sbp_mgm_orb __P((struct sbp_dev *, int, struct sbp_ocb *));
240static void sbp_cam_detach_target (struct sbp_target *);
241static void sbp_free_target (struct sbp_target *);
242static void sbp_mgm_timeout (void *arg);
243static void sbp_timeout (void *arg);
244static void sbp_mgm_orb (struct sbp_dev *, int, struct sbp_ocb *);
245
246MALLOC_DEFINE(M_SBP, "sbp", "SBP-II/FireWire");
247
248/* cam related functions */
249static void sbp_action(struct cam_sim *sim, union ccb *ccb);
250static void sbp_poll(struct cam_sim *sim);
251static void sbp_cam_scan_lun(struct cam_periph *, union ccb *);
252static void sbp_cam_scan_target(void *arg);

--- 2548 unchanged lines hidden ---
245
246MALLOC_DEFINE(M_SBP, "sbp", "SBP-II/FireWire");
247
248/* cam related functions */
249static void sbp_action(struct cam_sim *sim, union ccb *ccb);
250static void sbp_poll(struct cam_sim *sim);
251static void sbp_cam_scan_lun(struct cam_periph *, union ccb *);
252static void sbp_cam_scan_target(void *arg);

--- 2548 unchanged lines hidden ---