On 09/03/2014 10:34 PM, 陈艳萍 wrote: > Hi Daniel, > Attached file is btusb driver add realtek Bluetooth support with firmware, we have tested under Ubuntu 14.04. Champion, Thanks for the new driver. I pushed the new code to http://github.com/lwfinger/rtl8723au_bt/new. Using it, I was able to connect to a BT mouse using an RTL8723AE module. Your version had a few compilation warnings, some of which were due to using a 64-bit system. A patch file to fix those is attached. One other problem is that the rar file contains a file named rlt8723a_fw. I am sure that you should rename that to rtl8723a_fw. Larry
--- a/btusb.c 2014-09-03 11:06:46.000000000 -0500 +++ b/btusb.c 2014-09-04 09:46:49.639096299 -0500 @@ -718,7 +718,7 @@ static int btusb_open(struct hci_dev *hd if (test_and_set_bit(HCI_RUNNING, &hdev->flags)) goto done; - BT_DBG(" %s test_and_set :hdev->flags = 0x%x \n",__func__,hdev->flags); + BT_DBG(" %s test_and_set :hdev->flags = 0x%x \n",__func__, (int)hdev->flags); if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags)) goto done; @@ -737,7 +737,7 @@ static int btusb_open(struct hci_dev *hd btusb_submit_bulk_urb(hdev, GFP_KERNEL); done: - BT_DBG(" %s done :hdev->flags = 0x%x \n",__func__,hdev->flags); + BT_DBG(" %s done :hdev->flags = 0x%x \n",__func__, (int)hdev->flags); usb_autopm_put_interface(data->intf); return 0; @@ -806,6 +806,7 @@ static int btusb_send_frame(struct hci_d struct urb *urb; unsigned int pipe; int err; + u16 *opcode; //BT_DBG("%s", hdev->name); //BT_DBG("%s hdev->flags=0x%x",__func__,hdev->flags); @@ -837,7 +838,7 @@ static int btusb_send_frame(struct hci_d pipe = usb_sndctrlpipe(data->udev, 0x00); - u16 *opcode = (u16*)(skb->data); + opcode = (u16*)(skb->data); // BT_DBG("dr->wLength =%d,opcode=0x%04x",dr->wLength,*opcode); usb_fill_control_urb(urb, data->udev, pipe, (void *) dr, skb->data, skb->len, btusb_tx_complete, skb); @@ -1466,7 +1467,7 @@ static int btusb_setup_rtl_get_oldfw( co BT_INFO("%s", __func__); /*check file length*/ if(fw->size<8){ - BT_ERR("%s: file size %d error", __func__,fw->size); + BT_ERR("%s: file size %d error", __func__, (int)fw->size); return -1; } /*check signature*/ @@ -1527,7 +1528,7 @@ static int btusb_setup_rtl_get_newfw ( s struct sk_buff *skb; uint16_t rom_ver; - uint8_t *temp; + const uint8_t *temp; uint8_t opcode,len; uint8_t data; struct rtk_epatch *patch_info = NULL; @@ -1561,7 +1562,7 @@ static int btusb_setup_rtl_get_newfw ( s /*check file length*/ if(fw->size<20){ - BT_ERR("%s: file size %d error", __func__,fw->size); + BT_ERR("%s: file size %d error", __func__, (int)fw->size); return -1; } /*check signature*/ @@ -1686,7 +1687,7 @@ static int btusb_setup_rtl_patching(stru return -EIO; } - evt_para = (struct hci_rp_read_local_version *)skb->data; + evt_para = (struct download_rp *)skb->data; if (evt_para->status) { BT_ERR("Realtek patch event failed (%02x)",evt_para->status); kfree_skb(skb); @@ -1768,7 +1769,8 @@ static int btusb_setup_rtl(struct hci_de fwname, ret); return ret; } - BT_DBG("%s fw->data=%p fw->size= %d ",__func__,fw->data,fw->size); + BT_DBG("%s fw->data=%p fw->size= %d ", __func__, fw->data, + (int)fw->size); /*For 8723a, use old style patch*/ if (lmp_version== ROM_LMP_8723A)