diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-05-01 15:15:40 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-05-10 03:28:48 -0400 |
commit | 10467e9e9b89272b25b56688bb276d0830e9ab9a (patch) | |
tree | d744cfac1547227a8947c1c8a554d83f0af67692 /net/bluetooth | |
parent | 1c7621596d11b9c3e19eb88a818758dee4901c95 (diff) |
Bluetooth: Add le16 macro to Retransmission and Monitor Timeouts values
Fix a possible problem with Big Endian machines.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 94be5dbb2569..0889949b6896 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -2487,8 +2487,10 @@ done: | |||
2487 | 2487 | ||
2488 | pi->remote_mps = le16_to_cpu(rfc.max_pdu_size); | 2488 | pi->remote_mps = le16_to_cpu(rfc.max_pdu_size); |
2489 | 2489 | ||
2490 | rfc.retrans_timeout = L2CAP_DEFAULT_RETRANS_TO; | 2490 | rfc.retrans_timeout = |
2491 | rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO; | 2491 | le16_to_cpu(L2CAP_DEFAULT_RETRANS_TO); |
2492 | rfc.monitor_timeout = | ||
2493 | le16_to_cpu(L2CAP_DEFAULT_MONITOR_TO); | ||
2492 | 2494 | ||
2493 | pi->conf_state |= L2CAP_CONF_MODE_DONE; | 2495 | pi->conf_state |= L2CAP_CONF_MODE_DONE; |
2494 | 2496 | ||
@@ -2578,8 +2580,8 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data, | |||
2578 | switch (rfc.mode) { | 2580 | switch (rfc.mode) { |
2579 | case L2CAP_MODE_ERTM: | 2581 | case L2CAP_MODE_ERTM: |
2580 | pi->remote_tx_win = rfc.txwin_size; | 2582 | pi->remote_tx_win = rfc.txwin_size; |
2581 | pi->retrans_timeout = rfc.retrans_timeout; | 2583 | pi->retrans_timeout = le16_to_cpu(rfc.retrans_timeout); |
2582 | pi->monitor_timeout = rfc.monitor_timeout; | 2584 | pi->monitor_timeout = le16_to_cpu(rfc.monitor_timeout); |
2583 | pi->mps = le16_to_cpu(rfc.max_pdu_size); | 2585 | pi->mps = le16_to_cpu(rfc.max_pdu_size); |
2584 | break; | 2586 | break; |
2585 | case L2CAP_MODE_STREAMING: | 2587 | case L2CAP_MODE_STREAMING: |
@@ -2634,8 +2636,8 @@ done: | |||
2634 | switch (rfc.mode) { | 2636 | switch (rfc.mode) { |
2635 | case L2CAP_MODE_ERTM: | 2637 | case L2CAP_MODE_ERTM: |
2636 | pi->remote_tx_win = rfc.txwin_size; | 2638 | pi->remote_tx_win = rfc.txwin_size; |
2637 | pi->retrans_timeout = rfc.retrans_timeout; | 2639 | pi->retrans_timeout = le16_to_cpu(rfc.retrans_timeout); |
2638 | pi->monitor_timeout = rfc.monitor_timeout; | 2640 | pi->monitor_timeout = le16_to_cpu(rfc.monitor_timeout); |
2639 | pi->mps = le16_to_cpu(rfc.max_pdu_size); | 2641 | pi->mps = le16_to_cpu(rfc.max_pdu_size); |
2640 | break; | 2642 | break; |
2641 | case L2CAP_MODE_STREAMING: | 2643 | case L2CAP_MODE_STREAMING: |