Commit 10467e9e authored by Gustavo F. Padovan's avatar Gustavo F. Padovan Committed by Marcel Holtmann

Bluetooth: Add le16 macro to Retransmission and Monitor Timeouts values

Fix a possible problem with Big Endian machines.
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: default avatarJoão Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 1c762159
...@@ -2487,8 +2487,10 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data) ...@@ -2487,8 +2487,10 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data)
pi->remote_mps = le16_to_cpu(rfc.max_pdu_size); pi->remote_mps = le16_to_cpu(rfc.max_pdu_size);
rfc.retrans_timeout = L2CAP_DEFAULT_RETRANS_TO; rfc.retrans_timeout =
rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO; le16_to_cpu(L2CAP_DEFAULT_RETRANS_TO);
rfc.monitor_timeout =
le16_to_cpu(L2CAP_DEFAULT_MONITOR_TO);
pi->conf_state |= L2CAP_CONF_MODE_DONE; pi->conf_state |= L2CAP_CONF_MODE_DONE;
...@@ -2578,8 +2580,8 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data, ...@@ -2578,8 +2580,8 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data,
switch (rfc.mode) { switch (rfc.mode) {
case L2CAP_MODE_ERTM: case L2CAP_MODE_ERTM:
pi->remote_tx_win = rfc.txwin_size; pi->remote_tx_win = rfc.txwin_size;
pi->retrans_timeout = rfc.retrans_timeout; pi->retrans_timeout = le16_to_cpu(rfc.retrans_timeout);
pi->monitor_timeout = rfc.monitor_timeout; pi->monitor_timeout = le16_to_cpu(rfc.monitor_timeout);
pi->mps = le16_to_cpu(rfc.max_pdu_size); pi->mps = le16_to_cpu(rfc.max_pdu_size);
break; break;
case L2CAP_MODE_STREAMING: case L2CAP_MODE_STREAMING:
...@@ -2634,8 +2636,8 @@ static void l2cap_conf_rfc_get(struct sock *sk, void *rsp, int len) ...@@ -2634,8 +2636,8 @@ static void l2cap_conf_rfc_get(struct sock *sk, void *rsp, int len)
switch (rfc.mode) { switch (rfc.mode) {
case L2CAP_MODE_ERTM: case L2CAP_MODE_ERTM:
pi->remote_tx_win = rfc.txwin_size; pi->remote_tx_win = rfc.txwin_size;
pi->retrans_timeout = rfc.retrans_timeout; pi->retrans_timeout = le16_to_cpu(rfc.retrans_timeout);
pi->monitor_timeout = rfc.monitor_timeout; pi->monitor_timeout = le16_to_cpu(rfc.monitor_timeout);
pi->mps = le16_to_cpu(rfc.max_pdu_size); pi->mps = le16_to_cpu(rfc.max_pdu_size);
break; break;
case L2CAP_MODE_STREAMING: case L2CAP_MODE_STREAMING:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment