Commit f120c6b6 authored by Bing Zhao's avatar Bing Zhao Committed by Marcel Holtmann

Bluetooth: Set hdev->dev_type based on Marvell device type

Get the device type from MODULE_BRINGUP_REQ command response.
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 64061607
...@@ -42,6 +42,8 @@ struct btmrvl_device { ...@@ -42,6 +42,8 @@ struct btmrvl_device {
void *card; void *card;
struct hci_dev *hcidev; struct hci_dev *hcidev;
u8 dev_type;
u8 tx_dnld_rdy; u8 tx_dnld_rdy;
u8 psmode; u8 psmode;
......
...@@ -116,6 +116,13 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb) ...@@ -116,6 +116,13 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb)
((event->data[2] == MODULE_BROUGHT_UP) || ((event->data[2] == MODULE_BROUGHT_UP) ||
(event->data[2] == MODULE_ALREADY_UP)) ? (event->data[2] == MODULE_ALREADY_UP)) ?
"Bring-up succeed" : "Bring-up failed"); "Bring-up succeed" : "Bring-up failed");
if (event->length > 3)
priv->btmrvl_dev.dev_type = event->data[3];
else
priv->btmrvl_dev.dev_type = HCI_BREDR;
BT_DBG("dev_type: %d", priv->btmrvl_dev.dev_type);
} else if (priv->btmrvl_dev.sendcmdflag && } else if (priv->btmrvl_dev.sendcmdflag &&
event->data[1] == MODULE_SHUTDOWN_REQ) { event->data[1] == MODULE_SHUTDOWN_REQ) {
BT_DBG("EVENT:%s", (event->data[2]) ? BT_DBG("EVENT:%s", (event->data[2]) ?
...@@ -549,6 +556,8 @@ int btmrvl_register_hdev(struct btmrvl_private *priv) ...@@ -549,6 +556,8 @@ int btmrvl_register_hdev(struct btmrvl_private *priv)
btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
hdev->dev_type = priv->btmrvl_dev.dev_type;
ret = hci_register_dev(hdev); ret = hci_register_dev(hdev);
if (ret < 0) { if (ret < 0) {
BT_ERR("Can not register HCI device"); BT_ERR("Can not register HCI device");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment