2 * This file is part of hci_h4p bluetooth driver
4 * Copyright (C) 2005, 2006 Nokia Corporation.
6 * Contact: Ville Tervo <ville.tervo@nokia.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 #include <linux/skbuff.h>
28 void hci_h4p_brf6150_parse_fw_event(struct hci_h4p_info *info,
31 struct hci_fw_event *ev;
34 if (bt_cb(skb)->pkt_type != H4_EVT_PKT) {
35 dev_err(info->dev, "Got non event fw packet.\n");
40 ev = (struct hci_fw_event *)skb->data;
41 if (ev->hev.evt != HCI_EV_CMD_COMPLETE) {
42 dev_err(info->dev, "Got non cmd complete fw event\n");
47 if (ev->status != 0) {
48 dev_err(info->dev, "Got error status from fw command\n");
55 complete(&info->fw_completion);
58 int hci_h4p_brf6150_send_fw(struct hci_h4p_info *info, struct sk_buff_head *fw_queue)
65 while ((skb = skb_dequeue(fw_queue)) != NULL) {
66 /* We should allways send word aligned data to h4+ devices */
68 err = skb_pad(skb, 1);
73 init_completion(&info->fw_completion);
74 skb_queue_tail(&info->txq, skb);
75 tasklet_schedule(&info->tx_task);
77 if (!wait_for_completion_timeout(&info->fw_completion, HZ)) {
78 dev_err(info->dev, "Timeout while sending brf6150 fw\n");
83 dev_err(info->dev, "There was fw_error while sending bfr6150 fw\n");
87 NBT_DBG_FW("Firmware sent\n");