diff options
| author | Mat Martineau <mathewm@codeaurora.org> | 2012-05-17 23:53:54 -0400 |
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-04 23:34:05 -0400 |
| commit | 522cc2ee6e55ba49f4df338e0dfcfb989b46eb8c (patch) | |
| tree | 9268f0b5059002acb16a5e00889389d0603fb491 /include/net/bluetooth | |
| parent | 273759e2c3bd69efe74799c446df69d9ea5ca418 (diff) | |
Bluetooth: Remove unused ERTM control field macros
Now that l2cap_ctrl is used to set up control fields, these macros are
not needed.
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'include/net/bluetooth')
| -rw-r--r-- | include/net/bluetooth/l2cap.h | 168 |
1 files changed, 0 insertions, 168 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 117db8e4a5f4..7bc40198f147 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -725,174 +725,6 @@ static inline __u16 __next_seq(struct l2cap_chan *chan, __u16 seq) | |||
| 725 | return (seq + 1) % (chan->tx_win_max + 1); | 725 | return (seq + 1) % (chan->tx_win_max + 1); |
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | static inline int l2cap_tx_window_full(struct l2cap_chan *ch) | ||
| 729 | { | ||
| 730 | int sub; | ||
| 731 | |||
| 732 | sub = (ch->next_tx_seq - ch->expected_ack_seq) % 64; | ||
| 733 | |||
| 734 | if (sub < 0) | ||
| 735 | sub += 64; | ||
| 736 | |||
| 737 | return sub == ch->remote_tx_win; | ||
| 738 | } | ||
| 739 | |||
| 740 | static inline __u16 __get_reqseq(struct l2cap_chan *chan, __u32 ctrl) | ||
| 741 | { | ||
| 742 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 743 | return (ctrl & L2CAP_EXT_CTRL_REQSEQ) >> | ||
| 744 | L2CAP_EXT_CTRL_REQSEQ_SHIFT; | ||
| 745 | else | ||
| 746 | return (ctrl & L2CAP_CTRL_REQSEQ) >> L2CAP_CTRL_REQSEQ_SHIFT; | ||
| 747 | } | ||
| 748 | |||
| 749 | static inline __u32 __set_reqseq(struct l2cap_chan *chan, __u32 reqseq) | ||
| 750 | { | ||
| 751 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 752 | return (reqseq << L2CAP_EXT_CTRL_REQSEQ_SHIFT) & | ||
| 753 | L2CAP_EXT_CTRL_REQSEQ; | ||
| 754 | else | ||
| 755 | return (reqseq << L2CAP_CTRL_REQSEQ_SHIFT) & L2CAP_CTRL_REQSEQ; | ||
| 756 | } | ||
| 757 | |||
| 758 | static inline __u16 __get_txseq(struct l2cap_chan *chan, __u32 ctrl) | ||
| 759 | { | ||
| 760 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 761 | return (ctrl & L2CAP_EXT_CTRL_TXSEQ) >> | ||
| 762 | L2CAP_EXT_CTRL_TXSEQ_SHIFT; | ||
| 763 | else | ||
| 764 | return (ctrl & L2CAP_CTRL_TXSEQ) >> L2CAP_CTRL_TXSEQ_SHIFT; | ||
| 765 | } | ||
| 766 | |||
| 767 | static inline __u32 __set_txseq(struct l2cap_chan *chan, __u32 txseq) | ||
| 768 | { | ||
| 769 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 770 | return (txseq << L2CAP_EXT_CTRL_TXSEQ_SHIFT) & | ||
| 771 | L2CAP_EXT_CTRL_TXSEQ; | ||
| 772 | else | ||
| 773 | return (txseq << L2CAP_CTRL_TXSEQ_SHIFT) & L2CAP_CTRL_TXSEQ; | ||
| 774 | } | ||
| 775 | |||
| 776 | static inline bool __is_sframe(struct l2cap_chan *chan, __u32 ctrl) | ||
| 777 | { | ||
| 778 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 779 | return ctrl & L2CAP_EXT_CTRL_FRAME_TYPE; | ||
| 780 | else | ||
| 781 | return ctrl & L2CAP_CTRL_FRAME_TYPE; | ||
| 782 | } | ||
| 783 | |||
| 784 | static inline __u32 __set_sframe(struct l2cap_chan *chan) | ||
| 785 | { | ||
| 786 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 787 | return L2CAP_EXT_CTRL_FRAME_TYPE; | ||
| 788 | else | ||
| 789 | return L2CAP_CTRL_FRAME_TYPE; | ||
| 790 | } | ||
| 791 | |||
| 792 | static inline __u8 __get_ctrl_sar(struct l2cap_chan *chan, __u32 ctrl) | ||
| 793 | { | ||
| 794 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 795 | return (ctrl & L2CAP_EXT_CTRL_SAR) >> L2CAP_EXT_CTRL_SAR_SHIFT; | ||
| 796 | else | ||
| 797 | return (ctrl & L2CAP_CTRL_SAR) >> L2CAP_CTRL_SAR_SHIFT; | ||
| 798 | } | ||
| 799 | |||
| 800 | static inline __u32 __set_ctrl_sar(struct l2cap_chan *chan, __u32 sar) | ||
| 801 | { | ||
| 802 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 803 | return (sar << L2CAP_EXT_CTRL_SAR_SHIFT) & L2CAP_EXT_CTRL_SAR; | ||
| 804 | else | ||
| 805 | return (sar << L2CAP_CTRL_SAR_SHIFT) & L2CAP_CTRL_SAR; | ||
| 806 | } | ||
| 807 | |||
| 808 | static inline bool __is_sar_start(struct l2cap_chan *chan, __u32 ctrl) | ||
| 809 | { | ||
| 810 | return __get_ctrl_sar(chan, ctrl) == L2CAP_SAR_START; | ||
| 811 | } | ||
| 812 | |||
| 813 | static inline __u32 __get_sar_mask(struct l2cap_chan *chan) | ||
| 814 | { | ||
| 815 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 816 | return L2CAP_EXT_CTRL_SAR; | ||
| 817 | else | ||
| 818 | return L2CAP_CTRL_SAR; | ||
| 819 | } | ||
| 820 | |||
| 821 | static inline __u8 __get_ctrl_super(struct l2cap_chan *chan, __u32 ctrl) | ||
| 822 | { | ||
| 823 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 824 | return (ctrl & L2CAP_EXT_CTRL_SUPERVISE) >> | ||
| 825 | L2CAP_EXT_CTRL_SUPER_SHIFT; | ||
| 826 | else | ||
| 827 | return (ctrl & L2CAP_CTRL_SUPERVISE) >> L2CAP_CTRL_SUPER_SHIFT; | ||
| 828 | } | ||
| 829 | |||
| 830 | static inline __u32 __set_ctrl_super(struct l2cap_chan *chan, __u32 super) | ||
| 831 | { | ||
| 832 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 833 | return (super << L2CAP_EXT_CTRL_SUPER_SHIFT) & | ||
| 834 | L2CAP_EXT_CTRL_SUPERVISE; | ||
| 835 | else | ||
| 836 | return (super << L2CAP_CTRL_SUPER_SHIFT) & | ||
| 837 | L2CAP_CTRL_SUPERVISE; | ||
| 838 | } | ||
| 839 | |||
| 840 | static inline __u32 __set_ctrl_final(struct l2cap_chan *chan) | ||
| 841 | { | ||
| 842 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 843 | return L2CAP_EXT_CTRL_FINAL; | ||
| 844 | else | ||
| 845 | return L2CAP_CTRL_FINAL; | ||
| 846 | } | ||
| 847 | |||
| 848 | static inline bool __is_ctrl_final(struct l2cap_chan *chan, __u32 ctrl) | ||
| 849 | { | ||
| 850 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 851 | return ctrl & L2CAP_EXT_CTRL_FINAL; | ||
| 852 | else | ||
| 853 | return ctrl & L2CAP_CTRL_FINAL; | ||
| 854 | } | ||
| 855 | |||
| 856 | static inline __u32 __set_ctrl_poll(struct l2cap_chan *chan) | ||
| 857 | { | ||
| 858 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 859 | return L2CAP_EXT_CTRL_POLL; | ||
| 860 | else | ||
| 861 | return L2CAP_CTRL_POLL; | ||
| 862 | } | ||
| 863 | |||
| 864 | static inline bool __is_ctrl_poll(struct l2cap_chan *chan, __u32 ctrl) | ||
| 865 | { | ||
| 866 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 867 | return ctrl & L2CAP_EXT_CTRL_POLL; | ||
| 868 | else | ||
| 869 | return ctrl & L2CAP_CTRL_POLL; | ||
| 870 | } | ||
| 871 | |||
| 872 | static inline __u32 __get_control(struct l2cap_chan *chan, void *p) | ||
| 873 | { | ||
| 874 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 875 | return get_unaligned_le32(p); | ||
| 876 | else | ||
| 877 | return get_unaligned_le16(p); | ||
| 878 | } | ||
| 879 | |||
| 880 | static inline void __put_control(struct l2cap_chan *chan, __u32 control, | ||
| 881 | void *p) | ||
| 882 | { | ||
| 883 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 884 | return put_unaligned_le32(control, p); | ||
| 885 | else | ||
| 886 | return put_unaligned_le16(control, p); | ||
| 887 | } | ||
| 888 | |||
| 889 | static inline __u8 __ctrl_size(struct l2cap_chan *chan) | ||
| 890 | { | ||
| 891 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 892 | return L2CAP_EXT_HDR_SIZE - L2CAP_HDR_SIZE; | ||
| 893 | else | ||
| 894 | return L2CAP_ENH_HDR_SIZE - L2CAP_HDR_SIZE; | ||
| 895 | } | ||
| 896 | 728 | ||
| 897 | extern bool disable_ertm; | 729 | extern bool disable_ertm; |
| 898 | 730 | ||
