switch (skb->pkt_type) { 
switch (bt_cb(skb)->pkt_type) { 
static void bluecard_write_wakeup(bluecard_info_t *info){	if (!info) {		BT_ERR("Unknown device");		return;	}	if (!test_bit(XMIT_SENDING_READY, &(info->tx_state)))		return;	if (test_and_set_bit(XMIT_SENDING, &(info->tx_state))) {		set_bit(XMIT_WAKEUP, &(info->tx_state));		return;	}	do {		register unsigned int iobase = info->link.io.BasePort1;		register unsigned int offset;		register unsigned char command;		register unsigned long ready_bit;		register struct sk_buff *skb;		register int len;		clear_bit(XMIT_WAKEUP, &(info->tx_state));		if (!(info->link.state & DEV_PRESENT))			return;		if (test_bit(XMIT_BUFFER_NUMBER, &(info->tx_state))) {			if (!test_bit(XMIT_BUF_TWO_READY, &(info->tx_state)))				break;			offset = 0x10;			command = REG_COMMAND_TX_BUF_TWO;			ready_bit = XMIT_BUF_TWO_READY;		} else {			if (!test_bit(XMIT_BUF_ONE_READY, &(info->tx_state)))				break;			offset = 0x00;			command = REG_COMMAND_TX_BUF_ONE;			ready_bit = XMIT_BUF_ONE_READY;		}		if (!(skb = skb_dequeue(&(info->txq))))			break;		if (skb->pkt_type & 0x80) {			/* Disable RTS */			info->ctrl_reg |= REG_CONTROL_RTS;			outb(info->ctrl_reg, iobase + REG_CONTROL);		}		/* Activate LED */		bluecard_enable_activity_led(info);		/* Send frame */		len = bluecard_write(iobase, offset, skb->data, skb->len);		/* Tell the FPGA to send the data */		outb_p(command, iobase + REG_COMMAND);		/* Mark the buffer as dirty */		clear_bit(ready_bit, &(info->tx_state));		if (skb->pkt_type & 0x80) {			DECLARE_WAIT_QUEUE_HEAD(wq);			DEFINE_WAIT(wait);			unsigned char baud_reg;			switch (skb->pkt_type) {			case PKT_BAUD_RATE_460800:				baud_reg = REG_CONTROL_BAUD_RATE_460800;				break;			case PKT_BAUD_RATE_230400:				baud_reg = REG_CONTROL_BAUD_RATE_230400;				break;			case PKT_BAUD_RATE_115200:				baud_reg = REG_CONTROL_BAUD_RATE_115200;				break;			case PKT_BAUD_RATE_57600:				/* Fall through... */			default:				baud_reg = REG_CONTROL_BAUD_RATE_57600;				break;			}			/* Wait until the command reaches the baseband */			prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE);			schedule_timeout(HZ/10);			finish_wait(&wq, &wait);			/* Set baud on baseband */			info->ctrl_reg &= ~0x03;			info->ctrl_reg |= baud_reg;			outb(info->ctrl_reg, iobase + REG_CONTROL);			/* Enable RTS */			info->ctrl_reg &= ~REG_CONTROL_RTS;			outb(info->ctrl_reg, iobase + REG_CONTROL);			/* Wait before the next HCI packet can be send */			prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE);			schedule_timeout(HZ);			finish_wait(&wq, &wait);		}		if (len == skb->len) {			kfree_skb(skb);		} else {			skb_pull(skb, len);			skb_queue_head(&(info->txq), skb);		}		info->hdev->stat.byte_tx += len;		/* Change buffer */		change_bit(XMIT_BUFFER_NUMBER, &(info->tx_state));	} while (test_bit(XMIT_WAKEUP, &(info->tx_state)));	clear_bit(XMIT_SENDING, &(info->tx_state));}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/0d48d93947dd9ea21c5cdc76a8581b06a4a39281/bluecard_cs.c/buggy/drivers/bluetooth/bluecard_cs.c