FreeBSD/sys/dev/firewire/firewire.c
/*
 * To bind IEEE1394 address block to process.
 */
To bind IEEE1394 address block to process.
To bind IEEE1394 address block to process .
int
fw_bindadd(struct firewire_comm *fc, struct fw_bind *fwb)
{
	struct fw_bind *tfw, *prev = NULL;
	int r = 0;
	if (fwb->start > fwb->end) {
		printf("%s: invalid range\n", __func__);
		return EINVAL;
	}
	FW_GLOCK(fc);
	STAILQ_FOREACH(tfw, &fc->binds, fclist) {
		if (fwb->end < tfw->start)
			break;
		prev = tfw;
	}
	if (prev == NULL)
		STAILQ_INSERT_HEAD(&fc->binds, fwb, fclist);
	else if (prev->end < fwb->start)
		STAILQ_INSERT_AFTER(&fc->binds, prev, fwb, fclist);
	else {
		printf("%s: bind failed\n", __func__);
		r = EBUSY;
	}
	FW_GUNLOCK(fc);
	return (r);
}
int fw_bindadd ( struct firewire_comm * fc , struct fw_bind * fwb ) { struct fw_bind * tfw , * prev = NULL ; int r = 0 ; if ( fwb -> start > fwb -> end ) { printf ( " \n " , __func__ ) ; return EINVAL ; } FW_GLOCK ( fc ) ; STAILQ_FOREACH ( tfw , & fc -> binds , fclist ) { if ( fwb -> end < tfw -> start ) break ; prev = tfw ; } if ( prev == NULL ) STAILQ_INSERT_HEAD ( & fc -> binds , fwb , fclist ) ; else if ( prev -> end < fwb -> start ) STAILQ_INSERT_AFTER ( & fc -> binds , prev , fwb , fclist ) ; else { printf ( " \n " , __func__ ) ; r = EBUSY ; } FW_GUNLOCK ( fc ) ; return ( r ) ; }
To bind IEEE1394 address block to process.
To bind IEEE1394 address block to process .