]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/bluetooth/hci_bcm.c
Merge remote-tracking branch 'omap/for-next'
[karo-tx-linux.git] / drivers / bluetooth / hci_bcm.c
index 1425bf50ae99b4076e3e5e1f251237e14f480d6a..cb852cc750b78256cd05fb62eda18dfb28c246aa 100644 (file)
@@ -249,6 +249,29 @@ static inline int bcm_request_irq(struct bcm_data *bcm) { return 0; }
 static inline int bcm_setup_sleep(struct hci_uart *hu) { return 0; }
 #endif
 
+static int bcm_set_diag(struct hci_dev *hdev, bool enable)
+{
+       struct hci_uart *hu = hci_get_drvdata(hdev);
+       struct bcm_data *bcm = hu->priv;
+       struct sk_buff *skb;
+
+       if (!test_bit(HCI_RUNNING, &hdev->flags))
+               return -ENETDOWN;
+
+       skb = bt_skb_alloc(3, GFP_KERNEL);
+       if (!skb)
+               return -ENOMEM;
+
+       *skb_put(skb, 1) = BCM_LM_DIAG_PKT;
+       *skb_put(skb, 1) = 0xf0;
+       *skb_put(skb, 1) = enable;
+
+       skb_queue_tail(&bcm->txq, skb);
+       hci_uart_tx_wakeup(hu);
+
+       return 0;
+}
+
 static int bcm_open(struct hci_uart *hu)
 {
        struct bcm_data *bcm;
@@ -342,6 +365,7 @@ static int bcm_setup(struct hci_uart *hu)
 
        bt_dev_dbg(hu->hdev, "hu %p", hu);
 
+       hu->hdev->set_diag = bcm_set_diag;
        hu->hdev->set_bdaddr = btbcm_set_bdaddr;
 
        err = btbcm_initialize(hu->hdev, fw_name, sizeof(fw_name));
@@ -775,6 +799,7 @@ static int bcm_remove(struct platform_device *pdev)
 static const struct hci_uart_proto bcm_proto = {
        .id             = HCI_UART_BCM,
        .name           = "BCM",
+       .manufacturer   = 15,
        .init_speed     = 115200,
        .oper_speed     = 4000000,
        .open           = bcm_open,