Replace xfer->act.hand with xfer->hand.
This commit is contained in:
parent
a59c4504d1
commit
c93bd7d0c4
@ -204,8 +204,8 @@ fw_asyreq(struct firewire_comm *fc, int sub, struct fw_xfer *xfer)
|
||||
struct tcode_info *info;
|
||||
|
||||
if(xfer == NULL) return EINVAL;
|
||||
if(xfer->act.hand == NULL){
|
||||
printf("act.hand == NULL\n");
|
||||
if(xfer->hand == NULL){
|
||||
printf("hand == NULL\n");
|
||||
return EINVAL;
|
||||
}
|
||||
fp = &xfer->send.hdr;
|
||||
@ -296,8 +296,8 @@ fw_asystart(struct fw_xfer *xfer)
|
||||
if (fc->status < FWBUSEXPLORE) {
|
||||
xfer->resp = EAGAIN;
|
||||
xfer->state = FWXF_BUSY;
|
||||
if (xfer->act.hand != NULL)
|
||||
xfer->act.hand(xfer);
|
||||
if (xfer->hand != NULL)
|
||||
xfer->hand(xfer);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -802,7 +802,7 @@ void fw_init(struct firewire_comm *fc)
|
||||
fw_xfer_free(xfer);
|
||||
return;
|
||||
}
|
||||
xfer->act.hand = fw_vmaccess;
|
||||
xfer->hand = fw_vmaccess;
|
||||
xfer->fc = fc;
|
||||
xfer->sc = NULL;
|
||||
|
||||
@ -1005,15 +1005,15 @@ fw_xfer_alloc_buf(struct malloc_type *type, int send_len, int recv_len)
|
||||
void
|
||||
fw_xfer_done(struct fw_xfer *xfer)
|
||||
{
|
||||
if (xfer->act.hand == NULL) {
|
||||
printf("act.hand == NULL\n");
|
||||
if (xfer->hand == NULL) {
|
||||
printf("hand == NULL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (xfer->fc == NULL)
|
||||
panic("fw_xfer_done: why xfer->fc is NULL?");
|
||||
|
||||
xfer->act.hand(xfer);
|
||||
xfer->hand(xfer);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1100,7 +1100,7 @@ fw_phy_config(struct firewire_comm *fc, int root_node, int gap_count)
|
||||
if (xfer == NULL)
|
||||
return;
|
||||
xfer->fc = fc;
|
||||
xfer->act.hand = fw_asy_callback_free;
|
||||
xfer->hand = fw_asy_callback_free;
|
||||
|
||||
fp = &xfer->send.hdr;
|
||||
fp->mode.ld[1] = 0;
|
||||
@ -1407,7 +1407,7 @@ fw_bus_explore(struct firewire_comm *fc )
|
||||
fp->mode.rreqq.src = 0;
|
||||
fp->mode.rreqq.dst = FWLOCALBUS | fc->ongonode;
|
||||
fp->mode.rreqq.dest_lo = addr;
|
||||
xfer->act.hand = fw_bus_explore_callback;
|
||||
xfer->hand = fw_bus_explore_callback;
|
||||
|
||||
if (firewire_debug)
|
||||
printf("node%d: explore addr=0x%x\n",
|
||||
@ -1457,7 +1457,7 @@ asyreqq(struct firewire_comm *fc, uint8_t spd, uint8_t tl, uint8_t rt,
|
||||
fp->mode.rreqq.src = 0;
|
||||
fp->mode.rreqq.dst = addr_hi >> 16;
|
||||
fp->mode.rreqq.dest_lo = addr_lo;
|
||||
xfer->act.hand = hand;
|
||||
xfer->hand = hand;
|
||||
|
||||
err = fw_asyreq(fc, -1, xfer);
|
||||
if(err){
|
||||
@ -1897,9 +1897,9 @@ fw_rcv(struct fw_rcv_buf *rb)
|
||||
resfp->mode.rresb.extcode = 0;
|
||||
resfp->mode.rresb.len = 0;
|
||||
/*
|
||||
rb->xfer->act.hand = fw_asy_callback;
|
||||
rb->xfer->hand = fw_asy_callback;
|
||||
*/
|
||||
rb->xfer->act.hand = fw_xfer_free;
|
||||
rb->xfer->hand = fw_xfer_free;
|
||||
if(fw_asyreq(rb->fc, -1, rb->xfer)){
|
||||
fw_xfer_free(rb->xfer);
|
||||
return;
|
||||
@ -1919,7 +1919,7 @@ fw_rcv(struct fw_rcv_buf *rb)
|
||||
}
|
||||
STAILQ_REMOVE_HEAD(&bind->xferlist, link);
|
||||
fw_rcv_copy(rb);
|
||||
rb->xfer->act.hand(rb->xfer);
|
||||
rb->xfer->hand(rb->xfer);
|
||||
return;
|
||||
break;
|
||||
case FWACT_CH:
|
||||
@ -2067,7 +2067,7 @@ fw_try_bmr(void *arg)
|
||||
fp->mode.lreq.dest_lo = 0xf0000000 | BUS_MGR_ID;
|
||||
xfer->send.payload[0] = htonl(0x3f);
|
||||
xfer->send.payload[1] = htonl(fc->nodeid);
|
||||
xfer->act.hand = fw_try_bmr_callback;
|
||||
xfer->hand = fw_try_bmr_callback;
|
||||
|
||||
err = fw_asyreq(fc, -1, xfer);
|
||||
if(err){
|
||||
@ -2142,7 +2142,7 @@ fw_vmaccess(struct fw_xfer *xfer){
|
||||
}
|
||||
sfp->mode.hdr.dst = rfp->mode.hdr.src;
|
||||
xfer->dst = ntohs(rfp->mode.hdr.src);
|
||||
xfer->act.hand = fw_xfer_free;
|
||||
xfer->hand = fw_xfer_free;
|
||||
|
||||
sfp->mode.hdr.tlrt = rfp->mode.hdr.tlrt;
|
||||
sfp->mode.hdr.pri = 0;
|
||||
|
@ -250,9 +250,7 @@ struct fw_xfer{
|
||||
#define FWXF_RCVD 10
|
||||
uint8_t state;
|
||||
uint8_t tl;
|
||||
union{
|
||||
void (*hand) (struct fw_xfer *);
|
||||
} act;
|
||||
void (*hand) (struct fw_xfer *);
|
||||
struct {
|
||||
struct fw_pkt hdr;
|
||||
uint32_t *payload;
|
||||
|
@ -579,7 +579,7 @@ fw_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
|
||||
bcopy((char *)fp + tinfo->hdr_len,
|
||||
(void *)xfer->send.payload, pay_len);
|
||||
xfer->send.spd = asyreq->req.sped;
|
||||
xfer->act.hand = fw_asy_callback;
|
||||
xfer->hand = fw_asy_callback;
|
||||
|
||||
if ((err = fw_asyreq(sc->fc, -1, xfer)) != 0)
|
||||
goto out;
|
||||
|
@ -114,7 +114,7 @@ fwmem_xfer_req(
|
||||
xfer->send.spd = fwdev->speed;
|
||||
else
|
||||
xfer->send.spd = min(spd, fwdev->speed);
|
||||
xfer->act.hand = hand;
|
||||
xfer->hand = hand;
|
||||
xfer->sc = sc;
|
||||
xfer->send.pay_len = slen;
|
||||
xfer->recv.pay_len = rlen;
|
||||
|
@ -385,7 +385,7 @@ fwe_init(void *arg)
|
||||
xfer->send.spd = tx_speed;
|
||||
xfer->fc = fwe->fd.fc;
|
||||
xfer->sc = (caddr_t)fwe;
|
||||
xfer->act.hand = fwe_output_callback;
|
||||
xfer->hand = fwe_output_callback;
|
||||
STAILQ_INSERT_TAIL(&fwe->xferlist, xfer, link);
|
||||
}
|
||||
} else
|
||||
|
@ -365,7 +365,7 @@ fwip_init(void *arg)
|
||||
m = m_getcl(M_TRYWAIT, MT_DATA, M_PKTHDR);
|
||||
xfer->recv.payload = mtod(m, uint32_t *);
|
||||
xfer->recv.pay_len = MCLBYTES;
|
||||
xfer->act.hand = fwip_unicast_input;
|
||||
xfer->hand = fwip_unicast_input;
|
||||
xfer->fc = fc;
|
||||
xfer->sc = (caddr_t)fwip;
|
||||
xfer->mbuf = m;
|
||||
@ -381,7 +381,7 @@ fwip_init(void *arg)
|
||||
xfer->send.spd = tx_speed;
|
||||
xfer->fc = fwip->fd.fc;
|
||||
xfer->sc = (caddr_t)fwip;
|
||||
xfer->act.hand = fwip_output_callback;
|
||||
xfer->hand = fwip_output_callback;
|
||||
STAILQ_INSERT_TAIL(&fwip->xferlist, xfer, link);
|
||||
}
|
||||
} else
|
||||
|
@ -936,7 +936,7 @@ SBP_DEBUG(0)
|
||||
END_DEBUG
|
||||
|
||||
xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0);
|
||||
xfer->act.hand = sbp_reset_start_callback;
|
||||
xfer->hand = sbp_reset_start_callback;
|
||||
fp = &xfer->send.hdr;
|
||||
fp->mode.wreqq.dest_hi = 0xffff;
|
||||
fp->mode.wreqq.dest_lo = 0xf0000000 | RESET_START;
|
||||
@ -1127,9 +1127,9 @@ END_DEBUG
|
||||
if (xfer == NULL)
|
||||
return;
|
||||
if (sdev->status == SBP_DEV_ATTACHED || sdev->status == SBP_DEV_PROBE)
|
||||
xfer->act.hand = sbp_agent_reset_callback;
|
||||
xfer->hand = sbp_agent_reset_callback;
|
||||
else
|
||||
xfer->act.hand = sbp_do_attach;
|
||||
xfer->hand = sbp_do_attach;
|
||||
fp = &xfer->send.hdr;
|
||||
fp->mode.wreqq.data = htonl(0xf);
|
||||
fw_asyreq(xfer->fc, -1, xfer);
|
||||
@ -1161,7 +1161,7 @@ SBP_DEBUG(0)
|
||||
END_DEBUG
|
||||
xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0);
|
||||
|
||||
xfer->act.hand = sbp_busy_timeout_callback;
|
||||
xfer->hand = sbp_busy_timeout_callback;
|
||||
fp = &xfer->send.hdr;
|
||||
fp->mode.wreqq.dest_hi = 0xffff;
|
||||
fp->mode.wreqq.dest_lo = 0xf0000000 | BUSY_TIMEOUT;
|
||||
@ -1219,7 +1219,7 @@ END_DEBUG
|
||||
xfer = sbp_write_cmd(sdev, FWTCODE_WREQB, 0x08);
|
||||
if (xfer == NULL)
|
||||
return;
|
||||
xfer->act.hand = sbp_orb_pointer_callback;
|
||||
xfer->hand = sbp_orb_pointer_callback;
|
||||
|
||||
fp = &xfer->send.hdr;
|
||||
fp->mode.wreqb.len = 8;
|
||||
@ -1276,7 +1276,7 @@ END_DEBUG
|
||||
xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0x10);
|
||||
if (xfer == NULL)
|
||||
return;
|
||||
xfer->act.hand = sbp_doorbell_callback;
|
||||
xfer->hand = sbp_doorbell_callback;
|
||||
fp = &xfer->send.hdr;
|
||||
fp->mode.wreqq.data = htonl(0xf);
|
||||
fw_asyreq(xfer->fc, -1, xfer);
|
||||
@ -1418,7 +1418,7 @@ END_DEBUG
|
||||
if(xfer == NULL){
|
||||
return;
|
||||
}
|
||||
xfer->act.hand = sbp_mgm_callback;
|
||||
xfer->hand = sbp_mgm_callback;
|
||||
|
||||
fp = &xfer->send.hdr;
|
||||
fp->mode.wreqb.dest_hi = sdev->target->mgm_hi;
|
||||
@ -1876,7 +1876,7 @@ printf("len %d\n", sbp_status->len);
|
||||
sfp->mode.wres.dst = rfp->mode.wreqb.src;
|
||||
xfer->dst = sfp->mode.wres.dst;
|
||||
xfer->spd = min(sdev->target->fwdev->speed, max_speed);
|
||||
xfer->act.hand = sbp_loginres_callback;
|
||||
xfer->hand = sbp_loginres_callback;
|
||||
|
||||
sfp->mode.wres.tlrt = rfp->mode.wreqb.tlrt;
|
||||
sfp->mode.wres.tcode = FWTCODE_WRES;
|
||||
@ -1993,7 +1993,7 @@ END_DEBUG
|
||||
xfer = fw_xfer_alloc_buf(M_SBP,
|
||||
/* send */0,
|
||||
/* recv */SBP_RECV_LEN);
|
||||
xfer->act.hand = sbp_recv;
|
||||
xfer->hand = sbp_recv;
|
||||
#if NEED_RESPONSE
|
||||
xfer->fc = sbp->fd.fc;
|
||||
#endif
|
||||
|
@ -1458,7 +1458,7 @@ sbp_targ_resp_callback(struct fw_xfer *xfer)
|
||||
sc = (struct sbp_targ_softc *)xfer->sc;
|
||||
fw_xfer_unload(xfer);
|
||||
xfer->recv.pay_len = SBP_TARG_RECV_LEN;
|
||||
xfer->act.hand = sbp_targ_recv;
|
||||
xfer->hand = sbp_targ_recv;
|
||||
s = splfw();
|
||||
STAILQ_INSERT_TAIL(&sc->fwb.xferlist, xfer, link);
|
||||
splx(s);
|
||||
@ -1594,7 +1594,7 @@ sbp_targ_recv(struct fw_xfer *xfer)
|
||||
printf("%s: rtcode = %d\n", __func__, rtcode);
|
||||
sfp = &xfer->send.hdr;
|
||||
xfer->send.spd = 2; /* XXX */
|
||||
xfer->act.hand = sbp_targ_resp_callback;
|
||||
xfer->hand = sbp_targ_resp_callback;
|
||||
sfp->mode.wres.dst = fp->mode.wreqb.src;
|
||||
sfp->mode.wres.tlrt = fp->mode.wreqb.tlrt;
|
||||
sfp->mode.wres.tcode = FWTCODE_WRES;
|
||||
@ -1652,7 +1652,7 @@ sbp_targ_attach(device_t dev)
|
||||
xfer = fw_xfer_alloc_buf(M_SBP_TARG,
|
||||
/* send */ 0,
|
||||
/* recv */ SBP_TARG_RECV_LEN);
|
||||
xfer->act.hand = sbp_targ_recv;
|
||||
xfer->hand = sbp_targ_recv;
|
||||
xfer->fc = sc->fd.fc;
|
||||
xfer->sc = (caddr_t)sc;
|
||||
STAILQ_INSERT_TAIL(&sc->fwb.xferlist, xfer, link);
|
||||
|
Loading…
Reference in New Issue
Block a user