FreeBSD/sys/dev/firewire/firewire.c
/*
 * Post process for Bus Manager election process.
 */
Post process for Bus Manager election process.
Post process for Bus Manager election process .
static void
fw_try_bmr_callback(struct fw_xfer *xfer)
{
	struct firewire_comm *fc;
	int bmr;
	if (xfer == NULL)
		return;
	fc = xfer->fc;
	if (xfer->resp != 0)
		goto error;
	if (xfer->recv.payload == NULL)
		goto error;
	if (xfer->recv.hdr.mode.lres.rtcode != FWRCODE_COMPLETE)
		goto error;
	bmr = ntohl(xfer->recv.payload[0]);
	if (bmr == 0x3f)
		bmr = fc->nodeid;
	CSRARC(fc, BUS_MGR_ID) = fc->set_bmr(fc, bmr & 0x3f);
	fw_xfer_free_buf(xfer);
	fw_bmr(fc);
	return;
error:
	device_printf(fc->bdev, "bus manager election failed\n");
	fw_xfer_free_buf(xfer);
}
static void fw_try_bmr_callback ( struct fw_xfer * xfer ) { struct firewire_comm * fc ; int bmr ; if ( xfer == NULL ) return ; fc = xfer -> fc ; if ( xfer -> resp != 0 ) goto error ; if ( xfer -> recv . payload == NULL ) goto error ; if ( xfer -> recv . hdr . mode . lres . rtcode != FWRCODE_COMPLETE ) goto error ; bmr = ntohl ( xfer -> recv . payload [ 0 ] ) ; if ( bmr == 0x3f ) bmr = fc -> nodeid ; CSRARC ( fc , BUS_MGR_ID ) = fc -> set_bmr ( fc , bmr & 0x3f ) ; fw_xfer_free_buf ( xfer ) ; fw_bmr ( fc ) ; return ; error : device_printf ( fc -> bdev , " \n " ) ; fw_xfer_free_buf ( xfer ) ; }
Post process for Bus Manager election process.
Post process for Bus Manager election process .