diff options
author | Yuri Kululin <ext-yuri.kululin@nokia.com> | 2010-07-23 05:57:12 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-10-12 11:44:51 -0400 |
commit | 08601469a5aac8b3453d8aca0b8f9bd8dfdae12c (patch) | |
tree | 90a126bf8bd9c56fad847c684384c715df329c49 /net/bluetooth | |
parent | fb3d8eb47ce377d6d7a8fc58b8046ea9eb376a28 (diff) |
Bluetooth: Fix RFCOMM RPN negotiation
According to the ETSI 3GPP TS 07.10 the default bit rate value for RFCOMM
is 9600 bit/s. Return this bit rate in case of RPN request and accept other
sane bit rates proposed by the sender in RPM command.
Signed-off-by: Yuri Kululin <ext-yuri.kululin@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 15ea84ba344e..b464843ed79e 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -1415,8 +1415,8 @@ static int rfcomm_recv_rpn(struct rfcomm_session *s, int cr, int len, struct sk_ | |||
1415 | return 0; | 1415 | return 0; |
1416 | 1416 | ||
1417 | if (len == 1) { | 1417 | if (len == 1) { |
1418 | /* This is a request, return default settings */ | 1418 | /* This is a request, return default (according to ETSI TS 07.10) settings */ |
1419 | bit_rate = RFCOMM_RPN_BR_115200; | 1419 | bit_rate = RFCOMM_RPN_BR_9600; |
1420 | data_bits = RFCOMM_RPN_DATA_8; | 1420 | data_bits = RFCOMM_RPN_DATA_8; |
1421 | stop_bits = RFCOMM_RPN_STOP_1; | 1421 | stop_bits = RFCOMM_RPN_STOP_1; |
1422 | parity = RFCOMM_RPN_PARITY_NONE; | 1422 | parity = RFCOMM_RPN_PARITY_NONE; |
@@ -1431,9 +1431,9 @@ static int rfcomm_recv_rpn(struct rfcomm_session *s, int cr, int len, struct sk_ | |||
1431 | 1431 | ||
1432 | if (rpn->param_mask & cpu_to_le16(RFCOMM_RPN_PM_BITRATE)) { | 1432 | if (rpn->param_mask & cpu_to_le16(RFCOMM_RPN_PM_BITRATE)) { |
1433 | bit_rate = rpn->bit_rate; | 1433 | bit_rate = rpn->bit_rate; |
1434 | if (bit_rate != RFCOMM_RPN_BR_115200) { | 1434 | if (bit_rate > RFCOMM_RPN_BR_230400) { |
1435 | BT_DBG("RPN bit rate mismatch 0x%x", bit_rate); | 1435 | BT_DBG("RPN bit rate mismatch 0x%x", bit_rate); |
1436 | bit_rate = RFCOMM_RPN_BR_115200; | 1436 | bit_rate = RFCOMM_RPN_BR_9600; |
1437 | rpn_mask ^= RFCOMM_RPN_PM_BITRATE; | 1437 | rpn_mask ^= RFCOMM_RPN_PM_BITRATE; |
1438 | } | 1438 | } |
1439 | } | 1439 | } |