diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-05-01 15:15:41 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-05-10 03:28:50 -0400 |
commit | 68d7f0ce911e41e463c45911be031cdf6a096fe8 (patch) | |
tree | 0434ce6c83b95913ce506fc92643349d5f58df53 /net/bluetooth | |
parent | 369ba30264826f38eefc61b93688100be8adbd4d (diff) |
Bluetooth: Enable option to configure Max Transmission value via sockopt
With the sockopt extension we can set a per-channel MaxTx value.
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 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index ff1466b21580..f9e4da2677af 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -783,6 +783,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent) | |||
783 | pi->omtu = l2cap_pi(parent)->omtu; | 783 | pi->omtu = l2cap_pi(parent)->omtu; |
784 | pi->mode = l2cap_pi(parent)->mode; | 784 | pi->mode = l2cap_pi(parent)->mode; |
785 | pi->fcs = l2cap_pi(parent)->fcs; | 785 | pi->fcs = l2cap_pi(parent)->fcs; |
786 | pi->max_tx = l2cap_pi(parent)->max_tx; | ||
786 | pi->tx_win = l2cap_pi(parent)->tx_win; | 787 | pi->tx_win = l2cap_pi(parent)->tx_win; |
787 | pi->sec_level = l2cap_pi(parent)->sec_level; | 788 | pi->sec_level = l2cap_pi(parent)->sec_level; |
788 | pi->role_switch = l2cap_pi(parent)->role_switch; | 789 | pi->role_switch = l2cap_pi(parent)->role_switch; |
@@ -791,6 +792,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent) | |||
791 | pi->imtu = L2CAP_DEFAULT_MTU; | 792 | pi->imtu = L2CAP_DEFAULT_MTU; |
792 | pi->omtu = 0; | 793 | pi->omtu = 0; |
793 | pi->mode = L2CAP_MODE_BASIC; | 794 | pi->mode = L2CAP_MODE_BASIC; |
795 | pi->max_tx = max_transmit; | ||
794 | pi->fcs = L2CAP_FCS_CRC16; | 796 | pi->fcs = L2CAP_FCS_CRC16; |
795 | pi->tx_win = tx_window; | 797 | pi->tx_win = tx_window; |
796 | pi->sec_level = BT_SECURITY_LOW; | 798 | pi->sec_level = BT_SECURITY_LOW; |
@@ -1785,6 +1787,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us | |||
1785 | opts.flush_to = l2cap_pi(sk)->flush_to; | 1787 | opts.flush_to = l2cap_pi(sk)->flush_to; |
1786 | opts.mode = l2cap_pi(sk)->mode; | 1788 | opts.mode = l2cap_pi(sk)->mode; |
1787 | opts.fcs = l2cap_pi(sk)->fcs; | 1789 | opts.fcs = l2cap_pi(sk)->fcs; |
1790 | opts.max_tx = l2cap_pi(sk)->max_tx; | ||
1788 | opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win; | 1791 | opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win; |
1789 | 1792 | ||
1790 | len = min_t(unsigned int, sizeof(opts), optlen); | 1793 | len = min_t(unsigned int, sizeof(opts), optlen); |
@@ -1797,6 +1800,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us | |||
1797 | l2cap_pi(sk)->omtu = opts.omtu; | 1800 | l2cap_pi(sk)->omtu = opts.omtu; |
1798 | l2cap_pi(sk)->mode = opts.mode; | 1801 | l2cap_pi(sk)->mode = opts.mode; |
1799 | l2cap_pi(sk)->fcs = opts.fcs; | 1802 | l2cap_pi(sk)->fcs = opts.fcs; |
1803 | l2cap_pi(sk)->max_tx = opts.max_tx; | ||
1800 | l2cap_pi(sk)->tx_win = (__u8)opts.txwin_size; | 1804 | l2cap_pi(sk)->tx_win = (__u8)opts.txwin_size; |
1801 | break; | 1805 | break; |
1802 | 1806 | ||
@@ -1912,6 +1916,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us | |||
1912 | opts.flush_to = l2cap_pi(sk)->flush_to; | 1916 | opts.flush_to = l2cap_pi(sk)->flush_to; |
1913 | opts.mode = l2cap_pi(sk)->mode; | 1917 | opts.mode = l2cap_pi(sk)->mode; |
1914 | opts.fcs = l2cap_pi(sk)->fcs; | 1918 | opts.fcs = l2cap_pi(sk)->fcs; |
1919 | opts.max_tx = l2cap_pi(sk)->max_tx; | ||
1915 | opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win; | 1920 | opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win; |
1916 | 1921 | ||
1917 | len = min_t(unsigned int, len, sizeof(opts)); | 1922 | len = min_t(unsigned int, len, sizeof(opts)); |
@@ -2331,7 +2336,7 @@ done: | |||
2331 | case L2CAP_MODE_ERTM: | 2336 | case L2CAP_MODE_ERTM: |
2332 | rfc.mode = L2CAP_MODE_ERTM; | 2337 | rfc.mode = L2CAP_MODE_ERTM; |
2333 | rfc.txwin_size = pi->tx_win; | 2338 | rfc.txwin_size = pi->tx_win; |
2334 | rfc.max_transmit = max_transmit; | 2339 | rfc.max_transmit = pi->max_tx; |
2335 | rfc.retrans_timeout = 0; | 2340 | rfc.retrans_timeout = 0; |
2336 | rfc.monitor_timeout = 0; | 2341 | rfc.monitor_timeout = 0; |
2337 | rfc.max_pdu_size = cpu_to_le16(L2CAP_DEFAULT_MAX_PDU_SIZE); | 2342 | rfc.max_pdu_size = cpu_to_le16(L2CAP_DEFAULT_MAX_PDU_SIZE); |