static struct hpsb_iso* hpsb_iso_common_init(struct hpsb_host *host, enum hpsb_iso_type type, 
static struct hpsb_iso *hpsb_iso_common_init(struct hpsb_host *host, enum hpsb_iso_type type, 
static struct hpsb_iso* hpsb_iso_common_init(struct hpsb_host *host, enum hpsb_iso_type type,					     unsigned int data_buf_size,					     unsigned int buf_packets,					     int channel,					     int dma_mode,					     int irq_interval,					     void (*callback)(struct hpsb_iso*)){	struct hpsb_iso *iso;	int dma_direction;	/* make sure driver supports the ISO API */	if (!host->driver->isoctl) {		printk(KERN_INFO "ieee1394: host driver '%s' does not support the rawiso API\n",		       host->driver->name);		return NULL;	}	/* sanitize parameters */	if (buf_packets < 2)		buf_packets = 2;	if ((dma_mode < HPSB_ISO_DMA_DEFAULT) || (dma_mode > HPSB_ISO_DMA_PACKET_PER_BUFFER))		dma_mode=HPSB_ISO_DMA_DEFAULT;	if ((irq_interval < 0) || (irq_interval > buf_packets / 4)) 		irq_interval = buf_packets / 4;	if (irq_interval == 0)     /* really interrupt for each packet*/		irq_interval = 1;	if (channel < -1 || channel >= 64)		return NULL;	/* channel = -1 is OK for multi-channel recv but not for xmit */	if (type == HPSB_ISO_XMIT && channel < 0)		return NULL;	/* allocate and write the struct hpsb_iso */	iso = kmalloc(sizeof(*iso) + buf_packets * sizeof(struct hpsb_iso_packet_info), GFP_KERNEL);	if (!iso)		return NULL;	iso->infos = (struct hpsb_iso_packet_info *)(iso + 1);	iso->type = type;	iso->host = host;	iso->hostdata = NULL;	iso->callback = callback;	init_waitqueue_head(&iso->waitq);	iso->channel = channel;	iso->irq_interval = irq_interval;	iso->dma_mode = dma_mode;	dma_region_init(&iso->data_buf);	iso->buf_size = PAGE_ALIGN(data_buf_size);	iso->buf_packets = buf_packets;	iso->pkt_dma = 0;	iso->first_packet = 0;	spin_lock_init(&iso->lock);	if (iso->type == HPSB_ISO_XMIT) {		iso->n_ready_packets = iso->buf_packets;		dma_direction = PCI_DMA_TODEVICE;	} else {		iso->n_ready_packets = 0;		dma_direction = PCI_DMA_FROMDEVICE;	}	atomic_set(&iso->overflows, 0);	iso->bytes_discarded = 0;	iso->flags = 0;	iso->prebuffer = 0;	/* allocate the packet buffer */	if (dma_region_alloc(&iso->data_buf, iso->buf_size, host->pdev, dma_direction))		goto err;	return iso;err:	hpsb_iso_shutdown(iso);	return NULL;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/066ef9c2fb30a22eca7724326e210f0405c51f29/iso.c/clean/drivers/ieee1394/iso.c