diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2005-08-09 23:30:28 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:55:13 -0400 |
commit | 0d48d93947dd9ea21c5cdc76a8581b06a4a39281 (patch) | |
tree | 96a1cbfe83a02e27fed3d30f1ac9f2fe05c17506 /drivers/bluetooth/hci_usb.c | |
parent | 2eb25a6c34504254760e67172f7518d6bfdd7676 (diff) |
[Bluetooth]: Move packet type into the SKB control buffer
This patch moves the usage of packet type into the SKB control
buffer. After this patch it is now possible to shrink the sk_buff
structure and redefine its pkt_type.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/bluetooth/hci_usb.c')
-rw-r--r-- | drivers/bluetooth/hci_usb.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index 65740346de36..67d96b5cbb96 100644 --- a/drivers/bluetooth/hci_usb.c +++ b/drivers/bluetooth/hci_usb.c | |||
@@ -443,7 +443,7 @@ static int __tx_submit(struct hci_usb *husb, struct _urb *_urb) | |||
443 | 443 | ||
444 | static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb) | 444 | static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb) |
445 | { | 445 | { |
446 | struct _urb *_urb = __get_completed(husb, skb->pkt_type); | 446 | struct _urb *_urb = __get_completed(husb, bt_cb(skb)->pkt_type); |
447 | struct usb_ctrlrequest *dr; | 447 | struct usb_ctrlrequest *dr; |
448 | struct urb *urb; | 448 | struct urb *urb; |
449 | 449 | ||
@@ -451,7 +451,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb) | |||
451 | _urb = _urb_alloc(0, GFP_ATOMIC); | 451 | _urb = _urb_alloc(0, GFP_ATOMIC); |
452 | if (!_urb) | 452 | if (!_urb) |
453 | return -ENOMEM; | 453 | return -ENOMEM; |
454 | _urb->type = skb->pkt_type; | 454 | _urb->type = bt_cb(skb)->pkt_type; |
455 | 455 | ||
456 | dr = kmalloc(sizeof(*dr), GFP_ATOMIC); | 456 | dr = kmalloc(sizeof(*dr), GFP_ATOMIC); |
457 | if (!dr) { | 457 | if (!dr) { |
@@ -479,7 +479,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb) | |||
479 | 479 | ||
480 | static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb) | 480 | static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb) |
481 | { | 481 | { |
482 | struct _urb *_urb = __get_completed(husb, skb->pkt_type); | 482 | struct _urb *_urb = __get_completed(husb, bt_cb(skb)->pkt_type); |
483 | struct urb *urb; | 483 | struct urb *urb; |
484 | int pipe; | 484 | int pipe; |
485 | 485 | ||
@@ -487,7 +487,7 @@ static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb) | |||
487 | _urb = _urb_alloc(0, GFP_ATOMIC); | 487 | _urb = _urb_alloc(0, GFP_ATOMIC); |
488 | if (!_urb) | 488 | if (!_urb) |
489 | return -ENOMEM; | 489 | return -ENOMEM; |
490 | _urb->type = skb->pkt_type; | 490 | _urb->type = bt_cb(skb)->pkt_type; |
491 | } | 491 | } |
492 | 492 | ||
493 | urb = &_urb->urb; | 493 | urb = &_urb->urb; |
@@ -505,14 +505,14 @@ static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb) | |||
505 | #ifdef CONFIG_BT_HCIUSB_SCO | 505 | #ifdef CONFIG_BT_HCIUSB_SCO |
506 | static inline int hci_usb_send_isoc(struct hci_usb *husb, struct sk_buff *skb) | 506 | static inline int hci_usb_send_isoc(struct hci_usb *husb, struct sk_buff *skb) |
507 | { | 507 | { |
508 | struct _urb *_urb = __get_completed(husb, skb->pkt_type); | 508 | struct _urb *_urb = __get_completed(husb, bt_cb(skb)->pkt_type); |
509 | struct urb *urb; | 509 | struct urb *urb; |
510 | 510 | ||
511 | if (!_urb) { | 511 | if (!_urb) { |
512 | _urb = _urb_alloc(HCI_MAX_ISOC_FRAMES, GFP_ATOMIC); | 512 | _urb = _urb_alloc(HCI_MAX_ISOC_FRAMES, GFP_ATOMIC); |
513 | if (!_urb) | 513 | if (!_urb) |
514 | return -ENOMEM; | 514 | return -ENOMEM; |
515 | _urb->type = skb->pkt_type; | 515 | _urb->type = bt_cb(skb)->pkt_type; |
516 | } | 516 | } |
517 | 517 | ||
518 | BT_DBG("%s skb %p len %d", husb->hdev->name, skb, skb->len); | 518 | BT_DBG("%s skb %p len %d", husb->hdev->name, skb, skb->len); |
@@ -601,11 +601,11 @@ static int hci_usb_send_frame(struct sk_buff *skb) | |||
601 | if (!test_bit(HCI_RUNNING, &hdev->flags)) | 601 | if (!test_bit(HCI_RUNNING, &hdev->flags)) |
602 | return -EBUSY; | 602 | return -EBUSY; |
603 | 603 | ||
604 | BT_DBG("%s type %d len %d", hdev->name, skb->pkt_type, skb->len); | 604 | BT_DBG("%s type %d len %d", hdev->name, bt_cb(skb)->pkt_type, skb->len); |
605 | 605 | ||
606 | husb = (struct hci_usb *) hdev->driver_data; | 606 | husb = (struct hci_usb *) hdev->driver_data; |
607 | 607 | ||
608 | switch (skb->pkt_type) { | 608 | switch (bt_cb(skb)->pkt_type) { |
609 | case HCI_COMMAND_PKT: | 609 | case HCI_COMMAND_PKT: |
610 | hdev->stat.cmd_tx++; | 610 | hdev->stat.cmd_tx++; |
611 | break; | 611 | break; |
@@ -627,7 +627,7 @@ static int hci_usb_send_frame(struct sk_buff *skb) | |||
627 | 627 | ||
628 | read_lock(&husb->completion_lock); | 628 | read_lock(&husb->completion_lock); |
629 | 629 | ||
630 | skb_queue_tail(__transmit_q(husb, skb->pkt_type), skb); | 630 | skb_queue_tail(__transmit_q(husb, bt_cb(skb)->pkt_type), skb); |
631 | hci_usb_tx_wakeup(husb); | 631 | hci_usb_tx_wakeup(husb); |
632 | 632 | ||
633 | read_unlock(&husb->completion_lock); | 633 | read_unlock(&husb->completion_lock); |
@@ -682,7 +682,7 @@ static inline int __recv_frame(struct hci_usb *husb, int type, void *data, int c | |||
682 | return -ENOMEM; | 682 | return -ENOMEM; |
683 | } | 683 | } |
684 | skb->dev = (void *) husb->hdev; | 684 | skb->dev = (void *) husb->hdev; |
685 | skb->pkt_type = type; | 685 | bt_cb(skb)->pkt_type = type; |
686 | 686 | ||
687 | __reassembly(husb, type) = skb; | 687 | __reassembly(husb, type) = skb; |
688 | 688 | ||
@@ -702,6 +702,7 @@ static inline int __recv_frame(struct hci_usb *husb, int type, void *data, int c | |||
702 | if (!scb->expect) { | 702 | if (!scb->expect) { |
703 | /* Complete frame */ | 703 | /* Complete frame */ |
704 | __reassembly(husb, type) = NULL; | 704 | __reassembly(husb, type) = NULL; |
705 | bt_cb(skb)->pkt_type = type; | ||
705 | hci_recv_frame(skb); | 706 | hci_recv_frame(skb); |
706 | } | 707 | } |
707 | 708 | ||