Deleted Added
full compact
fwdev.c (127468) fwdev.c (129585)
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/fwdev.c 127468 2004-03-26 23:17:10Z simokawa $
34 * $FreeBSD: head/sys/dev/firewire/fwdev.c 129585 2004-05-22 16:14:17Z dfr $
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/types.h>
41#include <sys/mbuf.h>
42#if defined(__DragonFly__) || __FreeBSD_version < 500000

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

123 return(EBUSY);
124
125 q->bulkxfer = (struct fw_bulkxfer *) malloc(
126 sizeof(struct fw_bulkxfer) * b->nchunk,
127 M_FW, M_WAITOK);
128 if (q->bulkxfer == NULL)
129 return(ENOMEM);
130
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/types.h>
41#include <sys/mbuf.h>
42#if defined(__DragonFly__) || __FreeBSD_version < 500000

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

123 return(EBUSY);
124
125 q->bulkxfer = (struct fw_bulkxfer *) malloc(
126 sizeof(struct fw_bulkxfer) * b->nchunk,
127 M_FW, M_WAITOK);
128 if (q->bulkxfer == NULL)
129 return(ENOMEM);
130
131 b->psize = roundup2(b->psize, sizeof(u_int32_t));
132 q->buf = fwdma_malloc_multiseg(fc, sizeof(u_int32_t),
131 b->psize = roundup2(b->psize, sizeof(uint32_t));
132 q->buf = fwdma_malloc_multiseg(fc, sizeof(uint32_t),
133 b->psize, b->nchunk * b->npacket, BUS_DMA_WAITOK);
134
135 if (q->buf == NULL) {
136 free(q->bulkxfer, M_FW);
137 q->bulkxfer = NULL;
138 return(ENOMEM);
139 }
140 q->bnchunk = b->nchunk;

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

342 ir->stproc->poffset + ir->queued);
343 if(sc->fc->irx_post != NULL)
344 sc->fc->irx_post(sc->fc, fp->mode.ld);
345 if(fp->mode.stream.len == 0){
346 err = EIO;
347 return err;
348 }
349 err = uiomove((caddr_t)fp,
133 b->psize, b->nchunk * b->npacket, BUS_DMA_WAITOK);
134
135 if (q->buf == NULL) {
136 free(q->bulkxfer, M_FW);
137 q->bulkxfer = NULL;
138 return(ENOMEM);
139 }
140 q->bnchunk = b->nchunk;

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

342 ir->stproc->poffset + ir->queued);
343 if(sc->fc->irx_post != NULL)
344 sc->fc->irx_post(sc->fc, fp->mode.ld);
345 if(fp->mode.stream.len == 0){
346 err = EIO;
347 return err;
348 }
349 err = uiomove((caddr_t)fp,
350 fp->mode.stream.len + sizeof(u_int32_t), uio);
350 fp->mode.stream.len + sizeof(uint32_t), uio);
351 ir->queued ++;
352 if(ir->queued >= ir->bnpacket){
353 s = splfw();
354 STAILQ_INSERT_TAIL(&ir->stfree, ir->stproc, link);
355 splx(s);
356 sc->fc->irx_enable(sc->fc, ir->dmach);
357 ir->stproc = NULL;
358 }

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

689 if (!FW_EUI64_EQUAL(sc->fc->eui, crom_buf->eui)) {
690 err = FWNODE_INVAL;
691 break;
692 }
693 /* myself */
694 ptr = malloc(CROMSIZE, M_FW, M_WAITOK);
695 len = CROMSIZE;
696 for (i = 0; i < CROMSIZE/4; i++)
351 ir->queued ++;
352 if(ir->queued >= ir->bnpacket){
353 s = splfw();
354 STAILQ_INSERT_TAIL(&ir->stfree, ir->stproc, link);
355 splx(s);
356 sc->fc->irx_enable(sc->fc, ir->dmach);
357 ir->stproc = NULL;
358 }

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

689 if (!FW_EUI64_EQUAL(sc->fc->eui, crom_buf->eui)) {
690 err = FWNODE_INVAL;
691 break;
692 }
693 /* myself */
694 ptr = malloc(CROMSIZE, M_FW, M_WAITOK);
695 len = CROMSIZE;
696 for (i = 0; i < CROMSIZE/4; i++)
697 ((u_int32_t *)ptr)[i]
697 ((uint32_t *)ptr)[i]
698 = ntohl(sc->fc->config_rom[i]);
699 } else {
700 /* found */
701 ptr = (void *)&fwdev->csrrom[0];
702 if (fwdev->rommax < CSRROMOFF)
703 len = 0;
704 else
705 len = fwdev->rommax - CSRROMOFF + 4;

--- 169 unchanged lines hidden ---
698 = ntohl(sc->fc->config_rom[i]);
699 } else {
700 /* found */
701 ptr = (void *)&fwdev->csrrom[0];
702 if (fwdev->rommax < CSRROMOFF)
703 len = 0;
704 else
705 len = fwdev->rommax - CSRROMOFF + 4;

--- 169 unchanged lines hidden ---