diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-05-02 22:09:01 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-08-22 17:50:07 -0400 |
commit | 44dd46de325c4d47abfd1361e5d84a548edb8e42 (patch) | |
tree | cd23feb79ecee0eed27abbd4078bfcc80896194c /net/bluetooth | |
parent | 52d18347dfb61519aa0f58fe1759edd3ad8c4e36 (diff) |
Bluetooth: Add module option to enable L2CAP ERTM support
Since the Enhanced Retransmission mode for L2CAP is still under heavy
development disable it by default and provide a module option to enable
it manually for testing.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index bd0a4c1bced0..810a3c1a4188 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -50,7 +50,9 @@ | |||
50 | #include <net/bluetooth/hci_core.h> | 50 | #include <net/bluetooth/hci_core.h> |
51 | #include <net/bluetooth/l2cap.h> | 51 | #include <net/bluetooth/l2cap.h> |
52 | 52 | ||
53 | #define VERSION "2.13" | 53 | #define VERSION "2.14" |
54 | |||
55 | static int enable_ertm = 0; | ||
54 | 56 | ||
55 | static u32 l2cap_feat_mask = L2CAP_FEAT_FIXED_CHAN; | 57 | static u32 l2cap_feat_mask = L2CAP_FEAT_FIXED_CHAN; |
56 | static u8 l2cap_fixed_chan[8] = { 0x02, }; | 58 | static u8 l2cap_fixed_chan[8] = { 0x02, }; |
@@ -2205,10 +2207,13 @@ static inline int l2cap_information_req(struct l2cap_conn *conn, struct l2cap_cm | |||
2205 | 2207 | ||
2206 | if (type == L2CAP_IT_FEAT_MASK) { | 2208 | if (type == L2CAP_IT_FEAT_MASK) { |
2207 | u8 buf[8]; | 2209 | u8 buf[8]; |
2210 | u32 feat_mask = l2cap_feat_mask; | ||
2208 | struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) buf; | 2211 | struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) buf; |
2209 | rsp->type = cpu_to_le16(L2CAP_IT_FEAT_MASK); | 2212 | rsp->type = cpu_to_le16(L2CAP_IT_FEAT_MASK); |
2210 | rsp->result = cpu_to_le16(L2CAP_IR_SUCCESS); | 2213 | rsp->result = cpu_to_le16(L2CAP_IR_SUCCESS); |
2211 | put_unaligned(cpu_to_le32(l2cap_feat_mask), (__le32 *) rsp->data); | 2214 | if (enable_ertm) |
2215 | feat_mask |= L2CAP_FEAT_ERTM; | ||
2216 | put_unaligned(cpu_to_le32(feat_mask), (__le32 *) rsp->data); | ||
2212 | l2cap_send_cmd(conn, cmd->ident, | 2217 | l2cap_send_cmd(conn, cmd->ident, |
2213 | L2CAP_INFO_RSP, sizeof(buf), buf); | 2218 | L2CAP_INFO_RSP, sizeof(buf), buf); |
2214 | } else if (type == L2CAP_IT_FIXED_CHAN) { | 2219 | } else if (type == L2CAP_IT_FIXED_CHAN) { |
@@ -2828,6 +2833,9 @@ EXPORT_SYMBOL(l2cap_load); | |||
2828 | module_init(l2cap_init); | 2833 | module_init(l2cap_init); |
2829 | module_exit(l2cap_exit); | 2834 | module_exit(l2cap_exit); |
2830 | 2835 | ||
2836 | module_param(enable_ertm, bool, 0644); | ||
2837 | MODULE_PARM_DESC(enable_ertm, "Enable enhanced retransmission mode"); | ||
2838 | |||
2831 | MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); | 2839 | MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); |
2832 | MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION); | 2840 | MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION); |
2833 | MODULE_VERSION(VERSION); | 2841 | MODULE_VERSION(VERSION); |