| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * AVM BlueFRITZ! USB driver |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * Copyright (C) 2003-2006 Marcel Holtmann <marcel@holtmann.org> |
|---|
| 6 | | - * |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 10 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 11 | | - * (at your option) any later version. |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 16 | | - * GNU General Public License for more details. |
|---|
| 17 | | - * |
|---|
| 18 | | - * You should have received a copy of the GNU General Public License |
|---|
| 19 | | - * along with this program; if not, write to the Free Software |
|---|
| 20 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 21 | | - * |
|---|
| 22 | 7 | */ |
|---|
| 23 | 8 | |
|---|
| 24 | 9 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 148 | 133 | |
|---|
| 149 | 134 | err = usb_submit_urb(urb, GFP_ATOMIC); |
|---|
| 150 | 135 | if (err) { |
|---|
| 151 | | - BT_ERR("%s bulk tx submit failed urb %p err %d", |
|---|
| 152 | | - data->hdev->name, urb, err); |
|---|
| 136 | + bt_dev_err(data->hdev, "bulk tx submit failed urb %p err %d", |
|---|
| 137 | + urb, err); |
|---|
| 153 | 138 | skb_unlink(skb, &data->pending_q); |
|---|
| 154 | 139 | usb_free_urb(urb); |
|---|
| 155 | 140 | } else |
|---|
| .. | .. |
|---|
| 247 | 232 | |
|---|
| 248 | 233 | err = usb_submit_urb(urb, GFP_ATOMIC); |
|---|
| 249 | 234 | if (err) { |
|---|
| 250 | | - BT_ERR("%s bulk rx submit failed urb %p err %d", |
|---|
| 251 | | - data->hdev->name, urb, err); |
|---|
| 235 | + bt_dev_err(data->hdev, "bulk rx submit failed urb %p err %d", |
|---|
| 236 | + urb, err); |
|---|
| 252 | 237 | skb_unlink(skb, &data->pending_q); |
|---|
| 253 | 238 | kfree_skb(skb); |
|---|
| 254 | 239 | usb_free_urb(urb); |
|---|
| .. | .. |
|---|
| 262 | 247 | BT_DBG("bfusb %p hdr 0x%02x data %p len %d", data, hdr, buf, len); |
|---|
| 263 | 248 | |
|---|
| 264 | 249 | if (hdr & 0x10) { |
|---|
| 265 | | - BT_ERR("%s error in block", data->hdev->name); |
|---|
| 250 | + bt_dev_err(data->hdev, "error in block"); |
|---|
| 266 | 251 | kfree_skb(data->reassembly); |
|---|
| 267 | 252 | data->reassembly = NULL; |
|---|
| 268 | 253 | return -EIO; |
|---|
| .. | .. |
|---|
| 274 | 259 | int pkt_len = 0; |
|---|
| 275 | 260 | |
|---|
| 276 | 261 | if (data->reassembly) { |
|---|
| 277 | | - BT_ERR("%s unexpected start block", data->hdev->name); |
|---|
| 262 | + bt_dev_err(data->hdev, "unexpected start block"); |
|---|
| 278 | 263 | kfree_skb(data->reassembly); |
|---|
| 279 | 264 | data->reassembly = NULL; |
|---|
| 280 | 265 | } |
|---|
| 281 | 266 | |
|---|
| 282 | 267 | if (len < 1) { |
|---|
| 283 | | - BT_ERR("%s no packet type found", data->hdev->name); |
|---|
| 268 | + bt_dev_err(data->hdev, "no packet type found"); |
|---|
| 284 | 269 | return -EPROTO; |
|---|
| 285 | 270 | } |
|---|
| 286 | 271 | |
|---|
| .. | .. |
|---|
| 292 | 277 | struct hci_event_hdr *hdr = (struct hci_event_hdr *) buf; |
|---|
| 293 | 278 | pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen; |
|---|
| 294 | 279 | } else { |
|---|
| 295 | | - BT_ERR("%s event block is too short", data->hdev->name); |
|---|
| 280 | + bt_dev_err(data->hdev, "event block is too short"); |
|---|
| 296 | 281 | return -EILSEQ; |
|---|
| 297 | 282 | } |
|---|
| 298 | 283 | break; |
|---|
| .. | .. |
|---|
| 302 | 287 | struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) buf; |
|---|
| 303 | 288 | pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen); |
|---|
| 304 | 289 | } else { |
|---|
| 305 | | - BT_ERR("%s data block is too short", data->hdev->name); |
|---|
| 290 | + bt_dev_err(data->hdev, "data block is too short"); |
|---|
| 306 | 291 | return -EILSEQ; |
|---|
| 307 | 292 | } |
|---|
| 308 | 293 | break; |
|---|
| .. | .. |
|---|
| 312 | 297 | struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) buf; |
|---|
| 313 | 298 | pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen; |
|---|
| 314 | 299 | } else { |
|---|
| 315 | | - BT_ERR("%s audio block is too short", data->hdev->name); |
|---|
| 300 | + bt_dev_err(data->hdev, "audio block is too short"); |
|---|
| 316 | 301 | return -EILSEQ; |
|---|
| 317 | 302 | } |
|---|
| 318 | 303 | break; |
|---|
| .. | .. |
|---|
| 320 | 305 | |
|---|
| 321 | 306 | skb = bt_skb_alloc(pkt_len, GFP_ATOMIC); |
|---|
| 322 | 307 | if (!skb) { |
|---|
| 323 | | - BT_ERR("%s no memory for the packet", data->hdev->name); |
|---|
| 308 | + bt_dev_err(data->hdev, "no memory for the packet"); |
|---|
| 324 | 309 | return -ENOMEM; |
|---|
| 325 | 310 | } |
|---|
| 326 | 311 | |
|---|
| .. | .. |
|---|
| 329 | 314 | data->reassembly = skb; |
|---|
| 330 | 315 | } else { |
|---|
| 331 | 316 | if (!data->reassembly) { |
|---|
| 332 | | - BT_ERR("%s unexpected continuation block", data->hdev->name); |
|---|
| 317 | + bt_dev_err(data->hdev, "unexpected continuation block"); |
|---|
| 333 | 318 | return -EIO; |
|---|
| 334 | 319 | } |
|---|
| 335 | 320 | } |
|---|
| .. | .. |
|---|
| 381 | 366 | } |
|---|
| 382 | 367 | |
|---|
| 383 | 368 | if (count < len) { |
|---|
| 384 | | - BT_ERR("%s block extends over URB buffer ranges", |
|---|
| 385 | | - data->hdev->name); |
|---|
| 369 | + bt_dev_err(data->hdev, "block extends over URB buffer ranges"); |
|---|
| 386 | 370 | } |
|---|
| 387 | 371 | |
|---|
| 388 | 372 | if ((hdr & 0xe1) == 0xc1) |
|---|
| .. | .. |
|---|
| 406 | 390 | |
|---|
| 407 | 391 | err = usb_submit_urb(urb, GFP_ATOMIC); |
|---|
| 408 | 392 | if (err) { |
|---|
| 409 | | - BT_ERR("%s bulk resubmit failed urb %p err %d", |
|---|
| 410 | | - data->hdev->name, urb, err); |
|---|
| 393 | + bt_dev_err(data->hdev, "bulk resubmit failed urb %p err %d", |
|---|
| 394 | + urb, err); |
|---|
| 411 | 395 | } |
|---|
| 412 | 396 | |
|---|
| 413 | 397 | unlock: |
|---|
| .. | .. |
|---|
| 492 | 476 | /* Max HCI frame size seems to be 1511 + 1 */ |
|---|
| 493 | 477 | nskb = bt_skb_alloc(count + 32, GFP_KERNEL); |
|---|
| 494 | 478 | if (!nskb) { |
|---|
| 495 | | - BT_ERR("Can't allocate memory for new packet"); |
|---|
| 479 | + bt_dev_err(hdev, "Can't allocate memory for new packet"); |
|---|
| 496 | 480 | return -ENOMEM; |
|---|
| 497 | 481 | } |
|---|
| 498 | 482 | |
|---|