fwohci.c (121781) | fwohci.c (123740) |
---|---|
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/fwohci.c 121781 2003-10-31 05:05:12Z simokawa $ | 34 * $FreeBSD: head/sys/dev/firewire/fwohci.c 123740 2003-12-23 02:36:43Z peter $ |
35 * 36 */ 37 38#define ATRQ_CH 0 39#define ATRS_CH 1 40#define ARRQ_CH 2 41#define ARRS_CH 3 42#define ITX_CH 4 --- 1266 unchanged lines hidden (view full) --- 1309} 1310#endif 1311 1312static int 1313fwohci_tx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch) 1314{ 1315 int err = 0; 1316 int idb, z, i, dmach = 0, ldesc; | 35 * 36 */ 37 38#define ATRQ_CH 0 39#define ATRS_CH 1 40#define ARRQ_CH 2 41#define ARRS_CH 3 42#define ITX_CH 4 --- 1266 unchanged lines hidden (view full) --- 1309} 1310#endif 1311 1312static int 1313fwohci_tx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch) 1314{ 1315 int err = 0; 1316 int idb, z, i, dmach = 0, ldesc; |
1317 u_int32_t off = NULL; | 1317 u_int32_t off = 0; |
1318 struct fwohcidb_tr *db_tr; 1319 struct fwohcidb *db; 1320 1321 if(!(dbch->xferq.flag & FWXFERQ_EXTBUF)){ 1322 err = EINVAL; 1323 return err; 1324 } 1325 z = dbch->ndesc; 1326 for(dmach = 0 ; dmach < sc->fc.nisodma ; dmach++){ 1327 if( &sc->it[dmach] == dbch){ 1328 off = OHCI_ITOFF(dmach); 1329 break; 1330 } 1331 } | 1318 struct fwohcidb_tr *db_tr; 1319 struct fwohcidb *db; 1320 1321 if(!(dbch->xferq.flag & FWXFERQ_EXTBUF)){ 1322 err = EINVAL; 1323 return err; 1324 } 1325 z = dbch->ndesc; 1326 for(dmach = 0 ; dmach < sc->fc.nisodma ; dmach++){ 1327 if( &sc->it[dmach] == dbch){ 1328 off = OHCI_ITOFF(dmach); 1329 break; 1330 } 1331 } |
1332 if(off == NULL){ | 1332 if(off == 0){ |
1333 err = EINVAL; 1334 return err; 1335 } 1336 if(dbch->xferq.flag & FWXFERQ_RUNNING) 1337 return err; 1338 dbch->xferq.flag |= FWXFERQ_RUNNING; 1339 for( i = 0, dbch->bottom = dbch->top; i < (dbch->ndb - 1); i++){ 1340 dbch->bottom = STAILQ_NEXT(dbch->bottom, link); --- 27 unchanged lines hidden (view full) --- 1368 return err; 1369} 1370 1371static int 1372fwohci_rx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch) 1373{ 1374 int err = 0; 1375 int idb, z, i, dmach = 0, ldesc; | 1333 err = EINVAL; 1334 return err; 1335 } 1336 if(dbch->xferq.flag & FWXFERQ_RUNNING) 1337 return err; 1338 dbch->xferq.flag |= FWXFERQ_RUNNING; 1339 for( i = 0, dbch->bottom = dbch->top; i < (dbch->ndb - 1); i++){ 1340 dbch->bottom = STAILQ_NEXT(dbch->bottom, link); --- 27 unchanged lines hidden (view full) --- 1368 return err; 1369} 1370 1371static int 1372fwohci_rx_enable(struct fwohci_softc *sc, struct fwohci_dbch *dbch) 1373{ 1374 int err = 0; 1375 int idb, z, i, dmach = 0, ldesc; |
1376 u_int32_t off = NULL; | 1376 u_int32_t off = 0; |
1377 struct fwohcidb_tr *db_tr; 1378 struct fwohcidb *db; 1379 1380 z = dbch->ndesc; 1381 if(&sc->arrq == dbch){ 1382 off = OHCI_ARQOFF; 1383 }else if(&sc->arrs == dbch){ 1384 off = OHCI_ARSOFF; 1385 }else{ 1386 for(dmach = 0 ; dmach < sc->fc.nisodma ; dmach++){ 1387 if( &sc->ir[dmach] == dbch){ 1388 off = OHCI_IROFF(dmach); 1389 break; 1390 } 1391 } 1392 } | 1377 struct fwohcidb_tr *db_tr; 1378 struct fwohcidb *db; 1379 1380 z = dbch->ndesc; 1381 if(&sc->arrq == dbch){ 1382 off = OHCI_ARQOFF; 1383 }else if(&sc->arrs == dbch){ 1384 off = OHCI_ARSOFF; 1385 }else{ 1386 for(dmach = 0 ; dmach < sc->fc.nisodma ; dmach++){ 1387 if( &sc->ir[dmach] == dbch){ 1388 off = OHCI_IROFF(dmach); 1389 break; 1390 } 1391 } 1392 } |
1393 if(off == NULL){ | 1393 if(off == 0){ |
1394 err = EINVAL; 1395 return err; 1396 } 1397 if(dbch->xferq.flag & FWXFERQ_STREAM){ 1398 if(dbch->xferq.flag & FWXFERQ_RUNNING) 1399 return err; 1400 }else{ 1401 if(dbch->xferq.flag & FWXFERQ_RUNNING){ --- 1484 unchanged lines hidden --- | 1394 err = EINVAL; 1395 return err; 1396 } 1397 if(dbch->xferq.flag & FWXFERQ_STREAM){ 1398 if(dbch->xferq.flag & FWXFERQ_RUNNING) 1399 return err; 1400 }else{ 1401 if(dbch->xferq.flag & FWXFERQ_RUNNING){ --- 1484 unchanged lines hidden --- |