Deleted Added
full compact
34c34
< * $FreeBSD: head/sys/dev/firewire/fwohci.c 119289 2003-08-22 07:30:41Z simokawa $
---
> * $FreeBSD: head/sys/dev/firewire/fwohci.c 120660 2003-10-02 04:06:56Z simokawa $
141c141
< static void print_db __P((struct fwohcidb_tr *, volatile struct fwohcidb *, u_int32_t , u_int32_t));
---
> static void print_db __P((struct fwohcidb_tr *, struct fwohcidb *, u_int32_t , u_int32_t));
802c802
< volatile struct fwohcidb *db;
---
> struct fwohcidb *db;
834c834
< int tcode, hdr_len, pl_off, pl_len;
---
> int tcode, hdr_len, pl_off;
839c839
< volatile struct fwohci_txpkthdr *ohcifp;
---
> struct fwohci_txpkthdr *ohcifp;
841,842c841,842
< volatile struct fwohcidb *db;
< volatile u_int32_t *ld;
---
> struct fwohcidb *db;
> u_int32_t *ld;
871c871
< fp = (struct fw_pkt *)xfer->send.buf;
---
> fp = &xfer->send.hdr;
874c874
< ohcifp = (volatile struct fwohci_txpkthdr *) db_tr->db[1].db.immed;
---
> ohcifp = (struct fwohci_txpkthdr *) db_tr->db[1].db.immed;
883c883
< ohcifp->mode.common.spd = xfer->spd & 0x7;
---
> ohcifp->mode.common.spd = xfer->send.spd & 0x7;
918,919c918
< pl_len = xfer->send.len - pl_off;
< if (pl_len > 0) {
---
> if (xfer->send.pay_len > 0) {
923,925d921
< caddr_t pl_addr;
<
< pl_addr = xfer->send.buf + pl_off;
927c923
< pl_addr, pl_len,
---
> &xfer->send.payload[0], xfer->send.pay_len,
1033c1029
< volatile struct fwohcidb *db;
---
> struct fwohcidb *db;
1126c1122
< xfer->recv.len = 0;
---
> xfer->recv.pay_len = 0;
1133c1129
< xfer->recv.len = 0;
---
> xfer->recv.pay_len = 0;
1322c1318
< volatile struct fwohcidb *db;
---
> struct fwohcidb *db;
1381c1377
< volatile struct fwohcidb *db;
---
> struct fwohcidb *db;
1512c1508
< volatile struct fwohcidb *db;
---
> struct fwohcidb *db;
1639c1635
< volatile struct fwohcidb *db;
---
> struct fwohcidb *db;
2107c2103
< volatile struct fwohcidb *db;
---
> struct fwohcidb *db;
2153c2149
< volatile struct fwohcidb_tr *db_tr;
---
> struct fwohcidb_tr *db_tr;
2258c2254
< volatile struct fwohcidb *curr = NULL, *prev, *next = NULL;
---
> struct fwohcidb *curr = NULL, *prev, *next = NULL;
2332c2328
< print_db(struct fwohcidb_tr *db_tr, volatile struct fwohcidb *db,
---
> print_db(struct fwohcidb_tr *db_tr, struct fwohcidb *db,
2449c2445
< volatile struct fwohcidb *db;
---
> struct fwohcidb *db;
2451c2447
< volatile struct fwohci_txpkthdr *ohcifp;
---
> struct fwohci_txpkthdr *ohcifp;
2466c2462
< ohcifp = (volatile struct fwohci_txpkthdr *) db[1].db.immed;
---
> ohcifp = (struct fwohci_txpkthdr *) db[1].db.immed;
2514c2510
< volatile struct fwohcidb *db = db_tr->db;
---
> struct fwohcidb *db = db_tr->db;
2529,2530c2525
< bzero((void *)(uintptr_t)(volatile void *)
< &db[1].db.immed[0], sizeof(db[1].db.immed));
---
> bzero((void *)&db[1].db.immed[0], sizeof(db[1].db.immed));
2547c2542
< volatile struct fwohcidb *db = db_tr->db;
---
> struct fwohcidb *db = db_tr->db;
2598c2593
< int slen;
---
> int slen, hlen;
2607a2603
> /* determine length to swap */
2627c2623,2624
< if (slen > len) {
---
> hlen = tinfo[fp0->mode.common.tcode].hdr_len;
> if (hlen > len) {
2630c2627
< return(-slen);
---
> return(-hlen);
2636c2633
< return(slen);
---
> return(hlen);
2639d2635
< #define PLEN(x) roundup2(x, sizeof(u_int32_t))
2642a2639
> struct tcode_info *info;
2645,2680c2642,2648
< switch(fp->mode.common.tcode){
< case FWTCODE_RREQQ:
< r = sizeof(fp->mode.rreqq) + sizeof(u_int32_t);
< break;
< case FWTCODE_WRES:
< r = sizeof(fp->mode.wres) + sizeof(u_int32_t);
< break;
< case FWTCODE_WREQQ:
< r = sizeof(fp->mode.wreqq) + sizeof(u_int32_t);
< break;
< case FWTCODE_RREQB:
< r = sizeof(fp->mode.rreqb) + sizeof(u_int32_t);
< break;
< case FWTCODE_RRESQ:
< r = sizeof(fp->mode.rresq) + sizeof(u_int32_t);
< break;
< case FWTCODE_WREQB:
< r = sizeof(struct fw_asyhdr) + PLEN(fp->mode.wreqb.len)
< + sizeof(u_int32_t);
< break;
< case FWTCODE_LREQ:
< r = sizeof(struct fw_asyhdr) + PLEN(fp->mode.lreq.len)
< + sizeof(u_int32_t);
< break;
< case FWTCODE_RRESB:
< r = sizeof(struct fw_asyhdr) + PLEN(fp->mode.rresb.len)
< + sizeof(u_int32_t);
< break;
< case FWTCODE_LRES:
< r = sizeof(struct fw_asyhdr) + PLEN(fp->mode.lres.len)
< + sizeof(u_int32_t);
< break;
< case FWOHCITCODE_PHY:
< r = 16;
< break;
< default:
---
> info = &tinfo[fp->mode.common.tcode];
> r = info->hdr_len + sizeof(u_int32_t);
> if ((info->flag & FWTI_BLOCK_ASY) != 0)
> r += roundup2(fp->mode.wreqb.len, sizeof(u_int32_t));
>
> if (r == sizeof(u_int32_t))
> /* XXX */
2683,2684c2651
< r = 0;
< }
---
>
2688a2656
>
2695c2663
< volatile struct fwohcidb *db = &db_tr->db[0];
---
> struct fwohcidb *db = &db_tr->db[0];
2815c2783,2784
< printf("plen is negative! offset=%d\n", offset);
---
> printf("plen(%d) is negative! offset=%d\n",
> plen, offset);
2845c2814,2815
< printf("plen: %d, stat %x\n", plen ,stat);
---
> printf("plen: %d, stat %x\n",
> plen ,stat);
2855a2826,2828
> {
> struct fw_rcv_buf rb;
>
2859,2860c2832,2838
< fw_rcv(&sc->fc, vec, nvec, 0, spd);
< break;
---
> rb.fc = &sc->fc;
> rb.vec = vec;
> rb.nvec = nvec;
> rb.spd = spd;
> fw_rcv(&rb);
> break;
> }