Commit 633a34bd authored by Rashika Kheria's avatar Rashika Kheria Committed by Greg Kroah-Hartman

Staging: btmtk_usb: Fix line length exceeding 80 characters

This patch fixes the following checkpatch.pl warning in btmtk_usb.c
WARNING: line over 80 characters in the file
Signed-off-by: default avatarRashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c527ba95
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* or on the worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. * or on the worldwide web at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
* *
*/ */
...@@ -72,8 +73,9 @@ static int btmtk_usb_reset(struct usb_device *udev) ...@@ -72,8 +73,9 @@ static int btmtk_usb_reset(struct usb_device *udev)
BT_DBG("%s\n", __func__); BT_DBG("%s\n", __func__);
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x01, DEVICE_VENDOR_REQUEST_OUT, ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x01,
0x01, 0x00, NULL, 0x00, CONTROL_TIMEOUT_JIFFIES); DEVICE_VENDOR_REQUEST_OUT, 0x01, 0x00,
NULL, 0x00, CONTROL_TIMEOUT_JIFFIES);
if (ret < 0) { if (ret < 0) {
BT_ERR("%s error(%d)\n", __func__, ret); BT_ERR("%s error(%d)\n", __func__, ret);
...@@ -92,13 +94,14 @@ static int btmtk_usb_io_read32(struct btmtk_usb_data *data, u32 reg, u32 *val) ...@@ -92,13 +94,14 @@ static int btmtk_usb_io_read32(struct btmtk_usb_data *data, u32 reg, u32 *val)
struct usb_device *udev = data->udev; struct usb_device *udev = data->udev;
int ret; int ret;
ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), request, DEVICE_VENDOR_REQUEST_IN, ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), request,
0x0, reg, data->io_buf, 4, DEVICE_VENDOR_REQUEST_IN, 0x0, reg, data->io_buf,
CONTROL_TIMEOUT_JIFFIES); 4, CONTROL_TIMEOUT_JIFFIES);
if (ret < 0) { if (ret < 0) {
*val = 0xffffffff; *val = 0xffffffff;
BT_ERR("%s error(%d), reg=%x, value=%x\n", __func__, ret, reg, *val); BT_ERR("%s error(%d), reg=%x, value=%x\n",
__func__, ret, reg, *val);
return ret; return ret;
} }
...@@ -122,12 +125,13 @@ static int btmtk_usb_io_write32(struct btmtk_usb_data *data, u32 reg, u32 val) ...@@ -122,12 +125,13 @@ static int btmtk_usb_io_write32(struct btmtk_usb_data *data, u32 reg, u32 val)
index = (u16)reg; index = (u16)reg;
value = val & 0x0000ffff; value = val & 0x0000ffff;
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), request, DEVICE_VENDOR_REQUEST_OUT, ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), request,
value, index, NULL, 0, DEVICE_VENDOR_REQUEST_OUT, value, index,
CONTROL_TIMEOUT_JIFFIES); NULL, 0, CONTROL_TIMEOUT_JIFFIES);
if (ret < 0) { if (ret < 0) {
BT_ERR("%s error(%d), reg=%x, value=%x\n", __func__, ret, reg, val); BT_ERR("%s error(%d), reg=%x, value=%x\n",
__func__, ret, reg, val);
return ret; return ret;
} }
...@@ -139,7 +143,8 @@ static int btmtk_usb_io_write32(struct btmtk_usb_data *data, u32 reg, u32 val) ...@@ -139,7 +143,8 @@ static int btmtk_usb_io_write32(struct btmtk_usb_data *data, u32 reg, u32 val)
value, index, NULL, 0, CONTROL_TIMEOUT_JIFFIES); value, index, NULL, 0, CONTROL_TIMEOUT_JIFFIES);
if (ret < 0) { if (ret < 0) {
BT_ERR("%s error(%d), reg=%x, value=%x\n", __func__, ret, reg, val); BT_ERR("%s error(%d), reg=%x, value=%x\n",
__func__, ret, reg, val);
return ret; return ret;
} }
...@@ -186,13 +191,15 @@ static void btmtk_usb_cap_init(struct btmtk_usb_data *data) ...@@ -186,13 +191,15 @@ static void btmtk_usb_cap_init(struct btmtk_usb_data *data)
ret = request_firmware(&firmware, MT7650_FIRMWARE, &udev->dev); ret = request_firmware(&firmware, MT7650_FIRMWARE, &udev->dev);
if (ret < 0) { if (ret < 0) {
if (ret == -ENOENT) { if (ret == -ENOENT) {
BT_ERR("Firmware file \"%s\" not found \n", MT7650_FIRMWARE); BT_ERR("Firmware file \"%s\" not found \n",
MT7650_FIRMWARE);
} else { } else {
BT_ERR("Firmware file \"%s\" request failed (err=%d) \n", BT_ERR("Firmware file \"%s\" request failed (err=%d) \n",
MT7650_FIRMWARE, ret); MT7650_FIRMWARE, ret);
} }
} else { } else {
BT_DBG("Firmware file \"%s\" Found \n", MT7650_FIRMWARE); BT_DBG("Firmware file \"%s\" Found \n",
MT7650_FIRMWARE);
/* load firmware here */ /* load firmware here */
data->firmware = firmware; data->firmware = firmware;
btmtk_usb_load_fw(data); btmtk_usb_load_fw(data);
...@@ -205,7 +212,8 @@ static void btmtk_usb_cap_init(struct btmtk_usb_data *data) ...@@ -205,7 +212,8 @@ static void btmtk_usb_cap_init(struct btmtk_usb_data *data)
ret = request_firmware(&firmware, MT7662_FIRMWARE, &udev->dev); ret = request_firmware(&firmware, MT7662_FIRMWARE, &udev->dev);
if (ret < 0) { if (ret < 0) {
if (ret == -ENOENT) { if (ret == -ENOENT) {
BT_ERR("Firmware file \"%s\" not found\n", MT7662_FIRMWARE); BT_ERR("Firmware file \"%s\" not found\n",
MT7662_FIRMWARE);
} else { } else {
BT_ERR("Firmware file \"%s\" request failed (err=%d)\n", BT_ERR("Firmware file \"%s\" request failed (err=%d)\n",
MT7662_FIRMWARE, ret); MT7662_FIRMWARE, ret);
...@@ -258,9 +266,9 @@ static int btmtk_usb_chk_crc(struct btmtk_usb_data *data, u32 checksum_len) ...@@ -258,9 +266,9 @@ static int btmtk_usb_chk_crc(struct btmtk_usb_data *data, u32 checksum_len)
memmove(data->io_buf, &data->rom_patch_offset, 4); memmove(data->io_buf, &data->rom_patch_offset, 4);
memmove(&data->io_buf[4], &checksum_len, 4); memmove(&data->io_buf[4], &checksum_len, 4);
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x1, DEVICE_VENDOR_REQUEST_IN, ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x1,
0x20, 0x00, data->io_buf, 8, DEVICE_VENDOR_REQUEST_IN, 0x20, 0x00, data->io_buf,
CONTROL_TIMEOUT_JIFFIES); 8, CONTROL_TIMEOUT_JIFFIES);
if (ret < 0) { if (ret < 0) {
BT_ERR("%s error(%d)\n", __func__, ret); BT_ERR("%s error(%d)\n", __func__, ret);
...@@ -318,8 +326,8 @@ static int btmtk_usb_reset_wmt(struct btmtk_usb_data *data) ...@@ -318,8 +326,8 @@ static int btmtk_usb_reset_wmt(struct btmtk_usb_data *data)
BT_DBG("%s\n", __func__); BT_DBG("%s\n", __func__);
ret = usb_control_msg(data->udev, usb_sndctrlpipe(data->udev, 0), 0x01, ret = usb_control_msg(data->udev, usb_sndctrlpipe(data->udev, 0), 0x01,
DEVICE_CLASS_REQUEST_OUT, 0x12, 0x00, data->io_buf, DEVICE_CLASS_REQUEST_OUT, 0x12, 0x00,
8, CONTROL_TIMEOUT_JIFFIES); data->io_buf, 8, CONTROL_TIMEOUT_JIFFIES);
if (ret) if (ret)
BT_ERR("%s:(%d)\n", __func__, ret); BT_ERR("%s:(%d)\n", __func__, ret);
...@@ -350,7 +358,8 @@ static int btmtk_usb_load_rom_patch(struct btmtk_usb_data *data) ...@@ -350,7 +358,8 @@ static int btmtk_usb_load_rom_patch(struct btmtk_usb_data *data)
unsigned char phase; unsigned char phase;
void *buf; void *buf;
char *pos; char *pos;
unsigned int pipe = usb_sndbulkpipe(data->udev, data->bulk_tx_ep->bEndpointAddress); unsigned int pipe;
pipe = usb_sndbulkpipe(data->udev, data->bulk_tx_ep->bEndpointAddress);
if (!data->firmware) { if (!data->firmware) {
BT_ERR("%s:please assign a rom patch\n", __func__); BT_ERR("%s:please assign a rom patch\n", __func__);
...@@ -391,7 +400,8 @@ static int btmtk_usb_load_rom_patch(struct btmtk_usb_data *data) ...@@ -391,7 +400,8 @@ static int btmtk_usb_load_rom_patch(struct btmtk_usb_data *data)
goto error0; goto error0;
} }
buf = usb_alloc_coherent(data->udev, UPLOAD_PATCH_UNIT, GFP_ATOMIC, &data_dma); buf = usb_alloc_coherent(data->udev, UPLOAD_PATCH_UNIT,
GFP_ATOMIC, &data_dma);
if (!buf) { if (!buf) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -409,78 +419,83 @@ static int btmtk_usb_load_rom_patch(struct btmtk_usb_data *data) ...@@ -409,78 +419,83 @@ static int btmtk_usb_load_rom_patch(struct btmtk_usb_data *data)
/* loading rom patch */ /* loading rom patch */
while (1) { while (1) {
s32 sent_len_max = UPLOAD_PATCH_UNIT - PATCH_HEADER_SIZE; s32 sent_len_max = UPLOAD_PATCH_UNIT - PATCH_HEADER_SIZE;
sent_len = (patch_len - cur_len) >= sent_len_max ? sent_len_max : (patch_len - cur_len); sent_len = (patch_len - cur_len) >= sent_len_max ?
sent_len_max : (patch_len - cur_len);
BT_DBG("patch_len = %d\n", patch_len); BT_DBG("patch_len = %d\n", patch_len);
BT_DBG("cur_len = %d\n", cur_len); BT_DBG("cur_len = %d\n", cur_len);
BT_DBG("sent_len = %d\n", sent_len); BT_DBG("sent_len = %d\n", sent_len);
if (sent_len > 0) { if (sent_len <= 0)
if (first_block == 1) { break;
if (sent_len < sent_len_max)
phase = PATCH_PHASE3; if (first_block == 1) {
else if (sent_len < sent_len_max)
phase = PATCH_PHASE1;
first_block = 0;
} else if (sent_len == sent_len_max) {
phase = PATCH_PHASE2;
} else {
phase = PATCH_PHASE3; phase = PATCH_PHASE3;
} else
phase = PATCH_PHASE1;
first_block = 0;
} else if (sent_len == sent_len_max) {
phase = PATCH_PHASE2;
} else {
phase = PATCH_PHASE3;
}
/* prepare HCI header */ /* prepare HCI header */
pos[0] = 0x6F; pos[0] = 0x6F;
pos[1] = 0xFC; pos[1] = 0xFC;
pos[2] = (sent_len + 5) & 0xFF; pos[2] = (sent_len + 5) & 0xFF;
pos[3] = ((sent_len + 5) >> 8) & 0xFF; pos[3] = ((sent_len + 5) >> 8) & 0xFF;
/* prepare WMT header */ /* prepare WMT header */
pos[4] = 0x01; pos[4] = 0x01;
pos[5] = 0x01; pos[5] = 0x01;
pos[6] = (sent_len + 1) & 0xFF; pos[6] = (sent_len + 1) & 0xFF;
pos[7] = ((sent_len + 1) >> 8) & 0xFF; pos[7] = ((sent_len + 1) >> 8) & 0xFF;
pos[8] = phase; pos[8] = phase;
memcpy(&pos[9], data->firmware->data + PATCH_INFO_SIZE + cur_len, sent_len); memcpy(&pos[9],
data->firmware->data + PATCH_INFO_SIZE + cur_len,
sent_len);
BT_DBG("sent_len + PATCH_HEADER_SIZE = %d, phase = %d\n", BT_DBG("sent_len + PATCH_HEADER_SIZE = %d, phase = %d\n",
sent_len + PATCH_HEADER_SIZE, phase); sent_len + PATCH_HEADER_SIZE, phase);
usb_fill_bulk_urb(urb, usb_fill_bulk_urb(urb,
data->udev, data->udev,
pipe, pipe,
buf, buf,
sent_len + PATCH_HEADER_SIZE, sent_len + PATCH_HEADER_SIZE,
load_rom_patch_complete, load_rom_patch_complete,
&sent_to_mcu_done); &sent_to_mcu_done);
urb->transfer_dma = data_dma; urb->transfer_dma = data_dma;
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret) if (ret)
goto error2; goto error2;
if (!wait_for_completion_timeout(&sent_to_mcu_done, msecs_to_jiffies(1000))) { if (!wait_for_completion_timeout(&sent_to_mcu_done,
usb_kill_urb(urb); msecs_to_jiffies(1000))) {
BT_ERR("upload rom_patch timeout\n"); usb_kill_urb(urb);
goto error2; BT_ERR("upload rom_patch timeout\n");
} goto error2;
}
BT_DBG("."); BT_DBG(".");
mdelay(200); mdelay(200);
cur_len += sent_len; cur_len += sent_len;
} else {
break;
}
} }
total_checksum = checksume16((u8 *)data->firmware->data + PATCH_INFO_SIZE, patch_len); total_checksum = checksume16(
(u8 *)data->firmware->data + PATCH_INFO_SIZE,
patch_len);
BT_DBG("Send checksum req..\n"); BT_DBG("Send checksum req..\n");
...@@ -520,8 +535,8 @@ static int load_fw_iv(struct btmtk_usb_data *data) ...@@ -520,8 +535,8 @@ static int load_fw_iv(struct btmtk_usb_data *data)
memmove(buf, data->firmware->data + 32, 64); memmove(buf, data->firmware->data + 32, 64);
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x01, ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x01,
DEVICE_VENDOR_REQUEST_OUT, 0x12, 0x0, buf, 64, DEVICE_VENDOR_REQUEST_OUT, 0x12, 0x0, buf, 64,
CONTROL_TIMEOUT_JIFFIES); CONTROL_TIMEOUT_JIFFIES);
if (ret < 0) { if (ret < 0) {
BT_ERR("%s error(%d) step4\n", __func__, ret); BT_ERR("%s error(%d) step4\n", __func__, ret);
...@@ -559,7 +574,8 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data) ...@@ -559,7 +574,8 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data)
dma_addr_t data_dma; dma_addr_t data_dma;
int ret = 0, sent_len; int ret = 0, sent_len;
struct completion sent_to_mcu_done; struct completion sent_to_mcu_done;
unsigned int pipe = usb_sndbulkpipe(data->udev, data->bulk_tx_ep->bEndpointAddress); unsigned int pipe;
pipe = usb_sndbulkpipe(data->udev, data->bulk_tx_ep->bEndpointAddress);
if (!data->firmware) { if (!data->firmware) {
BT_ERR("%s:please assign a fw\n", __func__); BT_ERR("%s:please assign a fw\n", __func__);
...@@ -598,9 +614,11 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data) ...@@ -598,9 +614,11 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data)
| (*(data->firmware->data + 5) << 8) | (*(data->firmware->data + 5) << 8)
| (*(data->firmware->data + 4)); | (*(data->firmware->data + 4));
fw_ver = (*(data->firmware->data + 11) << 8) | (*(data->firmware->data + 10)); fw_ver = (*(data->firmware->data + 11) << 8) |
(*(data->firmware->data + 10));
build_ver = (*(data->firmware->data + 9) << 8) | (*(data->firmware->data + 8)); build_ver = (*(data->firmware->data + 9) << 8) |
(*(data->firmware->data + 8));
BT_DBG("fw version:%d.%d.%02d ", BT_DBG("fw version:%d.%d.%02d ",
(fw_ver & 0xf000) >> 8, (fw_ver & 0xf000) >> 8,
...@@ -657,7 +675,8 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data) ...@@ -657,7 +675,8 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data)
/* Loading ILM */ /* Loading ILM */
while (1) { while (1) {
sent_len = (ilm_len - cur_len) >= 14336 ? 14336 : (ilm_len - cur_len); sent_len = (ilm_len - cur_len) >= 14336 ? 14336 :
(ilm_len - cur_len);
if (sent_len > 0) { if (sent_len > 0) {
packet_header &= ~(0xffffffff); packet_header &= ~(0xffffffff);
...@@ -665,7 +684,8 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data) ...@@ -665,7 +684,8 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data)
packet_header = cpu_to_le32(packet_header); packet_header = cpu_to_le32(packet_header);
memmove(buf, &packet_header, 4); memmove(buf, &packet_header, 4);
memmove(buf + 4, data->firmware->data + 32 + cur_len, sent_len); memmove(buf + 4, data->firmware->data + 32 + cur_len,
sent_len);
/* U2M_PDMA descriptor */ /* U2M_PDMA descriptor */
btmtk_usb_io_write32(data, 0x230, cur_len); btmtk_usb_io_write32(data, 0x230, cur_len);
...@@ -693,7 +713,8 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data) ...@@ -693,7 +713,8 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data)
if (ret) if (ret)
goto error3; goto error3;
if (!wait_for_completion_timeout(&sent_to_mcu_done, msecs_to_jiffies(1000))) { if (!wait_for_completion_timeout(&sent_to_mcu_done,
msecs_to_jiffies(1000))) {
usb_kill_urb(urb); usb_kill_urb(urb);
BT_ERR("upload ilm fw timeout\n"); BT_ERR("upload ilm fw timeout\n");
goto error3; goto error3;
...@@ -714,58 +735,61 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data) ...@@ -714,58 +735,61 @@ static int btmtk_usb_load_fw(struct btmtk_usb_data *data)
/* Loading DLM */ /* Loading DLM */
while (1) { while (1) {
sent_len = (dlm_len - cur_len) >= 14336 ? 14336 : (dlm_len - cur_len); sent_len = (dlm_len - cur_len) >= 14336 ? 14336 :
(dlm_len - cur_len);
if (sent_len > 0) { if (sent_len <= 0)
packet_header &= ~(0xffffffff); break;
packet_header |= (sent_len << 16);
packet_header = cpu_to_le32(packet_header);
memmove(buf, &packet_header, 4); packet_header &= ~(0xffffffff);
memmove(buf + 4, data->firmware->data + 32 + ilm_len + cur_len, sent_len); packet_header |= (sent_len << 16);
packet_header = cpu_to_le32(packet_header);
/* U2M_PDMA descriptor */ memmove(buf, &packet_header, 4);
btmtk_usb_io_write32(data, 0x230, 0x80000 + cur_len); memmove(buf + 4,
data->firmware->data + 32 + ilm_len + cur_len,
sent_len);
while ((sent_len % 4) != 0) { /* U2M_PDMA descriptor */
BT_DBG("sent_len is not divided by 4\n"); btmtk_usb_io_write32(data, 0x230, 0x80000 + cur_len);
sent_len++;
}
/* U2M_PDMA length */ while ((sent_len % 4) != 0) {
btmtk_usb_io_write32(data, 0x234, sent_len << 16); BT_DBG("sent_len is not divided by 4\n");
sent_len++;
}
usb_fill_bulk_urb(urb, /* U2M_PDMA length */
udev, btmtk_usb_io_write32(data, 0x234, sent_len << 16);
pipe,
buf,
sent_len + 4,
load_fw_complete,
&sent_to_mcu_done);
urb->transfer_dma = data_dma; usb_fill_bulk_urb(urb,
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; udev,
pipe,
buf,
sent_len + 4,
load_fw_complete,
&sent_to_mcu_done);
ret = usb_submit_urb(urb, GFP_ATOMIC); urb->transfer_dma = data_dma;
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
if (ret) ret = usb_submit_urb(urb, GFP_ATOMIC);
goto error3;
if (!wait_for_completion_timeout(&sent_to_mcu_done, msecs_to_jiffies(1000))) { if (ret)
usb_kill_urb(urb); goto error3;
BT_ERR("upload dlm fw timeout\n");
goto error3;
}
BT_DBG("."); if (!wait_for_completion_timeout(&sent_to_mcu_done,
msecs_to_jiffies(1000))) {
usb_kill_urb(urb);
BT_ERR("upload dlm fw timeout\n");
goto error3;
}
mdelay(500); BT_DBG(".");
cur_len += sent_len; mdelay(500);
cur_len += sent_len;
} else {
break;
}
} }
/* upload 64bytes interrupt vector */ /* upload 64bytes interrupt vector */
...@@ -978,8 +1002,8 @@ static int btmtk_usb_submit_bulk_in_urb(struct hci_dev *hdev, gfp_t mem_flags) ...@@ -978,8 +1002,8 @@ static int btmtk_usb_submit_bulk_in_urb(struct hci_dev *hdev, gfp_t mem_flags)
pipe = usb_rcvbulkpipe(data->udev, data->bulk_rx_ep->bEndpointAddress); pipe = usb_rcvbulkpipe(data->udev, data->bulk_rx_ep->bEndpointAddress);
usb_fill_bulk_urb(urb, data->udev, pipe, usb_fill_bulk_urb(urb, data->udev, pipe, buf, size,
buf, size, btmtk_usb_bulk_in_complete, hdev); btmtk_usb_bulk_in_complete, hdev);
urb->transfer_flags |= URB_FREE_BUFFER; urb->transfer_flags |= URB_FREE_BUFFER;
...@@ -1015,7 +1039,8 @@ static void btmtk_usb_isoc_in_complete(struct urb *urb) ...@@ -1015,7 +1039,8 @@ static void btmtk_usb_isoc_in_complete(struct urb *urb)
if (urb->status == 0) { if (urb->status == 0) {
for (i = 0; i < urb->number_of_packets; i++) { for (i = 0; i < urb->number_of_packets; i++) {
unsigned int offset = urb->iso_frame_desc[i].offset; unsigned int offset = urb->iso_frame_desc[i].offset;
unsigned int length = urb->iso_frame_desc[i].actual_length; unsigned int length;
length = urb->iso_frame_desc[i].actual_length;
if (urb->iso_frame_desc[i].status) if (urb->iso_frame_desc[i].status)
continue; continue;
...@@ -1096,8 +1121,9 @@ static int btmtk_usb_submit_isoc_in_urb(struct hci_dev *hdev, gfp_t mem_flags) ...@@ -1096,8 +1121,9 @@ static int btmtk_usb_submit_isoc_in_urb(struct hci_dev *hdev, gfp_t mem_flags)
pipe = usb_rcvisocpipe(data->udev, data->isoc_rx_ep->bEndpointAddress); pipe = usb_rcvisocpipe(data->udev, data->isoc_rx_ep->bEndpointAddress);
usb_fill_int_urb(urb, data->udev, pipe, buf, size, btmtk_usb_isoc_in_complete, usb_fill_int_urb(urb, data->udev, pipe, buf, size,
hdev, data->isoc_rx_ep->bInterval); btmtk_usb_isoc_in_complete, hdev,
data->isoc_rx_ep->bInterval);
urb->transfer_flags = URB_FREE_BUFFER | URB_ISO_ASAP; urb->transfer_flags = URB_FREE_BUFFER | URB_ISO_ASAP;
...@@ -1306,7 +1332,8 @@ static int btmtk_usb_send_frame(struct sk_buff *skb) ...@@ -1306,7 +1332,8 @@ static int btmtk_usb_send_frame(struct sk_buff *skb)
} }
usb_fill_control_urb(urb, data->udev, pipe, (void *) dr, usb_fill_control_urb(urb, data->udev, pipe, (void *) dr,
skb->data, skb->len, btmtk_usb_tx_complete, skb); skb->data, skb->len,
btmtk_usb_tx_complete, skb);
hdev->stat.cmd_tx++; hdev->stat.cmd_tx++;
break; break;
...@@ -1322,8 +1349,8 @@ static int btmtk_usb_send_frame(struct sk_buff *skb) ...@@ -1322,8 +1349,8 @@ static int btmtk_usb_send_frame(struct sk_buff *skb)
pipe = usb_sndbulkpipe(data->udev, pipe = usb_sndbulkpipe(data->udev,
data->bulk_tx_ep->bEndpointAddress); data->bulk_tx_ep->bEndpointAddress);
usb_fill_bulk_urb(urb, data->udev, pipe, usb_fill_bulk_urb(urb, data->udev, pipe, skb->data,
skb->data, skb->len, btmtk_usb_tx_complete, skb); skb->len, btmtk_usb_tx_complete, skb);
hdev->stat.acl_tx++; hdev->stat.acl_tx++;
BT_DBG("HCI_ACLDATA_PKT:\n"); BT_DBG("HCI_ACLDATA_PKT:\n");
...@@ -1442,7 +1469,8 @@ static inline int __set_isoc_interface(struct hci_dev *hdev, int altsetting) ...@@ -1442,7 +1469,8 @@ static inline int __set_isoc_interface(struct hci_dev *hdev, int altsetting)
static void btmtk_usb_work(struct work_struct *work) static void btmtk_usb_work(struct work_struct *work)
{ {
struct btmtk_usb_data *data = container_of(work, struct btmtk_usb_data, work); struct btmtk_usb_data *data = container_of(work, struct btmtk_usb_data,
work);
struct hci_dev *hdev = data->hdev; struct hci_dev *hdev = data->hdev;
int new_alts; int new_alts;
int err; int err;
...@@ -1451,7 +1479,8 @@ static void btmtk_usb_work(struct work_struct *work) ...@@ -1451,7 +1479,8 @@ static void btmtk_usb_work(struct work_struct *work)
if (hdev->conn_hash.sco_num > 0) { if (hdev->conn_hash.sco_num > 0) {
if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) { if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) {
err = usb_autopm_get_interface(data->isoc ? data->isoc : data->intf); err = usb_autopm_get_interface(data->isoc ?
data->isoc : data->intf);
if (err < 0) { if (err < 0) {
clear_bit(BTUSB_ISOC_RUNNING, &data->flags); clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
usb_kill_anchored_urbs(&data->isoc_anchor); usb_kill_anchored_urbs(&data->isoc_anchor);
...@@ -1489,13 +1518,15 @@ static void btmtk_usb_work(struct work_struct *work) ...@@ -1489,13 +1518,15 @@ static void btmtk_usb_work(struct work_struct *work)
__set_isoc_interface(hdev, 0); __set_isoc_interface(hdev, 0);
if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags)) if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags))
usb_autopm_put_interface(data->isoc ? data->isoc : data->intf); usb_autopm_put_interface(data->isoc ?
data->isoc : data->intf);
} }
} }
static void btmtk_usb_waker(struct work_struct *work) static void btmtk_usb_waker(struct work_struct *work)
{ {
struct btmtk_usb_data *data = container_of(work, struct btmtk_usb_data, waker); struct btmtk_usb_data *data = container_of(work, struct btmtk_usb_data,
waker);
int err; int err;
err = usb_autopm_get_interface(data->intf); err = usb_autopm_get_interface(data->intf);
......
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