static void bt3c_receive(bt3c_info_t *info){	unsigned int iobase;	int size = 0, avail;	if (!info) {		BT_ERR("Unknown device");		return;	}	iobase = info->link.io.BasePort1;	avail = bt3c_read(iobase, 0x7006);	//printk("bt3c_cs: receiving %d bytes\n", avail);	bt3c_address(iobase, 0x7480);	while (size < avail) {		size++;		info->hdev->stat.byte_rx++;		/* Allocate packet */		if (info->rx_skb == NULL) {			info->rx_state = RECV_WAIT_PACKET_TYPE;			info->rx_count = 0;			if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {				BT_ERR("Can't allocate mem for new packet");				return;			}		}		if (info->rx_state == RECV_WAIT_PACKET_TYPE) {			info->rx_skb->dev = (void *) info->hdev;			info->rx_skb->pkt_type = inb(iobase + DATA_L);			inb(iobase + DATA_H);			//printk("bt3c: PACKET_TYPE=%02x\n", info->rx_skb->pkt_type);			switch (info->rx_skb->pkt_type) {			case HCI_EVENT_PKT:				info->rx_state = RECV_WAIT_EVENT_HEADER;				info->rx_count = HCI_EVENT_HDR_SIZE;				break;			case HCI_ACLDATA_PKT:				info->rx_state = RECV_WAIT_ACL_HEADER;				info->rx_count = HCI_ACL_HDR_SIZE;				break;			case HCI_SCODATA_PKT:				info->rx_state = RECV_WAIT_SCO_HEADER;				info->rx_count = HCI_SCO_HDR_SIZE;				break;			default:				/* Unknown packet */				BT_ERR("Unknown HCI packet with type 0x%02x received", info->rx_skb->pkt_type);				info->hdev->stat.err_rx++;				clear_bit(HCI_RUNNING, &(info->hdev->flags));				kfree_skb(info->rx_skb);				info->rx_skb = NULL;				break;			}		} else {			__u8 x = inb(iobase + DATA_L);			*skb_put(info->rx_skb, 1) = x;			inb(iobase + DATA_H);			info->rx_count--;			if (info->rx_count == 0) {				int dlen;				struct hci_event_hdr *eh;				struct hci_acl_hdr *ah;				struct hci_sco_hdr *sh;				switch (info->rx_state) {				case RECV_WAIT_EVENT_HEADER:					eh = (struct hci_event_hdr *)(info->rx_skb->data);					info->rx_state = RECV_WAIT_DATA;					info->rx_count = eh->plen;					break;				case RECV_WAIT_ACL_HEADER:					ah = (struct hci_acl_hdr *)(info->rx_skb->data);					dlen = __le16_to_cpu(ah->dlen);					info->rx_state = RECV_WAIT_DATA;					info->rx_count = dlen;					break;				case RECV_WAIT_SCO_HEADER:					sh = (struct hci_sco_hdr *)(info->rx_skb->data);					info->rx_state = RECV_WAIT_DATA;					info->rx_count = sh->dlen;					break;				case RECV_WAIT_DATA:					hci_recv_frame(info->rx_skb);					info->rx_skb = NULL;					break;				}			}		}	}	bt3c_io_write(iobase, 0x7006, 0x0000);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/0d48d93947dd9ea21c5cdc76a8581b06a4a39281/bt3c_cs.c/buggy/drivers/bluetooth/bt3c_cs.c